This project models and analyzes restaurant meal ordering behavior using a relational SQL database. It simulates a food delivery platform with members, restaurants, meals, and transactions. The project was developed entirely using SQLite and DB Browser for SQLite and demonstrates full-cycle data handling—from schema creation and population to advanced SQL querying and data validation.
-
Data/- Contains the raw CSV files used to populate the database tables. Each file corresponds to one table, such as
orders.csv,members.csv,meals.csv, etc.
- Contains the raw CSV files used to populate the database tables. Each file corresponds to one table, such as
-
Database/- Contains the SQLite database file (
restaurants_database.db) and thepopulate_tables.sqlscript that loads data from the CSVs.
- Contains the SQLite database file (
-
ERDs/-
The conceptual model (PDF diagram), which outlines the high-level entities and relationships.
-
The physical model (PDF diagram), which defines the tables, columns, and key constraints.
-
-
Queries/ -
Houses themed SQL query scripts demonstrating analytical capabilities and SQL fluency. Files include:
-
customer_behavior.sql: Analyzes member activity and spending. -
revenue_analysis.sql: Examines trends in revenue and order value. -
meal_popularity.sql: Identifies top-selling meals and pricing insights. -
restaurant_performance.sql: Evaluates restaurant-level performance. -
monthly_trends.sql: Highlights changes over time. -
views_and_ctes.sql: Demonstrates the use of CTEs and reusable views. -
data_validation.sql: Performs a comprehensive join across all tables to verify structural integrity.
-
-
Schema/ -
Contains SQL scripts for database setup:
-
restaurants_create_tables.sql: Creates the normalized table structure and constraints. -
restaurants_drop_tables.sql: Drops all tables to reset the database.
-
-
Scripts/- Includes a Python helper script,
generate_insert_script.py, used to convert CSV files into SQLINSERTstatements for database loading.
- Includes a Python helper script,
This project was built and tested in DB Browser for SQLite. To run the full database and query process, follow these steps:
-
Open the SQLite database file
- Launch DB Browser for SQLite and open
restaurants_database.dbfrom theDatabasefolder.
- Launch DB Browser for SQLite and open
-
(Optional) Reset the database
- Open and execute
restaurants_drop_tables.sqlfrom theSchemafolder to drop existing tables if you're starting fresh.
- Open and execute
-
Create tables
- Open and execute
restaurants_create_tables.sqlto create all tables and relationships.
- Open and execute
-
Load the data
- Open and run
populate_tables.sqlfrom theDatabasefolder. This script populates the tables using the CSV files in theDatafolder.
- Open and run
-
Commit changes
- In DB Browser, click “Write Changes” to save the inserted data to the database file.
-
Run the query scripts
- Open the SQL files in the
Queriesfolder one by one to explore and analyze the data. Each script is self-contained and themed for a specific analysis topic.
- Open the SQL files in the
The dataset used in this project is publicly available on Kaggle: Restaurant Demand Forecasting Dataset on Kaggle
The original dataset has been restructured and normalized into multiple related tables for use in a relational SQL context.
-
Fully normalized SQL database with 10 interrelated tables
-
Entity-Relationship Diagrams (conceptual and physical) for schema visualization
-
End-to-end data handling: table creation, population, querying, and validation
-
Themed SQL queries with joins, aggregates, common table expressions (CTEs), and views
-
Validation queries to confirm referential integrity across all tables
-
Clean directory structure for modular organization
Tyler Katz
B.S. in Applied Data Analytics, Class of 2026 Syracuse University
This projest is licensed under the MIT Licesne. See the LICESNE for details.