PrepAway - Latest Free Exam Questions & Answers

Which of the following statements will produce a result data set that satisfies all of these conditions…

Given the following table definitions:
EMPLOYEES
————————————————
EMPID INTEGER
NAME CHAR(20)
DEPTID CHAR(3)
SALARY DECIMAL(10,2)
COMMISSION DECIMAL(8,2)
DEPARTMENTS
————————————————
DEPTNO INTEGER
DEPTNAME CHAR(20)
Which of the following statements will produce a result data set that satisfies all of these
conditions:
> Displays the total number of employees in each department
>> Displays the corresponding department name for each department ID
>> Sorted by department employee count, from greatest to least

PrepAway - Latest Free Exam Questions & Answers

A.
SELECT *,COUNT(empno) FROM departments, employees WHERE deptid = deptno GROUP
BY deptname ORDER BY 2 DESC

B.
SELECTdeptname, COUNT(empno) FROM departments, employees WHERE deptid = deptno
GROUP BY deptname ORDER BY 2 DESC

C.
SELECTdeptname, COUNT(empno) FROM departments, employees WHERE deptid = deptno
GROUP BY deptname ORDER BY 2 ASC

D.
SELECTdeptname, COUNT(*) FROM departments, employees WHERE deptid = deptno
GROUP BY deptname ORDER BY 2

One Comment on “Which of the following statements will produce a result data set that satisfies all of these conditions…


Leave a Reply