What you'll learn

Level: Beginner

An aggregation query is often more than a count or summation. In this mini course, you'll tackle a series of exercises that cover built-in aggregation functions, including grouping data and ranking dating with window functions.

The course format is a series of exercises.  Each exercise is about 5 minutes. To help you along, each exercise includes a hint and a detailed solution. 

Prerequisites

Wanted: Architects, Developers, Administrators, and Business Leaders

Your curiosity and desire to learn YSQL are the only requirements for this mini course. The hands-on labs and exercises come complete with step-by-step instructions and easy to follow explanations and solutions.

Checklist

What you'll need

  • Operating System:
    macOS 10+, Ubuntu 16+, or Windows 10+

  • Chromium web browser:
    Chrome, Opera, or Microsoft Edge

  • YugabyteDB Managed free cluster

  • YugabyteDB Community Slack account

Course details

Duration 120 minutes

  1. 01
    • ๐Ÿ‘‹ Welcome!

    • ๐Ÿช Get Started with YugabyteDB Managed

    • ๐Ÿงช [LAB]: Create a YugabyteDB Managed free cluster

    • ๐Ÿ”ญ [LAB]: Create the ysql_exercises database

    • โ›น๐Ÿปโ€โ™‚๏ธ. Count the number of facilities

    • โ›น๏ธโ€โ™‚๏ธ. Count the number of expensive facilities

    • ๐ŸŒ๏ธ Count the number of recommendations each member makes

    • โ›น๐Ÿปโ€โ™€๏ธ. List the total slots booked per facility

    • โ›น๐Ÿฝ. List the total slots booked per facility in a given month

    • โ›น๐Ÿฝโ€โ™‚๏ธ. List the total slots booked per facility per month

    • ๐ŸŒ๐Ÿฟโ€โ™€๏ธ. Find the count of members who have made at least one booking

    • โ›น๐Ÿฝโ€โ™€๏ธ. List facilities with more than 1000 slots booked

    • โ›น๐Ÿฟโ€โ™‚๏ธ. Find the total revenue of each facility

    • โ›น๐Ÿฝ. Find facilities with a total revenue less than 1000

    • โ›น๐Ÿพโ€โ™‚๏ธ. Output the facility id that has the highest number of slots booked

    • โ›น๐Ÿฟโ€โ™€๏ธ. List the total slots booked per facility per month, part 2

    • โ›น๏ธ. List the total hours booked per named facility

    • โ›น๐Ÿฟ. List each member's first booking after September 1st 2012

    • ๐ŸŒ๐Ÿผโ€โ™‚๏ธ. Produce a list of member names, with each row containing the total member count

    • ๐ŸŒ๐Ÿพโ€โ™‚๏ธ. Produce a numbered list of members

    • โ›น๐Ÿผโ€โ™€๏ธ. Output the facility id that has the highest number of slots booked, again

    • ๐ŸŒ๏ธ. Rank members by (rounded) hours used

    • โ›น๐Ÿพโ€โ™€๏ธ. Find the top three revenue generating facilities

    • โ›น๐Ÿป. Classify facilities by value

    • โ›น๐Ÿฝโ€โ™‚๏ธ. Calculate the payback time for each facility

    • ๐Ÿช‚. Calculate a rolling average of total revenue

    • ๐Ÿ“š Additional reading

    • ๐Ÿงฐ Your YugabyteDB skill on LinkedIn

    • ๐Ÿ† Learning Path Tracker

Digital Badge

Practitioner:
YSQL Exercises - Aggregation queries

After completing this course, you will receive a digital badge.

This badge is proof that you completed this course. The skills badge validates your learning.

With a few clicks, you can easily add your digital badge to your LinkedIn profile.
Practitioner: YSQL Exercises - Aggregation queries

Frequently asked questions


  • What is the cost?

    Yugabyte University courses are FREE, so enroll today!

  • Is this course self-paced? In other words, do I decide to learn when I want and on my schedule?

    Yes, you do!

    This is a self-paced course! You can start, stop, pause, resume, and replay whenever you feel like it.

    Using the Course Player, for example, you can watch learning videos whenever you want.

    This course doesn't have any on-demand labs for hands-on exercises, but for our courses that do have labs, they are available when you want as well!

  • For this course, do I need to purchases a YugabyteDB software license?

    For this course, do I need to purchases a YugabyteDB software license? You do not need to purchase a YugabyteDB software license for this course. YugabyteDB is open source software.

    You can sign up for YugabyteDB Managed free cluster without a credit card or payment method.

  • Do I need to sign up for a YugabyteDB Managed free cluster?

    Do I need to sign up for a YugabyteDB Managed free cluster? What an interesting idea!

    Most of our courses require a YugabyteDB cluster, so an on-demand YugabyteDB Managed free cluster is a great option.

    If a course requires a YugabyteDB cluster, the course will provide two options:

    (1) a lab provides instructions for how to sign up for a YugabyteDB Managed free cluster, or...

    (2) an on-demand, lab environment that includes a YugabyteDB cluster.

  • What do I receive for completing this course?

    A big THANK YOU from the team at Yugabyte University!

    If you complete all of the courses in the learning path, you will automatically receive proof of completion and join a special group of students.

  • Sometimes I get stuck. How can I get help?

    If you get stuck, help is a literally a click away. In the Course Player header bar, select Discussions and post a question, concern, or even suggestion.

    We also have a #training channel on YugabyteDB Community Slack.

    In the Course Player, you always find instructions on how to get help in the Help lesson.

  • Will I be able to review this course?

    After completing this course, you will have the opportunity to review it!

    We highly value your feedback and suggestions. Your review and rating helps pay it forward for our future students.

  • Can I enroll in just this course?

    Yes, you can. Simply enroll and start right away. It's free and fun! For this learning path, there are seven courses with a suggested order. You can enroll in any course you want.