CH 7 - Introduction To SQL and Its Commands For Board Exam
CH 7 - Introduction To SQL and Its Commands For Board Exam
PRACTICE QUESTIONS
Query:
SELECT COUNT(GAME),AVG(SALARY) FROM COACH;
(a) 3 70000 (b) 4 35000 (c) 4 70000 (d) 3 35000
72. Which of the following set of functions is a valid set of
aggregated functions in MySQL?
(a) AVG(),ROUND(),COUNT() (b) MIN(),UPPER(),AVG()
(c) COUNT(),MAX(),SUM() (d) DATE(),COUNT(),LTRIM()
73. Aggregate functions can be used in the select list or the
_____ clause of a select statement. They cannot be used in
a ______ clause.
(a) Where, having (b) Having, where
(c) Group by, having (d) Group by, where
ORDER BY, GROUP BY , HAVING
74. The SELECT statement when combined with clause,
returns records in sorted order.
(a) SORT (b) ARRANGE (c) ORDER BY (d) SEQUENCE
75. Which of the following is correct sequence in a SELECT
query?
(a) SELECT,FRO,WHERE,GROUP BY, HAVING, ORDER
BY
(b) SELECT,WHERE,FROM,GROUP BY,HAVING,ORDER
BY
(c) SELECT,FROM,WHERE,HAVING,GROUP BY, ORDER
BY
(d) SELECT,FROM.WHERE,GROUP BY, ORDER BY,
HAVING
76. In MYSQL _____ clause applies the condition on every
ROW and ______ clause applies the condition on every
GROUP.
77. If we have not specified ASC or DESC after a SQL ORDER
BY clause, the following is used by default
(a) DESC (b) ASC
(c) There is no default value (d) None of the mentioned
78. SQL applies conditions on the groups through ____ clause
after groups have been formed.
(a) Group by (b) With (c) Where (d) Having
79. For Given table "EMP" with following columns:
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,DEPT
DESC;
(b) SELECT * FROM EMP ORDER BY ENAME, ORDER
BY DEPT DESC;
(c) SELECT * FROM EMP ORDER BY ENAME
DESC,DEPT;
(d) SELECT * FROM EMP WHERE ORDER BY
ENAME,DEPT DESC;
80. Consider the following query
Select * from employee order by salary ____, name
_______ ;
To display the salary from greater to smaller and name in
alphabetical order which of the following option should be
used?
(a) ascending, descending (b) asc,desc
(c) desc,asc (d) Descending,Ascending
81. Which of the following will be the correct SQL command
to add a new column FEES in a table TEACHER?
(a) ALTER TABLE TEACHER ADD COLUMN FEES FLOAT;
(b) ADD COLUMN FEES FLOAT INTO TEACHER;
(c) UPDATE TEACHER ADD COLUMN FEES FLOAT;
(d) INSERT INTO TEACHER ADD COLUMN FEES FLOAT;
82. Find the output of
the MySQL query
based on the given
Table – STUDENT
(i) SELECTCOUNT(DISTINCTNumber)FROMGAMES;
(ii) SELECT MAX(ScheduleDate), MIN(ScheduleDate)
FROM GAMES;
(iii) SELECT SUM(PrizeMoney) FROM GAMES;
(iv) SELECT * FROM GAMES WHERE PrizeMoney>12000;
14. Write the output of the queries (i) to (vi) based on the table
given below:
********************************************************