Computer Science, asked by amitthorat919, 9 months ago

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 Anonymous
6

\tt\it\bf\it\large\bm{\mathcal{\fcolorbox{blue}{white}{\green{Solution:-}}}}

_____________________________

➠ select block_no, count(dept_no)

AS "NO_OF_DEPT" from department

ORDER BY NO_OF_DEPT(DESC)

_____________________________

Answered by supriya1998prajapati
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