Union Square Donuts

Database Design Documentation by Lydia Oyediran


Problem Statement

The goal of this project is to design a normalised SQLite database for a donut shop that can track raw ingredients, menu items (donuts), customer accounts, and sales orders.


Scope

In Scope


Outside Scope


Functional Requirements

What Users Should Be Able to Do


Out of Scope


Representation

Entities

This section defines all tables, constraints, and relationships, including explicit identification of junction tables and foreign key mappings.


ingredients


donuts


customers


orders


donut_ingredients (Junction Table)


order_items (Junction Table)


Summary of Junction Tables


Relationships

Entity Relationship Diagram (ERD)

Union Square Donuts ERD


Descriptions


Optimizations

The following optimization was implemented:

Why?


Limitations

Design Limitations


Representation Limitations

If the price of a donut changes (e.g., from $4.00 to $5.00), historical queries will reflect the new price instead of the original purchase price hence, making past financial records inaccurate. To fix this in a production environment, a price_at_purchase column would need to be added directly to the order_items table.