Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Supposed that each of the following Update operations is applied directly to the database state shown in the Figure 3.6. Discuss all integrity constraints

Supposed that each of the following Update operations is applied directly to the database state shown in theEMPLOYEE Fname Minit Lname Ssn Bdate DEPARTMENT Dname Dnumber Mgr_ssn Mgr_start_date DEPT LOCATIONS DnumberFigure 3.6 One possible database state for the COMPANY relational database schema. EMPLOYEE Fname Minit LnameFigure 3.6 One possible database state for the COMPANY relational database schema WORKS ON Essn 123456789

Supposed that each of the following Update operations is applied directly to the database state shown in the Figure 3.6. Discuss all integrity constraints violated by each operation, if any, and the different ways of enforcing these constraints. Please work on only problems b, c, f, g, and i. a. Insert into EMPLOYEE. b. Insert into DEPARTMENT. d. Insert into DEPENDENT. f. Delete the WORKS ON tuples with Essn = '333445555'. g. Delete the EMPLOYEE tuple with Ssn = '987654321'. h. Delete the PROJECT tuple with Pname = 'ProductX'. i. Modify the Mgr_ssn and Mgr_start_date of the DEPARTMENT tuple with Dnumber = 5 to $123456789' and '2007-10-01', respectively. j. Modify the Super_ssn attribute of the EMPLOYEE tuple with Ssn = $999887777' to '943775543'. k. Modify the Hours attribute of the WORKS ON tuple with Essn = $999887777' and Pno = 10 to '5.0'. 2. Consider the following relations for a database that keeps track of bank customers and their accounts: BRANCH (Branch Name, Assets, Bcity) CUSTOMER (CustName, SSN, Street, City) DEPOSIT (Branch_name, AcctNo, CustName, Balance) LOAN (Branch_name, LoanNo, CustName, Amount) Specify the foreign keys for this schema. EMPLOYEE Fname Minit Lname Ssn Bdate DEPARTMENT Dname Dnumber Mgr_ssn Mgr_start_date DEPT LOCATIONS Dnumber Dlocation PROJECT Pname Pnumber Plocation Dnum Address Sex Salary WORKS ON Essn Pno Hours DEPENDENT Essn Dependent_name Sex Bdate Relationship Super_ssn Dno Figure 3.7 Referential integrity constraints displayed on the COMPANY relational database schema. Figure 3.6 One possible database state for the COMPANY relational database schema. EMPLOYEE Fname Minit Lname Ssn Bdate Address John B Smith 123456789 1965-01-09 731 Fondren, Houston, TX Franklin T Wong 333445555 1955-12-08 638 Voss, Houston, TX Alicia J Zelaya 999887777 1968-01-19 3321 Castle, Spring, TX Jennifer S Wallace 987654321 1941-06-20 291 Berry, Bellaire, TX Ramesh K Narayan 666884444 1962-09-15 975 Fire Oak, Humble, TX Joyce A English 453453453 1972-07-31 5631 Rice, Houston, TX Ahmad V Jabbar 987987987 1969-03-29 980 Dallas, Houston, TX James E Borg 888665555 1937-11-10 450 Stone, Houston, TX DEPARTMENT Dname Research Administration Headquarters Dnumber 5 4 1 Mgr_ssn 333445555 987654321 888665555 Mgr_start_date 1988-05-22 1995-01-01 1981-06-19 Sex Salary Super_ssn Dno M 30000 333445555 M 40000 888665555 F 25000 987654321 4 43000 888665555 F 4 38000 333445555 5 25000 333445555 5 25000 987654321 4 55000 NULL 1 M F M M DEPT_LOCATIONS Dnumber 1 4 5 10 5 5 55 01 Dlocation Houston Stafford Bellaire Sugarland Houston Figure 3.6 One possible database state for the COMPANY relational database schema WORKS ON Essn 123456789 123456789 666884444 453453453 453453453 333445555 333445555 333445555 333445555 999887777 999887777 987987987 987987987 987654321 987654321 888665555 Pno Hours 1 32.5 2 7.5 3 40.0 1 20.0 2 20.0 2 10.0 10.0 10.0 10.0 30 30.0 10 10.0 10 35.0 5.0 20.0 15.0 NULL 3 10 20 30 30 20 20 DEPENDENT Essn 333445555 333445555 333445555 987654321 123456789 123456789 123456789 PROJECT Pname ProductX ProductY ProductZ Computerization Reorganization Newbenefits Dependent_name Alice Theodore Joy Abner Michael Alice Elizabeth Pnumber 1 2 3 10 20 30 Sex F M F M Plocation Bellaire Sugarland Houston Stafford Houston Stafford Dnum 5 5 5 4 1 4 Bdate Relationship 1986-04-05 Daughter 1983-10-25 Son 1958-05-03 Spouse 1942-02-28 Spouse M 1988-01-04 Son F 1988-12-30 Daughter F 1967-05-05 Spouse

Step by Step Solution

There are 3 Steps involved in it

Step: 1

b Insert into PROJECT Integrity Constraints Violated Referential Integrity The foreign key constraint between PROJECT and DEPARTMENT is violated because the Department number 4 does not exist in the D... 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

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Shamkant Navathe

7th Edition

0133970779, 978-0133970777

More Books

Students also viewed these Programming questions

Question

What is the effect of word war second?

Answered: 1 week ago

Question

Name some advantages of the MapReduce/Hadoop technology.

Answered: 1 week ago