Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking for beginner and intermediate level SQL puzzles, that I can point trainees at for practice.

I'm aware of which is a great resource - is there anything else out there that you could suggest?

share|improve this question
up vote 48 down vote accepted

Joe Celko's books and newsgroup posts are a good source of puzzles (with a variety of answers). They might be a bit more intermediate/advanced and not MySQL-specific, but are easy to follow and generally come from practical real-world situations.

Particularly, hunt down a copy of Joe Celko's SQL Puzzles and Answers (link to Google preview), it's a compilation of some of the best.

The SQLTeam forums occasionally have some interesting problems too, but generally focused on MS SQL Server.

The HackerRank SQL domain has a variety of SQL challenges that can be completed using multiple implementations (e.g.: Oracle, MySql, MS SQL Server, DB2).

share|improve this answer

There are lots of interesting puzzles and contests in BeyondRelational.Com

TSQL Challenges
TSQL Beginners Challenge

share|improve this answer
Are solutions posted anywhere for the beginners challenges? – Gabe Feb 21 '11 at 0:38

SQL Server Central has some quizzes here:

There's also SQL Quiz, which is more like quiz questions rather than puzzles:

And Lessthandot has some general programmer puzzles:

share|improve this answer

One that I've used before is:

Has an interactive book with exercises (and tips) and solutions

share|improve this answer
The link to programmers is dead (404) a similar question… is closed. – James Jenkins Dec 16 '15 at 17:36

You can sign up for SQLServerCentral's Newsletter and receive a Question of the Day (among other news and articles) in your mailbox daily.

One thing to note is that in addition to SQL, the questions also focus on database administration. They are pretty challenging though.

share|improve this answer

Practical skills of SQL language has a good collection of exercises for beginners as well as for experienced programmers.

share|improve this answer

There are two sites which really stand out for learning SQL, especially Oracle (for MySQL see below).

  • Oracle forums. Pay particular attention to the posts of Frank Kulash and Solomon Yakobson (sometimes things of rare beauty) but anyone with a rep of > 20k merits attention. Check the rankings on the forums page.

  • Orafaq forums. Solomon Yakobson (again), Michel Cadot and Black Swan are to be followed here.

Many lesser padawan answer questions using PL/SQL only to be set straight by (amongst others) the sensei specified above who point out pure SQL solutions of such pulchritude as to make the Mona Lisa (La Gioconda) pale in comparison.

For MySQL see here - a "cookbook" of MySQL queries.

Finally, I would just say that there are many texts worthy of study. Check Celko, DuBois and Gulutzan inter alia.

share|improve this answer

protected by Jack Douglas May 23 '15 at 11:37

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.