Conditional Aggregates

Learn about conditional aggregates, a way to use aggregate functions based on a given set of conditions.

Start[missing "en.views.course_landing_page.sql-table-transformation.course_illustration" translation]
Conditional Aggregates
Lesson 1 of 1
  1. 1

    Aggregate functions compute a single result from a set of multiple input values. You can think of aggregate data as data collected from multiple rows at a time. In this lesson, we'll continue l...

  2. 2

    While working with databases, it's common to have empty or unknown "cells" in data tables. For example, in our first [...] table, we keep track of when flights arrive in a column called [...] : ...

  3. 3

    Almost every programming language has a way to represent "if, then, else", or conditional logic. In SQL, we represent this logic with the [...] statement, as follows: [...] In the above state...

  4. 4

    Sometimes you want to look at an entire result set, but want to implement conditions on certain aggregates. For instance, maybe you want to identify the total amount of airports as well as the to...

  5. 5

    We can do that same thing for other aggregates like [...] . For instance, if we wanted to sum the total flight distance and compare that to the sum of flight distance from a particular airline (in...

  6. 6

    Oftentimes we'd like to combine aggregates, to create percentages or ratios. In the instance of the last query, we might want to find out the percent of flight distance that is from United by ori...

  7. 7

    Modify the previous elevation example to find the percentage of high elevation airports [...] by state.

  8. 8

    Congratulations! You just learned about Conditional Aggregates in SQL. What can we generalize so far? *Conditional Aggregates are aggregate functions the compute a result set based on a give...

Conditional Aggregates

Start[missing "en.views.course_landing_page.sql-table-transformation.course_illustration" translation]