hi
I need to design a table for holding employees. Each employee should have one manager and he is also an employee..
Create table EmpTable
(
Emp_Id int not null,
ename varchar(100),
mgr_id int unique ,
PRIMary Key (emp_id),
foreign key (mgr_id)references EmpTable(emp_id)
)
so above table structure will allow me to insert on record with "mgr_id" as NULL..
i.e it will allow me to insert following values
Emp_id, Ename,mgr_id
101,'XYX',Null
102,'ABC',101
103,'mno',101
but not
104,'PQR',NULL
How should i design my table to handle above situation
Case :
what if i need to insert more than one record( this is a situation where in i have more than one CEO for the company).
Sri