Assignment 4
Assignment 4
Multiple-Choice Questions:
4) The data type of values that appear in each column is represented by _____ of possible values.
a) range b) product c) domain d) function
13) _______ constraint can be expressed in schema of relational model by using DDL.
a) schema-based b) inherent model-based c) application-based d) system-based
14) ________ constraint specifies that no two distinct tuples in any state of relational schema can
have same values for superkeys.
a) entity-integrity b) domain c) referential-integrity d) key
15) _______ constraint specifies that within each tuple, the value of each attribute must be atomic
value from some domain.
a) entity-integrity b) domain c) referential-integrity d) key
17) When there is more than one key in a relation, then each such key is called ______.
a) primary b) useful c) multiple d) candidate
18) _______ constraint states that no primary key value can be null.
a) key b) domain c) referential-integrity d) entity-integrity
19) _______ constraint states that a tuple in one relation that refers to another relation must refer to
an existing tuple in that relation.
a) key b) domain c) referential-integrity d) entity-integrity
20) _______ constraint is used to maintain consistency among tuples in two relations.
a) key b) domain c) referential-integrity d) entity-integrity
TRUE or FALSE:
Suppose each of the following update operations is applied directly to the COMPANY database
state. Discuss all integrity constraints violated by each operation, if any.
1. Insert <‘Robert’, ‘F’, ‘Scott’, ‘943775543’, ‘1952-06-21’, ‘2365 Newcastle Rd, Bellaire,
TX’, M, 58000, ‘888665555’, 1> into EMPLOYEE.
2. Insert <‘Product A’, 4, ‘Bellaire’, 2> into PROJECT.
3. Insert <‘Production’, 4, ‘943775543’, ‘1998-02-01’> into DEPARTMENT.
4. Insert <‘677678989’, null, ’40.0’> into WORKS_ON.
5. Insert <‘453453453’, ‘John’, M, ‘1970-02-03’, ‘SPOUSE’> into DEPENDENT.
6. Delete the WORKS_ON tuples with ESSN = ‘333445555’.
7. Delete the EMPLOYEE tuple with SSN = ‘9887654321’.
8. Delete the PROJECT tuple with PNAME = ‘ProductX’.
9. Modify the MGRSSN and MGRSTARTDATE of the DEPARTMENT tuple with
DNUMBER = 5 to ‘123456789’ and ‘1999-10-01’, respectively.
10. Modify the SUPERSSN attribute of the EMPLOYEE tuple with SSN = ‘999887777’ to
‘94377543’.
11. Modify the HOURS attribute of the WORKS_ON tuple with ESSN = ‘999887777’ and
PNO = 10 to ‘5.0’.