This repository contains the W3Schools SQL database, cleaned and formatted for use in DB Fiddle (MySQL 8.0). It includes 8 tables: Categories, Customers, Employees, Orders, OrderDetails, Products, Shippers, and Suppliers. The data is ideal for practicing SQL queries.
- Categories: 8 records (product categories)
- Customers: 91 records (customer details)
- Employees: 10 records (employee details)
- Orders: 401 records (customer orders)
- OrderDetails: 518 records (order items)
- Products: 77 records (product details)
- Shippers: 3 records (shipping companies)
- Suppliers: 29 records (product suppliers)
- Go to DB Fiddle.
- Select MySQL 8.0 as the database engine.
- Copy the SQL code from one of the
.sqlfiles (e.g.,customers.sql) or usew3schools_full.sqlfor the entire database. - Paste the code into the Schema panel (left side).
- Click Run to create the tables and insert data.
- Write and test your SQL queries in the Query panel (right side).
- Save or share your fiddle using the provided URL.
Note: Insert tables in dependency order (Categories, Suppliers, Products, Customers, Employees, Shippers, Orders, OrderDetails) to avoid foreign key errors.
Categories.sql: Schema and data forCategoriestable.Customers.sql: Schema and data forCustomerstable.Employees.sql: Schema and data forEmployeestable.Orders.sql: Schema and data forOrderstable.OrderDetails.sql: Schema and data forOrderDetailstable.Products.sql: Schema and data forProductstable.Shippers.sql: Schema and data forShipperstable.Suppliers.sql: Schema and data forSupplierstable.ConcatentedData.sql: Combined schema and data for all tables.
- Set NULL
PostalCodeinCustomersto 'Unknown'. - Removed spaces from
PostalCodeinCustomersandSuppliers. - Normalized
Phoneformats inSuppliersandShippers(e.g., '(503) 555-9831' → '503-555-9831'). - Rounded
PriceinProductsto 2 decimal places.
- If DB Fiddle is slow, use individual table files or a subset of the data.
- For local testing, import the
.sqlfiles into MySQL Workbench or a similar tool. - Practice queries like
SELECT,JOIN,GROUP BY, andSUBQUERYusing this dataset.
This dataset is provided for educational purposes. Feel free to use and share it for teaching SQL.