Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7510573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:15:46+00:00 2026-05-29T23:15:46+00:00

I was wondering, is there any possibility to create a table where i have

  • 0

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 ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T23:15:47+00:00Added an answer on May 29, 2026 at 11:15 pm

    Unfortunately you’ve just asked the age old question;

    How do I put two things in one column?

    The answer is, of course, that you don’t; you have two columns. To extend your employee example your employee table would become:

    create table employees (
       id number
     , name varchar2(4000)
     , skill_1 number
     , skill_2 number
     , constraint employee_pk primary key (id)
     , constraint employee_skill_1_fs 
          foreign key ( skill_1 ) 
       references skills(skillid)
     , constraint employee_skill_2_fs 
          foreign key ( skill_2 ) 
       references skills(skillid) 
       );
    

    As you can see this isn’t a particularly pretty thing to do and breaks normalisation; what happens if you want your employee ( or your employee wants of course ) to have 3 skills? Or 10?.

    It would probably be better to create a third table and do all your joins by a single primary and foreign key; so you would have

    employees ( employee_id, ..., pk employee_id);
    employee_skills ( employee_id, skill_id, ..., pk employee_id, skill_id, fk skill_id );
    skills ( skill_id, description, ..., pk skill_id );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm wondering if there's a possibility to have access to any of developer version
I am wondering is there any way to execute following shell script, which waits
I was wondering if there is any possibility to implement a logical implication in
Am wondering if there is any applet which I can use and customize to
Just wondering is there any way to create a temporary sandbox environment for running
I was wondering is there any tutorial on how to create a FrameWork?, i
Been wondering are there any ways to measure the learning performance of ANNs. Thanks
I was wondering - are there any known techniques to control access to a
I am wondering is there any way we can test the font size/color of
i just wondering is there any performance issue or anything thing wrong if that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.