---
# System prepended metadata

title: SQL語法介紹
tags: [sql mysql]

---

---
tags: sql mysql
---

# SQL語法介紹

## SQL的用途與方法

![](https://i.imgur.com/gAQuYMH.png)




## SQL語法的分類

#### DDL(Data Definition Language) - ==資料定義語言==

* CREATE, ALTER, DROP

#### DML(Data Manipulation Language) - ==資料操縱語言==

* SELECT, INSERT, UPDATE, DELETE

#### DCL(Data Control Language) - ==資料控製語言==

* GRANT, REVOKE

> 案例

![](https://i.imgur.com/y3J79G6.png)

```sql=
SELECT * FROM Customers
WHERE City IN ('Paris','London');

select id, name
from user
where age > 18;


```

