Bineesh  Viswanath

Bineesh Viswanath

  • NA
  • 1k
  • 777.7k

Primary and Foreign Key in SQL

Jun 14 2013 5:24 AM
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)