Question: A database for a retailer needs to store information about customers (identified by c id, with name as an attribute), products (identified by p id,
A database for a retailer needs to store information about customers (identified by c id, with name as an attribute), products (identified by p id, with price as an attribute) and transactions (identified by t id, with date as an attribute).
Assume that (1) each transaction is initiated by exactly one customer,
(2) a customer may initiate multiple (including 0) transactions, and
(3) for each transaction, all of the products purchased and their quantities must be recorded (e.g., in the case of transaction 1234, 2 units of product X and 3 units of product Y are purchased).
(a) (15 points) Draw an E/R diagram that captures all of the above information.
(b) (15 points) Define tables using SQL that correspond to the E-R diagram in (a). You must define the smallest number of tables while ensuring that these tables are in BCNF (you do not need to prove that the resulting tables are in BCNF). For each table, specify primary and foreign keys. Add integrity constraints if needed.
(c) (10 points) List all of the nontrivial functional dependencies that you can find from the tables in (b). Please omit functional dependencies that are redundant (for example, if a b is included, do not add ac bc).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
