Mô tả

Database structure design?  It's here.  Query tuning and optimization? You'll master it.  Complex queries? Yes indeed!

This is the only course online that will teach you how to design a database, store complex data, optimize your queries, everything that is needed for operating a production, scalable database!

Every app in the world, whether it is a mobile app built with Flutter, a web app constructed with React, or a plain HTML page, needs to store information in a database.  Although there are many different databases you can use, PostgreSQL has been a number-one pick for decades, offering scalable performance, rock-solid uptime, and flexible design systems.  This course will teach you everything you need to know about PostgreSQL to use it on your next big project!

Don't know anything about databases at all? No problem. We begin with an overview of SQL, the language used to interact with PostgreSQL. Through an incredible number of exercises, you'll get practical, hands on experience working with realistic datasets.  You will understand how to store, fetch, and update information with a series of powerful commands. 

After gaining experience with elementary operations, you will move on to understanding database design patterns, offering multiple ways to structure your database for efficient data modeling. You'll see many different scenarios with different types of data, and understand the pros and cons to several approaches.

This course is packed with practice exercises and quizzes. You'll get immediate practice on all of the different topics and features that you learn!  In addition, you'll understand exactly where to use each of these features in real and practical projects.

Besides getting practical hands-on experience, you'll also get a behind-the-scenes look at how PostgreSQL works internally. We'll dive into raw data files, investigating how PostgreSQL stores information on your hard drive bit by bit.  This knowledge is invaluable when it comes time to start tuning your queries for performance.  By having a natural instinct of how PostgreSQL works, you can plan on being able to get every last bit of performance out of your database.

Here is a partial list of some of the topics that are covered in this course:

  • Apply powerful SQL commands to store, update, and retrieve information

  • Build relationships between records using foreign keys between tables

  • Understand PostgreSQL's numerous data types, and when to use each

  • Assemble reports of business data by using aggregation pipelines

  • Work with millions of records to simulate real production queries

  • Exercise your query logic skills through the use of sets and sorting operators

  • Compose queries out of smaller reusable units using subqueries

  • Use different design patterns to efficiently model your data

  • See how to divide database objects into different schemas to maintain them more easily

  • Validate your data using simple 'check' rules

  • Construct perfect designs for common features such as 'like', 'follow', and 'tag' systems

  • Speed up your queries with indexes - you'll see exactly how they work behind the scenes!

  • Dive into some of the most complex queries around with recursive common table expressions

  • Deal with concurrency issues easily by applying transactions

I made this course to be the perfect resource for engineers just getting started with their first database.  Master the database itself, and see how to apply it with real designs.  Sign up today and master PostgreSQL!

Bạn sẽ học được gì

Master the fundamentals of relational databases

Acquire the skills necessary to obtain a database administrator (DBA) or database developer job

Design fast and efficient databases using the latest technologies

Practice your skills with many quizzes, projects, and built-in exercises

Learn and apply multiple database design patterns

Optimize queries for superb read and write efficiency

Understand how PostgreSQL stores information at the hardware level

Connect PostgreSQL to front-end apps using an API

Build common app features, such as a 'like' and 'mention' systems

Handle complex concurrency issues and race conditions

Advance your database designs using schema migrations

See how to use PostgreSQL to speed up automated tests

Yêu cầu

  • A Mac, PC, or Linux-based Computer

Nội dung khoá học

37 sections

Simple - But Powerful - SQL Statements

15 lectures
Join Our Community!
00:07
Course Resources
00:38
What is PostgreSQL All About?
04:12
Database Design
05:11
Database Terminology
3 questions
Creating Tables
04:42
Analyzing CREATE TABLE
03:30
Inserting Data Into a Table
04:49
Retrieving Data with Select
02:07
Create, Insert, and Select!
1 question
Calculated Columns
04:37
Calculating Phone Revenue
00:58
Using Calculated Columns
1 question
Exercise Solution
01:03
String Operators and Functions
06:17

Filtering Records

18 lectures
Filtering Rows with "Where"
03:49
More on the "Where" Keyword
02:30
Compound "Where" Clauses
05:24
A "Where" Exercise Overview
00:37
Practicing Where Statements
1 question
A "Where" Solution
00:56
"Where" With Lists
00:37
A More Challenging 'Where'
1 question
A "Where" With Lists Solution
01:42
Calculations in "Where" Clauses
02:05
Trying Calculations in Where Clauses
1 question
Solving Calculations
01:51
Updating Rows
04:16
Deleting Rows
03:16
Try Updating Records In a Table!
1 question
A Solution for Updating Rows
01:29
Practice Deleting Records
1 question
Solution for Deleting Rows
01:17

