Loading

Quipoin Menu

Learn • Practice • Grow

sql / Advanced SQL Joins
mcq
Direction: Choose the correct option

Q1.

SELECT d.dept_name, e.name FROM departments d LEFT JOIN employees e ON d.dept_id = e.dept_id;
What will this return for departments with no employees?
A. Department name with NULL for employee
B. Department not shown
C. Error
D. Only departments with employees
Direction: Choose the correct option

Q2.

SELECT e.name, d.dept_name FROM employees e RIGHT JOIN departments d ON e.dept_id = d.dept_id;
What does RIGHT JOIN do?
A. Keeps only matches
B. Keeps left table
C. Keeps all departments
D. Keeps all employees
Direction: Choose the correct option

Q3.

How do you simulate FULL OUTER JOIN in MySQL?
A. Using CROSS JOIN
B. Using FULL JOIN keyword
C. Not possible
D. Using UNION of LEFT and RIGHT JOIN
Direction: Choose the correct option

Q4.

SELECT d.dept_name FROM departments d LEFT JOIN employees e ON d.dept_id = e.dept_id WHERE e.emp_id IS NULL;
What does this find?
A. Employees with no department
B. Departments with no employees
C. Departments with employees
D. All departments
Direction: Choose the correct option

Q5.

SELECT e.name, d.dept_name FROM employees e JOIN departments d USING (dept_id);
When can USING be used?
A. Always
B. Never
C. Only with aliases
D. When column names are identical