Database Management Principles and Applications
Semester II- Academic year 2018-2019
The Relational Data Model and Relational Database Constraints
Assignment # 4
1.
Suppose that each of the following Update operations is applied directly to the database state shown in the provided Figure. Discuss all integrity constraints violated by each operation, if any, and the different ways of enforcing these constraints. (CLO2)
(a)
Insert <‘Sophia’, ‘M’, ‘Wood’, ‘973442298’, ‘1974-05-21’, ’23 S Lamar Blvd. Rd, Austin, TX’,
‘F’, 62000, ‘222445555’, 5> into EMPLOYEE.
(b)
Insert <‘6Sigma’, 4, ‘Austin’, 4> into PROJECT.
(c)
Delete the DEPENDENT tuples with Essn = ‘987654321’.
(d) Modify the Plocation and Dnum of the PROJECT tuples with Dnum = 5 to ‘Houston’ and 1, respectively.
(e) Modify the Pnumber attribute of the PROJECT tuple with Pnumber = 30 to40
2.
Consider the relation FACTORY(Product#, Production_Section#, Supervisor, Stage,
Warehouse_code, Machine#, Machine_Time, Production_Time, Units_manufactured). This represents products manufactured in a factory, with unique Product_section#s. Identify what you think should be various candidate keys, and write in your own words the conditions or assumptions under which each candidate key would be valid. (CLO2)
3. Consider the following relations for a database that keeps track of visits of various doctors working for a group of hospitals, to various hospitals under the group: (CLO2)
DOCTORS(DSsn, Name, Start_year, Dept_no, location)
VISIT(DSsn, From_hospital, To_hospital, Departure_date, Return_date, Visit_id)
EXPENSE(Visit_id, Account#, Amount)
A Visit can be charged to one or more accounts. Specify the foreign keys for this schema, stating any assumptions you make.
Due date: 23-02-2019
Assignment to be submitted via MOODLE