SQL Exercises: Display the year and subject of Dennis Gabor prize
14. Locate Dennis Gabor
From the following table, write a SQL query to locate the Nobel Prize winner ‘Dennis Gabor'. Return year, subject.
Sample table: nobel_win
YEAR SUBJECT WINNER COUNTRY CATEGORY ---- ------------------------- --------------------------------------------- ------------------------- ------------ 1970 Physics Hannes Alfven Sweden Scientist 1970 Physics Louis Neel France Scientist 1970 Chemistry Luis Federico Leloir France Scientist 1970 Physiology Ulf von Euler Sweden Scientist 1970 Physiology Bernard Katz Germany Scientist 1970 Literature Aleksandr Solzhenitsyn Russia Linguist 1970 Economics Paul Samuelson USA Economist 1970 Physiology Julius Axelrod USA Scientist ..... 1994 Literature Kenzaburo Oe Japan Linguist
Sample Solution:
-- This query selects the 'year' and 'subject' columns from the 'nobel_win' table.
SELECT year, subject
-- Specifies the table from which to retrieve the data (in this case, 'nobel_win').
FROM nobel_win
-- Filters the rows to only include those where the 'winner' column has the value 'Dennis Gabor'.
WHERE winner = 'Dennis Gabor';
Output of the Query:
year subject 1971 Physics
Code Explanation:
The above query in SQL that retrieves data from a table called 'nobel_win'. The query selects the year and subject columns from the table and filters the results by only displaying rows where the winner column is equal to 'Dennis Gabor'. The query is asking the database to select the year and subject of the nobel prize win for the winner named 'Dennis Gabor'.
Relational Algebra Expression:
Relational Algebra Tree:
Go to:
PREV : Literature Winner 1971.
NEXT : Physics Winners Since 1950.
Practice Online
For more Practice: Solve these Related Problems:
- Write a SQL query to locate the Nobel Prize winner "Albert Einstein".
- Write a SQL query to find the Nobel Prize winner "Marie Curie".
- Write a SQL query to retrieve the Nobel Prize winner "Niels Bohr".
- Write a SQL query to identify the Nobel Prize winner "Richard Feynman".
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
