School uniform is available at M/s Sheetal Private Limited. They have maintained SCHOOL_UNIFORM Database with two relations viz. UNIFORM and COST. The following figure shows database schema and its state.
School Uniform Database Attributes and Constraints UNIFORM: UCode (Primary Key), UName (Not Null), UColor COST: UCode (Composite Primary Key), Size (Composite Primary Key), Price (>0)
Table: UNIFORM
| UCode | UName | UColor |
|---|---|---|
| 1 | Shirt | White |
| 2 | Pant | Grey |
| 3 | Skirt | Grey |
| 4 | Tie | Blue |
| 5 | Socks | Blue |
| 6 | Belt | Blue |
Can they insert the following tuples to the UNIFORM Relation? Give reasons in support of your answer. i) 7, Handkerchief, NULL ii) 4, Ribbon, Red iii) 8, NULL, White
Can they insert the following tuples to the COST Relation? Give reasons in support of your answer. i) 7, S, 0 ii) 9, XL, 100
Explanation
The question tests understanding of database constraints including Primary Key, Not Null, Check constraints, and Referential Integrity. In part (a), insertion fails if the Primary Key is duplicated or Not Null constraint is violated. In part (b), insertion fails if the Check constraint (Price > 0) is violated or if the Foreign Key references a non-existent record in the parent table (UNIFORM).