From d75321c4f5e0e25e8f68fc3f5a78b620efc2facb Mon Sep 17 00:00:00 2001 From: mba1398 <26516464+mba1398@users.noreply.github.com> Date: Fri, 13 Aug 2021 22:37:33 +0800 Subject: [PATCH] =?UTF-8?q?Update=20ch02:=20=E5=9F=BA=E7=A1=80=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E4=B8=8E=E6=8E=92=E5=BA=8F.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ch02: 基础查询与排序.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ch02: 基础查询与排序.md b/ch02: 基础查询与排序.md index 502e63b..07563ec 100644 --- a/ch02: 基础查询与排序.md +++ b/ch02: 基础查询与排序.md @@ -163,11 +163,11 @@ OR 相当于“或者”,类似数学中的取并集。 AND运算符工作效果图 -![图片](https://github.com/datawhalechina/team-learning-sql/blob/main/img/ch02/ch02.01and.png) +![图片](./img/ch02/ch02.01and.png) OR运算符工作效果图 -![图片](https://github.com/datawhalechina/team-learning-sql/blob/main/img/ch02/ch02.02or.png) +![图片](./img/ch02/ch02.02or.png) ### 通过括号优先处理 @@ -213,11 +213,11 @@ SELECT product_name, product_type, regist_date 真值表 -![图片](https://github.com/datawhalechina/team-learning-sql/blob/main/img/ch02/ch02.03true.png) +![图片](./img/ch02/ch02.03true.png) 查询条件为P AND(Q OR R)的真值表 -![图片](https://github.com/datawhalechina/team-learning-sql/blob/main/img/ch02/ch02.04true2.png) +![图片](./img/ch02/ch02.04true2.png) ### 含有NULL时的真值 @@ -229,7 +229,7 @@ NULL的真值结果既不为真,也不为假,因为并不知道这样一个 三值逻辑下的AND和OR真值表为: -![图片](https://github.com/datawhalechina/team-learning-sql/blob/main/img/ch02/ch02.05true3.png) +![图片](./img/ch02/ch02.05true3.png) ## ## 练习题-第一部分 @@ -355,7 +355,7 @@ SELECT product_type, COUNT(*) ``` 按照商品种类对表进行切分 -![图片](https://github.com/datawhalechina/team-learning-sql/blob/main/img/ch02/ch02.06cut.png) +![图片](./img/ch02/ch02.06cut.png) 这样,GROUP BY 子句就像切蛋糕那样将表进行了分组。在 GROUP BY 子句中指定的列称为**聚合键**或者**分组列**。 @@ -403,7 +403,7 @@ SELECT purchase_price, COUNT(*) 将表使用GROUP BY分组后,怎样才能只取出其中两组? -![图片](https://github.com/datawhalechina/team-learning-sql/blob/main/img/ch02/ch02.07groupby.png) +![图片](./img/ch02/ch02.07groupby.png) 这里WHERE不可行,因为,WHERE子句只能指定记录(行)的条件,而不能用来指定组的条件(例如,“数据行数为 2 行”或者“平均值为 500”等)。 @@ -490,11 +490,11 @@ product_type | sum | sum 衣服 | 5000 | 3300 办公用品 | 600 | 320 ``` -![图片](https://github.com/datawhalechina/team-learning-sql/blob/main/img/ch02/ch02.08test26.png) +![图片](./img/ch02/ch02.08test26.png) ### 2.7 此前我们曾经使用SELECT语句选取出了product(商品)表中的全部记录。当时我们使用了 `ORDER BY` 子句来指定排列顺序,但现在已经无法记起当时如何指定的了。请根据下列执行结果,思考 `ORDER BY` 子句的内容。 -![图片](https://github.com/datawhalechina/team-learning-sql/blob/main/img/ch02/ch02.09test27.png) +![图片](./img/ch02/ch02.09test27.png)