w3resource
SQL exercises

SQL: Show all the winners in Physics for 1970 together with the winner of Economics for 1971

SQL Basic Select Statement : Exercise-19 with Solution.

Write a SQL query to show all the winners in Physics for 1970 together with the winner of Economics for 1971.

Sample table : nobel_win


Sample Solution:

SELECT *
 FROM nobel_win 
   WHERE (subject ='Physics' AND year=1970)
UNION
SELECT *
 FROM nobel_win 
     WHERE (subject ='Economics' AND year=1971);

Output :

SQL exercises

Query Visualization:

Duration:

Query visualization of Show all the winners in Physics for 1970 together with the winner of Economics for 1971 - Duration

Rows:

Query visualization of Show all the winners in Physics for 1970 together with the winner of Economics for 1971 - Rows

Cost:

Query visualization of Show all the winners in Physics for 1970 together with the winner of Economics for 1971 - Cost

Practice Online


Have another way to solve this solution? Contribute your code (and comments) through Disqus.

Previous: Write a SQL query to show all the details of the winners with first name Louis.
Next: Write a SQL query to show all the winners of nobel prize in the year 1970 except the subject Physiology and Economics.

What is the difficulty level of this exercise?



New Content: Composer: Dependency manager for PHP, R Programming