Schematically: (not tested at all!)
- Product Table (Product_Id, Name, description,colour,price)
- Customer Table (Customer_Id, Name, address,e-mail, etc..)
- Discount Table Customer (DiscCust_Id, Customer_id,start discount time, end discount time)
- Discount Table Product (DiscProd_Id, Product_id,start discount time, end discount time)
- Order Table (Order_Id, Product_id,Customer_id,Quantity,Price,Buy_Date)
- Delivery Table (Deliver_Id, Order_Id, Product_id,Customer_id,Order_table.Quantity,etc...)
When querying, inserting, updating, deleting table, you'll have to Join the tables (look at
http://www.sql-join.com/sql-join-types) and write WHERE clauses
SELECT Order_Id,Customer.Name,Product.Name,Product.colour from Order
(LEFT/INNER/RIGHT) JOIN Product ON Product.Product_Id = Order.Product_id
(LEFT/INNER/RIGHT) JOIN Customer ON Customer.Customer_Id = Order.Customer_id
WHERE ORDER.Buy_Date < "12/12/2016"