Working with Tables

23 lectures
The Plan Moving Forward
01:43
Approaching Database Design
07:28
Let's Design Some Schema
2 questions
One-to-Many and Many-to-One Relationships
06:33
A 'Has One' or 'Has Many'?
4 questions
One-to-One and Many-to-Many Relationships
05:41
Identifying One-to-One and Many-to-Many Relationships
3 questions
Primary Keys and Foreign Keys
05:29
Understanding Foreign Keys
08:19
Foreign Keys; How Do They Work?
4 questions
Auto-Generated ID's
05:47
Creating Foreign Key Columns
04:38
Running Queries on Associated Data
06:48
Exercise Overview
02:07
Creating and Using Foreign Keys
1 question
Foreign Key Creation Solution
02:09
Foreign Key Constraints Around Insertion
05:35
Constraints Around Deletion
05:00
Commands You’ll Need for the Next Video
00:22
Testing Deletion Constraints
04:37
Setting Foreign Keys to Null on Delete
02:58
What Happens On Delete?
2 questions
Adding Some Complexity
02:56

Relating Records with Joins

22 lectures
Adding Some Data
03:56
Queries with Joins and Aggregations
03:23
Joining Data from Different Tables
07:38
Another Quick Join
02:22
Exercise Overview
01:13
Practice Joining Data
1 question
A Joinful Solution
01:42
Alternate Forms of Syntax
05:51
Missing Data in Joins
06:16
Why Wasn't It Included
02:22
Four Kinds of Joins
09:25
Each Join in Practice
04:14
Does Order Matter?
04:11
Test Your Joining Knowledge
5 questions
Exercise Overview
00:55
Joins, Joins, Join!
1 question
Two Possible Solutions
02:59
Where with Join
06:44
Three Way Joins
08:29
A Bit of Practice
04:58
Three Way Exercise
1 question
Exercise Solution
02:52

Aggregation of Records

19 lectures
Aggregating and Grouping
02:10
Picturing Group By
05:29
Selecting Columns After Grouping
2 questions
Aggregate Functions
02:59
Combining Group By and Aggregates
04:47
A Gotcha with Count
02:35
Visualizing More Grouping
03:10
Exercise Overview
00:39
Practice For Grouping and Aggregating
1 question
Grouping Solution
01:20
Adding a Layer of Difficulty
00:42
Grouping With a Join!
1 question
Solution
01:27
Filtering Groups with Having
04:43
Having In Action
02:35
More on Having!
06:47
A Having Exercise Overview
03:36
Practice Yourself Some Having
1 question
A Quick Solution
02:32

Working with Large Datasets

8 lectures
A New Dataset
10:22
Investigating This Dataset
02:34
Some Group By Practice
01:20
Group By Review
1 question
Group By Review Solution
02:25
Remember Joins?
02:13
Inner Join Review
1 question
Of Course You Remember!
01:25

Sorting Records

6 lectures
The Basics of Sorting
02:14
Two Variations on Sorting
02:40
Offset and Limit
06:38
Exercise Overview
00:25
Sorting, Offsetting, and Limiting
1 question
Exercise Solution
01:20

Unions and Intersections with Sets

7 lectures
Handling Sets with Union
05:43
A Few Notes on Union
03:45
Commonalities with Intersect
03:23
Removing Commonalities with Except
05:49
Union Exercise Overview
01:26
Merging Results with Union
1 question
Exercise Solution
01:27

Assembling Queries with SubQueries

32 lectures
What's a Subquery?
05:48
Thinking About the Structure of Data
04:46
What's the Data Look Like?
4 questions
Subqueries in a Select
05:41
Exercise Overview
01:05
Embedding in Select
1 question
Select Solution
01:18
Subqueries in a From
07:58
From Subqueries that Return a Value
02:45
Example of a Subquery in a From
08:56
Exercise Overview
01:15
Subquery From's
1 question
Exercise Solution
01:59
Subqueries in a Join Clause
04:52
More Useful - Subqueries with Where
08:11
Data Structure with Where Subqueries
05:35
Exercise Overview
00:57
Subquery Where's
1 question
Exercise Solution
02:05
The Not In Operator with a List
04:09
A New Where Operator
06:20
Finally Some!
05:21
Is It A Valid Subquery?
3 questions
Exercise Overview
00:27
Practice Your Subqueries!
1 question
A Quick Solution
01:33
Probably Too Much About Correlated Subqueries
16:39
More on Correlated Subqueries
08:53
A Select Without a From?
03:28
Exercise Overview
00:45
From-less Selects
1 question
Exercise Solution
01:19

