|
1 | | -# mysql-study |
| 1 | +### MySQL数据库入门大全 |
| 2 | + |
| 3 | +本文总结了自己学习过程中的全部历程,有数据库的基本概念介绍,有`MySQL`数据库中的`4`种语言,也有《SQL必知必会》一书的总结,更有`SqlZoo`网站由浅入深的配套练习 |
| 4 | + |
| 5 | +**本文既是自己的学习记录与总结,也可以作为数据库尤其是`MySQL`的入门资料** |
| 6 | + |
| 7 | +<!--MORE--> |
| 8 | + |
| 9 | +### 学习资料汇总 |
| 10 | + |
| 11 | +自己在学习的过程中使用了一些资料,**有网课,有书籍,也有网站**,包含: |
| 12 | + |
| 13 | +- [网易课程-MYSQL从入门到精通](https://study.163.com/course/courseMain.htm?courseId=1005092013) |
| 14 | +- **《SQL必知必会》** |
| 15 | +- [SqlZoo练习](https://sqlzoo.net/) |
| 16 | + |
| 17 | +>  |
| 18 | +
|
| 19 | +>  |
| 20 | +
|
| 21 | +>  |
| 22 | +
|
| 23 | + |
| 24 | + |
| 25 | +### MySQL安装 |
| 26 | + |
| 27 | +`MySQL`现在主要是`5.X`和`8.0`;本文中介绍的是在`Ubuntu18.04`中如何安装[MySQL5.7](https://www.jianshu.com/p/430f61337a2e) |
| 28 | + |
| 29 | +### MySQL数据库基本概念 |
| 30 | + |
| 31 | +数据库中的常见的[概念](https://www.jianshu.com/p/c71aa0199107) |
| 32 | + |
| 33 | +- 数据库 |
| 34 | +- 表 |
| 35 | +- 列、字段 |
| 36 | +- 行、记录 |
| 37 | + |
| 38 | +- 主键 |
| 39 | + |
| 40 | +### MySQL数据类型、字段修饰语、运算符 |
| 41 | + |
| 42 | +`MySQL`数据库中的主要[数据类型](https://www.jianshu.com/p/af46e2a39fa0) |
| 43 | + |
| 44 | +- 数值型 |
| 45 | +- 浮点型 |
| 46 | +- 字符串类型 |
| 47 | +- 日期时间类型 |
| 48 | + |
| 49 | +---- |
| 50 | + |
| 51 | +[字段修饰语和运算符](https://www.jianshu.com/p/10878072fe93)如下 |
| 52 | + |
| 53 | +**字段修饰语包含** |
| 54 | + |
| 55 | +| 修饰语 | 作用 | |
| 56 | +| :------------- | :------------------------------- | |
| 57 | +| unsigned | 无符号 | |
| 58 | +| auto_increment | 自增 | |
| 59 | +| default | 默认值 | |
| 60 | +| comment | 字段解释说明 | |
| 61 | +| not null | 非空 | |
| 62 | +| null | 空 | |
| 63 | +| unique | 唯一索引 | |
| 64 | +| index | 普通索引 | |
| 65 | +| primary key | 主键,必须指定为`auto_increment` | |
| 66 | + |
| 67 | +**常见的运算符** |
| 68 | + |
| 69 | +- = :表示赋值或者判断 |
| 70 | +- !=或者<>:不等于 |
| 71 | +- <:小于 |
| 72 | +- \>:大于 |
| 73 | +- <=、>=:小于等于或者大于等于 |
| 74 | +- OR:或 |
| 75 | +- AND:与 |
| 76 | +- BETWEEN…AND…:在…和…之间 |
| 77 | +- IN/NOT IN :在或不在 |
| 78 | + |
| 79 | +### MySQL中的4种语言 |
| 80 | + |
| 81 | +数据库中有常见的[4种语言]( https://www.jianshu.com/p/1e23f566364f)和[4种语言的知识点汇总](https://www.jianshu.com/p/3b6cab3b62f6) |
| 82 | + |
| 83 | +1. [数据定义语言DDL](https://www.jianshu.com/p/c5610beb6137) |
| 84 | +2. [数据操作语言DML](https://www.jianshu.com/p/f513350202b7) |
| 85 | +3. [数据控制语言DCL](https://www.jianshu.com/p/df52c7346f7d) |
| 86 | +4. [数据查询语言DQL](https://www.jianshu.com/p/083a6505ec83) |
| 87 | + |
| 88 | +### MySQL数据库进阶 |
| 89 | + |
| 90 | +1. [数据库引擎](https://www.jianshu.com/p/5315d6b30eae) |
| 91 | +2. [数据库字符集](https://www.jianshu.com/p/8706fa7ac392) |
| 92 | +3. [int-char-varchar](https://www.jianshu.com/p/cbd358d391de) |
| 93 | +4. [MySQL事务](https://www.jianshu.com/p/5bdc80bba1d7) |
| 94 | +5. [MySQL存储过程](https://www.jianshu.com/p/364856a3eb5f) |
| 95 | +6. [MySQL游标cursor](https://www.jianshu.com/p/42cbf8c27b89) |
| 96 | + |
| 97 | +### SQL必知必会 |
| 98 | + |
| 99 | +1. [SQL必知必会1](https://www.jianshu.com/p/f5bf541eeefe) |
| 100 | +2. [SQL必知必会2](https://www.jianshu.com/p/7ca1fe0c16a9) |
| 101 | +3. [SQL必知必会3](https://www.jianshu.com/p/221060032944) |
| 102 | + |
| 103 | +### sqlzoo练习 |
| 104 | + |
| 105 | +`sqlzoo`是一个专门用来练习`SQL`语句查询的网站,上面分成了各个板块或者语句。先是网站的例题,用户可以稍微修改提交,然后有各种由简到难的查询练习,很适合学习`SQL`的小伙伴进行入门。 |
| 106 | + |
| 107 | +>  |
| 108 | +
|
| 109 | +#### select子句顺序 |
| 110 | + |
| 111 | +1. select |
| 112 | +2. from |
| 113 | +3. where |
| 114 | +4. group by |
| 115 | +5. having |
| 116 | +6. order by(desc是降序) |
| 117 | + |
| 118 | +#### 练习部分 |
| 119 | + |
| 120 | +1. [where的使用](https://www.jianshu.com/p/408dfe8d2b22) |
| 121 | +2. [select的使用1](https://www.jianshu.com/p/5b0bd1b15db8) |
| 122 | +3. [select的使用2](https://www.jianshu.com/p/dca016282919) |
| 123 | +4. [Nobel Quiz-通配符与group by](https://www.jianshu.com/p/0d1cc3dc711b) |
| 124 | +5. [select in select](https://www.jianshu.com/p/3f679a466a0c) |
| 125 | +6. [select in select-quiz](https://www.jianshu.com/p/9770145e4e38) |
| 126 | +7. [聚合函数](https://www.jianshu.com/p/fb0d91e15d94) |
| 127 | +8. [sum-count-quiz](https://www.jianshu.com/p/0d01e6693e25) |
| 128 | +9. [简单的join操作](https://www.jianshu.com/p/b07039f09a8d) |
| 129 | +10. [join-quiz-1](https://www.jianshu.com/p/eee8271e17e6) |
| 130 | +11. [more-join](https://www.jianshu.com/p/39577e371caa) |
| 131 | +12. [join-quiz-2](https://www.jianshu.com/p/2a966e14826d) |
| 132 | +13. [using-NULL](https://www.jianshu.com/p/8f6714966549) |
| 133 | +14. [NULL-quiz](https://www.jianshu.com/p/93b1cc951571) |
| 134 | +15. [self-join](https://www.jianshu.com/p/2c7401aeee16) |
0 commit comments