
Mastering MySQL: HAVING and GROUP BY
Authored by Sayeda Habeeba
Computers
7th Grade
Used 2+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the `HAVING` clause in MySQL?
To filter rows before grouping them
To filter groups after aggregation
To sort the results
To join tables
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is an example of an aggregate function in MySQL?
`SELECT`
`WHERE`
`COUNT()`
`JOIN`
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following SQL query: `SELECT department, COUNT(*) FROM employees GROUP BY department;`. What does this query do?
It counts the total number of employees
It counts the number of employees in each department
It lists all departments
It lists all employees
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which clause would you use to filter the results of a `GROUP BY` query based on an aggregate function?
`WHERE`
`ORDER BY`
`HAVING`
`LIMIT`
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the difference between `WHERE` and `HAVING` clauses in MySQL?
`WHERE` filters rows before aggregation, `HAVING` filters after
`WHERE` filters after aggregation, `HAVING` filters before
Both filter after aggregation
Both filter before aggregation
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following queries correctly uses `HAVING` with `GROUP BY` to find departments with more than 10 employees?
`SELECT department FROM employees WHERE COUNT(*) > 10 GROUP BY department;`
`SELECT department FROM employees GROUP BY department HAVING COUNT(*) > 10;`
`SELECT department FROM employees GROUP BY department WHERE COUNT(*) > 10;`
`SELECT department FROM employees HAVING COUNT(*) > 10 GROUP BY department;`
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In the query `SELECT department, AVG(salary) FROM employees GROUP BY department HAVING AVG(salary) > 50000;`, what does `AVG(salary) > 50000` do?
It filters departments with an average salary less than $50,000
It filters departments with an average salary greater than $50,000
It calculates the average salary for all employees
It lists all departments
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
9 questions
Ticker Symbols
Quiz
•
7th Grade
14 questions
Google Docs and Google Slides Review
Quiz
•
KG - University
12 questions
Copyright Laws
Quiz
•
6th - 9th Grade
10 questions
Spreadsheet Homework 2
Quiz
•
7th Grade
10 questions
Search Strategies Pre-Assessment
Quiz
•
6th - 8th Grade
13 questions
Digital Wellness Module 5: Rights & Literacy
Quiz
•
6th - 8th Grade
10 questions
Computer and Web Technologies
Quiz
•
7th - 9th Grade
10 questions
07. Technology in Agriculture
Quiz
•
7th - 8th Grade
Popular Resources on Wayground
8 questions
2 Step Word Problems
Quiz
•
KG - University
20 questions
Comparing Fractions
Quiz
•
4th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Latin Bases claus(clois,clos, clud, clus) and ped
Quiz
•
6th - 8th Grade
22 questions
fractions
Quiz
•
3rd Grade
7 questions
The Story of Books
Quiz
•
6th - 8th Grade