Code24Lab
Databases & SQL Beginner

PostgreSQL Foundations: Tables, Data Types & Queries

Work through a fictional bike-rental database in PostgreSQL: psql, data types, identity columns, numeric, dates, :: casts, constraints, INSERT/UPDATE/DELETE, NULL, GROUP BY, generate_series and transactions, with every answer checked as you go.

22 lessons 22 labs Certificate

  • One-time payment
  • Instant access right after payment
  • Secure checkout with Stripe

About this course

PostgreSQL Foundations teaches you to read and predict real PostgreSQL. You work with the fictional bike-rental company Velora Bikes and in every lab you play the database server: you work out what a query returns, which INSERT a constraint rejects and what is finally stored. You learn psql, the main data types and their storage, identity columns and sequence gaps, varchar and numeric limits, integer division and :: casts, date and timestamp arithmetic, CREATE TABLE with constraints, INSERT, UPDATE and DELETE with foreign keys, NULL and COALESCE, GROUP BY with FILTER, CASE, generate_series calendars and transactions. Every answer is checked instantly, and the first lesson is free.

Lessons

  1. psql and Your First PostgreSQL QueryLabFree
  2. Data Types and How Much Space They TakeLab Locked
  3. serial, Identity Columns and SequencesLab Locked
  4. text, varchar(n) and String FunctionsLab Locked
  5. numeric(p,s): Exact Decimals and OverflowLab Locked
  6. Integer Division, % and :: CastsLab Locked
  7. date: Days, Differences and IntervalsLab Locked
  8. timestamp, EXTRACT and Half-Open RangesLab Locked
  9. CREATE TABLE with NOT NULL, CHECK and DEFAULTLab Locked
  10. INSERT: Multi-Row VALUES, DEFAULT and RETURNINGLab Locked
  11. UPDATE: Change Rows SafelyLab Locked
  12. DELETE, Foreign Keys and ON DELETE CASCADELab Locked
  13. WHERE with IN, BETWEEN, AND and ORLab Locked
  14. ORDER BY, NULLS LAST, LIMIT and OFFSETLab Locked
  15. LIKE, ILIKE and Concatenation with ||Lab Locked
  16. NULL, COALESCE and AggregatesLab Locked
  17. GROUP BY, HAVING and the FILTER ClauseLab Locked
  18. boolean and CASE ExpressionsLab Locked
  19. generate_series: Numbers and Dates on DemandLab Locked
  20. Calendars with generate_series and LEFT JOINLab Locked
  21. Transactions: BEGIN, COMMIT, ROLLBACK and SAVEPOINTLab Locked
  22. Final Project: The March ReportLab Locked