Link to home
Start Free TrialLog in
Avatar of zollgut
zollgut

asked on

MySQL Database Unique Primary Keys?

Hi, just wanted to know if a primary key can have duplicate values?

I have one table (courses) which has an 'id' field.

Then i have another table (bookings) where i want to store various bookings for each course, but need to store the same 'id' so they can be linked.

Can this be done?
Thanks
Avatar of Kent Olsen
Kent Olsen
Flag of United States of America image

A primary key is, by definition, a unique key.

Kent
ASKER CERTIFIED SOLUTION
Avatar of GarbsTheTurtle
GarbsTheTurtle
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial