TO CREATE PRIMARY KEY AND FOREIGN KEY RELATIONSHIP FOR TWO TABLES

Sriramnandha
Posted by Sriramnandha under Sql Server category on | Points: 40 | Views : 1087
PRIMARY KEY TABLE:

CREATE TABLE TEST(TESTID INT CONSTRAINT PK_TESTID PRIMARY KEY(TESTID),TESTNAME VARCHAR(90))


FOREIGN KEY RELATIONSHIP:


CREATE TABLE TESTRESULT(TESTID INT REFERENCES TEST(TESTID),MARKS INT,TESTPERCENTATE INT)


REGARDS

Comments or Responses

Login to post response