+--------+----------+----------+
| DeptId | DeptName | DeptCode |
+--------+----------+----------+
| 1 | Sales | DEP001 |
| 2 | IT | DEP002 |
+--------+----------+----------+
+--------+--------+-----------+-----------+
| EmpId | DeptId | FirstName | LastName |
+--------+--------+-----------+-----------+
| 1 | 1 | Bob | Smith |
| 2 | 1 | Fred | Flintstone|
| 3 | 2 | Jane | Bloggs |
| 4 | 2 | Betty | Rubble |
+--------+--------+-----------+-----------+
SELECT *
FROM [Department] d
JOIN [Employee] e ON e.DeptId = d.DeptId
+----------+------------+------------+---------+----------+-------------+-------------+
| d.DeptId | d.DeptName | d.DeptCode | e.EmpId | e.DeptId | e.FirstName | e.LastName |
+----------+------------+------------+---------+----------+-------------+-------------+
| 1 | Sales | DEP001 | 1 | 1 | Bob | Smith |
| 1 | Sales | DEP001 | 2 | 1 | Fred | Flintstone |
| 2 | IT | DEP002 | 3 | 2 | Jane | Bloggs |
| 2 | IT | DEP002 | 4 | 2 | Betty | Rubble |
+----------+------------+------------+---------+----------+-------------+-------------+
Last reply 38 minutes ago
Official University College London Applicant Thread for 2024Last reply 44 minutes ago
Can I do economics degree without a level maths?Last reply 59 minutes ago
Official Cranfield University Applicant Thread for 2024Last reply 1 hour ago
How to choose unis in UCAS application for CS undergraduate course?Last reply 1 hour ago
Rishi Sunak pledges to remove benefits for people not taking jobs after 12 monthsLast reply 1 hour ago
Got my crush's number 2 days ago and no reply yet. What could be the reasons?Posted 1 hour ago
GB News set to axe 40 jobs after channel posts heavy lossesLast reply 1 hour ago
Rwanda bill likely to be stalled at least till April after seven defeats in the LordsPosted 2 hours ago
Sunak rejects offer of youth mobility scheme between EU and UKLast reply 2 hours ago
Bank Of england degree apprenticeship 2024Last reply 1 week ago
OCR A-level Computer Science Paper 2 (H446/02) - 19th June 2023 [Exam Chat]Last reply 2 weeks ago
AQA A-level Computer Science Paper 1 (7517 1A - 1E) - 12th June 2023 [Exam Chat]Last reply 4 weeks ago
OCR A-level Computer Science Paper 1 (H446/01) - 12th June 2023 [Exam Chat]Last reply 2 months ago
OCR GCSE Computer Science Paper 1 (J277/01) - 19th May 2023 [Exam Chat]Last reply 3 months ago
AQA GCSE Computer Science Paper 2 (8525/2) - 25th May 2023 [Exam Chat]Last reply 5 months ago
AQA GCSE Computer Science Paper 1 (8525/1A, 1B, 1C) - 19th May 2023 [Exam Chat]Last reply 5 months ago
AQA Computer Science NEA and Computer science paper 1 questionLast reply 1 week ago
OCR A-level Computer Science Paper 2 (H446/02) - 19th June 2023 [Exam Chat]Last reply 2 weeks ago
AQA A-level Computer Science Paper 1 (7517 1A - 1E) - 12th June 2023 [Exam Chat]Last reply 4 weeks ago
OCR A-level Computer Science Paper 1 (H446/01) - 12th June 2023 [Exam Chat]Last reply 2 months ago
OCR GCSE Computer Science Paper 1 (J277/01) - 19th May 2023 [Exam Chat]Last reply 3 months ago
AQA GCSE Computer Science Paper 2 (8525/2) - 25th May 2023 [Exam Chat]Last reply 5 months ago
AQA GCSE Computer Science Paper 1 (8525/1A, 1B, 1C) - 19th May 2023 [Exam Chat]Last reply 5 months ago
AQA Computer Science NEA and Computer science paper 1 question