Home › Interview Questions › Complete the SQL query by adding the missing FROM …

Complete the SQL query by adding the missing FROM and JOIN clauses to join on empid.

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

💡 Model Answer

To finish the query, you need to specify the source tables and the join condition. For example, if you want to join the employee table with the department table on dept_id:

SELECT e.empid, e.ename

FROM employee e

JOIN department d ON e.dept_id = d.dept_id;

If the requirement is to join on empid (perhaps with a salary or payroll table), you could write:

SELECT e.empid, e.ename

FROM employee e

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

The key is to include a FROM clause that lists the base table(s) and a JOIN clause that defines how the tables relate. Once the FROM and JOIN are in place, the query will execute correctly.

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