Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Following the example in Lecture 2, Print a report of salaries for HR.EMPLOYEES.

ID: 3875687 • Letter: F

Question

Following the example in Lecture 2, Print a report of salaries for HR.EMPLOYEES..

Set echo on

Set up a spool file to receive your output for submission. I would suggest c:CS4210wa2spool.txt

Set appropriate column headings and formats

Set appropriate linesize and pagesize. Give your report the title 'CS442a Module 2 Written Assignment'

Set a break on DEPARTMENT_ID and REPORT

Compute subtotals on DEPARTMENT_ID and a grand total on REPORT

Show just the fields DEPARTMENT_ID, EMPLOYEE_ID, FIRST_NAME, LAST_NAME, and SALARY for Department_ID < 50 from HR.EMPLOYEES . (Don't forget to order by DEPARTMENT_ID.)

Close the spool file

Explanation / Answer

Solution:

code:

Set linesize 1000

Set pagesize 1000

Spool c:CS4210wa2spool.txt

Title center  'CS442a Module 2 Written Assignment'

Break on DEPARTMENT_ID ;

SELECT DEPARTMENT_ID, EMPLOYEE_ID, FIRST_NAME, LAST_NAME, and SALARY from HR. EMPLOYEES WHERE DEPARTMENT_ID <50 ORDER BY DEPARTMENT_ID ;

SPOOL OFF;

I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)