
SQLZoo
「已注销」
这个作者很懒,什么都没留下…
展开
-
1 SELECT names-SQLZoo
Pattern Matching StringsThis tutorial uses the LIKE operator to check names. We will be using the SELECT command on the table world:You can use WHERE name LIKE ‘B%’ to find the countries that star...原创 2019-04-21 14:21:58 · 248 阅读 · 0 评论 -
7 More JOIN operations-SQLZoo
1. List the films where the yr is 1962 [Show id, title]SELECT id, title FROM movie WHERE yr = 1962;2. Give year of 'Citizen Kane’SELECT yr FROM movie WHERE title = 'Citizen Kane';3. List al...原创 2019-04-23 16:26:07 · 198 阅读 · 0 评论 -
7 JOIN Quiz 2-SQLZoo
1. Select the statement which lists the unfortunate directors of the movies which have caused financial loses (gross < budget)SELECT name FROM actor INNER JOIN movie ON actor.id = director WHER...原创 2019-04-23 16:30:49 · 590 阅读 · 0 评论 -
8 Using Null-SQLZoo
1. List the teachers who have NULL for their departmentselect name from teacherwhere dept IS NULL;2. Note the INNER JOIN misses the teachers with no department and the departments with no teache...原创 2019-04-24 09:51:32 · 217 阅读 · 0 评论 -
8 Using Null Quiz-SQLZoo
1. Select the code which uses an outer join correctly SELECT teacher.name, dept.name FROM teacher LEFT OUTER JOIN dept ON (teacher.dept = dept.id)2. Select the correct statement that shows the nam...原创 2019-04-24 09:57:37 · 373 阅读 · 0 评论 -
8 Scottish Parliament-SQLZoo
1. One MSP was kicked out of the Labour party and has no party. Find himselect name from mspwhere party is null;2. Obtain a list of all parties and leadersselect name,leader from party;3. Give...原创 2019-04-24 17:27:28 · 422 阅读 · 0 评论 -
0 SELECT basics-SQLZoo
The example uses a WHERE clause to show the population of ‘France’. Note that strings (pieces of text that are data) should be in ‘single quotes’;Modify it to show the population of GermanySELECT...原创 2019-04-20 15:42:03 · 141 阅读 · 0 评论 -
0 SELECT Quiz-SQLZoo
Some questions concerning basic SQL statementsSelect the code which produces this tableSELECT name, population FROM world WHERE population BETWEEN 1000000 AND 1250000Pick the result you wo...原创 2019-04-20 15:59:36 · 292 阅读 · 0 评论 -
8+ NSS Tutorial-SQLZoo
1. The example shows the number who responded for:question 1at ‘Edinburgh Napier University’studying ‘(8) Computer Science’Show the the percentage who STRONGLY AGREESELECT A_STRONGLY_AGREE FRO...原创 2019-04-29 16:57:39 · 757 阅读 · 3 评论 -
9 Self join-SQLZoo
1. How many stops are in the databaseselect count(id) from stops;2. Find the id value for the stop 'Craiglockhart’select id from stopswhere name = 'Craiglockhart';3. Give the id and the name f...原创 2019-04-30 17:14:46 · 173 阅读 · 0 评论 -
6 Old JOIN Tutorial-SQLZoo
1.Show the athelete (who) and the country name for medal winners in 2000SELECT who,nameFROM ttms JOIN country ON country = idWHERE games = 2000;2.Show the who and the color of the medal for th...原创 2019-04-22 17:27:12 · 371 阅读 · 0 评论 -
6 JOIN Quiz-SQLZoo
1. You want to find the stadium where player ‘Dimitris Salpingidis’ scored. Select the JOIN condition to use: game JOIN goal ON (id=matchid)2. You JOIN the tables goal and eteam in an SQL stateme...原创 2019-04-22 16:19:38 · 500 阅读 · 0 评论 -
6 The JOIN operation-SQLZoo
1. Modify it to show the matchid and player name for all goals scored by GermanySELECT matchid,player FROM goal WHERE teamid = 'GER';2. Show id, stadium, team1, team2 for just game 1012SELECT ...原创 2019-04-22 16:12:47 · 232 阅读 · 0 评论 -
2 SELECT from WORLD Tutorial-SQLZoo
In this tutorial you will use the SELECT command on the table world:Read the notes about this table. Observe the result of running this SQL command to show the name, continent and population of all...原创 2019-04-21 14:36:53 · 195 阅读 · 0 评论 -
2 BBC QUIZ-SQLZoo
Select the code which gives the name of countries beginning with USELECT name FROM world WHERE name LIKE 'U%'Select the code which shows just the population of United Kingdom?SELECT popula...原创 2019-04-21 14:43:58 · 249 阅读 · 0 评论 -
3 SELECT from Nobel Tutorial-SQLZoo
1. Change the query shown so that it displays Nobel prizes for 1950SELECT * FROM nobelWHERE yr = 1950;2. Show who won the 1962 prize for LiteratureSELECT winner FROM nobelWHERE yr = 1962AND su...原创 2019-04-21 15:11:28 · 218 阅读 · 0 评论 -
3 Nobel Quiz-SQLZoo
1. Pick the code which shows the name of winner’s names beginning with C and ending in nSELECT winner FROM nobel WHERE winner LIKE 'C%' AND winner LIKE '%n'2. Select the code that shows how many ...原创 2019-04-21 15:31:38 · 451 阅读 · 0 评论 -
4 SELECT within SELECT Tutorial-SQLZoo
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...原创 2019-04-21 15:48:18 · 359 阅读 · 0 评论 -
4 Nested SELECT Quiz-SQLZoo
1. Select the code that shows the name, region and population of the smallest country in each region SELECT region, name, population FROM bbc x WHERE population <= ALL (SELECT population FROM bbc...原创 2019-04-21 15:58:44 · 331 阅读 · 0 评论 -
5 SUM and COUNT-SQLZoo
1. Show the total population of the world.SELECT SUM(population) FROM world;2. List all the continents - just once eachselect distinct continent from world;3. Give the total GDP of Africaselec...原创 2019-04-21 16:03:25 · 322 阅读 · 0 评论 -
5 SUM and COUNT Quiz-SQLZoo
1. Select the statement that shows the sum of population of all countries in 'Europe’SELECT SUM(population) FROM bbc WHERE region = 'Europe'2. Select the statement that shows the number of countri...原创 2019-04-21 16:18:39 · 363 阅读 · 0 评论 -
5 The nobel table can be used to practice more SUM and COUNT functions-SQLZoo
1. Show the total number of prizes awardedSELECT COUNT(winner) FROM nobel;2. List each subject - just onceselect distinct subject from nobel;3. Show the total number of prizes awarded for Physic...原创 2019-04-21 16:27:43 · 214 阅读 · 0 评论 -
9 Self join Quiz-SQLZoo
1. Select the code that would show it is possible to get from Craiglockhart to HaymarketSELECT DISTINCT a.name, b.name FROM stops a JOIN route z ON a.id=z.stop JOIN route y ON y.num = z.num JO...原创 2019-04-30 17:15:00 · 418 阅读 · 1 评论