Database systems 5. (20 POINTS- 2 POINTS each) Given an arbitrary state of a COM
ID: 3893980 • Letter: D
Question
Database systems
5. (20 POINTS- 2 POINTS each) Given an arbitrary state of a COMPANY database as EMPLOYEE Fname Minit Lname Address Sex Salary Super_ssn Dno B Smith 123456789 1965-01-09 731 Fondren, Houston, TX M 30000 333445555 5 0 FranklinT Wong 333445555 1955-12-08 638 Voss, Houston, TX M 40000 888665555 5 Alicia JZelaya 999887777 1968-01-19 3321 Castle, Spring, X F 25000 9876543214 Jennifer S Wallace 987654321 1941-06-20 291 Berry, Bellaire, TX F43000 888665555 4 Ramesh K Narayan 666884444 1962-09-15 975 Fire Oak, Humble, TX M 38000 333445555 5 Joyce A English 453453453 1972-07-31 5631 Rice, Houston, TX F25000 333445555 5 AhmadVJabbar 9879879871969-03-29 980 Dallas, Houston, TX M 25000 987654321 4 James E Borg 888665555 1937-11-10 450 Stone, Houston, TXM 55000 NULL 0 DEPARTMENT DEPT LOCATIONS Dnumber Dnumber Dlocation Mgr ssn 333445555 987654321 888665555 Mgr start date 1988-05-22 1995-01-01 1981-06-19 Research Stafford 3Explanation / Answer
A. This will not having any intigrity constraints violation but the date field we must enter it in the way it was shown in the table otherwise it wipp raise error.
B. This is not having any constraint. Violation or error.
C. It will raise the duplicate value error or primary key violation because already there is Dnum 4 in the table if we again try to do insertion the same value it will give violation error. The only possible way is to enter the new number as it is primary key.
D. This will give primary key violation as this is Pno is the primary key here. So it will not accept null values. We must have to give the value.
E. This is successfully deletes the tuple it tries to delete.
F. This will gives foreign key violation as this is primary table and the field is implemented in the child table using foreign key so it will give error. We must have implement cascade constraints along with foreign key inorder to delete the parent records without giving any violation errors.
G. It will also give same as above as it is having child records in Works_on table. We must implement cacade option in child table inorder to execute this successfully.
H.It will successfully executed without having any violation errors.
I. It will give foreign key constraint violation as it is having child records so we must use on update cascade option in child tables if we want to run this query.
J. It will execute successfully.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.