This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Kan I make 3 tables when I not have Integer as PK (table 2 and 3)?
Model number (78)
Car make (VW)
Car model (Lupo)
Car type (Waggon)
Model manufacture (Zumrette)
Price (123)
Scale (1:44)
Colour (Blue)
Weight (78)
Year (1977)
Country of manufacture (Germany)
Country of production (D)
1. table Model number (78) PK
Car make (VW) FK
Car type (Waggon)
Model manufacture (Zumrette)
Price (123)
Scale (1:44)
Colour (Blue)
Weight (78)
Year (1977)
Country of manufacture (Germany) FK
2. table Country of manufacture (Germany) PK
Country of production (D)
You can mark any field in the table as a primary key or even have a composite (made up of 2+ fields) as a primary key.
One suggestion though: It's a good practice to always use an integer as a primary key since it makes joins to other tables easier. For example, if someone was placing an order for a car in your example, it saves space to have foreign key dependencies using integers over strings. The general rule is to always use integers as primary key unless you have an obvious 'natural key'. Although I've argued in the past there's really no such thing as a natural key, and integer keys should always be used. Either way, your model # can still be marked as a key (even if its not the primary key) with a uniqueness constraint.