LMSouq
database Open

SQL keys, MUL vs PRI vs UNI

TH
themaestro
1 month ago
3 views
Problem Description
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 | | +-----------+---------+------+-----+---------+-------+

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base