AllRounder.ai
Chapters in this course

Enrol to start learning

Reading is open to everyone. Enrolling is free, and it is what unlocks the audio lessons, practice tests and progress tracking.

Enrol free

12.2.4. GROUP BY – Aggregate Results

  • This section

    Practice test

    11 questions on this section. Wrong answers show you what to read again.

    Sign up to take it
  • Whole chapter

    Revision test

    Mixed questions from across the chapter. Your answers get marked.

    Sign up to take it
  • Quick

    Flashcard drill

    3 cards from this lesson. Good the night before a test.

Try these first

  1. 1.

    What does the GROUP BY clause do?

    Hint

    Think of how you can summarize data.

  2. 2.

    Write a SQL query to count the number of users registered by email domain.

    Hint

    Look into substring functions for extracting data.

  3. 3.

    What does the GROUP BY clause do in SQL?

    • It sorts the data in ascending order.
    • It combines rows that have the same value in specified columns.
    • It retrieves all records from a table.
    Hint

    Think about how we summarize information.

  4. 4.

    True or False: GROUP BY can be used with aggregate functions like COUNT and AVG.

    • True
    • False
    Hint

    Recall our discussion on how to summarize data.

  5. 5.

    Write a SQL query to find the total revenue generated per product category for the last year.

    Hint

    Make sure your date filters include the correct time frame.

  6. 6.

    Create a report that shows how many times each user logged in within the last month, grouped by user.

    Hint

    Filter the relevant records before counting.

Exercises

Total Questions

2

Estimated Time

4 min

Passing Score

70%

Instructions

  • Read each question carefully
  • You can use hints if you need help
  • Complete all questions before submitting

4 more questions available

Enrol free

Quiz

Total Questions

2

Estimated Time

4 min

Passing Score

70%

Instructions

  • Read each question carefully
  • You can use hints if you need help
  • Complete all questions before submitting

1 more question available

Enrol free

Challenge Problems

Total Questions

2

Estimated Time

4 min

Passing Score

70%

Instructions

  • Read each question carefully
  • You can use hints if you need help
  • Complete all questions before submitting