Search Header Logo

Aggregate Functions group by having

Authored by MAYURI K

Engineering

Professional Development

Used 1+ times

Aggregate Functions group by having
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

21 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Employee(emp_id, dept, salary, bonus)
• salary and bonus may contain NULLs
• dept includes some NULL department rows

Which query filters only departments where more than 3 employees exist?

WHERE COUNT() > 3

HAVING COUNT() > 3

WHERE emp_id > 3

FILTER COUNT(*) > 3

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

COUNT(*) vs COUNT(salary) difference?

COUNT(salary) ignores NULL

COUNT(*) counts all rows

Both A and B

They are always identical

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which returns departments with total bonus > total salary?

Valid

Invalid

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which filters employees before grouping?

WHERE

HAVING

GROUP WHERE

DISTINCT

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Evaluate: SELECT dept, SUM(salary) FROM Employee GROUP BY dept HAVING SUM(salary) IS NULL;

Shows only depts where salary all NULL

Shows non-NULL salary depts

Shows error

Shows all rows

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which counts NULL salary rows per dept?

Correct

Wrong

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

HAVING always needs GROUP BY?

No

Yes

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?