Have a Question?

If you have any question you can ask below or enter what you are looking for!



Primary Key and Foreign Key Relationship code

I want to create Primary key and Foreign Key relationship on DeptNo column Between Tables Employee and Dept. What would be the Syntax for it?

  Devbrat Tripathi

we have deptno column is primary key in table A.

PRIMARY KEY (deptno.).

CREATE TABLE B.
O_Id int NOT NULL,
OrderNo int NOT NULL,
DEPT int,

PRIMARY KEY (deptno.).

FOREIGN KEY (dept.) REFERENCES A(Deptno.)

highlighted line syntax for foreign key ...



  Rakesh Sharma       18 Aug 2016       0       0     

Post Your Answers:

Please use the CODE HIGHLIGHT Button to format/highlight your codes if any