SQL Exercises: Display all the data of employees including their department
SQL JOINS: Exercise-26 with Solution
Write a query in SQL to display all the data of employees including their department.
Sample table: emp_details
SELECT emp_idno, A.emp_fname AS "First Name", emp_lname AS "Last Name", B.dpt_name AS "Department", emp_dept, dpt_code, dpt_allotment FROM emp_details A INNER JOIN emp_department B ON A.emp_dept = B.dpt_code;
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
Previous: Write a SQL query to display the name of each company along with the ID and price for their most expensive product.
Next: Write a query in SQL to display the first name and last name of each employee, along with the name and sacntion amount for their department.
What is the difficulty level of this exercise?