https://github.com/uwla/sample_mysql_database
W3Schools MySQL Tutorials Database CSV & SQL files
https://github.com/uwla/sample_mysql_database
csv database db mysql sample sql w3schools
Last synced: 7 months ago
JSON representation
W3Schools MySQL Tutorials Database CSV & SQL files
- Host: GitHub
- URL: https://github.com/uwla/sample_mysql_database
- Owner: uwla
- License: mit
- Created: 2019-09-08T15:29:09.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-02-08T01:32:09.000Z (about 2 years ago)
- Last Synced: 2025-03-12T07:33:11.593Z (about 1 year ago)
- Topics: csv, database, db, mysql, sample, sql, w3schools
- Homepage:
- Size: 47.9 KB
- Stars: 13
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Sample MySQL Database
This repository contains the database used in
[W3Schools SQL tutorials](https://www.w3schools.com/sql/default.asp).
I cloned the repo https://github.com/AndrejPHP/w3schools-database and made
some changes:
- changed table names to match the ones on W3School's website
- added a text file containing some [query challenges](./queries.txt)
and [its solutions](./queries-answersheet.sql)
- exported database to [csv files](./csv)
About the last one, you can play with the `csv` files instead of creating a
`MySQL` database. There is a command-line software called `textql` that allows
you to execute SQL commands against structured text such as `csv`.
## Dataset
The dataset consists of the following tables with their respective columns:
- **Categories**: ID, Name, Description
- **Customers**: ID, Name, Contact, Address, City, PostalCode, Country
- **Employees**: EmployeeID, LastName, FirstName, Birthdate, Photo, Notes
- **OrderDetails**: ID, OrderID, ProductID, Quantity
- **Orders**: ID, CustomerID, EmployeeID, Date, Shipper ID
- **Products**: ID, Name, SupplierID, CategoryID, Unit, Price
- **Shippers**: ID, Name, Phone
- **Suppliers**: ID, Name, Contact, Address, City, PostalCode, Country, Phone
## Importing the SQL file
```shell
myqsl -u yourUserName -p
```
You'll be asked to type your password. Then type your password.
Alternatively, you can enter mysql as root. Type the following:
```shell
sudo mysql
```
Next, within mysql, type:
```shell
source /path/to/w3schools.sql;
```
Of course, you need to replace `/path/to/w3schools.sql` with the
absolute path of the file in your computer.