![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
SQLZOO学习
文章平均质量分 81
Deng_Allen
这个作者很懒,什么都没留下…
展开
-
SQLZOO——Self join(难难难)
1.How manystopsare in the database.SELECT COUNT(id)FROM stops-- 直接计数即可2.Find theidvalue for the stop 'Craiglockhart'.SELECT idFROM stopsWHERE name = 'Craiglockhart'原创 2021-01-20 10:35:59 · 224 阅读 · 1 评论 -
SQLZOO——JOIN Quiz 2
1.Select the statement which lists the unfortunate directors of the movies which have caused financial loses (gross < budget)2.Select the correct example of JOINing three tablesmovie表和actor表联结有两种方式联结,见本页第6题3.Select the statement that shows...原创 2021-01-20 08:09:58 · 392 阅读 · 1 评论 -
SQLZOO——More JOIN operation
1.List the films where theyris 1962 [Showid,title]SELECT id, titleFROM movieWHERE yr=19622.Give year of 'Citizen Kane'.SELECT yrFROM movieWHERE title = 'Citizen Kane'3.List all of the Star Trek movies, include theid,titleandyr(all o...原创 2021-01-18 09:10:27 · 192 阅读 · 0 评论 -
SQLZOO——JOIN Quiz
目录(选择对应题目直接跳转即可)1.You want to find the stadium where player 'Dimitris Salpingidis' scored. Select the JOIN condition to use:2.You JOIN the tablesgoalandeteamin an SQL statement. Indicate the list of column names that may be used in the SELECT l...原创 2021-01-17 09:24:02 · 852 阅读 · 0 评论 -
SQLZOO——The JOIN operation
目录1.Modify it to show thematchidandplayername for all goals scored by Germany. To identify German players, check for:teamid = 'GER'2.Show id, stadium, team1, team2 for just game 10123.The code below shows the player (from the goal) and stadium n...原创 2021-01-16 11:24:48 · 261 阅读 · 0 评论 -
SQLZOO——Using Null
1.List the teachers who have NULL for their departmentSELECT nameFROM teacherWHERE dept IS NULL2.Note the INNER JOIN misses the teachers with no department and the departments with no teacher.SELECT teacher.name, dept.name FROM teacher INNER JOIN de原创 2021-01-15 10:54:26 · 151 阅读 · 0 评论 -
SQLZOO ——The nobel table can be used to practice more SUM and COUNT functions
1.Show the total number of prizes awarded.SELECT COUNT(winner) FROM nobel2.List each subject - just onceSELECT subjectFROM nobelGROUP BY subject3.Show the total number of prizes awarded for Physics.SELECT COUNT(subject)FROM nobelWHERE subject =原创 2021-01-14 13:22:02 · 262 阅读 · 0 评论 -
SQLZOO ——SUM and COUNT
SUM and COUNTWorld Country Profile: Aggregate functionsYou might want to look at these examples firstTotal world populationList of continentsGDP of Africa 6Count the big countriesBaltic states populationUsing GROUP BY and HAVINGCounting the count原创 2021-01-14 10:48:52 · 176 阅读 · 2 评论