StaffCoder
PostgreSQL
PostgreSQLPostgreSQL
4 modules · 12 challengesSign up
Module 3 of 4 · 4 challenges

PostgreSQL Querying Fundamentals

Ask the database precise questions: range, list and pattern filters with grouped logic, null-aware predicates and fallbacks, stable ordering and paging, one row per group, and value banding.
Finish every challenge, or complete the star challenge, to complete the module.

Challenges

4 challenges

Search That Ignores the Filters

Sign up to unlock
—No data yeteasy
About this challenge

Write the rental listings search queries so a price range, a neighbourhood shortlist and a keyword each narrow the results, and the combined filter keeps only listings that satisfy both of its conditions.

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

The Missing Nulls

Sign up to unlock
—No data yeteasy
About this challenge

Rewrite the rental listing queries so listings with no recorded deposit are found, excluded and defaulted correctly, and the price-per-bedroom figure stops crashing on a zero-bedroom studio.

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

Pages Out of Order

Sign up to unlock
—No data yeteasy
About this challenge

Shape a rental listings page: one order with mixed sort directions, a unique tiebreaker and unpriced listings last, the same page of results by offset and by a row-value keyset cursor, one row per landlord with DISTINCT ON, and a CASE expression that bands every listing including the unpriced ones.

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

Rental Listings Finder

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

Write the whole query set behind a rental site's finder: range, list and pattern filters with grouped boolean logic, null-aware predicates and fallbacks, stable multi-key ordering with unpriced listings last, offset and keyset pagination, one row per landlord, and CASE price bands - then the three of them working together.

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

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.