Foreign key refering to primary keys across multiple tables?
- by sanjay bharkatiya
hi , i have three tables say city,state and road
1) city - city_id(PK),name
2) state- Stt_id(PK),name
3) Road- Edge_id(PK), Admin_id(FK)
where Admin_id refers to city_id and Stt_id both.
This is done because the tables are too huge.
say city_id contains 1,2,3
and Stt_id contains 4,5,6
now if i am inserting 1,2,3,4,5,6 in admin_id it is throuing an error .. what is the solution of my problem,
regards
sanjay