sqlzoo
文章平均质量分 84
卡拿爱吃鱼
卡拿的咸鱼,Full stack,big data
展开
-
sqlzoo_SELECT within SELECT Tutorial
1.List each country name where the population is larger than that of 'Russia'.SELECT name FROM world WHERE population > (SELECT population FROM world WHERE name='Russia')2.Show t...原创 2018-07-21 13:47:51 · 246 阅读 · 0 评论 -
sqlzoo_SUM and COUNT
1.Show the total population of the world.SELECT SUM(population) FROM world2.List all the continents - just once each.select distinct continent from world3.Give the total GDP of Africase...原创 2018-07-21 16:36:31 · 177 阅读 · 0 评论 -
sqlzoo_The JOIN operation
1.The first example shows the goal scored by a player with the last name 'Bender'. The * says to list all the columns in the table - a shorter way of saying matchid, teamid, player, gtime.Modify it to...原创 2018-07-22 17:30:28 · 357 阅读 · 0 评论 -
sqlzoo_More JOIN operations
1.List the films where the yr is 1962 [Show id, title]SELECT id, title FROM movie WHERE yr=19622.Give year of 'Citizen Kane'.select yrfrom moviewhere title = 'Citizen Kane'3.List all o...原创 2018-07-22 21:13:19 · 209 阅读 · 0 评论 -
sqlzoo_Using Null
1.List the teachers who have NULL for their department.select name from teacher where dept IS NULL 2.Note the INNER JOIN misses the teachers with no department and the departments with no t...原创 2018-07-22 23:09:50 · 219 阅读 · 0 评论 -
sqlzoo_Self join
1.How many stops are in the database.select count(id) from stops2.Find the id value for the stop 'Craiglockhart'select id from stops where name = 'Craiglockhart'3.Give the id and the name ...原创 2018-09-18 17:05:07 · 651 阅读 · 0 评论