Thursday 19 September 2013

Link one record to multiple records in separate table

Link one record to multiple records in separate table

Background Info
I have a database with two tables: Phones, and Carriers
Phones -> Carriers
Phones (Primary key: Phones.ID; Foreign Key: Phones.CarrierID) is linked to
Carriers (Primary key: Carriers.ID; Foreign Key: Carriers.RegionID).
The data types for both Phones.CarrierID and Carriers.ID are bigint. Sorry
if that's confusing!
Problem
I have a record in my Phones table called Nokia Lumia 1020. I need to be
able to link it to multiple records in the Carriers Table via the
Phones.CarrierID column. How would I do this without creating multiple
records for the Nokia Lumia 1020 in the Phones table?

No comments:

Post a Comment