You are on page 1of 5

DBMS

Worksheet 3

Student Name: Ayush Pandey UID: 21BCS6143


Branch: CSE - AIML Section/Group: 21AML-5 (B)
Semester: 3rd Subject Code: 21CSH - 243
Subject Name: Database Management System

Question 1: Create the following table and insert the data into the table.

Solution:
GRADERS
ACCREDITED UNIVERSITY

"Phys ie s "
mysql • i n sert into no bet prize vatue s (1 S70 "Han ne Al-Fven " "Sweden”, "Sc ient ist " ) ;
, s ,

mysql > in sert into no bet prize vatue s 1970 , "Phys ie s " , "Lo uis Need " , "France " , "Sc ie nt ist " ) ; guery QA , 1 row a-F-Fected {0 . 00 sec)

"Chemistry”,
”Luis Feder ico Le To ir" , "France " , "Scientist”);
mysql i n se rt in to no bet pr ize vat ue s ( 1S70 ,
Query 0 R , 1 ro n a-F-Fected (0 . 00 sec )

mysql› insert into nobelprize values(l970, "Physiology", "Ulf von Euler", "Sweden", "Scientist");
Query 0 R1 ro n a-F--F-ected (0 . 00 sec )
"Phys iotogy" ,
"Bernard "German y" , "Sc ient ist " ) ;
mysql > in sert into no bet prize vatue s 1970 ,
guery OF , 1 row a-F-Fected {0 . 00 sec
"Literature”,
”Aleksandr Solzhenitsym”, ”Russia", "Li ngui st " ) ;

mysql» insert into nobelprize values(l970, "Economics", "Paul Samuelson", "USA", "Econimist"); Query Ok, 1 r

mysql» insert into nobelprize values(l970, "Physiology", "Julius Axelrod", "USA", "Scientist");
guery OH , 1 row at-I-ected {0 . 00 sec)

mysql» insert into nobelprize values(1971,


values(l97l, "Chemistry",
"Physics", "Dennis Gabor",
"Gerhard "Hungary",
Herzberg", "Scientist");
"Germany", Query OM, 1 r
"Scientist");
Query OX, 1 row affected (0.00 sec)

mysql» insert into nobelprize values(l97l, ”Peace", ”Willy Brandt“, "Germany“, "Chancellor”) ; Query OP, 1 r

mysql» insert into nobelprize values(l97l, "Literature", "Pablo Neruda", "Chile", "Linguist"); Query Ok, 1 r

mysql> insert into nobelprize values(l971, "Economics", "Simon Huznets", "Russia", "Economist"); Query Ok, 1

"Prime
mysql» insert into nobelprize values(1978, "Peace", "Anwar al-Sadat", "Egypt", "President"); Query OM, 1 row

”Peace“,
"Men ac Begin“, "Israel", Minister");
mysql> insert into nobelprize hem
values(l978,
mysql› insert into nobelprize values(l987, "Chemistry", "Donald J. Cram", "USA", "Scientist"); Query OP, 1 r

mysql» insert into nobelprize values(1987, "Chemistry", "Jean-Marie Lehn", "France", "Scientist");
Query 0k, 1 row affected (0.00 sec)

mysql» insert into nobelprize va1ues(1987, "Physiology", "Susumu Tonegaza", "Japan", "Scientist");
Query OH, 1 row affected (0.00 sec)
Question 2: Write a SQL query that combines the winners in Physics, 1970 and
in Economics, 1971. Return year, subject, winner, country, and category.
Solution:

Question 3: Write a SQL query to find the Nobel prize winners in 1970 excluding the subjects of
Physiology and Economics. Return year, subject, winner, country, and category.
Solution:

Question 4: Write a SQL query to find Nobel prize winners for the subject that does not begin with
the letter ‘P’. Return year, subject, winner, country, and category. Order the result by year,
descending and winner in ascending.
Solution: Solution is in the next page
Question 5: Write a SQL query to find the details of 1970 Nobel prize winners. Order the result
by subject, ascending except for ‘Chemistry’ and ‘Economics’ which will come at the end of the
result set. Return year, subject, winner, country, and category.
Solution:

You might also like