PRO SQL Modules
SQL Basics1h 20m • 4 lessons
Multiple Tables1h 40m • 5 lessons
Query Restructuring40m • 2 lessons
Data Transformation1h 40m • 5 lessons
Analytical SQL2h • 6 lessons
SQL SELECT

Dan Lee
Lesson Objectives
By the end of this lesson, you will:
- Understand how to retrieve data using SELECT
- Learn how to specify columns and use aliases (AS)
- Write your first SQL query using Netflix’s hit series data
🎬 Scenario: Analyzing Netflix Hit Series
You’ve just been hired as a Data Analyst at Netflix! Your first task is to extract insights on the platform’s most successful series.
Your manager, Alex, has asked:
We need a report on our top-performing series, including their ratings, genres, and total viewership. Can you retrieve this data?
To get started, take a look at the netflix_series table, which contains key details:
series_id | title | genre | release_year | seasons | rating | total_views_millions |
---|---|---|---|---|---|---|
1 | Stranger Things | Sci-Fi | 2016 | 4 | 8.7 | 140 |
2 | Squid Game | Thriller | 2021 | 1 | 8.0 | 200 |
3 | The Witcher | Fantasy | 2019 | 3 | 7.9 | 90 |
4 | Money Heist | Crime | 2017 | 5 | 8.2 | 180 |
5 | Dark | Sci-Fi | 2017 | 3 | 8.8 | 85 |
6 | Bridgerton | Drama | 2020 | 2 | 7.3 | 100 |
7 | Breaking Bad | Crime | 2008 | 5 | 9.5 | 120 |
8 | Narcos | Crime | 2015 | 3 | 8.8 | 75 |
9 | The Crown | Drama | 2016 | 5 | 8.6 | 95 |
10 | Black Mirror | Sci-Fi | 2011 | 6 | 8.8 | 110 |
1. The Basics: SELECT *
The SELECT statement is the foundation of SQL. It’s how we retrieve data from a database.
Syntax
1SELECT * FROM table_name;
Example Query
1SELECT * FROM netflix_series;
Output Example
series_id | title | genre | release_year | seasons | rating | total_views_millions |
---|---|---|---|---|---|---|
101 | Stranger Things | Sci-Fi | 2016 | 4 | 8.7 | 140 |
102 | Squid Game | Thriller | 2021 | 1 | 8.0 | 200 |
103 | The Witcher | Fantasy | 2019 | 3 | 7.9 | 90 |
104 | Money Heist | Crime | 2017 | 5 | 8.2 | 180 |
… | … | … | … | … | … | … |
What’s Happening?
- SELECT * means “Show me everything in this table.”
- While SELECT * works, in real-world data analysis, we often only need specific columns.
2. Selecting Specific Columns
Instead of retrieving all columns, you can specify which columns you need.
Syntax
1SELECT column1, column2 FROM table_name;
Example Query
1SELECT title, genre, rating FROM netflix_series;
Output Example
title | genre | rating |
---|---|---|
Stranger Things | Sci-Fi | 8.7 |
Squid Game | Thriller | 8.0 |
The Witcher | Fantasy | 7.9 |
Money Heist | Crime | 8.2 |
… | … | … |
Why is this better than SELECT *?
- Faster Execution – Only pulls needed columns, reducing unnecessary data.
- More Readable – Avoids cluttering the results with extra columns.
3. Using Aliases (AS) for Readability
Your manager wants to create a report where column names are more readable.
SQL allows you to rename columns using AS.
Syntax
1SELECT column_name AS new_name FROM table_name;
Example Query
1SELECT title AS "Show Name",
2 genre AS "Category",
3 rating AS "IMDb Score"
4FROM netflix_series;
Output Example
Show Name | Category | IMDb Score |
---|---|---|
Stranger Things | Sci-Fi | 8.7 |
Squid Game | Thriller | 8.0 |
The Witcher | Fantasy | 7.9 |
Money Heist | Crime | 8.2 |
… | … | … |
Why Use Aliases?
- Makes reports more readable for non-technical users.
- Useful when working with complex queries that involve calculations or joins.
✍️ SQL Exercises
Exercise 1: Renaming Columns for a Netflix Series Report
Your manager wants a list of Netflix series along with their release year and total viewership. However, the column names should be more readable for a company report.
Rename the columns as follows:
- title → “Series Name”
- release_year → “Years Released”
- total_views_millions → “Total Views (Millions)”
Write an SQL query to retrieve the requested data.
Expected Output:
Series Name | Years Released | Total Views (Millions) |
---|---|---|
Stranger Things | 2016 | 140 |
Squid Game | 2021 | 200 |
The Witcher | 2019 | 90 |
Money Heist | 2017 | 180 |
Dark | 2017 | 85 |
Bridgerton | 2020 | 100 |
Breaking Bad | 2008 | 120 |
Narcos | 2015 | 75 |
The Crown | 2016 | 95 |
Black Mirror | 2011 | 110 |
Write an SQL query to return the requested data.