i want to create a composite key how i can do it.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shyam jaiswal 1
    New Member
    • Mar 2006
    • 1

    i want to create a composite key how i can do it.

    hello friends,
    i have few table like

    create table Employee ( emp_id INTEGER(6) PRIMARY KEY ,emp_name varchar(25) not null,
    emp_phno INTEGER(12), emp_desig varchar(15) not null,emp_passwo rd varchar(8)not null);

    create table Project( proj_id varchar(6) PRIMARY KEY ,proj_name varchar(25) not null,
    est_time INTEGER(10)not null, est_cost integer(10) not null,act_time integer(10),act _cost integer(10),
    proj_status varchar(10) DEFAULT "incomplete " not null);

    create table Works_On(emp_id INTEGER(6) REFERENCES emp_id(Employee ),
    proj_id varchar(6)REFER ENCES proj_id(Project ),
    primary key(emp_id,proj _id));
    here in Works_On i want emp_id & proj_id as composite key . above code is not working fie in work on i can add record without adding it in Employee & in Project.
    what i should do to solve this problem . send me correct sintax.
    thank u,
    shyam
Working...