16) When do you use a LIKE statement?
To do partial search e.g. to search employee by name, you need not specify
the complete name; using LIKE, you can search for partial string matches.
17) What is the meaning of underscore ( ‘_’ ) in the LIKE statement? –
Match for any single character.
18) What do you accomplish by GROUP BY ... HAVING clause? –
GROUP BY partitions the selected rows on the distinct values of the column on
which you group by.
HAVING selects GROUPs which match the criteria specified
19) Consider the employee table with column PROJECT nullable. How can you get
a list of employees who are not assigned to any project?
SELECT EMPNO
FROM EMP
WHERE PROJECT IS NULL;
20) What is the result of this query if no rows are selected:
SELECT SUM(SALARY)
FROM EMP
WHERE QUAL=‘MSC’;
NULL
|