Home›Library›Development

Curated Library

PostgreSQL for Beginners: Setup, Queries, Constraints and Joins

A sequence of 59 short lessons (about 4 hours in total) that takes you from installing PostgreSQL to writing everyday SQL. It covers creating databases and tables, inserting and querying data, filtering, grouping, aggregates, dates, keys and constraints, joins, and UUIDs. It suits complete beginners who want a hands-on introduction to Postgres.

  • 59 lessons
  • 4h 15m total
  • Development
  • English
  • Earns YodaCoins
Lessons byAmigoscode on YouTube

Curated by YodaHut. These lessons are hosted on YouTube and produced by their original creators, who are not affiliated with YodaHut. You still earn YodaCoins, keep your streak and track progress here.

59 lessons4h 15m total
One block per lesson, sized by its length

What You'll Learn

  • Install PostgreSQL on macOS or Windows and connect with psql or a GUI client such as pgAdmin 4
  • Create databases and tables, choosing column types and applying constraints
  • Insert, update and delete records, and load sample data generated with Mockaroo
  • Filter and sort data with SELECT, WHERE, ORDER BY, DISTINCT, IN, BETWEEN and LIKE/ILIKE
  • Summarise data using GROUP BY, HAVING, MIN, MAX, AVG, SUM, arithmetic operators, ROUND, aliases, COALESCE and NULLIF
  • Use primary keys, foreign keys, unique and check constraints, then combine tables with inner and left joins
  • Work with dates and timestamps, upserts with ON CONFLICT, sequences, extensions and UUID primary keys

Prerequisites

  • No prior experience needed
  • A computer running macOS or Windows where you can install software

Course Curriculum

59 lessons · 4h 15m
  1. 01What Is a Database2:04
  2. 02What Is SQL and a Relational Database3:54
  3. 03What Is PostgreSQL (Postgres)1:40
  4. 04Downloading Postgres on macOS3:32
  5. 05Installing PostgreSQL on Windows3:21
  6. 06GUI Clients vs Terminal Clients4:06
  7. 07Setting Up psql on macOS3:43
  8. 08psql and pgAdmin 4 on Windows5:00
  9. 09Creating a Database3:24
  10. 10Connecting to Databases4:39
  11. 11A Very Dangerous Command3:28
  12. 12Creating Tables (Slides)4:14
  13. 13Creating Tables Without Constraints3:36
  14. 14Creating Tables with Constraints6:55
  15. 15INSERT INTO (Slides)3:16
  16. 16INSERT INTO in Practice3:27
  17. 17Generating 1000 Rows with Mockaroo9:57
  18. 18SELECT FROM2:55
  19. 19ORDER BY4:38
  20. 20DISTINCT2:10
  21. 21WHERE Clause and AND3:33
  22. 22Comparison Operators4:03
  23. 23IN3:02
  24. 24BETWEEN2:07
  25. 25LIKE and ILIKE5:39
  26. 26GROUP BY3:32
  27. 27GROUP BY with HAVING5:32
  28. 28Adding a New Table and Data with Mockaroo3:39
  29. 29MIN, MAX and AVG4:14
  30. 30SUM2:08
  31. 31Basics of Arithmetic Operators4:09
  32. 32Arithmetic Operators and ROUND3:45
  33. 33Aliases2:53
  34. 34COALESCE3:45
  35. 35NULLIF4:11
  36. 36Timestamps and Dates3:08
  37. 37Adding and Subtracting Dates2:44
  38. 38Extracting Fields from a Timestamp1:31
  39. 39The AGE Function2:02
  40. 40What Are Primary Keys2:02
  41. 41Understanding Primary Keys5:11
  42. 42Adding a Primary Key4:37
  43. 43Unique Constraints8:21
  44. 44Check Constraints5:34
  45. 45Deleting Records6:52
  46. 46Updating Records4:24
  47. 47ON CONFLICT DO NOTHING5:16
  48. 48Upsert5:38
  49. 49Relationships and Foreign Keys3:13
  50. 50Adding a Relationship Between Tables5:26
  51. 51Updating Foreign Key Columns4:39
  52. 52Inner Joins5:51
  53. 53Left Joins5:44
  54. 54Deleting Records with Foreign Keys6:45
  55. 55Exporting Query Results to CSV3:19
  56. 56Serial and Sequences6:40
  57. 57Extensions2:21
  58. 58Understanding the UUID Data Type6:27
  59. 59UUIDs as Primary Keys10:45

About the Instructor

Amigoscode

YouTube creator

59 lessons here 4h 15m

The lessons in this course were produced by Amigoscode and are published on YouTube. YodaHut selected and sequenced them into this course; we did not make them, and Amigoscode is not affiliated with YodaHut.

Visit the channel on YouTube

More in the Library: Development