avatarJye Sawtell-Rickson

Summary

SQLZoo offers an interactive platform for practicing and honing SQL skills, featuring real-time query execution against a live database and a variety of challenges at different difficulty levels.

Abstract

SQLZoo is an established online resource since 1999 that allows users to write and execute SQL queries on a live database, providing immediate feedback on query results. It is particularly beneficial for Data Scientists and individuals in tech roles who need to maintain and improve their SQL proficiency. The platform includes educational content and assessments with detailed database diagrams, such as the White Christmas challenge, Help Desk, and Guest House problems. SQLZoo supports skill development for interview preparation, career advancement, and personal growth. Additionally, users can reference solutions on GitHub for guidance and consider alternative query approaches to enhance readability, speed, efficiency, and robustness. While primarily built for MySQL, SQLZoo also accommodates other SQL dialects like PostgreSQL, offering commands to switch languages, which can be beneficial for practicing different SQL techniques.

Opinions

  • The author highly recommends SQLZoo for its practical, hands-on approach to learning and practicing SQL.
  • SQLZoo is praised for its long-standing reputation and the real-world applicability of its challenges.
  • The platform is considered valuable for both beginners and experienced professionals looking to refine their SQL skills.
  • The author emphasizes the importance of considering multiple aspects of SQL queries, such as readability and efficiency, not just their correctness.
  • SQLZoo is appreciated for its flexibility in supporting various SQL dialects, which is seen as an opportunity to learn and adapt to different SQL environments.
  • The author encourages users to contribute their own solutions to the GitHub repository, fostering a collaborative learning community.
  • Other similar platforms are acknowledged, but SQLZoo is highlighted as a standout resource for SQL practice.

SQLZoo: The Best Way to Practice SQL

A Wild Playground to Test Your Skills with Solutions

Name those SQL animals! Hint: they’re each mentioned in the article. Original photo credit: Nikolay Tchaouchev.

SQL is a useful skill to have for many roles. No matter the industry, there’s going to be data stored in databases and SQL is the best way to get to it. And Data Scientists, in particular, need to be experts for quick access to high quality data. While most of us in tech have a decent grasp on the basics, we may lack the opportunities to push those skills further in our day-to-day work.

In comes SQLZoo — a great place to test your skills and rebuild rusty ones. You can use it for interview prep, or to stay sharp on the job and impress your boss. Here, I’ll introduce SQLZoo and why you should check it out, as well as a useful link to some SQLZoo answers for double-checking!

SQLZoo is a well established online platform (since 1999) for writing and running SQL queries against a live database. This means you can see the actual result of your query without having to scrupulously check your query matches a solution — it’s the result that matters. This is important because there are often many approaches to difficult questions, with one not necessarily being the best.

They have an educational section, but what you’re looking for are the “Assessments”. These contain more involved examples that allow you to deep-dive into a database at varying levels of difficulty. My favourite problems were under the White Christmas challenge which doubled as a good learning experience for the history of the famous “White Christmas”. Other good ones are Help Desk and Guest House which have detailed diagrams explaining the database as well as some more challenging problems.

At some point you might want to check your SQL looks good, and for that, you can check my solutions for some of the problems on Github (contributions encouraged!). Writing good quality SQL queries is a not so straightforward as you need to consider readability, speed, efficiency, robustness — all of which matter for businesses. While you’re trying out the problems, think about other ways you could have approached them. What would have been a more concise way to write it? How could you have been more efficient? What would happen if some of the columns contained NULL values?

It’s worth noting that SQLZoo is built with a MariaDB Server and by default requires you to use MySQL. For someone like myself who works mostly with BigQuery’s StandardSQL or PostgreSQL there are a set of commands to follow to get another language working. Alternatively, it might be a good chance to practice other techniques that you might not think of when using the variant of SQL you regularly work with.

Finally, there are other platforms out there with similar services. A small list:

  • w3resource — another great free resource for writing queries.
  • The SQL Murder Mystery — another one of my favourites thanks to it’s fun, interactive environment that has you feeling like a top secret agent.
  • Interview Query — a platform dedicated to data scientists to practice their SQL. If you’re serious worth looking into, but it’s a paid service.
  • TestDome — another platform for interview practice.

For practicing your general coding skills, there are many great, modern platforms such as Leetcode but SQL is a skill which tends to get less appreciation. Use SQLZoo to practice, test and improve your skills to bring your SQL to the next level.

PS. Let me know if you found any great problems or found some better solutions to mine — happy SQLing!

Data Science
Sql
Data Analysis
Data
Data Engineering
Recommended from ReadMedium