Skip to main content
Harmanpreet Singh
All subjects

Coursework

SQL

Analytical queries over a normalised job-postings dataset.

Joins, aggregation, dates, CASE, subqueries and CTEs on PostgreSQL.

Project 1

SQL practice on a job-postings dataset

Thirty-eight SQL exercises written for PostgreSQL over job postings, companies and skills: filtering, aggregation, joins, dates, CASE, subqueries and CTEs.

Stack
  • PostgreSQL
  • SQL
Who and when
Individual practice, February 2026
My contribution
I wrote the queries for each exercise.

Working demo

Run the exercises on PostgreSQL

Runs in your browser

Try this: Run the 'null' exercise, read the review note, then run the corrected version and compare.

The database engine loads on request (about 6 MB, then cached) and runs in your browser. Nothing is sent anywhere.

Loading demo...

What the original did

  • A schema with company_dim, skills_dim, job_postings_fact and skills_job_dim.
  • Exercises grouped from basic selects and filters to joins, aggregation, date handling, CASE and CTEs.
  • Each exercise is a problem statement in a comment followed by the query I wrote.

How it works

  • The fact table holds one row per posting, and the dimension tables hold companies and skills.
  • The skills table is linked through a bridge table because a posting can need many skills.
  • Most queries are read-only. A few build new tables from query results.

Added for this showcase

  • A real PostgreSQL engine compiled to WebAssembly, so the queries run exactly as written.
  • A deterministic synthetic dataset with the same schema, because the original data is not in the repository.
  • All the exercises in a browser grouped by topic, a free query editor, and review notes where I would now write a query differently.

Notes

  • The dataset is synthetic. Results show how the queries behave, not facts about the job market.
  • Some early exercises compare boolean columns with 1, which MySQL accepts and PostgreSQL rejects, and one has a trailing comma that PostgreSQL treats as a syntax error. The lab shows the real error and offers an adapted query.
  • About ten queries do not answer their problem statement correctly. They are kept as written, with a review note and a corrected version.