I have a three tables, A, B and C. A has many B, and B has many C. What is the best way design primary keys and relationship among these two. Sorry to ask a designing problem, but I don’t know whether to use
- one extra table to map A(pkey) – B(pkey) – C(pkey) OR
- two exta tables to map A-B and B-C separately OR
- use foreign key relationships without using any extra tables (if so please tell me how the key columns should come)
Thank you very much.
Option (3) sounds like the most natural:
To query:
Always make your database model the logical relationships in your data, not the other way round!