100

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

I'm aware of http://sqlzoo.net/ which is a great resource - is there anything else out there that you could suggest?

57

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).

22

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

TSQL Challenges
TSQL Beginners Challenge

  • Are solutions posted anywhere for the beginners challenges? – Gabe Feb 21 '11 at 0:38
17

SQL Server Central has some quizzes here:

http://www.sqlservercentral.com/tags/T-SQL/SQL+Puzzles/

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

http://www.sqlquiz.com/

And Lessthandot has some general programmer puzzles:

http://forum.lessthandot.com/viewforum.php?f=102

11

One that I've used before is: http://www.sql-tutorial.ru/en

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

10

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.

9

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

5

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.

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.