Welcome to the SQL Sample Database repository! This project provides a comprehensive example of a relational database structure, ideal for learning and practicing SQL queries, database normalization, data analysis, and more.
This repository includes:
- SQL Scripts for creating and populating the database.
- Entity-Relationship Diagram (ERD) for understanding the schema.
- Sample Queries to demonstrate common SQL operations.
The sample database simulates a retail management system with the following key entities:
CustomersEmployeesOfficesOrdersOrderDetailsProductsProductLinesPayments
An ERD is included in the repository for better understanding of the relationships between tables.
To set up the database locally:
-
Clone the repository:
git clone https://github.com/Spamziesagcan/SQL-Sample-Database.git cd SQL-Sample-Database -
Use any SQL-compatible database (e.g., MySQL, PostgreSQL, SQLite) to execute the SQL script:
-
Open your SQL tool of choice.
-
Execute sample_database.sql to create and populate the database.
-
Start querying! Sample queries are included in the sample_queries.sql file.
💡 Use Cases This sample database is perfect for:
Practicing SQL queries
Learning relational database design
Teaching database concepts
Testing BI tools and reporting dashboards
✅ Requirements Any SQL-compatible database system (MySQL recommended)
SQL client (like MySQL Workbench, DBeaver, DataGrip, etc.)
🙌 Contributing Contributions are welcome! If you’d like to add new queries, improve documentation, or enhance the schema:
-
Fork the repository
-
Create your branch (git checkout -b feature-name)
-
Commit your changes (git commit -m 'Add new feature')
-
Push to the branch (git push origin feature-name)
-
Open a Pull Request