sqlzoo练习15-NULL quiz
主要是对上节中学习到的NULL
空值的理解与复习
练习
- select the code which uses an outer join correctly.
1 | select teacher.name, dept.name |
- Select the correct statement that shows the name of department which employs Cutflower -
选出雇佣了Cutfolowerl老师的系
1 | select dept.name |
- Select out of following the code which uses a JOIN to show a list of all the departments and number of employed teachers
选出所有的院系和该院系雇佣的老师的数目
1 | select dept.name, count(teacher.name) -- 统计老师的个数 |
- Using
SELECT name, dept, COALESCE(dept, 0) AS result FROM teacher
onteacher
table will:
1 | display 0 in result column for all teachers without department |
- the result of Query
主要考察的是
case
语句的用法
1 | select name, |
- Select the result that would be obtained from the following code:
1 | select name, |