Database relationships using phpmyAdmin (composite keys)
- by Cool Hand Luke UK
Hi,
I hope this question is not me being dense. I am using phpmyAdmin to create a database. I have the following four tables. Don't worry about that fact place and price are optional they just are.
Person (Mandatory)
Item (Mandatory)
Place (Optional)
Price (Optional)
Item is the main table. It will always have person linked.
* I know you do joins in mysql for the tables.
If I want to link the tables together I could use composite keys (using the ids from each table), however is this the most correct way to link the tables? It also means item will have 5 ids including its own. This all cause null values (apparently a big no no, which I can understand) because if place and price are optional and are not used on one entry to the items table I will have a null value there. Please help!
Thanks in advance. I hope this makes sense.