![]() |
composite key syntax. How can I fix this?
i wanted to create a table name booking that have 3 composite key where 2
of the composite key is referring to each another table named customer and room. however when i wanted to create the table, it give me error. can someone tell me how can i fix this. Here's the command : Code:
CREATE TABLE booking( |
You can't have more than one primary key, thus what makes a primary key primary.
|
A primary key is what the database uses to identify the row. While you do not have to have one, it makes looking up a particular row a lot faster becuase the database expects you to find it via the primary key. However, it is a unique ID and there can only be one per row.
|
1 Attachment(s)
isn't that primary key that referring to another primary key in another table is called as 'composite key'?
i'm not not really agree when you said that i'm actually wanted to declare is a unique ID. or, am i wrong in understanding this 'composite key' term? if so, someone please explain to me... i'm sorry, i'm not expert in database i just started to learn it and stil learn about it. however, here's the relationship below and i really thinks what i'm trying to achieve is not foreign key but composite key.. |
Quote:
|
| All times are GMT. The time now is 02:17 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0