The Complete Python/PostgreSQL Course 2.0
4.6 (252 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
2,910 students enrolled

The Complete Python/PostgreSQL Course 2.0

Take the next step in your Python development by leveraging the power of PostgreSQL and databases!
Bestseller
4.6 (252 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
2,910 students enrolled
Last updated 6/2020
English
English
Current price: $139.99 Original price: $199.99 Discount: 30% off
5 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 13.5 hours on-demand video
  • 16 articles
  • 10 downloadable resources
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • How to leverage the power of databases (in-memory, SQLite, and PostgreSQL) to upgrade your Python applications
  • Prevent common pitfalls: avoid SQL injection attacks, store database credentials securely, and optimize the performance of your applications
  • Understand how databases work and how to take advantage of their features from the ground up, by building multiple projects
  • This is a no-nonsense, no-frills course on fully mastering PostgreSQL and how to use it effective within and outside of your Python apps
  • Learn how to work with dates and times effectively in Python applications
  • Produce engaging charts, graphs, and reports using database data
Course content
Expand all 153 lectures 13:39:24
+ A Full Python Refresher
41 lectures 04:44:28

This is a short introductory video to this section. I'm really excited to guide you through this Python refresher course!

Introduction to this section
01:01

This lecture has a link to all the Python code we'll write in this section. Use it to check your code as you write it, or to refresh your memory!

Access the code for this section here
00:24

Let's look at variables in Python. Variables are just names for values, which we can reuse and reset.

Python is a dynamic typed language, which means variables don't need be constrained to a specific type.

Preview 08:26
String formatting in Python
06:26
Getting user input
05:16
Writing our first Python app
03:19

In this lecture we look at three essential data structures in Python: lists, tuples, and sets.

A list is an ordered collection of items.

A tuple is an immutable ordered collection of items.

A set is an unordered collection of unique items.

Lists, tuples and sets
06:31

In this fascinating video, we look at advanced set operations: calculating items which are in two sets, or items which are in one set but not another.

Advanced set operations
04:39
Booleans in Python
04:59

This video explores how to create programs which can change depending on some input. For example, we might ask the user if they want to continue or not.

This makes use of boolean comparisons, such as:

  • 1 == 1 (which is True)

  • 5 > 5 (which is False)

The boolean comparisons we have available in Python are many:

  • ==

  • !=

  • >, <, <=, >=

  • is

  • is not

  • in

  • not in

If statements
08:17
The "in" keyword in Python
02:02
If statements with the "in" keyword
08:18

Loops allow us to repeat things over and over. This video explores two different types of loop in Python: for loop and while loop.

Loops in Python
11:07

List comprehension is a relatively unique thing to Python.

It allows us to succinctly use a for loop inside a list to generate values. These values then end up in the list.

For example, [x for x in range(10)] generates a list [0, 1, 2, 3, 4, 5, 6, 7, 8, 9].

List comprehensions in Python
07:24

Dictionaries are an extremely useful thing in Python.

They are akin to sets, but instead of being a set of unique values, they are a set of unique keys, and each has a value associated with it.

Dictionaries
08:31
Destructuring variables
08:28

In this video, let's look at methods in Python by creating some examples. Creating methods is simple, you just need the one keyword: def.

Functions in Python
10:41
Function arguments and parameters
07:40
Default parameter values
03:54
Functions returning values
07:19
Lambda functions in Python
07:52
Dictionary comprehensions
04:01

*args and **kwargs are truly fascinatingly confusing. For eons, they have annoyed Python learners.

To this I say no more!

They're just a way of passing arguments.

Unpacking arguments
10:24
Unpacking keyword arguments
08:44

Objects are the natural progression from dictionaries. Instead of just holding data, objects hold another special type of data: methods.

A method is a function which operates on the object calling it. Thus, an object can use its own values to calculate outputs of methods. Very cool.

Object-Oriented Programming in Python
15:52
Magic methods: _str_ and _repr_
06:25

In many instances, we don't want our methods to be solely referencing the object which calls them. Sometimes, we want to reference the class of the object. Other times, we don't need either the object or the class.

@classmethod and @staticmethod are two decorators (looking at that shortly!) which extend the capabilities of methods.

@classmethod and @staticmethod
14:03

Classes in Python can also inherit from one another. This essentially means that a class contains all of the properties and methods of the class it inherits from—but with the added bonus that it can have more.

Class inheritance
08:32
Class composition
06:08
Type hinting in Python 3.5+
05:08
Imports in Python
09:33
Relative imports in Python
08:52
Errors in Python
12:47
Custom error classes
05:04

Not only we can pass values from one method to another, but we can also pass functions.

This is not used very often, but it can sometimes yield very powerful methods in very few lines of code.

First-class functions
07:52

One of the most confusing aspects of Python for learners is the concept of decorators.

These are things we can place on top of function definitions which allow us to extend the function by executing code before and after the function.

They are extremely powerful when used well!

Simple decorators in Python
07:12
The 'at' syntax for decorators
03:33
Decorating functions with parameters
02:24

In this video we look at advanced decorators in Python, which is decorators that take arguments.

This amplifies the decorator's usefulness, although also makes them slightly more contrived.

Decorators with parameters
04:50
Mutability in Python
06:03
Mutable default parameters (and why they're a bad idea)
04:27
+ Build a Programming Journal with Python & SQL
22 lectures 01:29:56
A SQLite data viewer
05:16
CREATE TABLE: new tables with SQL
04:15
How to write comments in SQL
00:27
CREATE TABLE exercises
00:32
How to connect to a SQLite database with Python
07:16
Connecting to SQLite in our app
03:23
What is a cursor?
05:11
INSERT INTO: add data to a table
04:26
INSERT INTO exercises
00:55
How to insert data into SQLite with Python
07:15
SELECT: retrieve data from a table
02:40
SELECT exercises
00:36
Retrieving results from a cursor
07:38
WHERE: search with SQL
07:03
WHERE exercises
00:36
DROP TABLE: deleting entire tables
01:38
DROP TABLE exercise
00:08
What is a SQL injection attack?
03:37
+ A Movie Watchlist App with Python & SQL
26 lectures 01:40:01
Overview of the project
02:08
Three development stages of our project
04:15
Our starting code for this project
01:25
Queries we'll need for the project to begin with
05:06
Write the database.py file
07:01
UPDATE: changing data with SQL
03:35
UPDATE exercises
00:55
Write our user menu and functions
11:45
Watched movies: second approach
01:01
DELETE FROM: removing rows with SQL
02:15
DELETE FROM exercises
00:38
Stage 2: watching movies
07:56
Relational data: primary and foreign keys
04:15
Relational data exercise
00:20
Watched movies: final approach
02:52
Stage 3: adding new watched movies
08:49
Auto-incrementing row IDs
03:41
Auto-incrementing exercise
00:34
JOIN: access two tables at once with SQL
03:16
Use JOINs to retrieve the movies a user has watched
08:52
Types of JOINs with examples
00:23
ORDER BY: sort the returned table
01:51
LIMIT: getting a certain number of rows
01:05
LIKE: flexible searching
06:50
What is an index in SQL?
04:46
Adding an index to our table for more efficient searching
04:27
+ Introduction to PostgreSQL: Migrating our App
8 lectures 41:08
SQLite vs. PostgreSQL
04:27
How to install PostgreSQL
04:47
How to run and access PostgreSQL
03:57
psycopg2 vs psycopg2-binary
11:16
How to store (and not store!) sensitive information in your code
08:21
Psycopg2 cursors and query parameters
04:55
Auto-incrementing columns: SEQUENCE and SERIAL in PostgreSQL
01:55
Our changed code, and finding differences between files
01:30
+ Building a Poll App & Advanced SQL
16 lectures 01:38:31
Overview of the project
03:06
What is ACID?
03:57
Essential queries we'll need for this project
09:38
RETURNING data from modified rows
06:34
Nested queries: getting the latest poll
06:16
SQL built-in functions
04:20
GROUP BY and calculating vote percentages
12:13
PostgreSQL window functions
05:45
PostgreSQL window functions (part 2)
05:06
How to use ORDER BY with window functions
04:14
How to use PARTITION with window functions
04:18
SQL DISTINCT and DISTINCT ON
06:33
The SQL HAVING clause
01:14
SQL VIEW: virtual tables
09:52
How to read the PostgreSQL documentation
08:10
Adding type hinting to our application
07:15
+ Working with dates and times
13 lectures 01:27:56
How to separate our database entities into models
11:23
Creating our Option model class
04:15
Changes needed in database.py
07:40
Changes needed in app.py
11:50
What is connection pooling?
03:56
How to create a connection pool with psycopg2
05:51
Reduce pooling duplication with context managers
05:03
Reduce cursor creation duplication with context managers
02:57
The Python datetime module
04:40
How to calculate new dates with timedelta
03:04
How to handle timezones with pytz
10:24
How to save dates to PostgreSQL
08:25
Add the vote date to our polling app
08:28
+ Python and Advanced PostgreSQL with psycopg2
8 lectures 44:08
Composite primary keys
02:58
User-defined functions in PostgreSQL
09:16
Composite types and sets in functions
07:46
Stored procedures in PostgreSQL
05:25
Connections vs transactions in psycopg2
03:28
Locking in PostgreSQL
08:56
Asynchronous psycopg2
01:39
SQL string composition with psycopg2
04:40
+ Charting data from our tables using matplotlib
16 lectures 01:09:59
Overview: creating graphs from poll data
02:28
How to install matplotlib
00:24
How to draw a line graph with matplotlib
04:35
Matplotlib backends
00:32
Matplotlib figures, axes, and plots
03:55
The Object-Oriented Approach with matplotlib
03:25
How to add multiple subplots to a figure
04:39
How to draw a pie chart with matplotlib
13:27
How to draw a bar chart with matplotlib
05:25
How to adjust the size of a matplotlib plot
03:25
How to adjust the x axis tick labels so they fit in the screen
05:11
How to draw a stacked bar chart with matplotlib
06:20
How to create a legend from your graphed data
02:44
How to export an image with matplotlib
07:42
How to create one document with multiple matplotlib plots
02:45
How to create a custom legend with matplotlib
03:02
Requirements
  • Foundational Python knowledge is required (a Python refresher is provided), as the course focuses on using PostgreSQL with Python
  • A Python editor or IDE, such as Visual Studio Code or PyCharm
  • You don't need to install anything more for this course, everything we do is on the cloud (although guidance to do it locally is also provided)
Description

Master PostgreSQL and use it in your Python apps with this course!

Python and PostgreSQL are two of the most in-demand skills in the world. After completing this course, you'll be confident in adding both to your resume/CV.

In addition, all the database knowledge you'll gain in this course is easily transferable to other databases such as MySQL, Microsoft SQL Server, Amazon Redshift, Oracle, and others!

The focus of this course is on fully understanding PostgreSQL, and effectively integrating it with your Python applications. If you're a Python developer or you use Python at all, you're going to love this course!

You will:

  • Add data storage to your Python apps with in-memory databases, SQLite, and PostgreSQL.

  • Understand when and why you might want to use different types of databases in your applications.

  • Build a programming journal project to learn how to add a SQLite database to your application.

  • Create a movie watch-list app to explore how to improve your database design over time, as well as how to model different types of relationships.

  • Migrate the movie watch-list app to PostgreSQL to identify the differences between PostgreSQL and SQLite.

  • Build a polling app to learn about advanced data analysis with GROUP BY, PostgreSQL window functions, and nested queries.

  • Extend the polling app to work with dates and times, including how to avoid common timezone pitfalls.

  • Learn how to structure Python apps professionally, to make development easy when working with databases.

  • Explore advanced SQL and PostgreSQL concepts such as user-defined functions, stored procedures, locking, and async database connections with Python.

  • Take all your knowledge and apply it to produce data analysis reports and charts using matplotlib.

As you can see, there's a lot to do!

But this course is a no-nonsense, no-frills course. Every lecture has been planned, crafted, and edited to be perfectly concise and to the point. That way, you can take the most from this course, quickly and easily.

Throughout the course, we have animated diagrams to explain database concepts, as well as code-along videos when we're working with Python. But you won't just be watching me code! I've carefully planned and mapped out every project and feature we add, and I encourage you to try them on your own first, before following along with me!

Also, throughout the course I provide data sets with challenges and exercises for you to practice what you've learned.

I've been teaching and helping students online for over 7 years, and this course is the culmination of my teaching experience. I know how to help you understand concepts fully and quickly, in the best way for you.

Upon completing this course you'll be able to easily extend your Python applications with database functionality. You'll know how to answer questions using data, and you'll definitely be able to list PostgreSQL as one of your strongest skills.

I'll see you on the inside!

Check out the free preview videos for more information and to try out the course!

Who this course is for:
  • Beginner Python developers who want to take the next step in upgrading their applications by leveraging the power of databases.
  • Any Python developer who is not familiar with databases and wants to fully understand their choices before using one in their applications
  • Business analysis and data scientists who want to create larger applications or interact with larger data sets through a database