2. Using a Noncorrelated Subquery Each month a memo is that lists the employees
ID: 3817025 • Letter: 2
Question
2. Using a Noncorrelated Subquery Each month a memo is that lists the employees who have employment anniversaries for that month is posted. Create the report for the current month and list Employee ID and the first and last names for all employees hired during the current month of any year. You can find Employee. Name in the orionnemployee addresses table and Employee Hire Date in the orion.employee payroll table. Both tables contain the column Employee ID, Order the report by an employee's last name. a. Create a query that returns a list of employee IDs for employees with a current anniversary. The query should do the following Display Employee ID numbers. Use the orion employee payroll table. Return only employees whose hire date (Employee Hire ate is in the current month. Add a title to the report as shown. Partial PROC SQL Output (Generated when current month February) Employee IDs for current Month Anniversaries ployee, ID 120107 120116 120136 120162 120164Explanation / Answer
[1]
SELECT Employee_ID
FROM orion.employee_payroll
WHERE MONTH(Employee_Hire_Date) = MONTH(SYSDATE)
AND (SYSDATE - Employee_Hire_Date) / 30*12 >= 1;
[2]
SELECT Employee_ID
, SUBSTRING_INDEX(b.Employee_Name, ',' ,-1) AS "First Name"
, SUBSTRING_INDEX(b.Employee_Name, ',' ,1) AS "Last Name"
FROM orion.employee_payroll a
JOIN orion.employee_addresses b
ON (a.Employee_ID = b.Employee_ID)
WHERE MONTH(a.Employee_Hire_Date) = MONTH(SYSDATE)
AND (SYSDATE -a.Employee_Hire_Date) / 30*12 >= 1;
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.