
Why learn SQL and what are the major databases. Explains what tables, fields and rows are in the context of databases.
How to install PostgreSQL using EnterpriseDB installer
How to install PostgreSQL on Windows with pgAdmin 4 and psql tools
Get up and running with PostgreSQL 11 and pgAdmin 4 on Ubuntu.
How to install Northwind database using pgAdmin using the restore feature and northwind.tar file.
Add 3 more databases to learn from.
How to select all information from a table using simple SELECT statement.
How to return specific fields when running a SELECT statement.
If you want to find all the unique values in a specific field in table, you use the DISTINCT keyword.
Using COUNT statement to return the number of records.
How to derive information using more than one field.
Use pagila database to practice your basic SELECT.
Learn about the WHERE clause and how it is used to narrow down the number of records returned.
How to select records based on matching text fields.
How to use WHERE with numeric fields with =, >, >=, <, and <=
How to select records that have date fields.
Using AND to select records where all conditions must be true.
You can select records where any of the conditions are true using OR operator.
Reverse the meaning of operator using logical NOT operator.
Using parenthesis to create more complicated queries that combine logical operators.
Using BETWEEN to find values >= and <=.
If you have a long list of values the IN operator is easier to understand and read.
Use the usda resource to practice your WHERE clauses.
Learn what schemas are and how to use tables that are located in schemas.
Use psql command line to connect to your local database and run commands.
Remove inputing connection parameters for command line tools by using environment variables, a .pgpass file, or .pg_service.conf file.
Learn how to what databases are present and connect to them in psql.
How to list the schemas and see the tables in a schema using psql.
If you need the results to be returned in a specific order, use ORDER BY.
Find the smallest record with MIN and largest with MAX.
Use these function to find the average value or the sum of all the values.
LIKE allows you to match text patterns for partial matches.
You can change the name of a column with AS syntax.
If you only need a certain number of records use LIMIT to control.
Nulls are a special value to indicate an unknown. Learn how to use IS NULL and IS NOT NULL to select based on NULLs.
Practice using AdventureWorks database.
How to map out the tables and relationships in a database with diagrams.
How to pull information from 2 different tables in a single statement using JOIN.
Use multiple JOIN statements to pull together 3 or more tables.
Left joins allow you to pull all records from first table and any matching records from second table.
Right joins allow you to pull matching records from first table and all records from second table.
Full joins pull all records from both tables.
Connect a table back to itself.
Reduce typing with USING instead of ON in joins.
NATURAL joins combine tables where fields are named the same in each table.
Practice joins using the AdventureWorks database.
GROUP BY allows you to aggregate records and perform an aggregate function like AVG.
HAVING clause lets you filter out results of your GROUP BY results.
Use GROUPING SETS to group by multiple fields separately in a single query.
Using ROLLUP as a shortcut for complex GROUPING SET
CUBE creates all combinations of fields while grouping.
UNION allows you to combine 2 or more queries into a single result.
Use INTERSECT to find records that are in both queries.
Use EXCEPT to only bring back records from first query that are not in the second query.
Learning SQL was one of the most valuable skills I learned while building Match. We had one of the largest instances of Microsoft SQL Server in the 90s with millions of records to keep the site running. The better we got at SQL, the better we could make the site work for our users and answers sophisticated questions about our users.
I want to teach you how to use PostgreSQL. We will walk through
Basic selection statements
Joining multiple tables together
Grouping records to get aggregate data
Inserting, updating and deleting records
Creating tables and indexes
Subqueries to create sophisticated reports
Table constraints to keep data clean
Sequences to create auto incrementing fields
CTE - common table expressions that include recursive queries
Views to simply accessing complex queries
Conditional Expressions for queries
Window functions to combine regular queries with aggregate data
How to work with date, time and intervals
Create SQL Functions to capture complex statements
Create PL/pgSQL Functions that allow programming with if/then and loops
Triggers
Array data types
Composite data types
Transactions and concurrency control