Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CREATE TABLE Company ( person _ id int PRIMARY KEY, person _ Name VARCHAR ( 2 5 5 ) , department _ ID VARCHAR (

CREATE TABLE Company (
person_id int PRIMARY KEY,
person_Name VARCHAR(255),
department_ID VARCHAR(255),
company_Name VARCHAR(255),
isAstMgr BOOLEAN,
isMgr BOOLEAN,
isGnrMgr BOOLEAN,
FOREIGN KEY (deparment_ID,company_Name) REFERENCES Holding(deparment_ID,company_Name)
);
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 (deparment_ID,company_Name).
If there is a GnrMgr for a specific (deparment_ID,company_Name) 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 (deparment_ID,company_Name)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Secrets Of Analytical Leaders Insights From Information Insiders

Authors: Wayne Eckerson

1st Edition

1935504347, 9781935504344

More Books

Students also viewed these Databases questions