{"id":20086998,"url":"https://github.com/hayat01sh1da/mysql","last_synced_at":"2026-05-18T19:08:06.655Z","repository":{"id":179023492,"uuid":"370060452","full_name":"hayat01sh1da/mysql","owner":"hayat01sh1da","description":"This repository is for beginners who would like to master SQL(particularly MySQL). You can practice it on Docker container on your local environment.","archived":false,"fork":false,"pushed_at":"2025-07-24T19:02:39.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-25T02:38:23.395Z","etag":null,"topics":["docker","mysql","sql","tutorials"],"latest_commit_sha":null,"homepage":"https://github.com/hayat01sh1da/mysql","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hayat01sh1da.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-05-23T13:28:42.000Z","updated_at":"2025-07-24T19:02:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"cc47e62f-1e6b-4d39-a77b-2e096512cdf5","html_url":"https://github.com/hayat01sh1da/mysql","commit_stats":null,"previous_names":["hayat01sh1da/mysql"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hayat01sh1da/mysql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hayat01sh1da%2Fmysql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hayat01sh1da%2Fmysql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hayat01sh1da%2Fmysql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hayat01sh1da%2Fmysql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hayat01sh1da","download_url":"https://codeload.github.com/hayat01sh1da/mysql/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hayat01sh1da%2Fmysql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278284460,"owners_count":25961510,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","mysql","sql","tutorials"],"created_at":"2024-11-13T16:03:31.966Z","updated_at":"2026-05-18T19:08:06.639Z","avatar_url":"https://github.com/hayat01sh1da.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"## 1. Environment\n\n- WSL (Ubuntu 25.10)\n- Docker 29.3.1\n- mysql/mysql-server:8.0.32\n\n## 2. Reference\n\n[MySQL Tutorial - W3Schools](https://www.w3schools.com/mysql/default.asp)\n\n## 3. Docker\n\n### 3-1. Setup MySQL\n\n```bash\n$ docker build\n$ docker-compose up -d\n```\n\n### 3-2. Create DB, Tables and Insert Records\n\n```bash\n$ docker-compose exec db mysql -u root\nWelcome to the MySQL monitor.  Commands end with ; or \\g.\nYour MySQL connection id is 10\nServer version: 8.0.32 MySQL Community Server - GPL\n\nCopyright (c) 2000, 2023, Oracle and/or its affiliates.\n\nOracle is a registered trademark of Oracle Corporation and/or its\naffiliates. Other names may be trademarks of their respective\nowners.\n\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\n\nmysql\u003e source setup.sql\n```\n\n## 4. SQL Introduction\n\n### 4-1. List Up Databases\n\n```bash\nmysql\u003e SHOW DATABASES;\n+--------------------+\n| Database           |\n+--------------------+\n| information_schema |\n| mysql              |\n| performance_schema |\n| sql_tutorial       |\n| sys                |\n+--------------------+\n```\n\n### 4-2. Switch to a Specific Database\n\n```sql\nmysql\u003e USE sql_tutorial;\nDatabase changed\nmysql\u003e SHOW TABLES;\n+------------------------+\n| Tables_in_sql_tutorial |\n+------------------------+\n| Categories             |\n| Customers              |\n| Employees              |\n| OrderDetails           |\n| Orders                 |\n| Products               |\n| Shippers               |\n| Suppliers              |\n+------------------------+\n```\n\n### 4-3. Check Schema of a Specific Table\n\n```sql\nmysql\u003e DESCRIBE Employees;\n+-----------+--------------+------+-----+---------+-------+\n| Field     | Type         | Null | Key | Default | Extra |\n+-----------+--------------+------+-----+---------+-------+\n| ID        | int          | NO   | PRI | NULL    |       |\n| LastName  | varchar(255) | YES  |     | NULL    |       |\n| FirstName | varchar(255) | YES  |     | NULL    |       |\n| BirthDate | date         | YES  |     | NULL    |       |\n| Photo     | varchar(255) | YES  |     | NULL    |       |\n| Notes     | longtext     | YES  |     | NULL    |       |\n+-----------+--------------+------+-----+---------+-------+\n```\n\n### 4-4. Fetch a Specific Column\n\nYou can use `*` if you would like to fetch all columns.\n\n```sql\nmysql\u003e SELECT ID FROM Employees;\n+----+\n| ID |\n+----+\n|  1 |\n|  2 |\n|  3 |\n|  4 |\n|  5 |\n|  6 |\n|  7 |\n|  8 |\n|  9 |\n+----+\n```\n\n## 5. Schemas\n\n### 5-1. Categories\n\n|Field       |Type         |Null |Key |Default |Extra |\n|:-----------|:------------|:----|:---|:-------|:-----|\n|ID          |int          |NO   |PRI |NULL    |      |\n|Name        |varchar(255) |YES  |    |NULL    |      |\n|Description |varchar(255) |YES  |    |NULL    |      |\n\n### 5-2. Customers\n\n|Field       |Type         |Null |Key |Default |Extra |\n|:-----------|:------------|:----|:---|:-------|:-----|\n|ID          |int          |NO   |PRI |NULL    |      |\n|FullName    |varchar(255) |YES  |    |NULL    |      |\n|ContactName |varchar(255) |YES  |    |NULL    |      |\n|Address     |varchar(255) |YES  |    |NULL    |      |\n|City        |varchar(255) |YES  |    |NULL    |      |\n|ZipCode     |varchar(255) |YES  |    |NULL    |      |\n|Country     |varchar(255) |YES  |    |NULL    |      |\n\n### 5-3. Employees\n\n|Field     |Type         |Null |Key |Default |Extra |\n|:---------|:------------|:----|:---|:-------|:-----|\n|ID        |int          |NO   |PRI |NULL    |      |\n|LastName  |varchar(255) |YES  |    |NULL    |      |\n|FirstName |varchar(255) |YES  |    |NULL    |      |\n|BirthDate |date         |YES  |    |NULL    |      |\n|Photo     |varchar(255) |YES  |    |NULL    |      |\n|Notes     |longtext     |YES  |    |NULL    |      |\n\n### 5-4. Orders\n\n|Field      |Type |Null |Key |Default |Extra |\n|:----------|:----|:----|:---|:-------|:-----|\n|ID         |int  |NO   |PRI |NULL    |      |\n|OrderDate  |date |YES  |    |NULL    |      |\n|CustomerID |int  |YES  |MUL |NULL    |      |\n|EmployeeID |int  |YES  |MUL |NULL    |      |\n|ShipperID  |int  |YES  |MUL |NULL    |      |\n\n### 5-5. OrderDetails\n\n|Field     |Type |Null |Key |Default |Extra |\n|:---------|:----|:----|:---|:-------|:-----|\n|ID        |int  |NO   |PRI |NULL    |      |\n|Quantity  |int  |YES  |    |NULL    |      |\n|OrderID   |int  |YES  |MUL |NULL    |      |\n|ProductID |int  |YES  |MUL |NULL    |      |\n\n### 5-6. Products\n\n|Field      |Type         |Null |Key |Default |Extra |\n|:----------|:------------|:----|:---|:-------|:-----|\n|ID         |int          |NO   |PRI |NULL    |      |\n|Name       |varchar(255) |YES  |    |NULL    |      |\n|Unit       |varchar(255) |YES  |    |NULL    |      |\n|Price      |float        |YES  |    |NULL    |      |\n|CategoryID |int          |YES  |MUL |NULL    |      |\n|SupplierID |int          |YES  |MUL |NULL    |      |\n\n### 5-7. Shippers\n\n|Field |Type         |Null |Key |Default |Extra |\n|:-----|:------------|:----|:---|:-------|:-----|\n|ID    |int          |NO   |PRI |NULL    |      |\n|Name  |varchar(255) |YES  |    |NULL    |      |\n|Phone |varchar(255) |YES  |    |NULL    |      |\n\n### 5-8. Suppliers\n\n|Field       |Type         |Null |Key |Default |Extra |\n|:-----------|:------------|:----|:---|:-------|:-----|\n|ID          |int          |NO   |PRI |NULL    |      |\n|Name        |varchar(255) |YES  |    |NULL    |      |\n|ContactName |varchar(255) |YES  |    |NULL    |      |\n|Address     |varchar(255) |YES  |    |NULL    |      |\n|City        |varchar(255) |YES  |    |NULL    |      |\n|ZipCode     |varchar(255) |YES  |    |NULL    |      |\n|Country     |varchar(255) |YES  |    |NULL    |      |\n|Phone       |varchar(255) |YES  |    |NULL    |      |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhayat01sh1da%2Fmysql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhayat01sh1da%2Fmysql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhayat01sh1da%2Fmysql/lists"}