mirror of
https://github.com/jaywcjlove/reference.git
synced 2025-06-19 05:31:21 +08:00
chore: format markdown code. (#42)
* format: fix markdown * update: fix markdown * update: fix cron problems * update: delete .markdownlintignore * update * chore: add tab -> 4 space * chore: fix tab -> 2 in the .editorconfig
This commit is contained in:
@ -3,7 +3,6 @@ MySQL 备忘清单
|
||||
|
||||
本备忘单旨在快速理解 [MySQL](https://mysql.com) 所涉及的主要概念,提供了最常用的SQL语句,供您参考。
|
||||
|
||||
|
||||
入门
|
||||
---
|
||||
|
||||
@ -65,9 +64,9 @@ mysql -h <host> -u <user> -p [db_name]
|
||||
`SHOW TABLES;` | 列出当前数据库的表
|
||||
`SHOW FIELDS FROM` t`;` | 表的列表字段
|
||||
`DESC` t`;` | 显示表格结构
|
||||
`SHOW CREATE TABLE `t`;` | 显示创建表sql
|
||||
`TRUNCATE TABLE `t`;` | 删除表中的所有数据
|
||||
`DROP TABLE `t`;` | 删除表格
|
||||
`SHOW CREATE TABLE`t`;` | 显示创建表sql
|
||||
`TRUNCATE TABLE`t`;` | 删除表中的所有数据
|
||||
`DROP TABLE`t`;` | 删除表格
|
||||
|
||||
#### Proccess
|
||||
|
||||
@ -388,6 +387,7 @@ CREATE TABLE t(
|
||||
CHECK(c1> 0 AND c1 >= c2)
|
||||
);
|
||||
```
|
||||
|
||||
c2列中的设置值不为NULL
|
||||
|
||||
```sql
|
||||
@ -556,7 +556,6 @@ DROP INDEX idx_name;
|
||||
MySQL 数据类型
|
||||
---------
|
||||
|
||||
|
||||
### Strings
|
||||
|
||||
| - | - |
|
||||
@ -573,16 +572,15 @@ MySQL 数据类型
|
||||
| `ENUM` | One of preset options |
|
||||
| `SET` | Selection of preset options |
|
||||
|
||||
|
||||
### Date & time
|
||||
|
||||
| Data Type | Format |
|
||||
|-------------|---------------------|
|
||||
| `DATE ` | yyyy-MM-dd |
|
||||
| `TIME ` | hh:mm:ss |
|
||||
| `DATETIME ` | yyyy-MM-dd hh:mm:ss |
|
||||
| `DATE` | yyyy-MM-dd |
|
||||
| `TIME` | hh:mm:ss |
|
||||
| `DATETIME` | yyyy-MM-dd hh:mm:ss |
|
||||
| `TIMESTAMP` | yyyy-MM-dd hh:mm:ss |
|
||||
| `YEAR ` | yyyy |
|
||||
|
||||
| `YEAR` | yyyy |
|
||||
|
||||
### Numeric
|
||||
|
||||
@ -602,4 +600,4 @@ MySQL 数据类型
|
||||
|
||||
- [SQL 基础教程](http://www.w3school.com.cn/sql/index.asp) _(w3school.com.cn)_
|
||||
- [SQL 语句教程](http://www.1keydata.com/cn/sql/sql-count.php) _(1keydata.com)_
|
||||
- [21分钟 MySQL 基础入门](https://jaywcjlove.github.io/mysql-tutorial/21-minutes-MySQL-basic-entry.html) _(jaywcjlove.github.io)_
|
||||
- [21分钟 MySQL 基础入门](https://jaywcjlove.github.io/mysql-tutorial/21-minutes-MySQL-basic-entry.html) _(jaywcjlove.github.io)_
|
||||
|
Reference in New Issue
Block a user