Question 1669064
Question 1669064
SCHOOL-DPI
FIRST 25%
Class 12 - Informatics Practices
Time Allowed: 3 hours Maximum Marks: 60
Section A
1. Which clause is similar to HAVING clause in MySQL? [1]
a) SELECT b) WHERE
c) FROM d) TO
2. Which of the following is not an aggregate function? [1]
a) MAX() b) ADD()
c) COUNT() d) AVG()
3. Select correct SQL query from below to find the temperature in increasing order of all cites. [1]
a) SELECT city FROM weather ORDER BY b) SELECT city, temperature FROM weather
temperature; ORDER BY temperature;
c) SELECT city, temperature FROM weather d) SELECT city, temperature FROM weather;
ORDER BY city;
4. Consider the Club (coachid, coachname, sport, dateofapp, pay). [1]
List names of all coaches with their date of appointment in descending order.
a) Select coachname, dataofapp from club b) Select * from club order by dateofapp
order by dateofapp DSC DESC
c) Select coachname, dataofapp from club d) Select * from club order by dateofapp DSC
order by dateofapp DESC
5. What is the significance of the statement GROUP BY d.name in the following MySQL statement? [1]
SELECT name, COUNT (emp_id), emp_no FROM department GROUP BY name;
c) Counting of the field "name" on the table d) Sorting of the field "name"
"department"
6. Which of the following would arrange the rows in ascending order in SQL. [1]
a) SORT BY b) GROUP BY
c) ALIGN BY d) ORDER BY
7. What will be the order of sorting in the following MySQL statement? [1]
SELECT emp_id, emp_name FROM person ORDER BY emp_id, emp_name;
1/7
8. What is the significance of the statement "HAVING COUNT (emp_id)>2" in the following MySQL statement? [1]
SELECT name, COUNT (emp_id),emp_no FROM department GROUP BY name HAVING COUNT
(emp_id)>2;
a) Selecting those rows whose total emp_id>2 b) Both filter out all rows whose total emp_id
below 2 and selecting those rows whose
total emp_id>2
c) Filter out all rows whose total emp_id equal d) Filter out all rows whose total emp_id
to 2 below 2
9. If we have not specified ASC or DESC after a SQL ORDER BY clause, the following is used by default [1]
c) DESC d) ASC
10. The now() function in MySql is an example of? [1]
a) 11 b) November
c) May d) 5
12. Which of the following function is used to FIND the largest value from the given data in MYSQL? [1]
a) MAX() b) LARGEST()
c) BIG() d) MAXIMUM()
13. ________ helps to fetch a group of rows based on common values in a column. [1]
a) GROUP BY b) SELECT BY
c) ORDER BY d) FILTER
14. Which of the following function is not an aggregate function? [1]
a. Round()
b. Sum()
c. Count()
d. Avg()
c) Ascending d) Descending
16. What is the full form of SQL? [1]
2/7
a) Simple Query Language b) Structured Query List
a) Acts exactly like a WHERE clause. b) Similar to the WHERE clause but is used
for columns rather than groups.
c) Similar to WHERE clause but is used for d) Similar to WHERE clause but is used for
groups rather than rows. rows rather than columns.
18. Which of the following is not a valid aggregate function in MYSQL? [1]
a) MAX ( ) b) SUM ( )
c) COUNT ( ) d) LEN ( )
19. Which aggregate function returns the count of all rows in a specified table? [1]
a) SUB b) COUNT
c) SUM d) DISTINCT
20. Which clause is used with an aggregate functions? [1]
c) GROUP BY d) SELECT
21. Priyanka has given the following command to obtain the highest marks Select max(marks) from student where [1]
group by class; but she is not getting the desired result. Help her by writing the correct command.
a) Select class, max(marks) from student group b) Select class, max(marks) group by class
by marks; from student;
c) Select max(marks) from student where d) Select class, max(marks) from student
group by class; group by class;
22. What is the significance of ORDER BY in the following MySQL statement? [1]
SELECT emp_id, fname, Iname FROM person ORDER BY emp_id;
c) To filter out the summary groups. d) To filter out the row and column values.
24. For given table emp with following columns [1]
eno, ename, sal, dept, designation
Select correct statement to display all records of 'emp' in descending order of ename and within ascending order
of dept.
a) SELECT * FROM emp ORDER BY ename, b) SELECT * FROM emp WHERE ORDER
ORDER BY dept DESC; BY ename, dept DESC;
3/7
c) SELECT * FROM emp ORDER BY ename d) SELECT * FROM emp ORDER BY
DESC, dept; ename, dept DESC;
25. An aggregate function: [1]
a. Takes a column name as its arguments
b. May take an expression as its argument
c. Both takes a column name as its arguments and may take an expression as its argument
d. None of these
i. AVERAGE()
ii. MAX()
iii. COUNT()
iv. TOTAL()
27. Differentiate between COUNT ( ) and COUNT (*) functions in MYSQL. Give suitable examples to support [1]
your answer.
28. Keshav has written the following query to find out the sum of bonus earned by the employees of WEST zone: [1]
SELECT zone, TOTAL (bonus) FROM employee HAVING zone = 'WEST' ;
But he got an error. Identify the errors and rewrite the query by underlining the correction(s) done.
29. Which SQL command is used to modify the existing structure of a table? [1]
30. Which command is used to display the system date? [1]
Section B
31. To display the roll number, name and marks of all the students in descending order of their marks and ascending [2]
order of their names.
32. Gopi Krishna is using a table EMPLOYEE. It has the following columns: [2]
Code, Name, Salary, Deptcode
He wants to display maximum salary departmentwise.
He wrote the following command:
4/7
F03 Face Glow Foundation 1704 20
1 Swimming 10000 M, W
3 Dance 12000 M, W
4 Drawing 7000 T, Th
5 Craft 8000 F, S
6 Cooking 9000 T, F
Store ld Name Location City No. of Emp Date Open Sales Amt
5/7
PARTICIPANTS
Table : PARTICIPANTS
6/7
5 White Lotus Double Bed 23-02-2002 NULL 25
Write SQL queries using SQL functions to perform the following operations:
i. Display the Itemname whose price more than 10000
ii. Display the month name from the Stockdate.
iii. Display the total price of the whole stock.
iv. Display the average Price of all the stocks
41. Consider the table DOCTOR given below. Write commands in SQL for (i) to (ii) and output for (iii) to (v). [4]
Table : DOCTOR
7/7