SQL keys MUL vs PRI vs UNI

0 votes

What is the difference between MUL, PRI and UNI in MySQL?

I'm working with the command: while running a MySQL query.

desc mytable; 

One of the fields appears to be a MUL key, while the others display as UNI or PRI.

I am aware that only one record per table can be linked to a key if it is PRI. Is it possible for there to be more than one associated record if a key is MUL?

This is mytable's reaction.

+-----------+---------+------+-----+---------+-------+
| Field     | Type    | Null | Key | Default | Extra |
+-----------+---------+------+-----+---------+-------+
| courseid  | int(11) | YES  | MUL | NULL    |       | 
| dept      | char(3) | YES  |     | NULL    |       | 
| coursenum | char(4) | YES  |     | NULL    |       | 
+-----------+---------+------+-----+---------+-------+

Can someone please help me with this?

Sep 8, 2022 in Database by Kithuzzz
• 38,000 points
1,567 views

1 answer to this question.

0 votes

It denotes that the field is (a part of) an index that isn't unique. You can issue

show create table <table>;

To see more information about the table structure. I hope this helps you.

answered Sep 10, 2022 by narikkadan
• 63,600 points

Related Questions In Database

0 votes
2 answers

SQL vs NoSQL

Well, it depends on what you are ...READ MORE

answered Aug 11, 2018 in Database by slayer
• 29,370 points
1,218 views
0 votes
1 answer

IN vs OR in the SQL WHERE Clause

I assume you want to know the ...READ MORE

answered Sep 24, 2018 in Database by DataKing99
• 8,250 points
3,971 views
0 votes
1 answer

LEFT JOIN vs. LEFT OUTER JOIN in SQL Server

At the top level there are mainly ...READ MORE

answered Feb 4, 2022 in Database by Neha
• 9,020 points
2,000 views
0 votes
1 answer

SQL Server: PARTITION BY vs GROUP BY

To understand the differences between GROUP BY ...READ MORE

answered Feb 9, 2022 in Database by Neha
• 9,020 points
2,607 views
0 votes
1 answer
0 votes
1 answer

How to change the default value and to alter a column in sql?

Hi, You can try this: ALTER TABLE foobar_data CHANGE ...READ MORE

answered Jun 24, 2019 in Big Data Hadoop by Gitika
• 65,770 points
1,533 views
0 votes
1 answer

What is an index in SQL?

An index is used to speed up ...READ MORE

answered Feb 3, 2022 in Database by Vaani
• 7,070 points
689 views
0 votes
1 answer

Ordering by the order of values in a SQL IN() clause

Use MySQL's FIELD() function: SELECT name, description, ... FROM ... WHERE id ...READ MORE

answered Feb 4, 2022 in Database by Neha
• 9,020 points
5,343 views
0 votes
1 answer

Entity Framework VS LINQ to SQL VS ADO.NET with stored procedures?

First off, if you're starting a new ...READ MORE

answered Sep 16, 2022 in Database by narikkadan
• 63,600 points
5,454 views
0 votes
1 answer

SQL JOIN - WHERE clause vs. ON clause

They are not the same thing. Consider these ...READ MORE

answered Sep 16, 2022 in Database by narikkadan
• 63,600 points
1,161 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP