SQL quiz : HAVING

Solve the task by completing the SQL script

Question 1

Having1

Question:Complete the code below that demonstrates use of having

Instructions:

Refresh the page or click solve again if you misplaced any block

group
count(*)


select department,
      
as num_of_employees from employees
      
by department having count(*) > 10;

Output:

department num_of_employess
elect 25
extc 22
compt 20

Question 2

Having2

Question:Complete the code below that demonstrates use of having

Instructions:

Refresh the page or click solve again if you misplaced any block

department
salary
AVG
group


select *,
      
, AVG(
      
) as avg_salary from employees
      
by department having AVG(salary) >(select
      
(salary) from employees)

Output:

2.2, 0.52, 0.7400000000000001, 0.86

How useful was this post?

Click on a star to rate it!

,
  • SQL quiz : HAVING

    Solve the task by completing the SQL script

Instagram
WhatsApp
error: Content is protected !!