HomeInterview QuestionsWrite a SQL query that joins the employee and sala…

Write a SQL query that joins the employee and salary tables to retrieve employee details along with their salary.

🟢 Easy Coding Fresher level
1Times asked
Aug 2026Last seen
Aug 2026First seen

💡 Model Answer

Assuming the employee table has columns employee_id, employee_name, and department, and the salary table has employee_id and salary, a simple inner join will retrieve the desired data:

SELECT e.employee_id,

   e.employee_name,
   e.department,
   s.salary

FROM employee e

JOIN salary s ON e.employee_id = s.employee_id;

This query returns one row per employee with their salary. If an employee might not have a salary record, use LEFT JOIN instead.

This answer was generated by AI for study purposes. Use it as a starting point — personalize it with your own experience.

🎤 Get questions like this answered in real-time

Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers on a discreet on-screen overlay.

Get Assisting AI — Starts at ₹500