0% found this document useful (0 votes)
798 views5 pages

Mysql Questions For Class Xii Ip

SLIP TEST MYSQL

Uploaded by

kvmducs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
798 views5 pages

Mysql Questions For Class Xii Ip

SLIP TEST MYSQL

Uploaded by

kvmducs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

INFORMATICS PRACTICES(065)

SLIP TEST 1 DATE: 05/03/2022

1. Give the output of following commands :

(i) mysql>SELECT LEFT ('Swati',4);

(ii) mysql>SELECT RTRIM ('!!!!!Study is

important!!!!!');

(iii) mysql>SELECT ROUND(3234.343,1);

where, !!!!! denotes blank spaces.

2. Consider the following table Club :

COACH_ID COACHNAME AGE SPORTS Date_of_Joining PAY

1 Rajesh 30 Karate 1999-08-25 1000

2 Anuj 35 Swimming 2000-01-05 750

3 Shuchi 25 Basketball 2005-01-04 1200

4 Reetika 28 Badminton 2002-08-25 1400

5 Virendra 32 Cricket 1996-05-17 1500

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

from second character, with their age.

(ii) What will be the output of the following query?

mysql>SELECT LENGTH(COACHNAME) FROM Club WHERE AGE>30;

(iii) Write a query to display the day for the Date_of_Joining column.

(iv) What will be the output of the following query?

mysql>SELECT PAY*0.25+1000 FROM Club WHERE COACHNAME LIKE ‘R%’;


(v) Write a query to display 3 characters from left of coach name.

3. Write the query for (i) and predict the output for (ii) and (iii):

P_ID ProductName Manufacture Price

TP01 TALCOM POWDER LAK 40

FW05 FACE WASH ABC 45

BS01 BATH SOAP ABC 55

SH06 SHAMPOO XYZ 120

FW12 FACE WASH XYZ 95

(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;

1. Write the output of the following SQL queries:

(i) SELECT SUBSTR(TRIM(' INDIA Is Great ',3,6) ;

(ii) SELECT ROUND(654.67152) +ROUND(152.4146,2) ;

(iii) SELECT INSTR('MOBILE PHONE','E') ;

(iv) SELECT DAYOFMONTH('2019-11-22');

2. Consider the following table WORKER and answer (i) and (ii) parts of this question.

Ecode Name Desig Plevel DOJ DOB

11 Radhey Shyam Supervisor P001 13-Sep-2004 23-Aug-1981

12 Chander Nath Operator P003 22-Feb-2010 12-Jul-1987

13 Fizza Operator P003 14-June-2009 14-Oct-1983

15 Ameen Ahmed Mechanic P002 21-Aug-2006 13-Mar-1984


18 Sanya Clerk P002 19-Dec-2005 09-June-1983

(i) Write SQL commands for the following statements:

(a) To display the details of all workers in descending order of DOB.

(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’

(ii) Give the output of the following SQL queries:

(a) SELECT Desig,Plevel FROM Worker WHERE Desig LIKE '%or';

(b) SELECT RIGHT(Name,3) FROM Worker WHERE Plevel='P002';

(c) SELECT YEAR(DOJ) FROM Worker;

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%’;

1. Write the output produced by the following SQL commands:


(i) SELECT POW(2,3);
(ii) SELECT ROUND(123.2345, 2), ROUND(342.9234,−1);
(iii) SELECT LENGTH("Informatics Practices");

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;

i) What will be the output of the following command?


SELECT * FROM Persons WHERE Gender =‘F’ AND City LIKE “%Nagar”;
ii) Display gender wise average salary.
iii) Display city wise count of persons.
iv) Display table in the descending order of salary.
v) Display details of persons who is getting salary below 50000.

You might also like