Class - 12 CBSE Computer Science Important Output Questions 2025
Give output for following SQL queries as per given table(s) :
Table : SENDER
SenderID | SenderName | SenderAddress | SenderCity |
---|---|---|---|
ND01 | R Jain | 2, ABC Appts | New Delhi |
MU02 | H Sinha | 12, Newtown | Mumbai |
MU15 | S Jha | 27/A, Park Street | Mumbai |
ND50 | T Prasad | 122-K, SDA | New Delhi |
Table : RECIPIENT
RecID | SenderID | RecName | RecAddress | RecCity |
---|---|---|---|---|
KO05 | ND01 | R Bajpayee | 5, Central Avenue | Kolkata |
ND08 | MU02 | S Mahajan | 116, A Vihar | New Delhi |
MU19 | ND01 | H Singh | 2A, Andheri East | Mumbai |
MU32 | MU15 | P K Swamy | B5, C S Terminus | Mumbai |
ND48 | ND50 | S Tripathi | 13, B1 D, Mayur Vihar | New Delhi |
(i) SELECT DISTINCT SenderCity FROM Sender ;
(ii) SELECT A.SenderName, B.RecName
FROM Sender A, Recipient B
WHERE A.SenderID = B.SenderID AND B.RecCity = 'Mumbai' ;
(iii) SELECT RecName, RecAddress FROM Recipient
WHERE RecCity NOT IN('Mumbai', 'Kolkata') ;
(iv) SELECT RecID, RecName FROM Recipient
WHERE SenderID = 'MU02' OR SenderID = 'ND50' ;
SQL Queries
3 Likes
Answer
(i)
Output
+------------+
| SenderCity |
+------------+
| MUMBAI |
| NEW DELHI |
+------------+
(ii)
Output
+------------+-----------+
| SenderName | RecName |
+------------+-----------+
| R JAIN | H SINGH |
| S JHA | P K SWAMY |
+------------+-----------+
(iii)
Output
+------------+-----------------------+
| RecName | RecAddress |
+------------+-----------------------+
| S MAHAJAN | 116, A VIHAR |
| S TRIPATHI | 13, B1 D, MAYUR VIHAR |
+------------+-----------------------+
(iv)
Output
+-------+------------+
| RecID | RecName |
+-------+------------+
| ND08 | S MAHAJAN |
| ND48 | S TRIPATHI |
+-------+------------+
Answered By
2 Likes