Why is the `MUL` keyword showing up under the `Key` column for the `show columns from Employee` mysql command?

Grateful

When I execute show columns from Employee in MySQL for the following tables ...

CREATE TABLE Employee (
    id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
    departmentId TINYINT UNSIGNED NOT NULL
        COMMENT "CONSTRAINT FOREIGN KEY (departmentId) REFERENCES Department(id)",
    firstName VARCHAR(20) NOT NULL,
    lastName VARCHAR(40) NOT NULL,
    email VARCHAR(60) NOT NULL,
    ext SMALLINT UNSIGNED NULL,
    hireDate TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    leaveDate DATETIME NULL,
    INDEX name (lastName, firstName),
    INDEX (departmentId)
)

CREATE TABLE Department (
    id TINYINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, 
    name VARCHAR(40),
    UNIQUE (name)
)

... why is the keyword MUL appearing in the result set for the column lastName (as well as for departmentId) and not for firstName?

peterm

MUL as opposed to PRI and UNI means a non unique index and is shown for the first (or the only column) in an index when you issue a DESCRIBE or SHOW COLUMNS command.

The only exception to this is

If more than one of the Key values applies to a given column of a table, Key displays the one with the highest priority, in the order PRI, UNI, MUL.

firstName is a second column in the composite index name and therefore MUL is not being displayed for it.

Further reading SHOW COLUMNS Syntax

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Why is my div not showing up with jquery show

From Dev

Why is my div not showing up with jquery show

From Dev

Showing MYSQL table columns with key types and reference

From Dev

How can I exclude a certain column from showing and how to show columns by field_name?

From Dev

Why setting the key constraints on column removes "NOT NULL" from it (MySQL)?

From Dev

Show Columns query showing Column Data type not Column Value

From Dev

Mysql keyword in command executed from a shell script

From Dev

Why does Sequel Pro show a different result for a table's key values than MySQL on the command line?

From Dev

Why does Sequel Pro show a different result for a table's key values than MySQL on the command line?

From Dev

mysql show db column in multiple returned columns

From Dev

Why won't MySQL add these columns up?

From Dev

MySQL - why cannot I add foreign key to multiple columns pointing to one column?

From Dev

GnuPG command to show key info from file

From Dev

GnuPG command to show key info from file

From Dev

mysql - can I select values from the same column and show them in 2 columns result?

From Dev

Why do Chart Stacked Columns show up as thin lines?

From Dev

Why some startup programs show up with wmic command but not in Task manager?

From Dev

Laravel - Add column to existing pivot table and add MUL key

From Dev

How to transform employee attendence from rows to columns

From Dev

Done key not showing up on keyboard

From Dev

Special characters showing up on content retrieved from mysql using php

From Dev

Create multiple columns from a single column and clean up results

From Dev

pandas speed up creation of columns from column of lists

From Dev

datatable column filter not showing up

From Dev

No column name showing up in SQL

From Dev

Why showing error Wrong number of columns! COPYing 99 columns from a source file containing: FEWER columns

From Dev

Why is v-model not showing up? Need to show value when in edit mode on form

From Dev

JTable columns wont show up

From Dev

Why do my gvfs mounts not show up under ~/.gvfs or /run/user/<login>/gvfs?

Related Related

  1. 1

    Why is my div not showing up with jquery show

  2. 2

    Why is my div not showing up with jquery show

  3. 3

    Showing MYSQL table columns with key types and reference

  4. 4

    How can I exclude a certain column from showing and how to show columns by field_name?

  5. 5

    Why setting the key constraints on column removes "NOT NULL" from it (MySQL)?

  6. 6

    Show Columns query showing Column Data type not Column Value

  7. 7

    Mysql keyword in command executed from a shell script

  8. 8

    Why does Sequel Pro show a different result for a table's key values than MySQL on the command line?

  9. 9

    Why does Sequel Pro show a different result for a table's key values than MySQL on the command line?

  10. 10

    mysql show db column in multiple returned columns

  11. 11

    Why won't MySQL add these columns up?

  12. 12

    MySQL - why cannot I add foreign key to multiple columns pointing to one column?

  13. 13

    GnuPG command to show key info from file

  14. 14

    GnuPG command to show key info from file

  15. 15

    mysql - can I select values from the same column and show them in 2 columns result?

  16. 16

    Why do Chart Stacked Columns show up as thin lines?

  17. 17

    Why some startup programs show up with wmic command but not in Task manager?

  18. 18

    Laravel - Add column to existing pivot table and add MUL key

  19. 19

    How to transform employee attendence from rows to columns

  20. 20

    Done key not showing up on keyboard

  21. 21

    Special characters showing up on content retrieved from mysql using php

  22. 22

    Create multiple columns from a single column and clean up results

  23. 23

    pandas speed up creation of columns from column of lists

  24. 24

    datatable column filter not showing up

  25. 25

    No column name showing up in SQL

  26. 26

    Why showing error Wrong number of columns! COPYing 99 columns from a source file containing: FEWER columns

  27. 27

    Why is v-model not showing up? Need to show value when in edit mode on form

  28. 28

    JTable columns wont show up

  29. 29

    Why do my gvfs mounts not show up under ~/.gvfs or /run/user/<login>/gvfs?

HotTag

Archive