CoffeeHouse is a database system designed to manage the operations of a coffee shop, including order handling, promotions, inventory management, employee scheduling, and financial tracking. The schema is structured to support scalability, auditability, and promotional flexibility while ensuring normalized data design.
Represents drinks available on the menu.
- Attributes:
name,type,size,price,hot_or_cold - Each
MenuItemhas one recipe and may be part of promotions. - Linked to orders via the
customer-place-orderrelationship.
Defines the preparation method for each drink.
- One-to-one relationship with
MenuItemviaas_recipe. - Each recipe has multiple ordered steps stored in
recipe_steps.
Tracks all ingredients (stock items).
- Attributes:
name,unit,price,stock_quantity - Connected to recipes via
recipe_ingredients. - Updated through the
restocksrelationship viaRefill.
Represents stock refill actions.
- Connected to
InventoryandTransactions. - Captures the quantity restocked and cost via
refill_quant. - Logged financially in
Transactionsthroughrefill-update.
Central financial log of the shop.
- Attributes:
trans_id,timestamp,amount,balance(derived) - Connected to both
OrderandRefillviaorder-updateandrefill-update. - Ensures traceable financial history.
Staff member responsible for preparing drinks.
- Inherits:
name,ssn,email,salaryfromEmployee - Assigned shifts (day, start_time, end_time)
- Connected to
Orderviaprepared_by.
Represents customer purchases.
- Attributes:
order_id,timestamp,payment_method,total_amt - Linked to multiple
MenuItemswith quantities viaitem_quant. - Connected to a single
BaristaandTransaction.
Time-based or combo discounts for drinks.
- Attributes:
promo_id,description,start_time,end_time,day,discount% - Connected to
MenuItemsviapromotedMenuItem.
- Orders deduct inventory automatically based on recipe ingredients.
- Promotions are time-bound and item-specific, affecting order totals.
- Every financial action (sale or refill) is logged in the
Transactionstable. - Shift assignments are tracked for baristas to ensure operational transparency.
- Managers can place refil request and alters inventory(stock) and logged to transaction through refil-update.