CBSE Computer Science - Revision Tour(Solved) CBSE Guess > eBooks > Class XII > CBSE Computer Science Structure Query Language Solved Revision Tour By Mr. Ravi Kiran COMPUTER SCIENCE STRUCTURED QUERY LANGUAGE (vi) SELECT A.SenderName A, B.RecName FROM Sender A, Recipient B WHERE A.SenderID=B. SenderID AND B.RecCity=’Mumbai’; Ans: SenderName RecName (vii) SELECT RecName,RecAddress FROMRecipient WHERE RecCity Not IN (‘Mumbai’,Kolkata’); Ans: RecName RecAddressS (viii) SELECT RecID, RecName FROM Recipient WHERE SenderID = ‘MU02’ OR
SenderID = ‘ND50’; Ans: RecID RecName OUTSIDE DELHI 2006: 5.b) Study the following tables FLIGHTS and FARES and write SQL commands for the questions (i) to (iv) and give outputs for TABLE: FLIGHTS
TABLE:FLIGHTS
(i) Display FL_NO and NO_FLIGHTS from “KANPUR” TO “BANGALORE” from the table FLIGHTS. Ans: Select FL_NO, NO_FLIGHTS from FLIGHTS where Starting=”KANPUR” AND ENDING=”BANGALORE” (ii) Arrange the contents of the table FLIGHTS in the ascending order of FL_NO. Ans: (Children, Try this as an assignment) (iii) Display the FL_NO and fare to be paid for the flights from DELHI to MUMBAI using the
tables FLIGHTS and FARES, where the fare to paid = FARE+FARE+TAX%/100. Ans: Select FL_NO, FARE+FARE+(TAX%/100) from FLIGHTS, FARES where Starting=”DELHI” AND Ending=”MUMBAI” (iv) Display the minimum fare “Indian Airlines” is offering from the tables FARES. Ans: Select min(FARE) from FARES Where AIRLINES=”Indian Airlines” v) Select FL_NO,NO_FLIGHTS,AIRLINES from FLIGHTS, FARES Where STARTING = “DELHI”
AND FLIGHTS.FL_NO = FARES.FL_NO Ans: FL_NO NO_FLIGHTS AIRLINES IC799 2 Indian Airlines (vi) SELECT count (distinct ENDING) from FLIGHTS. Ans: (Children, Try this answer as an assignment)
CBSE Computer Science Solved Revision Tour By Mr. Ravi Kiran ( [email protected] ) |
|