SQL Exercises: Display the first name and last name of each employee, along with the name and sacntion amount for their department
SQL JOINS: Exercise-27 with Solution
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.
Sample table: emp_details
SELECT emp_details.emp_fname AS "First Name", emp_lname AS "Last Name", emp_department.dpt_name AS "Department", dpt_allotment AS "Amount Allotted" FROM emp_details INNER JOIN emp_department ON emp_details.emp_dept = emp_department.dpt_code;
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
Previous: Write a query in SQL to display all the data of employees including their department.
Next: Write a query in SQL to find the first name and last name of employees working for departments with a budget more than Rs.50000.
What is the difficulty level of this exercise?