Skip to content

Commit 970dd6a

Browse files
authored
Create SQL Exercises: Display the first name and last name of each employee, along with the name and sanction amount for their department
1 parent 03d5419 commit 970dd6a

1 file changed

+40
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
https://www.w3resource.com/sql-exercises/sql-joins-exercise-27.php
2+
3+
SQL JOINS: Exercise-27 with Solution
4+
From the following tables write a SQL to display the first name and last name of each employee, along with the name and sanction amount for their department.
5+
6+
Sample table:emp_department
7+
DPT_CODE DPT_NAME DPT_ALLOTMENT
8+
-------- --------------- -------------
9+
57 IT 65000
10+
63 Finance 15000
11+
47 HR 240000
12+
27 RD 55000
13+
89 QC 75000
14+
15+
16+
Sample table: emp_details
17+
EMP_IDNO EMP_FNAME EMP_LNAME EMP_DEPT
18+
--------- --------------- --------------- ----------
19+
127323 Michale Robbin 57
20+
526689 Carlos Snares 63
21+
843795 Enric Dosio 57
22+
328717 Jhon Snares 63
23+
444527 Joseph Dosni 47
24+
659831 Zanifer Emily 47
25+
847674 Kuleswar Sitaraman 57
26+
748681 Henrey Gabriel 47
27+
555935 Alex Manuel 57
28+
539569 George Mardy 27
29+
733843 Mario Saule 63
30+
631548 Alan Snappy 27
31+
839139 Maria Foster 57
32+
33+
34+
35+
SELECT emp_details.emp_fname, emp_lname,
36+
emp_department.dpt_name,
37+
dpt_allotment
38+
FROM emp_details
39+
JOIN emp_department
40+
ON emp_details.emp_dept = emp_department.dpt_code;

0 commit comments

Comments
 (0)