Hello. I must create a DB and my problem is this: Table Geolocation Table Cost_Center Table GeoToCost Table InkToCost Table Ink_Type
Cost_Center can reference 2 or more Geolocations So i made the intermediate table GeoToCost Ink must reference a Cost_Center so i made the intermediate table InkToCost The problem i am facing is how will determine in what Geolocation an Ink can be because the Cost_Center can be in more than one Geolocation. I am thinking of making a composite PK on table InkToCost with PK Cost_Center id and GeoToCost id.So i will know that an ink of type A has a Cost_Center name X that resides on Geolocation GeoA. I have 2 problems here. 1st if this the way to go and second, how will i reference this query. Do i need to add also GeoToCost id on ink_Type table?
I haven't made the tables yet so i don't have a schema but if required i will make test tables.
Anyhow FK's are Geolocation --> FK GeoToCost <-- Cost_Center , Cost_Center --> InkToCost <-- Ink_Type , So do i need also Cost_Center --> InkToCost(PK Cost_Center_id, GeoToCost_id) <-- Ink_Type ? Of can i just put on InkToCost the Cost_Center_id,Geolocation_id and don't make a composite PK? Thanks.
As I understand its enough if you just include GeoToCost in InkToCost as each record in GeoToCost represents a relationship of cost center to ONE particular location. Then you'll be able to link ink to cost center and also to its location.