Loading

Quipoin Menu

Learn • Practice • Grow

sql / Single Row Subqueries
mcq
Direction: Choose the correct option

Q1.

What is a single-row subquery?
A. Returns one database
B. Returns one column
C. Returns exactly one row
D. Returns one table
Direction: Choose the correct option

Q2.

SELECT * FROM employees WHERE salary = (SELECT MAX(salary) FROM employees);
What does this find?
A. Lowest salary employee
B. Employee with highest salary
C. Employees with average salary
D. All employees
Direction: Choose the correct option

Q3.

SELECT MAX(salary) FROM employees WHERE salary < (SELECT MAX(salary) FROM employees);
What does this find?
A. Lowest salary
B. Second highest salary
C. Highest salary
D. Average salary
Direction: Choose the correct option

Q4.

What happens if single-row subquery returns multiple rows?
A. Error occurs
B. All rows used
C. Last row used
D. First row used
Direction: Choose the correct option

Q5.

SELECT department, AVG(salary) FROM employees GROUP BY department HAVING AVG(salary) > (SELECT AVG(salary) FROM employees);
What does this query do?
A. Department list
B. Departments with above-average salary
C. Average of all
D. All departments