PHPRUNNER 5.3 BUILD 7474
I was looking for some advice on the best primary key of a detail table that uses autoincrement (auto increment).
For example CLIENT is the master table with CLIENT_ID (INT) as the primary key and BOOKINGS is the detail table with an autoincrement (INT) primary key BOOKING_ID.
My question is about the advantages / disadvantages of the following two ways of setting up the primary key for the detail table BOOKINGS:
Option 1): the BOOKINGS table Primary Key just contains the INT autoincrement field BOOKING_ID with CLIENT_ID as a foreign key
Option 2): the BOOKINGS table Primary Key contains 2 fields, starting with CLIENT_ID (of the master record) and followed by BOOKING_ID which autoincrements uniquely only within each CLIENT_ID
I've set up dependent / detail tables both ways and I'm just wondering if there's a "standard" / general advice as I've run into pros and cons with both methods.
Thanks you very much for your help! Take Care... Mike.