Difference between revisions of "Nobel Quiz/ja"

From SQLZOO
Jump to navigation Jump to search
(Created page with "{{Languages}} <div class='ref_section'> <table class='db_ref'> <caption>nobel</caption> <th>yr</th> <th>subject</th> <th>winner</th> <tr> <td>1960</td> <td>Chemistry</td> <td...")
 
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{Languages}}
+
{{Languages|Nobel_Quiz}}
 
<div class='ref_section'>
 
<div class='ref_section'>
 
<table class='db_ref'>
 
<table class='db_ref'>
Line 42: Line 42:
 
</div>
 
</div>
 
<div class=quiz>
 
<div class=quiz>
<div class=q>Pick the code which shows the name of winner's names beginning with C and ending in n
+
<div class=q>C で始まり n で終わる名前の受賞者を表示するコードを選べ。
 
<syntaxhighlight class=d lang='sql'>
 
<syntaxhighlight class=d lang='sql'>
 
SELECT name FROM nobel
 
SELECT name FROM nobel
Line 59: Line 59:
 
  WHERE winner LIKE 'C%' AND winner LIKE '%n' </syntaxhighlight>
 
  WHERE winner LIKE 'C%' AND winner LIKE '%n' </syntaxhighlight>
 
</div>
 
</div>
<div class=q>Select the code that shows how many Chemistry awards were given between 1950 and 1960
+
<div class=q>1950 から 1960 年の化学賞 Chemistry の受賞数を表示するコードを選べ。
 
<syntaxhighlight class=d lang='sql'>
 
<syntaxhighlight class=d lang='sql'>
 
SELECT COUNT(subject) FROM nobel
 
SELECT COUNT(subject) FROM nobel
Line 81: Line 81:
 
   AND yr BETWEEN (1950, 1960) </syntaxhighlight>
 
   AND yr BETWEEN (1950, 1960) </syntaxhighlight>
 
</div>
 
</div>
<div class=q>Pick the code that shows the amount of years where no Medicine awards were given
+
<div class=q>医学賞 Medicine の受賞者がいない年度の回数を表示するコードを選べ。
 
<syntaxhighlight class=d lang='sql'>
 
<syntaxhighlight class=d lang='sql'>
 
SELECT COUNT(DISTINCT yr) FROM nobel
 
SELECT COUNT(DISTINCT yr) FROM nobel
Line 98: Line 98:
 
  WHERE yr NOT IN (SELECT DISTINCT yr FROM nobel WHERE subject = 'Medicine') </syntaxhighlight>
 
  WHERE yr NOT IN (SELECT DISTINCT yr FROM nobel WHERE subject = 'Medicine') </syntaxhighlight>
 
</div>
 
</div>
<div class=q>Select the result that would be obtained from the following code:  
+
<div class=q>次のコードから得られる結果を選べ:  
 
<syntaxhighlight lang='sql'>SELECT subject, winner FROM nobel WHERE winner LIKE 'Sir%' AND yr LIKE '196%'</syntaxhighlight>
 
<syntaxhighlight lang='sql'>SELECT subject, winner FROM nobel WHERE winner LIKE 'Sir%' AND yr LIKE '196%'</syntaxhighlight>
 
<table class=d><tr><td>Medicine</td><td>John Eccles</td></tr><tr><td>Medicine</td><td>Frank Macfarlane Burnet</td></tr></table>
 
<table class=d><tr><td>Medicine</td><td>John Eccles</td></tr><tr><td>Medicine</td><td>Frank Macfarlane Burnet</td></tr></table>
Line 107: Line 107:
 
</div>
 
</div>
  
<div class=q>Select the code which would show the year when neither a Physics or Chemistry award was given
+
<div class=q>物理賞 Physics も化学賞 Chemistry もいなかった年度を表示するコードを選べ。
 
<syntaxhighlight class=d lang='sql'>
 
<syntaxhighlight class=d lang='sql'>
 
SELECT yr FROM nobel
 
SELECT yr FROM nobel
Line 135: Line 135:
 
</div>
 
</div>
  
<div class=q>Select the code which shows the years when a Medicine award was given but no Peace or Literature award was
+
<div class=q>医学賞 Medicine が授与されたが、平和賞 Peace も文学賞 Literature もいない年度を表示するコードを選べ。
 
<syntaxhighlight class=d lang='sql'>
 
<syntaxhighlight class=d lang='sql'>
 
SELECT DISTINCT yr
 
SELECT DISTINCT yr
Line 173: Line 173:
 
   yr NOT IN('Literature','Peace') </syntaxhighlight>
 
   yr NOT IN('Literature','Peace') </syntaxhighlight>
 
</div>
 
</div>
<div class=q>Pick the result that would be obtained from the following code:  
+
<div class=q>次のコードから得られる結果を選べ:  
 
<syntaxhighlight lang='sql'>
 
<syntaxhighlight lang='sql'>
 
  SELECT subject, COUNT(subject)  
 
  SELECT subject, COUNT(subject)  

Latest revision as of 11:39, 24 March 2020

Language:Project:Language policy English  • 日本語 • 中文
nobel
yr subject winner
1960 Chemistry Willard F. Libby
1960 Literature Saint-John Perse
1960 Medicine Sir Frank Macfarlane Burnet
1960 Medicine Peter Medawar
1960 Physics Donald A. Glaser
1960 Peace Albert Lutuli
...
C で始まり n で終わる名前の受賞者を表示するコードを選べ。
SELECT name FROM nobel
 WHERE winner LIKE '%C%' AND winner LIKE '%n%'
