StaffCoder
PostgreSQL

PostgreSQL Practice Exercises

PostgreSQL
4 modules · 12 challengesSign up
Module 1 of 4 · 4 challenges

Data Types & Table Design

Pick the column types that enforce the rules: exact money, whole counts, bounded text, instants, enumerated states, defaults and database-generated keys.
Finish every challenge, or complete the star challenge, to complete the module.

Challenges

4 challenges

Invoice Amounts That Drift

Sign up to unlock
60%3 of 5 solvedeasy
About this challenge

Retype an invoice table so money is exact to the cent, quantities are whole numbers, product codes are length-bounded and descriptions stay free-form.

Solved in a browser IDE and graded by tests. Sign up to solve

Times, Flags and States

Sign up to unlock
100%2 of 2 solvedeasy
About this challenge

Rework a shipment event table so event times are absolute instants, scheduled days carry no time of day, the signed-for flag is a yes/no value, and the shipment state is one of four values that sort in life-cycle order.

Solved in a browser IDE and graded by tests. Sign up to solve

Keys Nobody Has to Invent

Sign up to unlock
100%2 of 2 solvedeasy
About this challenge

Let the orders table mint its own keys and money columns: a database-assigned id, a time-ordered UUID reference, and line total and tax columns the database computes instead of callers.

Solved in a browser IDE and graded by tests. Sign up to solve

Clinic Appointment Book

STAR
Solving it completes the module
50%1 of 2 solvedeasy
About this challenge

Design a clinic appointments table end to end: exact money, whole minutes, bounded and free-form text, absolute instants and plain dates, a yes/no flag, a life-cycle status, a defaulted creation stamp, database-assigned keys and two derived amounts that can never disagree with their inputs.

Solved in a browser IDE and graded by tests. Sign up to solve

About this path

Master PostgreSQL from your first query to production, with hands-on SQL, analytics, indexing, transactions, security, performance tuning and replication, all tested against a real database.

This path starts with the SQL foundations of PostgreSQL: data types and table design, constraints and keys, querying, and joins and set operations. It helps to know what tables and rows are, but no earlier PostgreSQL experience is needed. The joins module shows how to combine tables to answer questions a single table can't.

Frequently asked questions

4

What will I practice in this path?

4 modules: Data Types & Table Design, Constraints & Keys, Querying Fundamentals and Joins & Set Operations.

How many PostgreSQL exercises are there, and how hard are they?

12 exercises, all easy.

What does this path run on?

Challenges run on PostgreSQL.

Do I need to install anything?

No. Every challenge runs in a browser-based IDE with everything already set up, and your code is graded automatically against a test suite.

We use cookies that are necessary to run Staffcoder, and optional analytics cookies to see which pages get used. Analytics stays off unless you accept. Read our Cookie Policy.