Mysql Questions For Class Xii Ip
Mysql Questions For Class Xii Ip
important!!!!!');
Give the answer of the following questions on the basis of the above table.
(i) Write a query to display the substring of 4 characters of the name of each coach, starting
(iii) Write a query to display the day for the Date_of_Joining column.
3. Write the query for (i) and predict the output for (ii) and (iii):
(i) To count the product manufacture wise from the table Product.
(ii) (SELECT Manufacture,MAX(Price), MIN(Price), COUNT(*)FROM Product
GROUP BY Manufacture;
(iii) SELECT Manufacture, MAX(Price) FROM Product;
2. Consider the following table WORKER and answer (i) and (ii) parts of this question.
(b) To display Name and Desig of those workers whose Plevel is either P001 or
P002.
(c) To display the content of all the workers, whose DOB is in between ‘19-JAN-
1984’ and ‘18-JAN-1987’.
(d) To add a new row with the following: 19, ‘Daya kishore’, ‘Operator’, ‘P003’,
‘19-Jun-2008’, ‘11-Jul-1984’
3. Consider the table DOCTOR given below. Write commands in SQL for (i) to (ii) and
output for (iii) to (v).
(i) Display the names and salaries of doctors in descending order of salaries.
(ii) Display names of each department along with total salary being given to doctors
of that department
(iii) SELECT SUM(Salary) FROM DOCTOR WHERE Department==‘Surgery’;
(iv) SELECT Department, COUNT(*) FROM DOCTOR GROUP BY Department;
(v) SELECT DOCName FROM DOCTOR WHERE Department LIKE ‘%gery%’;
2. Write SQL commands for (i) to (v) and write the output for (vi) on the basis of table
Furniture.
(i) To show all information about the baby cots from the Furniture table.
(ii) To list the itemname which are priced at more than 15000 from the Furniture table.
(iii) To list itemname and type of those items, in which date of stock is before 22/01/02 from
the Furniture table in the descending order of itemname.
(iv) To display itemname and dataofstock of those items, whose type is “ Sofa” from
Furniture table. (v) To insert a new row in the Furniture table with the following data:
14,‘‘Velvet touch” , ‘‘Double Bed”,{25/03/03}, 25000,30
(vi) Give the output of the following SQL statement based on table Furniture.
(a) SELECT LEFT(Itemname,3) FROM Furniture WHERE Type="Double Bed";
(b) SELECT MONTHNAME(Dateofstock) FROM Furniture WHERE Type="Sofa";
(c) SELECT * FROM Furniture WHERE Itemname LIKE 'E%';
(d) SELECT Price*Discount FROM Furniture WHERE Dateofstock>31/12/02;