This project contains SQL scripts and related documentation for setting up and managing an e-commerce database using MySQL and PopSQL.
sql/ddl/
: DDL scripts for creating and altering tables.sql/dml/
: DML scripts for inserting data.sql/queries/
: Scripts for complex queries and operations.sql/triggers/
: Scripts for creating triggers.docs/
: Documentation and diagrams.scripts/
: Shell scripts for database setup and management.backups/
: Database backup files.
- MySQL: The database management system used for this project.
- PopSQL: A SQL editor and collaboration tool.
-
Start the MySQL server.
-
Create a new database:
CREATE DATABASE ecommerce_db;
-
Clone the repository:
git clone https://github.com/your-username/e-commerce-sql-database-project.git cd e-commerce-sql-database-project
- Download and install PopSQL.
- Connect PopSQL to your MySQL database:
- Open PopSQL and create a new connection.
- Enter your MySQL server details (host, port, username, password, database name).
- Creating Tables: Run the scripts in
sql/ddl/
using PopSQL or the MySQL command line. - Inserting Data: Run the scripts in
sql/dml/
using PopSQL or the MySQL command line. - Executing Queries: Use the scripts in
sql/queries/
using PopSQL or the MySQL command line.
- Open PopSQL and connect to your MySQL database.
- Open and run the scripts in the
sql/
directory in the following order:sql/ddl/create_tables.sql
sql/dml/insert_data.sql
sql/queries/operations.sql
sql/triggers/create_triggers.sql