What is the difference between MUL
, PRI
and UNI
in MySQL?
I'm working on a MySQL query, using the command:
desc mytable;
One of the fields is shown as being a MUL
key, others show up as UNI
or PRI
.
I know that if a key is PRI
, only one record per table can be associated with that key. If a key is MUL
, does that mean that there could be more than one associated record?
Here's the response of mytable
.
+-----------+---------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+---------+------+-----+---------+-------+
| courseid | int(11) | YES | MUL | NULL | |
| dept | char(3) | YES | | NULL | |
| coursenum | char(4) | YES | | NULL | |
+-----------+---------+------+-----+---------+-------+
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…