r/DatabaseHelp • u/DJPharaohCHS • Apr 10 '17
MySQL Primary Keys?
Should Primary Keys always be ID #s? For example, if I have:
CREATE TABLE Concerts
Name VARCHAR(30)
Band VARCHAR(30)
Venue VARCHAR(30)
Cost DECIMAL(10,2)?
DateTime DATETIME
PRIMARY KEY(Band, Date)
Is Band and Date preferable or should I instead add a column like ConcertID and use that as the Primary Key?
1
Upvotes
View all comments
Show parent comment
1
u/ScariestofChewwies Apr 15 '17
If that is how you set it up, yep.