Selecting Distinct Records

4 lectures
Selecting Distinct Values
04:14
Exercise Overview
00:29
Some Practice with Distinct
1 question
A Distinct Solution
00:40

Utility Operators, Keywords, and Functions

3 lectures
The Greatest Value in a List
03:20
And the Least Value in a List!
02:01
The Case Keyword
04:13

Local PostgreSQL Installation

3 lectures
PostgreSQL Installation on macOS
05:47
pgAdmin Setup on macOS
04:56
Postgres installation on Windows
03:55

PostgreSQL Complex Datatypes

8 lectures
What'd We Just Do?
04:02
Data Types
04:09
Fast Rules on Numeric Data Types
02:01
More on Number Data Types
09:19
Reminder on Character Types
04:42
Boolean Data Types
02:28
Times, Dates, and Timestamps
05:30
Really Awesome Intervals
05:44

Database-Side Validation and Constraints

13 lectures
Thinking About Validation
04:12
Creating and Viewing Tables in PGAdmin
07:19
Applying a Null Constraint
06:24
Solving a Gotcha with Null Constraints
04:09
Creating NULL Constraints
1 question
Default Column Values
03:13
Applying a Unique Constraint to One column
05:35
Multi-Column Uniqueness
03:40
Is It Unique?
1 question
Adding a Validation Check
03:58
Checks Over Multiple Columns
05:04
Does It Pass a Check?
1 question
So Where Are We Applying Validation?
05:46

Database Structure Design Patterns

5 lectures
Approaching More Complicated Designs
03:13
Using a SQL Design Tool
06:06
A Config-based Schema Designer
07:02
Here's the Plan
02:15
Rebuilding Some Schema
06:54

How to Build a 'Like' System

10 lectures
Requirements of a Like System
04:35
How Not to Design a Like System
02:58
Designing a Like System
05:04
Building a Similar System
1 question
Making a Reaction System Instead
01:34
Polymorphic Associations
05:58
Polymorphic Association Alternative Implementation
06:56
The Simplest Alternative
03:39
Polymorphic Associations
2 questions
So Which Approach?
04:21

How to Build a 'Mention' System

5 lectures
Additional Features Around Posts
06:10
Adding Captions and Locations
01:39
Photo Mentions vs Caption Mentions
07:27
Considerations on Photo Tags vs Caption Tags
07:08
Update For Tags
05:01

How to Build a 'Hashtag' System

5 lectures
Designing a Hashtag System
07:33
Tables for Hashtags
03:36
Including the Hashtag Table
04:06
A Few More User Columns
06:01
Why No Number of Followers or Posts?
03:44

How to Design a 'Follower' System

1 lectures
Designing a Follower System
05:50

Implementing Database Design Patterns

7 lectures
Back to Postgres
01:45
Creating Tables with Checks
13:00
Posts Creation
08:31
Comments Creation
02:16
Likes Creation
06:52
Photo Tags and Caption Tags
05:28
Creating Hashtags, Hashtag Posts, and Followers
06:27

Approaching and Writing Complex Queries

9 lectures
Quick Note About Adding Some Data
00:38
Adding Some Data
04:06
Restoring from Scratch
04:24
Highest User ID's Exercise
01:41
Solution for User ID's
01:09
Posts by a Particular User
01:05
Solving for Posts by User
01:56
Likes Per User
00:50
Solution for Likes Per User
01:41

Understanding the Internals of PostgreSQL

6 lectures
Thinking About Performance
02:02
Where Does Postgres Store Data?
05:51
Heaps, Blocks, and Tuples
03:36
Terminology Check
4 questions
Block Data Layout
04:20
Heap File Layout
31:52

A Look at Indexes for Performance

10 lectures
Full Table Scans
04:08
What's an Index
02:23
How an Index Works
07:58
Creating an Index
03:58
Benchmarking Queries
05:27
Downsides of Indexes
05:09
Index Types
01:35
Automatically Generated Indexes
03:37
Using Automatically Created Indexes
1 question
Behind the Scenes of Indexes
31:55

Basic Query Tuning

