Learn SQL Using Practice Dolt Databases
Dolt is a MySQL compatible database with Git-like versioning semantics. DoltHub is a place on the internet to share Dolt databases. Databases are notoriously unforgiving. We all know a person who accidentally ran a bad query in production and broke a bunch of stuff. Git is equally daunting for novices. What can't git checkout
do? Git has a high barrier to entry but once you're in, you understand the power.
As we've said before Dolt is a simple, forgiving database to learn with. All of that still applies. With Dolt you can:
- Get started quickly
- Run SELECT queries with real data
- Practice write queries without fear
- See your diffs
- Contribute back your work
- Work with a friend
- Learn Git at the same time
But in the year since we wrote that, Dolt and DoltHub have gotten even better. Now, you can:
- Run write queries on DoltHub with your browser
- Use every feature of SQL including constraints and keyless tables
- Do it all much faster, especially on DoltHub
Learn SQL using Dolt
Dolt is the best database to use to learn SQL, and today we are launching our learn-sql series of databases to help aspiring SQL experts get started. We only have lesson 1 published and we will publish one per week moving forward. The first lesson covers SELECTS and JOIN.
Some of the benefits of learning SQL this way are:
- It's free!
- No setup required. Do everything on DoltHub.
- Join our Discord community if you need help or want to discuss the problems
- Submit a PR with your work and I'll review it personally and give you feedback (for free!)
The lesson-1
Dolt database has three small tables and questions in the README. Answering the questions requires crafting SQL queries. By crafting the queries and having them reviewed, you will quickly learn SQL.
Instructions
- Fork the
learn-sql/lesson-1
database
- Craft your query to answer one of the questions in the
README
- Save your query as a a sample query
Dolt has a cool Save Query feature that allows you to store queries and version them along with your database. You can see these on DoltHub under the queries section of the Database tab. We use this feature to share the answers to the questions in the lesson. Once you click save, you'll work through the pull request workflow on DoltHub. Complete the save by Merging your new Saved query into the master
branch.
- Make a PR to the
learn-sql/lesson-1
database
I will review your work and give you feedback if you make a Pull Request back to the root database you forked from.
Conclusion
Dolt and DoltHub allow you to learn SQL with just a website. We think it's the easiest way to master SQL out there. We built a set of lessons on DoltHub to help you get started. You can find them under the learn-sql organization. We'll review your submissions and act as a SQL tutor for free! If the lessons are popular we'll build more. Come chat with us on our Discord if you have ideas for more lessons.