Welcome

Anti Essays offers essay examples to help students with their essay writing.

Sign Up

FunçõEs Agrupamento Essay

Open Document

Below is an essay on "FunçõEs Agrupamento" from Anti Essays, your source for research papers, essays, and term paper examples.

Problem List

Problem 1
For all departments, display department number and the sum of all salaries for each department. Name the derived column SUM_SALARY.
SELECT WORKDEPT, SUM(SALARY) AS SUM_SALARY
FROM EMPLOYEE
GROUP BY WORKDEPT
Problem 2
For all departments, display the department number and the number of employees. Name the derived column EMP_COUNT.
SELECT WORKDEPT, COUNT(*) AS EMP_COUNT
FROM EMPLOYEE
GROUP BY WORKDEPT
Problem 3
Display those departments which have more than 3 employees.
SELECT * WORKDEPT
FROM EMPLOYEE
WHERE COUNT(*) > 3
GROUP BY WORKDEPT
Problem 4
For all departments with at least one designer, display the number of designers and the department number. Name the derived column DESIGNER.
SELECT WORKDEPT, COUNT(*) AS DESIGNER
FROM EMPLOYEE
WHERE JOB LIKE ‘DESIGNER’
HAVING COUNT(*) > = 1
GROUP BY WORKDEPT
Problem 5
Show the average salary for men and the average salary for women for each department. Display the work department, the sex, the average salary, average bonus, average commission, and the number of people in each group. Include only those groups that have two or more people. Show only two decimal places in the averages.
Use the following names for the derived columns: AVG-SALARY, AVG-BONUS, AVG-COMM, and COUNT.
SELECT WORKDEPT, SEX, AVG(SALARY) AS ‘AVG-SALARY’, AVG(BONUS) AS ‘AVG-BONUS’, AVG(COMM) AS ‘AVG-COMM’, COUNT(*) AS COUNT
FROM EMPLOYEE
GROUP BY WORKDEP, SEX
Problem 6
Display the average bonus and average commission for all departments with an average bonus greater than $500 and an average commission greater than $2,000. Display all averages with two digits to the right of the decimal point. Use the column headings AVG-BONUS and AVG-COMM for the derived columns.
SELECT AVG(BONUS) AS ‘AVG-BONUS’, AVG(COMM) AS ‘AVG-COMM’
FROM EMPLOYEE
WHERE AVG(BONUS) > 500 AND AVG(COMM) > 2000
GROUP BY WORKDEPT

Show More


Citations

MLA Citation

"FunçõEs Agrupamento". Anti Essays. 12 Dec. 2018

<http://trenmayamx.com/free-essays/Funcoes-Agrupamento-761644.html>

APA Citation

FunçõEs Agrupamento. Anti Essays. Retrieved December 12, 2018, from the World Wide Web: http://trenmayamx.com/free-essays/Funcoes-Agrupamento-761644.html