Question: CREATE TABLE Company ( person _ id int PRIMARY KEY, person _ Name VARCHAR ( 2 5 5 ) , department _ ID VARCHAR (
CREATE TABLE Company
personid int PRIMARY KEY,
personName VARCHAR
departmentID VARCHAR
companyName VARCHAR
isAstMgr BOOLEAN,
isMgr BOOLEAN,
isGnrMgr BOOLEAN,
FOREIGN KEY deparmentIDcompanyName REFERENCES HoldingdeparmentIDcompanyName
;
How to check condition that a person can only have one role which is AstMgr or Mgr or GnrMgr Two or more roles are not possible per person.
There may be several AstMgr or Mgr for a specific deparmentIDcompanyName
If there is a GnrMgr for a specific deparmentIDcompanyName there will not be other GnrMgr for same company.
How to write a DDL to check isGnrMgr column and not to allow to enter second GnrMgr for the same unique deparmentIDcompanyName
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
