Skip to content

Commit

Permalink
mysql: Add more MySQL content (#658)
Browse files Browse the repository at this point in the history
  • Loading branch information
tungbq authored Jul 9, 2024
1 parent a652552 commit 691712b
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ We cover a wide range of DevOps topics in our content library, explore them unde
<td>SQL</td>
<td><a href="./topics/sql/">sql</a></td>
<td>📖 <a href="https://github.com/tungbq/devops-basic/blob/main/topics/sql/README.md">sql/README.md</a></td>
<td>✔️ <a href="./topics/sql/">sql</a></td>
<td>✔️ <a href="./topics/sql/mysql-basics.md">mysql-basics</a></td>
</tr>
</table>

Expand All @@ -247,7 +247,7 @@ We cover a wide range of DevOps topics in our content library, explore them unde
| The DevOps Hub | ☁️ [TheDevOpsHub](https://github.com/TheDevOpsHub) |
| devops-project | 🏗️ [devops-project](https://github.com/tungbq/devops-project) |
| 90DaysOfDevOps | 📆 [90DaysOfDevOps](https://github.com/MichaelCade/90DaysOfDevOps) |
| Container Labs | ☁️ [container-labs](https://github.com/TheDevOpsHub/container-labs) |
| Container Labs | 🐳 [container-labs](https://github.com/TheDevOpsHub/container-labs) |
| python | 🐍 [python-examples](https://github.com/tungbq/python-examples) |
| aws-lab-with-terraform | ☁️ [aws-lab-with-terraform](https://github.com/tungbq/aws-lab-with-terraform) |
| AWS-LearningResource | 🧰 [AWS-LearningResource](https://github.com/tungbq/AWS-LearningResource) |
Expand Down
40 changes: 37 additions & 3 deletions topics/sql/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,41 @@
# What is SQL?
## 1. What is MySQL

- TODO
### Overview

## 1. Where to learn?
- MySQL, also known as K8s, is an open-source system for automating deployment, scaling, and management of containerized applications.

### Official website documentation of MySQL

- Visit https://dev.mysql.com/doc/

## 2. Installation

### How to install MySQL?

- https://dev.mysql.com/doc/mysql-installation-excerpt/5.7/en/

## 3. Basics of MySQL

### Getting started with MySQL

- https://dev.mysql.com/doc/mysql-getting-started/en/

### MySQL Helloword ⭐

- Visit [mysql-basics](./mysql-basics.md)

## 4. Beyond the Basics

### Exploring Advanced Examples

- Checkout [mysql-advanced](./mysql-advanced.md)

## 5. More

### CS50x SQL

- [CS50x 2023 - Lecture 7 - SQL](https://www.youtube.com/live/zrCLRC3Ci1c?si=yCsB6cSRY5FqyOXd)

### Recommended Books

- None
3 changes: 3 additions & 0 deletions topics/sql/mysql-advanced.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# More MySQL hands-on

TODO
37 changes: 37 additions & 0 deletions topics/sql/mysql-basics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# MySQL basic hands-on

This hands-on will:

- Provisions a mysql instance with docker
- Creates a database named `sqldemodb`, a table named `users` with the specified columns, and shows how to verify the database and table creation.

## Run and explore sql in docker container

```bash
docker run --name demo-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:latest

docker exec -it demo-mysql bash
# You now in the `bash-5.1#` container terminal

# Connect to SQL
mysql -uroot -p

# Creating new DB
CREATE DATABASE sqldemodb;

# Using the Database
USE sqldemodb;


# Creating a New Table
CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100) NOT NULL,
email VARCHAR(100) NOT NULL
);

# Verifying the Creation
SHOW DATABASES;
SHOW TABLES;
DESCRIBE users;
```

0 comments on commit 691712b

Please sign in to comment.