Practice 5 - Practice 5 SQL 1. Group functions work across...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Practice 5 – SQL 1. Group functions work across many rows to produce one result. True 2. Group functions include nulls in calculations False 3. The WHERE clause restricts rows prior to inclusion in a group calculation. True 4. Display the highest, lowest, sum, and average salary of all employees. Label the column Maximum, Minimum, Sum, and Average, respectively. Round your results to the decimal position. Save your SQL statement in a file called p5q4.sql SQL> select round(max(sal),2) "Maximum", 2 round(min(sal),2) "Minimum", 3 round(sum(sal),2) "Sum", 4 round(avg(sal),2) "Average" 5 from emp; Maximum Minimum Sum Average --------- - ---------- ---------- ---------- 5000 800 29025 2073.21 SQL> ed/ File saved 5. Modify p5q4.sql to display the minimum, maximum, sum and average salary for each job type. Resave to a file called p5q5.sql. Rerun your query. SQL> select job ,round(max(sal),2) "Maximum", 2 round(min(sal),2) "Minimum", 3 round(sum(sal),2) "Sum", 4 round(avg(sal),2) "Average" 5 from emp
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/29/2012 for the course INTERNATIO 101 taught by Professor Mr.johnnash during the Spring '11 term at Symbiosis International University.

Page1 / 4

Practice 5 - Practice 5 SQL 1. Group functions work across...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online