The queries used in the tutorial are given below:
CREATE TABLE Employee(
EmpId INT PRIMARY KEY,
EmpName varchar(25),
EmpAddr varchar(50)
)
INSERT INTO Employee VALUES (1,'Alex','SCO 1 Link Road')
INSERT INTO Employee VALUES (2,'Carol','SCO 2 Link Road')
INSERT INTO Employee VALUES (3,'Ross','SCO 3 Link Road')
INSERT INTO Employee VALUES (3,'Ross','SCO 3 Link Road')
SELECT * FROM EMPLOYEE
CREATE TABLE DEPARTMENT
(
DepID INT Primary key,
Depname Varchar(50),
EmpID INT REFERENCES EMPLOYEE(EmpID))
INSERT INTO DEPARTMENT VALUES (201,'Mechanical',4)
SELECT * FROM DEPARTMENT
On this page of the site you can watch the video online Primary key in SQL , Foreign key in SQL with a duration of hours minute second in good quality, which was uploaded by the user Niner's IELTS 21 June 2016, share the link with friends and acquaintances, this video has already been watched 21,637 times on youtube and it was liked by 152 viewers. Enjoy your viewing!