Are you looking for places to practice SQL online? This list contains many different websites that have SQL practice functionality.
SQL Practice Websites
Each of these websites allow you to practice your SQL queries on a database. Some of them are a simple textbox where you enter an SQL SELECT query on a predefined database, and others allow you to create tables and data to go along with the queries.
To be added to this list, there must be an interactive component or a way to enter SQL and see a result. Sites that show only practice questions or a method to download a database are not on this list.
Let’s take a look at the list.
SQLZoo is a popular site for practising SQL. It has a large range of practice exercises, from basic SELECT statements to more complicated queries.
Each page has a sample data set and several questions. You can enter the SQL that you think is needed to give the answer that is asked for, submit the SQL, and see the result. It also indicates if the result is correct or not.
SQL Fiddle is a popular site for quickly generating sample databases and writing SQL code on them. It can also be used for SQL practice. It’s a common way for users on StackOverflow to generate sample data because the data sets are saved on SQLFiddle and you can generate a link to that data set.
There are three panels:
- schema, for creating and populating your tables
- query, for writing your SELECT queries
- results, for viewing the results of the query
Another great thing about SQL Fiddle is that it supports different versions of SQL. As of September 2020, you can write SQL for:
- MySQL 5.6
- Oracle 11g R2
- PostgreSQL 9.6 and 9.3
- MS SQL Server 2017
DB-Fiddle is one of two sites called “DB Fiddle”. This one is similar to the other fiddles in that it lets you create tables, insert data, and run queries.
You can sign in to create an account, save your fiddles, and make them public or private.
It supports many different versions of SQL:
- MySQL 5.5, 5.6, 5.7, 8.0
- PostgreSQL 9.4, 9.5, 9.6, 10.0, 11, 12, 13 beta
- SQLite 3.26, 3.30
So while it doesn’t support Oracle or SQL Server, the versions of MySQL and PostgreSQL are newer than SQL Fiddle.
This site is another “fiddle” site where you can enter your sample queries and run them to see the results.
It has a sample database feature, which shows AdventureWorks for SQL Server, and there are many other SQL versions supported:
- DB2: Developer-C 11.1
- Firebird: 3.0
- MariaDB: 10.3, 10.4, 10.5
- MySQL: 5.5, 5.6, 5.7, 8.0
- Oracle: 11g R2, 18c
- PostgreSQL: 9.5, 9.6, 10, 11, 12, 13 beta
- SQLite 3.27
- SQL Server: 2014, 2016, 2017, 2019
HackerRank is a site that allows you to practice your skills in many different languages, and one of the languages provided is SQL.
There are many different SQL challenges on the site, and each of them has a sample data set, a question to answer with SQL, a list of the submissions, a leaderboard, and discussions.
Exercises are broken down by difficulty and you’re able to write the SQL in DB2, MySQL, Oracle, and SQL Server.
SQL Bolt is a site that teaches SQL as well as including several exercises on each concept. At the end of each page is a sample data set, and several questions you can answer using SQL.
While it doesn’t have the same flexibility as an online editor like SQLFiddle, it does explain the concepts and includes SQL practice exercises which are helpful. It’s a popular resource for people to practice.
Oracle Live SQL
Oracle Live SQL is a tool created by Oracle that lets you write and run SQL code against an online Oracle database. You can write code to create and populate tables and select data from them. It’s a handy way to practice Oracle-specific SQL online.
It also includes some helpful scripts as resources in the code library section and several tutorials on how to improve your SQL.
I use it often when I need a quick way to test some code in Oracle.
W3Schools is a website for learning a range of programming concepts including SQL. They offer an SQL practice feature using exercises, where you fill in the blanks to write queries.
It’s not as fully-featured as some other examples here, as it doesn’t have an SQL editor, but it can help you improve your SQL by completing queries.
W3Resource is a website that teaches quite a few programming concepts. They include tutorials on SQL and many SQL exercises.
Each of the exercises works off a sample data set and includes an SQL editor which is just a text box with a Submit button. The exercises include a solution which shows the correct query and the output.
It seems like a helpful site, but the layout and navigation is a little confusing to me.
StackOverflow Data Explorer
StackOverflow offers a tool called Data Explorer. This is a section of their site that lets you write and run queries against their database, which includes tables for posts, votes, tags, and more.
There are many saved queries that let you see information about the data in many areas of StackOverflow. You can also write your own queries.
It’s helpful because it uses a large sample database.
Coding Ground by Tutorials Point
The Tutorials Point website offers a tool called Coding Ground that lets you execute SQL online. It’s similar to SQL Fiddle and DB Fiddle, where it has an SQL editor and a results panel.
It seems to only support SQLite, but that should be enough for basic standard SQL. You can create and save projects, edit the theme, and change the font size of the page as well. If you create an account, you can share your SQL code with others.
SQLCourse is a site that has a tutorial on SQL which includes several exercises at the end of each page. It’s like SQL Bolt but the interface is not as nice and has several ads on the page.
The SQL editor is a simple textbox at the end of the page, and entering an incorrect statement will give you a vague error message. It’s useful but there are other better sites here.
Tech on the Net
Tech on the Net is a useful site for learning many programming concepts including SQL, and they include several practice exercises.
Each exercise includes a sample database with ERD, a question to solve, and an editor that lets you enter SQL and run it to see the results. It seems pretty easy to use.
This Russian-based site has some tutorials on learning SQL as well as a range of exercises. To access the exercises, you need to create a free account. Once you’re in, you can see the exercise, sample data, and write SQL queries to solve the questions.
You’re also able to see the results and see a leaderboard for all questions on the site. It has some good features, but the site has quite a few ads.
Rextester is a simple looking site that allows you to write and run SQL code. You can run code on many languages, and the SQL languages included are:
- MySQL 5.7.12
- Oracle: 18c
- PostgreSQL: 9.6
You can run SQL code and see the results at the bottom of the page.
SQLize is a simple site that lets you run MySQL queries and see the results.
There are some limitations, such as a max of 20 rows, but it’s pretty simple to use. You’re also only allowed to create temporary tables, not actual tables, due to how it’s designed.
SQLTest is an online SQL practice tool that lets you create tables, populate tables, write SQL queries on them and see the results.
It supports several SQL versions:
- Oracle: 11g
- MySQL: 5.1
- SQL Server: 2019
It also allows you to select some example code, which automatically populates the query editor, such as selecting a max value.
So there’s the list of resources for SQL practice questions and tools. Some of them are full editors that let you create objects and run queries, while others just have an SQL editor window with some practice questions. Using a combination of both can really help you improve your SQL skills.