2
Answers

Primary and Foreign Key in SQL

Bineesh  VP

Bineesh VP

11y
958
1
Sir, I am now in SQL training.

I have a doubt in the case of Primary and Foreign Key.


Look a Table:-

tbl_Class: classId(PK),className,noOfseats

tbl_Division:divisionId(PK),divisionName,classId(FK_tbl_Class)


In this table I set classId and divisionId as IDENTITY


when I do a Insert into procedure, I want to put same data the classId carry in tbl_Class.

is there any way to auto add the column like classId in the table where they act as FK?
Answers (2)