MiQ Interview Question

How to use joins in SQL. Explain by writing an SQL query ?

Interview Answer

Anonymous

Nov 10, 2024

In SQL, JOIN is used to combine rows from two or more tables based on a related column. For example: sql Copy code SELECT employees.name, departments.department_name FROM employees JOIN departments ON employees.department_id = departments.id; This query retrieves employee names and their department names by matching department_id from employees with id in departments.