- Year not given
Normalize sale relation up to 4NF
Short answer
1NF: remove repeating groups. 2NF: split partial dependencies → CUSTOMER, ITEM, SALE. 3NF: remove transitive dependencies → separate SUPLIER. Final 4NF schema: CUSTOMER(cust_name, ship_add), SALE(cust_name, item), ITEM(item, newsletter, supp, price), SUPPLIER(supp, supp_phone).
Normalize the following relation up to 4NF (show 1NF, 2NF, 3NF and 4NF). UNF: sale (cust_name, item, ship-add, newsletter, supplier, supplier-phone, price)
| Cust_name | Item | Ship-add | Newsletter | supp | supp-phone | price |
|---|---|---|---|---|---|---|
| A | a | bkt | a1 | M | AX | 100 |
| B | b | ktm | b1 | S | BX | 200 |
| C | a, b | bkt | a1, b1 | M, S | AX, BX | 300 |
| D | c | dhr | c1 | S | CX | 800 |
Assumptions (read from the sample data)
- A customer has one shipping address (cust_name → ship_add).
- Newsletter, supplier and price depend on the item (item → newsletter, supplier, price). Customer C bought items a and b; her price 300 is the sum 100 + 200 of the item prices, so price is taken as the item price.
- Each supplier has one phone (supp → supp_phone).
Unnormalized form (UNF)
Customer C has repeating groups (two items, two newsletters, two suppliers, two phones in one row).
1NF: remove repeating groups (one value per cell)
Each item bought becomes a separate row. Primary key: (cust_name, item).
| cust_name | item | ship_add | newsletter | supp | supp_phone | price |
|---|---|---|---|---|---|---|
| A | a | bkt | a1 | M | AX | 100 |
| B | b | ktm | b1 | S | BX | 200 |
| C | a | bkt | a1 | M | AX | 100 |
| C | b | bkt | b1 | S | BX | 200 |
| D | c | dhr | c1 | S | CX | 800 |
FDs: cust_name → ship_add; item → newsletter, supp, price; supp → supp_phone.
(Data problem: S has phone BX in row B and CX in row D. We treat CX as an entry error or a different supplier; in a real design supp → supp_phone must hold.)
2NF: remove partial dependencies
ship_add depends only on cust_name, and newsletter, supp, supp_phone, price depend only on item. Both are parts of the composite key, so split:
- CUSTOMER(cust_name, ship_add)
- ITEM(item, newsletter, supp, supp_phone, price)
- SALE(cust_name, item) (both foreign keys)
3NF: remove transitive dependencies
In ITEM, item → supp and supp → supp_phone, so supp_phone depends on the key through supp. Split:
- CUSTOMER(cust_name, ship_add)
- ITEM(item, newsletter, supp, price) (supp is a foreign key)
- SUPPLIER(supp, supp_phone)
- SALE(cust_name, item)
BCNF check
In every relation the left side of each FD is a key, so the schema is also in BCNF.
4NF: remove multivalued dependencies
4NF requires that every non-trivial MVD X →→ Y has X as a superkey. In the original UNF, a customer's items, and an item's newsletters and suppliers, were the multi-valued sets. After the split:
- SALE(cust_name, item) is all key; the only MVD is trivial.
- ITEM: newsletter and supp are single-valued per item (functional, not multi-valued), so there is no non-trivial MVD.
So the four relations are already in 4NF:
CUSTOMER(cust_name, ship_add)
SALE(cust_name, item)
ITEM(item, newsletter, supp, price)
SUPPLIER(supp, supp_phone)
If a business rule allowed an item to have several independent newsletters and several independent suppliers (item →→ newsletter | supp), ITEM would be split further into ITEM_NEWSLETTER(item, newsletter) and ITEM_SUPPLIER(item, supp, price) to reach 4NF.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- SQL: increase balances by 100% and 50% · Database Management System, chapter 3
- RA: computer dept employees and supervisors · Database Management System, chapter 3
- RA: delete Electrical dept projects · Database Management System, chapter 3
- RA: projects count per department · Database Management System, chapter 3
- RA: employees on Network over 15 hours · Database Management System, chapter 3
- RECORD.txt item cost with VAT · Computer Programming, chapter 10
- Built-up beam, unsupported 4 m, 40 kN/m + 100 kN · Design of Steel and Timber Structure, chapter 7
- Extreme value of x²+y²+z² with ax+by+cz=p · Mathematics, chapter 1 · asked 5×
- Pressure to drive oil up inclined pipe · Hydraulics, chapter 1