Subject Foreign Key Part of Primary Key
Author kiran.gutta@wipro.com
Hi,



I have the following tables.



TZ_RESTRICTIONS

Columns: TZ_ID, ST_TIME, END_TIME

Primary Key: TZ_ID, ST_TIME



USER_TZ_RESTRICTION

Columns: USER_ID, TZ_ID, TYPE

Primary Key: USER_ID, TYPE

Foreign key TZ_ID References TZ_RESTRICTIONS(TZ_ID)





Functionally,

For a given user and type, there can be multiple Time Zones. Each Time
Zone contains multiple Start Times & End Times.



When I create USER_TZ_RESTRICTION table, I get error "Could not find
UNIQUE INDEX with specified columns."



Please help me how to define the tables/references/constraints. I am new
to RDBMS.



Regards,

Kiran



[Non-text portions of this message have been removed]