Get Started With PostgreSQL

41 minutes

It’s amazing how much you can accomplish with a basic knowledge of SQL. In this course we’ll learn how to store lots of information (many millions of things!) and answer nearly any question we might have about that information (on the order of milliseconds!)

We’ll learn enough to make you say you “know SQL” -- table creation, inserts, selects, updates, deletes, aggregations, indexes, joins, and constraints. Along the way we’ll model real world problems so that you can see just how powerful SQL will make you!

If you’re interested in the Postgres client that is used in this course you can download it here to check it out and follow along.

pro-course-rss-logo

PRO RSS Feed

Create a Postgres Table

P

Insert Data into Postgres Tables

P

Filter Data in a Postgres Table with Query Statements

P

Update Data in Postgres

P

Delete Postgres Records

P

Group and Aggregate Data in Postgres

P

Sort Postgres Tables

P

Ensure Uniqueness in Postgres

P

Use Foreign Keys to Ensure Data Integrity in Postgres

P

Create Foreign Keys Across Multiple Fields in Postgres

P

Enforce Custom Logic with Check Constraints in Postgres

P

Speed Up Postgres Queries with Indexes

P

Find Intersecting Data with Postgres’ Inner Join

P

Select Distinct Data in Postgres

P
postgres tutorial about Create a Postgres Table

Create a Postgres Table

1:45 postgres PRO

Learn how to create a table using the most widely-used data types (serial, varchar, integer, float, boolean, and date), and the most necessary constraints (NOT NULL and primary key).

postgres tutorial about Insert Data into Postgres Tables

Insert Data into Postgres Tables

4:24 postgres PRO

Learn how to insert one record, two records, a million records! We’ll also explore some edge cases, like where not all data is known at the time of insertion.

postgres tutorial about Filter Data in a Postgres Table with Query Statements

Filter Data in a Postgres Table with Query Statements

3:35 postgres PRO

We have all this data, but how do we answer questions about it? In this lesson we’ll learn how to filter down to just the information we’re looking for.

postgres tutorial about Update Data in Postgres

Update Data in Postgres

1:55 postgres PRO

Data changes. In some applications, it changes all the time! In this lesson we’ll learn how to update a single record or many at once.

postgres tutorial about Delete Postgres Records

Delete Postgres Records

2:43 postgres PRO

What if you no longer need some information? Perhaps your tables are very large and you need to clean up your table to speed it up. This lesson will teach us how to delete data from our database.

postgres tutorial about Group and Aggregate Data in Postgres

Group and Aggregate Data in Postgres

6:45 postgres PRO

How can we see a histogram of movies on IMDB with a particular rating? Or how much movies grossed at the box office each month? Or how many movies there are of each genre? These are examples of data aggregation questions, and this lesson will teach us how to answer them.

postgres tutorial about Sort Postgres Tables

Sort Postgres Tables

1:20 postgres PRO

How do I see a list of my Facebook friends sorted by the number of friends they have, and then sorted alphabetically to break ties? Sorting data helps us to answer important business questions. In this lesson, we’ll learn how to do it in Postgres.

postgres tutorial about Ensure Uniqueness in Postgres

Ensure Uniqueness in Postgres

3:53 postgres PRO

Let’s say we have a bank. Our bank wants to give each account for each user a unique name, for instance, “Personal” or “Checking.” How can we make sure each account has a unique name for each user?

postgres tutorial about Use Foreign Keys to Ensure Data Integrity in Postgres

Use Foreign Keys to Ensure Data Integrity in Postgres

2:18 postgres PRO

Every movie needs a director and every rented movie needs to exist in the store. How do we make sure something in another table exists before inserting new data? This lesson will teach us about foreign keys and references.

postgres tutorial about Create Foreign Keys Across Multiple Fields in Postgres

Create Foreign Keys Across Multiple Fields in Postgres

3:08 postgres PRO

What if your foreign keys are more complex than a single field? Postgres lets you enforce foreign key constraints across multiple fields with a similar syntax to defining complex primary keys.

postgres tutorial about Enforce Custom Logic with Check Constraints in Postgres

Enforce Custom Logic with Check Constraints in Postgres

2:07 postgres PRO

What if your tables need custom constraints? A movie should only receive 1-5 stars, never 0 or 6. Price after tax should always equal the sum of the price plus tax. Check constraints help you enforce your own custom logic.

postgres tutorial about Speed Up Postgres Queries with Indexes

Speed Up Postgres Queries with Indexes

2:33 postgres PRO

The more data you add, the longer it will take to answer new questions you pose to your database. That’s because so far, Postgres has been scanning through the table looking at every row to see if it meets the constraint. We can speed this process up substantially by adding indexes.

postgres tutorial about Find Intersecting Data with Postgres’ Inner Join

Find Intersecting Data with Postgres’ Inner Join

4:26 postgres PRO

You have a table of movies and a table of directors; how can you see which director created each movie? An inner join will link related records so that you can answer questions like these. Inner joins are the most commonly used SQL join, because they only return data that is common in both tables.

postgres tutorial about Select Distinct Data in Postgres

Select Distinct Data in Postgres

0:52 postgres PRO

How many users visited our site yesterday? We can find out by looking at each visit, and limiting this list to a distinct list of users (who may have visited many times). In this lesson we’ll learn how to answer questions like these with the distinct keyword.

Presented by:

Brett Cassette

Brett is a comedian and writer who has heard of, but never truly experienced, programming

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?