4 lectures
The Query Processing Pipeline
04:57
Explain and Explain Analyze
05:25
Explain Vs Explain Analyze
1 question
Solving an Explain Mystery
08:58

Advanced Query Tuning

7 lectures
Developing an Intuitive Understanding of Cost
11:57
Calculating Cost by Hand
06:20
A Touch More on Costs
07:17
Calculating Costs
2 questions
Startup vs Total Costs
05:34
Costs Flow Up
01:48
Use My Index!
07:55

Simple Common Table Expressions

3 lectures
Common Table Expressions
01:52
A Quick Solution
03:52
So What's a CTE?
03:49

Recursive Common Table Expressions

5 lectures
Recursive CTE's
03:18
Recursive CTE's Step by Step
10:21
Why Use Recursive CTE's?
04:33
Writing the Query
08:02
Walking Through Recursion
09:47

Simplifying Queries with Views

5 lectures
Most Popular Users
06:16
A Possible Solution for Merging Tables
03:51
Creating a View
05:36
When to Use a View?
03:19
Deleting and Changing Views
02:26

Optimizing Queries with Materialized Views

6 lectures
Materialized Views
02:18
Grouping by Week
04:08
Reminder on Left Joins
04:29
Writing a Slow Query
09:18
Creating and Refreshing Materialized Views
06:37
Views vs Materialized Views
2 questions

Handling Concurrency and Reversibility with Transactions

5 lectures
What are Transactions Used For?
04:03
Some Sample Data
01:59
Opening and Closing Transactions
09:44
Transaction Cleanup on Crash
04:03
Closing Aborted Transactions
01:45

Managing Database Design with Schema Migrations

9 lectures
A Story on Migrations
17:13
Migration Files
05:00
Issues Solved by Migrations
02:51
A Few Notes on Migrations Libraries
04:38
A Note About Node Installation
00:06
Project Creation
02:52
Generating and Writing Migrations
07:11
Applying and Reverting Migrations
07:15
Generating and Applying a Second Migration
03:37

Schema vs Data Migrations

13 lectures
Schema vs Data Migrations
04:08
Dangers Around Data Migrations
09:06
Properly Running Data and Schema Migrations
05:28
Creating a Posts Table
04:39
A Small Web Server
14:52
Web Server Setup Instructions
00:38
Adding the Loc Column
04:10
Writing Values to Both Columns
04:12
Transaction Locks
13:39
Updating Values
04:19
Migrations Setup Instructions
00:29
Updating the App Server
04:13
Dropping the Last Columns
03:01

Accessing PostgreSQL From API's

7 lectures
Section Goal
00:52
Initial Setup
01:34
One Fast Migration
05:01
Building the Users Router
04:53
Understanding Connection Pools
06:31
Validating Connection Credentials
06:56
Query and Close
01:57

Data Access Pattern - Repositories

6 lectures
The Repository Pattern
03:38
Creating a Repository
08:20
Accessing the API
03:51
Casing Issues
04:21
Fixing Casing
06:33
Finding Particular Users
05:26

Security Around PostgreSQL

7 lectures
SQL Injection Exploits
06:40
Handling SQL Injection with Prepared Statements
07:48
Preventing SQL Injection
07:32
Reminder on Post Requests
02:51
Inserting Users
04:13
Handling Updates
04:36
And, Finally, Delete
04:05

Fast Parallel Testing

17 lectures
A Note on Testing
02:47
Assertions Around User Count
07:04
Connecting to a DB For Tests
05:01
Disconnecting After Tests
02:45
Multi-DB Setup
04:40
Assumptions Around Content
04:44
Issues with Parallel Tests
04:48
Isolation with Schemas
04:09
Creating and Accessing Schemas
05:21
Controlling Schema Access with Search Paths
05:47
Routing Schema Access
04:02
Strategy for Isolation
04:42
Programmatic Schema Creation
11:44
Escaping Identifiers
04:20
Test Helpers
05:18
Cleaning up Schemas and Roles
05:56
Finally... Parallel Tests! (Final Lecture)
03:32

Bonus!

1 lectures
Bonus!
00:33

Đánh giá của học viên

Chưa có đánh giá
Course Rating
5
0%
4
0%
3
0%
2
0%
1
0%

Bình luận khách hàng

Viết Bình Luận

Bạn đánh giá khoá học này thế nào?

image

Đăng ký get khoá học Udemy - Unica - Gitiho giá chỉ 50k!

Get khoá học giá rẻ ngay trước khi bị fix.