Interactive Course

Intermediate SQL

Master the complex SQL queries necessary to answer a wide variety of data science questions and prepare robust data sets for analysis in PostgreSQL.

  • 4 hours
  • 15 Videos
  • 55 Exercises
  • 16,514 Participants
  • 4,700 XP

Loved by learners at thousands of top companies:

mercedes-grey.svg
lego-grey.svg
intel-grey.svg
mls-grey.svg
whole-foods-grey.svg
ea-grey.svg

Course Description

So you've learned how to aggregate and join data from tables in your database — now what? How do you manipulate, transform, and make the most sense of your data? This intermediate-level course will teach you several key functions necessary to wrangle, filter, and categorize information in a relational database, expand your SQL toolkit, and answer complex questions. You will learn the robust use of CASE statements, subqueries, and window functions — all while discovering some interesting facts about soccer using the European Soccer Database. Let's score some goals with SQL!

  1. 1

    We'll take the CASE

    Free

    In this chapter, you will learn how to use the CASE WHEN statement to create categorical variables, aggregate data into a single column with multiple filtering conditions, and to calculate counts/percentages.

  2. Correlated Queries, Nested Queries, and Common Table Expressions

    In the chapter, you will learn how to use nested and correlated subqueries to extract more complex data from a relational database. You will also learn about common table expressions, and how to best construct queries using multiple common table expressions.

  1. 1

    We'll take the CASE

    Free

    In this chapter, you will learn how to use the CASE WHEN statement to create categorical variables, aggregate data into a single column with multiple filtering conditions, and to calculate counts/percentages.

  2. Short and Simple Subqueries

    In this chapter, you will learn about subqueries in the SELECT, FROM, and WHERE clauses. You will gain an understanding of when subqueries are necessary to construct your data set, and where to best include them in your queries.

  3. Correlated Queries, Nested Queries, and Common Table Expressions

    In the chapter, you will learn how to use nested and correlated subqueries to extract more complex data from a relational database. You will also learn about common table expressions, and how to best construct queries using multiple common table expressions.

  4. Window Functions

    In chapter 4, you will learn about window functions and how to pass aggregate functions along a data set. You will also learn how to calculate running totals and partitioned averages.

What do other learners have to say?

Devon

“I've used other sites, but DataCamp's been the one that I've stuck with.”

Devon Edwards Joseph

Lloyd's Banking Group

Louis

“DataCamp is the top resource I recommend for learning data science.”

Louis Maiden

Harvard Business School

Ronbowers

“DataCamp is by far my favorite website to learn from.”

Ronald Bowers

Decision Science Analytics @ USAA

Mona Khalil
Mona Khalil

Curriculum Lead at DataCamp

As a data scientist at Greenhouse, Mona answers questions related to how the hiring process can be improved to find better candidates quicker and reduce bias in the hiring process. They previously worked in education, marketing, and local government. They also co-host Bad Methods, a podcast that brings a fun and interesting lens to critically evaluating science. You can find them on twitter at mona_kay_.

See More
Collaborators
  • Hillary Green-Lerman

    Hillary Green-Lerman

  • Sumedh Panchadhar

    Sumedh Panchadhar

Prerequisites
Icon Icon Icon professional info