(v) To count the number of items whose cost is more than 10000. (vi) To insert a new record in the Lab table with the following data : I 8. "VCR", 2. 2 2 2000 . 1, 2 (vii) Give the output of the following SQL command : SELECT MIN (DISTINCT quantity) FROM lab; SELECT MIN(warranty) FROM lab WHERE quantity = 2; SELECT SUM(costperitem) FROM lab WHERE quantity >2; SELECT AVG(csostperitem) FROM lab WHERE dateofpurchase<{l/199}; 06. (b) Given the following tables for a database LIBRARY. 2004 Write SQL command for questions (i) to (vi) (i) To show Book name, Author name and Price of books of EPB publishers (ii) To list the names of books of Fiction Type (iii) To display the and price of the books in descending order of their price (iv) To increase the price of all books of First Publ. by 50 (v) To display the Book_Id, Book_Name and Quantity_Issued for all books which have been issued. (The query will require contents from both the tables) (vi) To insert a new row in the table Issued having the following data : 4 (vii) Give the output of the following queries on the above tables : SELECT COUNT(DISTINCT Publishers) FROM Books SELECT SUM(Price) FROM Books WHERE Quantity >5 SELECT Book_Name, Author_Name FROM Books WHERE Price<500 SELECT COUNT (*) FROM Books 07. (b) Consider the following tables EMPLOYEES and EMPSALARY. Write SQL commands for the statements (i) to (iv) and give outputs for SQL queries (v) to (viii). 2005 (i) To display Firstname, Lastname, Address and City of all employees living in Paris from the table EMPLOYEES. (ii) To display the content of EMPLOYEES table in descending order of FIRSTNAME. (iii) To display the Firstname, Lastname, and Total Salary of all Managers from
(v) To count the number of items whose cost is more than 10000. (vi) To insert a new record in the Lab table with the following data : I 8. "VCR", 2. 2 2 2000 . 1, 2 (vii) Give the output of the following SQL command : SELECT MIN (DISTINCT quantity) FROM lab; SELECT MIN(warranty) FROM lab WHERE quantity = 2; SELECT SUM(costperitem) FROM lab WHERE quantity >2; SELECT AVG(csostperitem) FROM lab WHERE dateofpurchase<{l/199}; 06. (b) Given the following tables for a database LIBRARY. 2004 Write SQL command for questions (i) to (vi) (i) To show Book name, Author name and Price of books of EPB publishers (ii) To list the names of books of Fiction Type (iii) To display the and price of the books in descending order of their price (iv) To increase the price of all books of First Publ. by 50 (v) To display the Book_Id, Book_Name and Quantity_Issued for all books which have been issued. (The query will require contents from both the tables) (vi) To insert a new row in the table Issued having the following data : 4 (vii) Give the output of the following queries on the above tables : SELECT COUNT(DISTINCT Publishers) FROM Books SELECT SUM(Price) FROM Books WHERE Quantity >5 SELECT Book_Name, Author_Name FROM Books WHERE Price<500 SELECT COUNT (*) FROM Books 07. (b) Consider the following tables EMPLOYEES and EMPSALARY. Write SQL commands for the statements (i) to (iv) and give outputs for SQL queries (v) to (viii). 2005 (i) To display Firstname, Lastname, Address and City of all employees living in Paris from the table EMPLOYEES. (ii) To display the content of EMPLOYEES table in descending order of FIRSTNAME. (iii) To display the Firstname, Lastname, and Total Salary of all Managers from
Class%2012%20-%20All%20Questions.docx