Question

EMPLOYEE_COURSE_t EmployeeID CourseID CompletionDate EMPLOYEE_t EmployeeID (PK) EmployeeFirstName EmployeeLastName EmployeeJobTitle EmployeeStreet EmployeeCity EmployeeState EmployeeZip EmployeeHireDate ManagerID...

EMPLOYEE_COURSE_t

EmployeeID

CourseID

CompletionDate

EMPLOYEE_t
EmployeeID (PK)

EmployeeFirstName

EmployeeLastName

EmployeeJobTitle

EmployeeStreet

EmployeeCity

EmployeeState

EmployeeZip

EmployeeHireDate

ManagerID

1.Which employees have not completed course ID = 90? Hint: name of employee only, and the best way to determine this is by having a subselect statement to determine the EmployeeIDs that have completed CourseID 90, and then have a the select statement use the output of the subselect to determine which of all of the employees are not in the list provided by the subselect.

2.Who is the manager of the manager of the sales reps? Hint: Show the name of the sales rep’s manager’s manager only, and your single SQL statement will need to determine the sales rep’s manager before it can determine the manager of the sales rep’s manager.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

--1 as explanation is already give I'm going to give you query directly.

Select employeeid, employeeFirstName from employee_t where Employeeid not in ( selevt Employeeid from employee_course_t where courseid=90);

--2

Below 1st we have extracted manger of sales rep. Those manger are passed as employees to emplyee table to get their managers.

Select Managerid from Employee_T where Employeeid in ( Select ManagerID from Employee_t where EmployeeJobTitle='Sales Rep')

Add a comment
Know the answer?
Add Answer to:
EMPLOYEE_COURSE_t EmployeeID CourseID CompletionDate EMPLOYEE_t EmployeeID (PK) EmployeeFirstName EmployeeLastName EmployeeJobTitle EmployeeStreet EmployeeCity EmployeeState EmployeeZip EmployeeHireDate ManagerID...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT