I was wondering, is there any possibility to create a table where i have a table which accepts a foreign key but may have multiple values for the same row.
For example:
Employee(id,name,skillid);
Skill(Skillid,skillname);
here an instance for Employee could be
Employee(311,"john", (01,02) );
Skill (01,Java); Skill (02,C++);
I implemented the same making primary key for the table as (is,skillid)
But in a case i have a table :
create table Movie (Movie_ID varchar(5),
Cast varchar(5),
foreign key(Cast) references Person(Person_ID),
primary key(movie_id, Cast));
and another table :
create table Awards (Award_Id varchar(5),
Person_Id varchar(5),
Movie_Id varchar(5),
Award_Name varchar(30),
Year number(4),
Organization_Id varchar(5),
primary key (Award_id,year,Organization_Id),
foreign key(Person_Id) references Person(Person_ID),
-- foreign key(Movie_ID) references Movie(Movie_ID),
foreign key(Organization_Id) references Organization(Organization_Id));
In this case i am not able to use Movie_ID as a Foreign key since the table it is referencing has combination of 2 things as its primary key. And i am not using 2nd of those attribute in the Awards table.
Any hints how this can be implemented ?