sqlzoo–select basics,select from world sqlzoo–select from nobel ,select in select sqlzoo–sum and count sqlzoo–the join operation sqlzoo–More JOIN operations sqlzoo–using null sqlzoo–self join
select basics
world表格:
namecontinentareapopul…
sqlzoo–select basics,select from world sqlzoo–select from nobel ,select in select sqlzoo–sum and count sqlzoo–the join operation sqlzoo–More JOIN operations sqlzoo–using null sqlzoo–self join
select from nobel
select from nobel 字段…
sqlzoo–select basics,select from world sqlzoo–select from nobel ,select in select sqlzoo–sum and count sqlzoo–the join operation sqlzoo–More JOIN operations sqlzoo–using null sqlzoo–self join
More JOIN operations
movie电影(id编号…
1. 列出1962年首影的電影, [顯示 id, title]
SELECT id, titleFROM movieWHERE yr1962;2. 電影大國民 ‘Citizen Kane’ 的首影年份。
SELECT yr
FROM movie
WHERE title Citizen Kane3. 列出全部Star Trek星空奇遇記系列的電影,包括id, title 和 y…
sqlzoo–select basics,select from world sqlzoo–select from nobel ,select in select sqlzoo–sum and count sqlzoo–the join operation sqlzoo–More JOIN operations sqlzoo–using null sqlzoo–self join
sqlzoo–using null
table:teacher教师
id編號dept…
1. 展示世界的總人口。
SELECT SUM(population)
FROM world;2. 列出所有的洲份, 每個只有一次。
SELECT DISTINCT continent
FROM world;3. 找出非洲(Africa)的GDP總和。
SELECT SUM(gdp)
FROM world
WHERE continent Africa;4. 有多少個國家具有至少百萬(1000000)的面積。…
sqlzoo–select basics,select from world sqlzoo–select from nobel ,select in select sqlzoo–sum and count sqlzoo–the join operation sqlzoo–More JOIN operations sqlzoo–using null sqlzoo–self join
SUM and COUNT
namecontinentareapopulationgdpAfgh…
1. 觀察運行一個簡單的SQL命令的結果。
SELECT name, continent, population FROM world;2. 顯示具有至少2億人口的國家名稱。 2億是200000000,有八個零。
SELECT name FROM world
WHERE population>200000000;3. 找出有至少200百萬(2億)人口的國家名稱&#x…
1. 列出每個國家的名字 name,當中人口 population 是高於俄羅斯’Russia’的人口。
SELECT name FROM worldWHERE population >(SELECT population FROM worldWHERE nameRussia);2. 列出歐州每國家的人均GDP,當中人均GDP要高於英國’United Kingdom’…
sqlzoo–select basics,select from world sqlzoo–select from nobel ,select in select sqlzoo–sum and count sqlzoo–the join operation sqlzoo–More JOIN operations sqlzoo–using null sqlzoo–self join
The JOIN operation
TABLE game:
id(編號)mdate(日…