Govt. Exams
Entrance Exams
Advertisement
Topics in Database
What will be the output of: SELECT MAX(salary) FROM employees GROUP BY department;
Correct Answer:
B. The maximum salary for each department
EXPLANATION
MAX() with GROUP BY returns the maximum salary value for each distinct department.
Consider a table with columns: id, name, salary. If a row has NULL salary, what will SELECT * FROM table WHERE salary = NULL return?
Correct Answer:
B. No rows (NULL cannot be compared with =)
EXPLANATION
NULL values cannot be compared using = operator. To check for NULL, use IS NULL or IS NOT NULL.