In a store that sells electronic items, the owner maintains a well-organized database
containing information about all the products available for sale. The products include
smartphones, laptops, tablets, televisions, cameras, headphones, speakers, and many others.
This database stores details about its products such as the product name, unique product ID,
category, brand, price, and the current quantity of each product in stock.
When a customer makes a purchase, the relevant order data is recorded in the database. The
order data must include a unique order number, the time the order was placed and the order's
total price. An order must be placed by only one customer.
Customer data should also be recorded in the database. These data include a unique customer
id, customer name and customer phone number. Customers might place one or more orders.
For each created order, the database keeps track of the individual items purchased. These
items are recorded as order items. An order item is identified by a unique item ID. An order
item entry includes the product ID of the item purchased, its price, the quantity purchased in
that order, and a column indicating whether the item has been returned ("Yes/No"). Each
order item entry is associated with the order number to which it belongs.
Each order must have at least one order item (representing the products purchased in that
order). Each order item should belong to exactly one order.
Each order item is associated with one product, while a product can have multiple associated items.