Write a query to display the block number and number of departments in each block , (which are in department table) and give an alias as NO_OF_DEPT. Sort the result based on NO_OF_DEPT in descending.
Answers
Answered by
6
_____________________________
➠ select block_no, count(dept_no)
AS "NO_OF_DEPT" from department
ORDER BY NO_OF_DEPT(DESC)
_____________________________
Answered by
62
Answer:
select department_block_no, count(department_id) as NO_OF_DEPT
FROM department
GROUP BY department_block_no
ORDER BY NO_OF_DEPT DESC;
Similar questions
Computer Science,
4 months ago
Math,
4 months ago
Biology,
9 months ago
Geography,
9 months ago
Math,
11 months ago