Skip to content

Commit

Permalink
update: 更新此前打不开的图片
Browse files Browse the repository at this point in the history
  • Loading branch information
qianguyihao committed Aug 20, 2023
1 parent 58c8f9f commit dbdf9d6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
16 changes: 6 additions & 10 deletions 10-MySQL数据库/05-MySQL数据库的常用命令.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ publish: true

我们可以在 Navicat Premium 软件中,创建数据库和表,然后输入查询命令来查询数据。选择菜单栏「查询->新建查询->输入 sql 命令->运行」即可,效果如下:

![](https://github.com/qianguyihao/Web/blob/master/img/20200417_1750.png)
![](https://img.smyhvae.com/20200417_1750.png)

我们还可以直接在终端输入命令行来操作。

注意,在 Mac 终端执行 sql 命令时,命令的末尾必须加上`;`(英文格式的分号)。效果如下:

![](https://github.com/qianguyihao/Web/blob/master/img/20200417_1700.png)
![](https://img.smyhvae.com/20200417_1700.png)

MySQL 命令行的一些简单命令如下。

Expand Down Expand Up @@ -225,8 +225,7 @@ SELECT * FROM author INNER JOIN book;

查询结果:


![](https://github.com/qianguyihao/Web/blob/master/img/20200418_2300.png)
![](https://img.smyhvae.com/20200418_2300.png)


上面这种查询,没有意义,因为没有加任何查询条件。
Expand All @@ -239,8 +238,7 @@ SELECT * FROM author INNER JOIN book ON author.authorId = book.authorId;

查询结果:

![](https://github.com/qianguyihao/Web/blob/master/img/20200418_2305.png)

![](https://img.smyhvae.com/20200418_2305.png)

上面这行命令,跟下面这行命令等价:

Expand All @@ -256,7 +254,7 @@ SELECT * FROM author LEFT JOIN book ON author.authorId = book.authorId;

查询结果:

![](https://github.com/qianguyihao/Web/blob/master/img/20200418_2310.png)
![](https://img.smyhvae.com/20200418_2310.png)

**情况 3**:(right join)

Expand All @@ -266,7 +264,7 @@ SELECT * FROM author RIGHT JOIN book ON author.authorId = book.authorId;

查询结果:

![](https://github.com/qianguyihao/Web/blob/master/img/20200418_2315.png)
![](https://img.smyhvae.com/20200418_2315.png)

### 参考链接

Expand All @@ -285,5 +283,3 @@ SELECT * FROM author RIGHT JOIN book ON author.authorId = book.authorId;





2 changes: 1 addition & 1 deletion 11-Node.js/07-Node.js操作MySQL数据库.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ flush privileges;

针对下面这张表:

![](https://github.com/qianguyihao/Web/blob/master/img/20200418_1728.png)
![](https://img.smyhvae.com/20200418_1728.png)


通过 Node.js可以对其进行一些增删改查操作。代码举例如下。
Expand Down

0 comments on commit dbdf9d6

Please sign in to comment.