Basic SQL Practice Grounds

Learn SQL

You’re through the basics of SQL! This is a great place to stop and get more practice on what you’ve learned so far. Here we’ve constructed a list of challenges to give you that practice. Take some time to go through these before moving on to the Mid-Level SQL section.

A few things to keep in mind when going through

  • If no specific columns or values are called out to return, assume that it’s asking for all the columns (splat *).
  • If it does ask for specific information like “names”, only return that column. If you return other things as well it won’t be able to match the correct answer.
  • If you’re having trouble with a question use the ‘Hint’ button. If you’re really having trouble or think that the answer might be wrong, send us a note at
  • We check if things are correct not by the query you wrote, but by the results that are returned. This is the best way as there are often a few different ways to get the same result.

Good luck!

Q. Fetch the first 8 rows of the albums table.
References: select limit

Q. Fetch the 12th through 32nd rows of the tracks table.
References: select limit

Q. Fetch the 9th through 49th rows of the artists table.
References: limit

Q. Get the names of all of the artists.
References: from

Q. Get the names of all of the artists in reverse alphabetical order. (Z to A)
References: order-by

Q. Get only the last 4 names of the artists sorted alphabetically.
References: order-by limit

Q. Get the 20 longest tracks.
References: order-by limit

If you’ve completed all of these CONGRATULATIONS! You’re proficient and fluent enough in SQL now to complete a significant portion of analytic and transactional queries.

If you're finding this SQL Tutorial helpful, you may also enjoy our product Chartio. Chartio is on a mission to enable anyone in a company with the power of a data analyst. To do so we've built a very user friendly interface for people to explore and visualize data with either SQL, or our drag and drop Visual SQL. You can connect to all of your different data sources, and quickly create visuals and dashboards to share with your team. Give us a spin, there's a 2 week free trial.