paid course

Joining Data in PostgreSQL

Join two or three tables together into one, combine tables using set theory, and work with subqueries in PostgreSQL

  • 5 hours
  • 13 Videos
  • 53 Exercises
  • 40,465 Participants
  • 4,400 XP

Course Description

Now that you've learned the basics of SQL in our Intro to SQL for Data Science course, it's time to supercharge your queries using joins and relational set theory! In this course you'll learn all about the power of joining tables while exploring interesting features of countries and their cities throughout the world. You will master inner and outer joins, as well as self-joins, semi-joins, anti-joins and cross joins - fundamental tools in any PostgreSQL wizard's toolbox. You'll fear set theory no more, after learning all about unions, intersections, and except clauses through easy-to-understand diagrams and examples. Lastly, you'll be introduced to the challenging topic of subqueries. You will see a visual perspective to grasp the ideas throughout the course using the mediums of Venn diagrams and other linking illustrations.

Join two or three tables together into one, combine tables using set theory, and work with subqueries in PostgreSQL

Course Outline

  1. 1

    Introduction to joins

    Free

    In this chapter, you'll be introduced to the concept of joining tables, and explore the different ways you can enrich your queries using inner joins and self-joins. You'll also see how to use the case statement to split up a field into different categories.

  2. Set theory clauses

    In this chapter, you'll learn more about set theory using Venn diagrams and you will be introduced to union, union all, intersect, and except clauses. You'll finish by investigating semi-joins and anti-joins, which provide a nice introduction to subqueries.

  1. 1

    Introduction to joins

    Free

    In this chapter, you'll be introduced to the concept of joining tables, and explore the different ways you can enrich your queries using inner joins and self-joins. You'll also see how to use the case statement to split up a field into different categories.

  2. Outer joins and cross joins

    In this chapter, you'll come to grips with different kinds of outer joins. You'll learn how to gain further insights into your data through left joins, right joins, and full joins. In addition to outer joins, you'll also work with cross joins.

  3. Set theory clauses

    In this chapter, you'll learn more about set theory using Venn diagrams and you will be introduced to union, union all, intersect, and except clauses. You'll finish by investigating semi-joins and anti-joins, which provide a nice introduction to subqueries.

  4. Subqueries

    In this closing chapter, you'll learn how to use nested queries to add some finesse to your data insights. You'll also wrap all of the content covered throughout this course into solving three challenge problems.

Chester Ismay
Chester Ismay

Senior Curriculum Lead at DataCamp

Chester builds (and helps instructors build) R, Python, SQL, and Spreadsheets courses for DataCamp. He obtained a PhD in Statistics from Arizona State University and has taught courses and led workshops in mathematics, computer science, statistics, data science, and sociology. He is co-author of the fivethirtyeight R package and author of the thesisdown R package. He is also a co-author of ModernDive, an open-source textbook for introductory statistics and data science students using R.

See More

Course Instructor

Chester Ismay
Chester Ismay

Senior Curriculum Lead at DataCamp

Chester builds (and helps instructors build) R, Python, SQL, and Spreadsheets courses for DataCamp. He obtained a PhD in Statistics from Arizona State University and has taught courses and led workshops in mathematics, computer science, statistics, data science, and sociology. He is co-author of the fivethirtyeight R package and author of the thesisdown R package. He is also a co-author of ModernDive, an open-source textbook for introductory statistics and data science students using R.

See More
Collaborator(s)
  • Colin Ricardo

    Colin Ricardo

  • Filip Schouwenaars

    Filip Schouwenaars

Join over 3,210,000 others learning to leverage the power of data with DataCamp!

Start Course For Free
Icon Icon Icon professional Icon info