SQL XII Basics+Group by+Joins Assignment
SQL XII Basics+Group by+Joins Assignment
MySQL Assignment
1. Consider the given Table Hospital and write SQL queries for the
following:
Table : Hospital
Table : Results
Rank Integer 2
Table : FURNITURE
i. To list the ITEMNAME which are priced at more than 15000 from the
FURNITURE table.
ii. To list ITEMANME and TYPE of those items, in which DATEOFSTOCK is
before 22/01/02 from FURNITURE table in descending order of ITEMNAME.
RAHUL
MU05 ND01 5, PARK AVENUE MUMBAI
KISHORE
TABLE: RECIPIENT
6. Write a query to find the number of recipients in each city. Display the city
and the total number of recipients.
7. Create a query to group senders by city and list the sender names in each
city.
9. Formulate a query to find out how many senders are in New Delhi and how
many in Mumbai, grouping them by city and counting.
10. Write an equi join query to display all sender and recipient details where
SENDERID matches in both tables. Include sender name, sender address,
recipient name, and recipient address in the output.
12. Write a query to join both tables and display the full details of senders and
recipients who are from the same city.
13. Create a query to display senders and their corresponding recipients, but
only for records where the recipient city is New Delhi.
14. Write a query to list all the recipients and the corresponding sender
addresses using inner join, showing RECNAME and SENDERADDRESS.
Table: Consumer
C_ID ConsumerName Address S_ID
01 Good Learner Delhi PL01
06 Write Well Mumbai GP02
12 Topper Delhi DP01
15 Write & Draw Delhi PL02
16 Motivation Banglore PL01