SELECT name FROM nobel
 WHERE winner LIKE '%C' AND winner LIKE 'n%'
SELECT name FROM nobel
 WHERE winner LIKE 'C%' AND winner LIKE '%n'
SELECT winner FROM nobel
 WHERE winner LIKE '%C' AND winner LIKE 'n%'
SELECT winner FROM nobel
 WHERE winner LIKE 'C%' AND winner LIKE '%n'
1950 から 1960 年の化学賞 Chemistry の受賞数を表示するコードを選べ。
SELECT COUNT(subject) FROM nobel
 WHERE subject = 'Chemistry'
   AND BETWEEN 1950 and 1960
SELECT COUNT(subject) FROM nobel
 WHERE subject = 'Chemistry'
   AND yr BETWEEN (1950, 1960)
SELECT COUNT(subject) FROM nobel
 WHERE subject = 'Chemistry'
   AND yr BETWEEN 1950 and 1960
SELECT subject FROM nobel
 WHERE subject = 'Chemistry'
   AND yr BETWEEN 1950 and 1960
SELECT subject FROM nobel
 WHERE subject = 'Chemistry'
   AND yr BETWEEN (1950, 1960)
医学賞 Medicine の受賞者がいない年度の回数を表示するコードを選べ。
SELECT COUNT(DISTINCT yr) FROM nobel
 WHERE yr IN (SELECT DISTINCT yr FROM nobel WHERE subject <> 'Medicine')
SELECT COUNT(DISTINCT yr) FROM nobel
 WHERE yr NOT IN (SELECT DISTINCT yr FROM nobel WHERE subject = 'Medicine')
SELECT DISTINCT yr FROM nobel
 WHERE yr NOT IN (SELECT DISTINCT yr FROM nobel WHERE subject LIKE 'Medicine')
SELECT COUNT(DISTINCT yr) FROM nobel
 WHERE yr NOT IN (SELECT DISTINCT yr FROM nobel WHERE subject NOT LIKE 'Medicine')
SELECT COUNT(yr) FROM nobel
 WHERE yr NOT IN (SELECT DISTINCT yr FROM nobel WHERE subject = 'Medicine')
次のコードから得られる結果を選べ:
SELECT subject, winner FROM nobel WHERE winner LIKE 'Sir%' AND yr LIKE '196%'
MedicineJohn Eccles
MedicineFrank Macfarlane Burnet
ChemistrySir Cyril Hinshelwood
MedicineSir John Eccles
MedicineSir Frank Macfarlane Burnet
MedicineJohn Eccles
MedicineFrank Macfarlane Burnet
ChemistryWillard F.Libby
Sir John Eccles
Sir Frank Macfarlane Burnet
物理賞 Physics も化学賞 Chemistry もいなかった年度を表示するコードを選べ。
SELECT yr FROM nobel
 WHERE subject NOT IN(SELECT yr 
                        FROM nobel
                       WHERE subject IN ('Chemistry','Physics'))
SELECT yr FROM nobel
 WHERE subject NOT IN(SELECT subject 
                        FROM nobel
                       WHERE subject IN ('Chemistry','Physics'))
SELECT yr FROM nobel
 WHERE yr NOT IN(SELECT yr 
                   FROM nobel
                 WHERE subject IN ('Chemistry','Physics'))
SELECT yr FROM nobel
 WHERE yr NOT IN(SELECT subject
                 FROM nobel
                WHERE subject IN ('Chemistry','Physics'))
SELECT yr FROM subject
 WHERE yr NOT IN (SELECT yr
                    FROM nobel
                   WHERE subject IN ('Chemistry','Physics'))
医学賞 Medicine が授与されたが、平和賞 Peace も文学賞 Literature もいない年度を表示するコードを選べ。
SELECT DISTINCT yr
  FROM nobel
 WHERE subject='Medicine' AND
       subject NOT IN(SELECT yr from nobel
                      WHERE subject='Literature')
  AND  yr NOT IN (SELECT yr
                    FROM nobel
                   WHERE subject='Peace')
SELECT DISTINCT yr
  FROM nobel WHERE subject='Medicine'
   AND yr NOT IN(SELECT yr from nobel
                  WHERE subject='Literature'
                    AND subject='Peace')
SELECT DISTINCT yr
  FROM nobel
 WHERE subject='Medicine' 
   AND yr NOT IN(SELECT yr FROM nobel 
                  WHERE subject='Literature')
   AND yr NOT IN (SELECT yr FROM nobel
                   WHERE subject='Peace')
SELECT DISTINCT yr
  FROM subject
 WHERE subject='Medicine'
   AND yr NOT IN(SELECT yr from nobel
                  WHERE subject='Literature'
                    AND subject='Peace')
SELECT DISTINCT yr
  FROM subject
 WHERE subject='Medicine' AND
  yr NOT IN('Literature','Peace')
次のコードから得られる結果を選べ:
 SELECT subject, COUNT(subject) 
   FROM nobel 
  WHERE yr ='1960' 
  GROUP BY subject
1
1
2
1
1
Chemistry6
Chemistry3
Literature1
Medicine2
Peace0
Physics2
Chemistry1
Literature1
Medicine2
Peace1
Physics1
Chemistry1
Literature1
Peace1
Physics1