OXFORD GREEN PUBLIC SCHOOL, GREATER NOIDA
WORK SHEET - I (2023-24)
SUBJECT- INFORMATICS PRACTICES
CLASS - XII
DATABASE QUERY USING SQL
Q1. Consider the table ‘Employee’.
Write the SQL command to obtain the following output :
Q2. Write the output of the following SQL queries:
(i) SELECT ROUND(6.5675, 2);
(ii) SELECT TRUNCATE(5.3456, 1);
(iii) SELECT DAYOFMONTH('2009-08-25');
(iv) SELECT MID('Class 12', 2,3);
Q3 Write the output of the following SQL queries :
(i)SELECT INSTR(‘UNICODE’,’CO’)
(ii)SELECT RIGHT(‘Informatics’,3);
Q4. Write the output of the following SQL queries :
(i) SELECT RIGHT(‘software’, 4);
(ii) SELECT INSTR(‘twelve’,‘WE’);
(iii) SELECT MONTH(‘2022-03-01’);
(iv) SELECT ROUND(76.987, 2);
Q5. Write the output of the following SQL queries :
(i) SELECT MOD(34,5);
(ii) SELECT MOD(10,8);
(iii) SELECT MOD(13, 0);
(iv) SELECT POW(2,4);
Q6. Write the output of the following SQL queries :
(i)SELECT SQRT(25);
(ii) SELECT LENGTH('O P JINDAL SCHOOL, RAIGARH');
(iii) SELECT CHAR(78,65,77,65,78);
(iv) SELECT CHAR(76.5,65.3,'77.6',65,78);
Q7. Write the output of the following SQL queries:
(i) SELECT TRUNCATE(8.975,2);
(ii) SELECT MID(‘HONESTY WINS’,3,4);
(iii) SELECT RIGHT(CONCAT(‘PRACTICES’,’INFORMATICS’),5);
(iv) SELECT DAY(‘2015-01-16’);
Q8.The avg() function in MySql is an example of __________.
a. Math function
b. Text function
c. Date Function
d. Aggregate Function
Q9. Consider the table given below :
Write output.
(i) SELECT Name, LENGTH(Name) FROM Salesperson
Q10. The LastName column of a table "Directory" is given below:
Based on this information, find the output of the following
queries:
(a) SELECT lastname FROM Directory WHERE
lastname like "_a%";
(b)SELECT lastname FROM Directory WHERE lastname
not like "%a";