Computer Science: An Overview: Global Edition (12th Edition)

Published by Pearson Higher Education
ISBN 10: 1292061162
ISBN 13: 978-1-29206-116-0

Chapter 9 - Database Systems - Chapter Review Problems - Page 452: 26

Answer

See the explanation

Work Step by Step

To retrieve the Name and JobTitle of each current employee from the relational database described in Figure 9.5, you can use the following SQL query: ```sql SELECT Employee.Name, Employee.JobTitle FROM Employee JOIN EmploymentHistory ON Employee.EmployeeID = EmploymentHistory.EmployeeID WHERE EmploymentHistory.EndDate IS NULL; ``` Explanation: 1. **SELECT Employee.Name, Employee.JobTitle**: This selects the Name and JobTitle columns from the Employee table. 2. **FROM Employee**: Specifies the table from which to retrieve the data. 3. **JOIN EmploymentHistory ON Employee.EmployeeID = EmploymentHistory.EmployeeID**: Joins the Employee table with the EmploymentHistory table based on the common EmployeeID column. 4. **WHERE EmploymentHistory.EndDate IS NULL**: Filters the results to include only current employees by checking if the EndDate in the EmploymentHistory table is NULL, indicating that the employee is currently employed.
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.