Question: Proc sql code for this question please- Building Complex Queries with In-Line Views Your ultimate goal in this exercise is to create a report showing

Proc sql code for this question please-

  1. Building Complex Queries with In-Line Views

Your ultimate goal in this exercise is to create a report showing each employees salary expressed as a percentage of the total salary for that employees department. The report should be sorted by department and, within each department, in descending order of salary percentage.

  • The orion.employee_payroll table contains Salary.
  • The orion.employee_addresses table contains Employee_Name.
  • The orion.employee_organization table contains Department.
    1. Create a report aggregating the sum of all salaries for each department. The report should include Department and the sum of all associated salary values as Dept_Salary_Total. Join orion.employee_payroll and orion.employee_organization by Employee_ID to obtain the information that you need.
  • The orion.employee_payroll table contains salary values.
  • The orion.employee_organization table contains department information.
  • b. Create a report that includes the employee ID, name, and department. Join orion.employee_addresses and orion.employee_organization by Employee_ID to obtain
    1. the information that you need.
  • The orion.employee_addresses table contains Employee_Name and Employee_ID.
  • The orion.employee_organization table contains Employee_ID and Department.

c. Use the two queries that you created in a and b as in-line views. Join the views with orion.employee_payroll by either Employee_ID or Department to create the final report.

  • The query from step a contains Department and Dept_Salary_Total.
  • The query from step b contains Employee_ID, Employee_Name, and Department.
  • The orion.employee_payroll table contains Employee_ID and individual Salary values.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!