6
Reply

SQL Query Question

Praveen Moosad

Praveen Moosad

15y
6.4k
0
Reply

    select Count(Dept) as No_Of_Emp,Dept from Emp Group By(Dept) Order by Dept DEsc

    Select dept, count(dept) from emp group by Dept

    when developer get issue then its a bug.

    when tester got an issue then its a error

    and when production side got any issue tne its a defect.

    select dept,count(empid) as 'No of Employees' from tablename

    group by dept order by empid desc

    select dept, count(*) from emp group by dept order by dept desc

    Write a query based on the below records in the table

    Empid         Empname      Dept
    1                 Praveen         IT
    2                 Mahesh         IT
    3                 Scott             HR
    4                  Leslie           Admin
    5                  Mary            HR

    Write a SQL query which returns the following result

    Dept                 No of Employees

    IT                     2
    HR                   2
    Admin              1