Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Jayage

macrumors newbie
Original poster
Nov 27, 2009
1
0
I've fully created my table with all its attributes, but i forgot to declare my primary key.

Looking at the FAQ's it doesn't say anything about altering a table to include a Primary key!

Its a restaurant database which includes the restaurant names, their addresses, cuisine, longitude and latitude.

Inside each restaurant has starters and main courses.

Any commands to make the cuisine the primary key?!
 
I'm not too sure you would want cuisine as your PK. What if you have multiple restaurants that have the same cuisine?

I would recreate the table, and have a restaurant_id column as your PK. (just a unique number).

Cuisine should also have it's own table, with a cuisine_id column as it's PK. Then the restaurant table would have a FK to the cuisine table.

Enjoy.
 
and just incase your next question is what is a PK and FK
PK = primary key
FK = foreign key
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.