Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
CSDN 技术社区
skill_tree_mysql
提交
1539015a
S
skill_tree_mysql
项目概览
CSDN 技术社区
/
skill_tree_mysql
通知
21
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
skill_tree_mysql
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
1539015a
编写于
6月 06, 2022
作者:
M
Mars Liu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
in
上级
42398a8c
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
143 addition
and
31 deletion
+143
-31
data/2.MySQL中阶/6.子查询/4.EXISTS/config.json
data/2.MySQL中阶/6.子查询/4.EXISTS/config.json
+7
-2
data/2.MySQL中阶/6.子查询/4.EXISTS/exists.json
data/2.MySQL中阶/6.子查询/4.EXISTS/exists.json
+8
-0
data/2.MySQL中阶/6.子查询/4.EXISTS/exists.md
data/2.MySQL中阶/6.子查询/4.EXISTS/exists.md
+57
-0
data/2.MySQL中阶/6.子查询/5. IN/config.json
data/2.MySQL中阶/6.子查询/5. IN/config.json
+7
-2
data/2.MySQL中阶/6.子查询/5. IN/in.json
data/2.MySQL中阶/6.子查询/5. IN/in.json
+8
-0
data/2.MySQL中阶/6.子查询/5. IN/in.md
data/2.MySQL中阶/6.子查询/5. IN/in.md
+56
-0
data/2.MySQL中阶/6.子查询/5.NOT EXISTS/config.json
data/2.MySQL中阶/6.子查询/5.NOT EXISTS/config.json
+0
-12
data/2.MySQL中阶/6.子查询/6. NOT IN/config.json
data/2.MySQL中阶/6.子查询/6. NOT IN/config.json
+0
-0
data/2.MySQL中阶/6.子查询/7. 列子查询/config.json
data/2.MySQL中阶/6.子查询/7. 列子查询/config.json
+0
-0
data/tree.json
data/tree.json
+0
-15
未找到文件。
data/2.MySQL中阶/6.子查询/4.EXISTS/config.json
浏览文件 @
1539015a
...
...
@@ -2,9 +2,14 @@
"node_id"
:
"mysql-6c6789b86f714acaa76467fdf9623191"
,
"keywords"
:
[],
"children"
:
[],
"export"
:
[],
"export"
:
[
"exists.json"
],
"keywords_must"
:
[
[
"mysql"
,
"exists"
]
[
"mysql"
,
"exists"
]
],
"keywords_forbid"
:
[
"not exists"
...
...
data/2.MySQL中阶/6.子查询/4.EXISTS/exists.json
0 → 100644
浏览文件 @
1539015a
{
"type"
:
"code_options"
,
"author"
:
"ccat"
,
"source"
:
"exists.md"
,
"notebook_enable"
:
false
,
"exercise_id"
:
"8d0da43e53624d8187ac781f685f4b71"
}
\ No newline at end of file
data/2.MySQL中阶/6.子查询/4.EXISTS/exists.md
0 → 100644
浏览文件 @
1539015a
# Exists
Joe 想从员工表
```
mysql
create table employee(
id int primary key auto_increment,
dept int,
name varchar(256),
post varchar(16)
)
```
中找出所有其所在部门没有助理(post 为
`assistant`
)的员工信息。由于 Joe 没有其它表的查询权限,
他只能查询员工表,并且这一次他想用 exists 实现。这个查询应该是:
## 答案
```
mysql
select id, name, dept
from employee as o
where not exists(select * from employee as i where o.dept = i.dept and post='assistant');
```
## 选项
### A
```
mysql
select id, name, dept
from employee as o
where exists(select * from employee as i where o.dept = i.dept and post='assistant');
```
### B
```
mysql
select id, name, dept
from employee as o
where not exists(select * from employee as i where o.dept = i.dept and post='assistant');
```
### C
```
mysql
select id, name, dept
from employee as o
where 'assistant' != exists(select post from employee as i);
```
### D
```
mysql
select id, name, dept
from employee as o
where 'assistant' = not exists(select post from employee as i where o.dept = i.dept);
```
\ No newline at end of file
data/2.MySQL中阶/6.子查询/
6
. IN/config.json
→
data/2.MySQL中阶/6.子查询/
5
. IN/config.json
浏览文件 @
1539015a
...
...
@@ -2,9 +2,14 @@
"node_id"
:
"mysql-8436069c855c4f1ead7cf11a026e004b"
,
"keywords"
:
[],
"children"
:
[],
"export"
:
[],
"export"
:
[
"in.json"
],
"keywords_must"
:
[
[
"mysql"
,
"in"
]
[
"mysql"
,
"in"
]
],
"keywords_forbid"
:
[
"not in"
...
...
data/2.MySQL中阶/6.子查询/5. IN/in.json
0 → 100644
浏览文件 @
1539015a
{
"type"
:
"code_options"
,
"author"
:
"ccat"
,
"source"
:
"in.md"
,
"notebook_enable"
:
false
,
"exercise_id"
:
"2ded48602e384fc2b5476186e8b91842"
}
\ No newline at end of file
data/2.MySQL中阶/6.子查询/5. IN/in.md
0 → 100644
浏览文件 @
1539015a
# IN
Joe 想要从员工表
```
mysql
create table employee(
id int primary key auto_increment,
dept int,
name varchar(256),
post varchar(16)
)
```
中查询出研发部(dept为'rd')和人力资源部(dept为'hr')的员工列表,这个查询应该怎么写?
## 答案
```
mysql
select id, dept, name, post
from employee
where dept in ('dev', 'hr');
```
## 选项
### A
```
mysql
select id, dept, name, post
from employee
where dept in (select 'dev', 'hr');
```
### B
```
mysql
select id, dept, name, post
from employee
where dept in (select * from 'dev', 'hr');
```
### C
```
mysql
select id, dept, name, post
from employee
where dept in ('dev' and 'hr');
```
#### D
```
mysql
select id, dept, name, post
from employee
where dept in ('dev' or 'hr');
```
data/2.MySQL中阶/6.子查询/5.NOT EXISTS/config.json
已删除
100644 → 0
浏览文件 @
42398a8c
{
"node_id"
:
"mysql-19bc57db42bd4615ba4f123745289407"
,
"keywords"
:
[],
"children"
:
[],
"export"
:
[],
"keywords_must"
:
[
[
"mysql"
,
"not exists"
]
],
"keywords_forbid"
:
[],
"group"
:
0
}
\ No newline at end of file
data/2.MySQL中阶/6.子查询/
7
. NOT IN/config.json
→
data/2.MySQL中阶/6.子查询/
6
. NOT IN/config.json
浏览文件 @
1539015a
文件已移动
data/2.MySQL中阶/6.子查询/
8
. 列子查询/config.json
→
data/2.MySQL中阶/6.子查询/
7
. 列子查询/config.json
浏览文件 @
1539015a
文件已移动
data/tree.json
浏览文件 @
1539015a
...
...
@@ -1223,21 +1223,6 @@
"group"
:
0
}
},
{
"NOT EXISTS"
:
{
"node_id"
:
"mysql-19bc57db42bd4615ba4f123745289407"
,
"keywords"
:
[],
"children"
:
[],
"keywords_must"
:
[
[
"mysql"
,
"not exists"
]
],
"keywords_forbid"
:
[],
"group"
:
0
}
},
{
" IN"
:
{
"node_id"
:
"mysql-8436069c855c4f1ead7cf11a026e004b"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录