摘要:
习题地址:http://sqlzoo.net/1a.htm表结构: bbc(name, region, area, population, gdp)1a.List each country name where the population is larger than 'Russia'.select name from bbc where population > (select population from bbc where name = 'Russia')1b.List thenameandregionof countries in the re 阅读全文
摘要:
习题地址:http://sqlzoo.net/1b.htm表结构: nobel(yr, subject, winner)1a.Change the query shown so that it displays Nobel prizes for 1950.select *from nobel where yr = 19501b.Show who won the 1962 prize for Literature.select winner from nobel where yr = 1962 and subject = 'Literature'2a.Show the year 阅读全文
摘要:
习题地址:http://sqlzoo.net/3a.htm表结构: album(asin, title, artist, price, release, label, rank) track(album, dsk, posn, song)1b.Whichartistrecorded thesong'Exodus'?select album.artist from album join trackon (album.asin = track.album)where track.song = 'Exodus'1c.Show thesongfor eachtracko 阅读全文
摘要:
习题地址:http://sqlzoo.net/2.htm表结构:bbc(name, region, area, population, gdp)1b.List all the regions - just once each.select distinct region from bbc1c.Give the total GDP of Africaselect sum(GDP) from bbc where region = 'Africa'1d.How many countries have an area of at least 1000000select count(na 阅读全文
摘要:
习题地址:http://sqlzoo.net/1.htm表结构:bbc(name, region, area, population, gdp)2a.Show the name for the countries that have a population of at least 200 million. (200 million is 200000000, there are eight zeros)select name from bbc where population >= 2000000002b.Give the name and the per capitaGDPfor t 阅读全文