


I have written another story comparing WHERE and HAVING in SQL in case you want to learn more. For example, they can be used in a HAVING clause, but that is beyond the scope of this lesson. These aggregators may also be used elsewhere in queries.

#Macbook growly notes table sum how to#
In this lesson I will teach you how to use the aggregating keywords MIN, MAX, COUNT, SUM and AVG in the SELECT statement. I got the data for this table from the Spice Girls discography Wikipedia page, the Spice(album) Wikipedia page, Spice World(album) Wikipedia page, Forever(Spice Girls Album) and on an Australian charts website.

I didn’t include the greatest hits album because I thought that would confuse matters. The table contains the length of each track, when each single was released, what position the song peaked at in the Australian charts and how many weeks the song was in the Australian charts. This dataset contains information on all the tracks in each album that the Spice Girls released. Using Australian charts data for the singles released from each Spice Girls album, I think I can prove the first one rules! The data Just in case people don’t believe me, I want to find some data to back it up. I think that the first Spice Girls album is the best one. understand how aliases work and how to use the AS keyword to create them.know how NULL values will be handled in each of the above methods.use the keyword GROUP BY to group by a column in a table.use the keyword SUM to find the total of a numerical column when all the values are added together.use the keyword AVG to find the mean of a numerical column.use the keyword COUNT to count the number of rows in a column or table.use the keyword MAX to find the maximum value in a column.use the keyword MIN to find the minimum value in a column.This is one that was on high rotation in my house growing up. We will use data on the first Spice Girls album titled Spice. So what better example to use in this lesson than the Spice Girls to celebrate a bit of girl power. It just so happens that all of the friends I am teaching data science to, whilst self-isolating are women. So we will learn how to deal with them in our datasets. This will also be the first lesson that we have encountered NULL values. We will also practice using the COUNT, AVG and SUM keywords in a similar manner. We will learn how to use the keywords MIN and MAX to find the minimum and maximum of our data respectively. Now that we know how to filter data, we will move onto aggregation. In addition, we explored the use of the keywords IN, AND, OR, LIKE, BETWEEN and NOT. Using one of my favourite shows, Charmed for example data, we went through using WHERE clauses in queries. Last week, we covered filtering data using SQL. Otherwise, get stuck into this lesson on grouping and aggregating data using SQL. All of the lessons can also be found here. If you would like to start at the beginning here is a link to the first lesson. We are powering through learning SQL, with three lessons under our belt already. I have been so enjoying engaging with my friends to share my love of data science. Photo by Kiana Bosman on Unsplash Introduction
