Mastering the COUNT Function
Introduction
Hello and welcome to our journey through Mastering SQL Functions with Taylor Swift! In this course, we're going to embark on an engaging journey, honing our SQL skills while navigating the world of Taylor Swift's discography.
In today's lesson, we'll delve into the basics of SQL functions, with a particular focus on the COUNT function. This function serves as a convenient tool when conducting quantitative analysis of our data set, such as determining the total number of records in a table. So, let's get started!
Dataset Introduction
In case you haven't done any of our other courses using this dataset, here is a quick overview for you. Below are some sample rows to give you an idea of the structure starting from the simplest table:
Albums Table
| AlbumID | AlbumName | ReleaseDate |
|---|---|---|
| 22 | Speak Now (Deluxe Edition) | 2010-10-25 |
| 23 | Speak Now | 2010-10-25 |
| 24 | Fearless Platinum Edition | 2008-11-11 |
| 25 | Fearless | 2008-11-11 |
Albums table contains all of Taylor's albums including release dates.
Songs Table
| SongID | AlbumID | Name | TrackNumber | URI | Popularity | DurationMS |
|---|---|---|---|---|---|---|
| 0vqI4ZIMuifeKeItGiWbPj | 19 | Starlight | 15 | spotify:track:0vqI4ZIMuifeKeItGiWbPj | 40 | 217826 |
| 0vvt4IZOMkRug195S4MUq0 | 22 | If This Was A Movie | 16 | spotify:track:0vvt4IZOMkRug195S4MUq0 | 46 | 234546 |
| 0wavGRldH0AWyu2zvTz8zb | 6 | Sweet Nothing | 12 | spotify:track:0wavGRldH0AWyu2zvTz8zb | 73 | 188496 |
| 0XfOV7qY3834QpFVwOb6CC | 19 | Treacherous | 3 | spotify:track:0XfOV7qY3834QpFVwOb6CC | 41 | 240773 |
This table lists Taylor Swift's songs, linking them to their albums, and includes details about track numbers, Spotify URIs, popularity ratings, and song lengths in milliseconds.
