Functional dependency driven design
SQL
Hard
3 views
Problem Description
Table Shipment(order_id, courier, courier_phone). courier determines courier_phone. Show normalized tables.
Output Format
DDL statement(s)
Constraints
courier -> courier_phone
Official Solution
CREATE TABLE Couriers (courier VARCHAR(100) PRIMARY KEY, courier_phone VARCHAR(30)); CREATE TABLE Shipments (order_id INT PRIMARY KEY, courier VARCHAR(100), FOREIGN KEY (courier) REFERENCES Couriers(courier));
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!