In: Computer Science
Write the following SQL queries and show the corresponding output of the DBMS:
1) Write an SQL statement to display all the information of all
Nobel Laureate winners.
2) Write an SQL statement to display the string "Hello,
World!".
3) Write an SQL query to display the result of the following
expression: 2 * 14 +76.
4) Write an SQL statement to display the winner and category of all
Laureate winners.
5) Write an SQL query to find the winner(s) of the 1987 prize for
Chemistry.
6) Write an SQL query to find the subject and category for which
'Paul Samuelson' won his Nobel Prize.
7) Write an SQL query to give the name of the 'Linguist' winners
before year 2000.
8) Write an SQL query to show all the details of the Economics and
Literature Subject prize winners between the years 1971 to 1990
inclusive.
9) Write an SQL query to show all the details of the winners with
the letters sequence 'er' in their names.
10) Write an SQL query to show all the winners in Physics for 1970
together with the winner of Economics for 1971.
11) Write a SQL query to show all the winners of Nobel Prize in the
year 1970 for all subjects except Physiology and Economics.
Dear Student ,
As per the requirement submitted above , kindly find the below solution.
This demonstration is using MySQL.
Question 1:
SQL Query :
SELECT * FROM `nobellaureatewinners`;
Screen in MySQL :
********************************
Question 2:
SQL Query :
select 'Hello, World!';
Screen in MySQL :
********************************
Question 3:
SQL Query :
select 2 * 14 +76;
Screen in MySQL :
********************************
Question 4:
SQL Query :
SELECT Winner,Category FROM nobellaureatewinners;
Screen in MySQL :
********************************
Question 5:
SQL Query :
SELECT Winner FROM nobellaureatewinners
where year=1987 and Subject='Chemistry';
Screen in MySQL :
********************************
Question 6:
SQL Query :
SELECT subject,Category FROM nobellaureatewinners
where Winner='Paul Samuelson';
Screen in MySQL :
********************************
Question 7:
SQL Query :
SELECT Winner FROM nobellaureatewinners
where Category='Linguist' and year <2000;
Screen in MySQL :
********************************
Question 8:
SQL Query :
SELECT * FROM nobellaureatewinners
where Subject in ('Economics','Literature')
and year BETWEEN 1971 and 1990;
Screen in MySQL :
********************************
Question 9:
SQL Query :
SELECT * FROM nobellaureatewinners where Winner like '%er%';
Screen in MySQL :
********************************
Question 10:
SQL Query :
SELECT Winner FROM nobellaureatewinners where
(Subject='Physics' and Year=1970) or
(Subject='Economics' and Year=1971);
Screen in MySQL :
********************************
Question 11:
SQL Query :
SELECT Winner FROM nobellaureatewinners
where year=1970 and Subject not in ('Physiology','Economics')
Screen in MySQL :
********************************
NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.