Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Uatabase Management System Design Test 3 Spring 2018 2. (20 points) Consider the EMPLOYEE table's constraint with the name EMPSUPERFK as speci in the Figure

image text in transcribed
Uatabase Management System Design Test 3 Spring 2018 2. (20 points) Consider the EMPLOYEE table's constraint with the name EMPSUPERFK as speci in the Figure below CREATE TABLE EMPLOYEE Dno INT PRIMARY KEY (Sen), FOREIGN KEY (Supersan) REFERENCES EMPLOYEEISen) FOREIGN KEY Dno) REFERENCES DEPARTMENT(Dnumber) CONSTRAINT EMPPK NOT NULLDEFAULT 1, CONSTRAINT EMPSUPERFK ON DELETE SET NULL CONSTRAINT EMPDEPTFK ON UPDATE CASCADE, ON DELETE SET DEFAULT ON UPDATE CASCADE) CREATE TABLE DEPARTMENT Mg-sun CHARD) NOT NULL DEFAULT 888665558 CONSTRAINT DEPTPK CONSTRAINT DEPTSK CONSTRAINT DEPTMGRFK PRIMARY KEY(Dnumber). UNIQUE (Dnama), FOREIGN KEY (Mgrn) REFERENCES EMPLOYEE Sam) Figure 4.2 Example Bustrating how delault sttribute values and referential Integrity triggared actions are specified n SOL ON DELETE SET DEFAULT ON UPDATE CASCADE CREATE TABLE DEPT LOCATIONS PRIMARY KEY (Dnumber, Dlocation), FOREIGN KEY (D umber) REFERENCES DEPARTMENT Dnumber) ON DELETE CASCADE ON UPDATE CASCADE is changed to read as follows: CONSTRAINT EMPSUPERFK FOREIGN KEY (Super_ssn) REFERNCES EMPLOYEE (SSN) ON DELETE CASCADE ON UPDATE CASCADE Answer the following questions: a. (10 po ints) What happens when the following command is run on the database state shown in the extra page given during the test? DELETE EMPLOYEE WHERE LNAME Borg b. (10 points) Is it better to CASCADE or SET NULL in the case of the EMPSUPERFK constraint N DELETE above

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

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

4th Edition

0805360476, 978-0805360479

More Books

Students also viewed these Databases questions