/* EMPLOYEE table used for the SELF-JOIN example */ /* Create table with UNARY relationship. */ CREATE TABLE dbo.employee( emp_ID varchar(4) NOT NULL, emp_Fname varchar(10) NULL, emp_Lname varchar(10) NULL, emp_Supv varchar(4) NULL, CONSTRAINT PK_employee PRIMARY KEY(emp_ID) , CONSTRAINT FK_supervisor FOREIGN KEY(emp_Supv) REFERENCES employee(emp_ID)); /* Insert data */ insert into employee (emp_id, emp_fname, emp_lname, emp_supv) values ('1050', 'Carlo', 'Mora', NULL); insert into employee (emp_id, emp_fname, emp_lname, emp_supv) values ('1062', 'Robert', 'Block', 1050); insert into employee (emp_id, emp_fname, emp_lname, emp_supv) values ('1063', 'Teresa', 'Roberts', 1062); insert into employee (emp_id, emp_fname, emp_lname, emp_supv) values ('1077', 'Carla', 'Stevens', 1050); insert into employee (emp_id, emp_fname, emp_lname, emp_supv) values ('1080', 'Wilma', 'Washington', 1050); insert into employee (emp_id, emp_fname, emp_lname, emp_supv) values ('1081', 'Rory', 'Block', 1062);