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 2004: 5. Give the following table for database a LIBRARY. TABLE : BOOKS
TABLE:ISSUED
Write SQL queries from b to g. (b)To show Book name, Author name and
Price of books of EPB publisher. Ans: select Book_name,Author_name, price from books where Publisher =”EPB” (c) To list the names of the books of FICTIONS type. Ans: Select Book_name from books where type=”FICTION” (d) To display the names and prices of the
books in descending order of their price. Ans: Select Book_name, price from books
order by price desc; (e) To increase the price of all books of First Pub.by 50. Ans: update books set price= price+50 where publishers = “First Publ” (f) To Display the Book_ID, Book_Name and Quantity Issued for all books Which have been issued. Ans:Select Book_ID, Book_Name, Quantity_Issued from Books,Issued where Books.BookId=Issued.BookId; (g) To insert a new row in the table Issued having the following data: “F0002”,4 Ans: insert into Issued values(“F0002”,4) (h) Give the output of the following queries on the above tables: (i) Select Count(Distinct Publishers) From Books Ans: 3 (ii) Select Sum(Price) From Books Where Quantity>5 Ans: 1350. (iii) Select Book_Name,Author_Name From Books Where Price<500. Ans: Book_Name Author_Name My First C++ Brian & Brooks C++ Brainworks A.W.Rossaine Fast Cook Lata Kapoor. (iv) Select Count(*) From Books. Ans: 5
CBSE Computer Science Solved Revision Tour By Mr. Ravi Kiran ( [email protected] ) |
|