Learn SQL with Phai
SQL from the first step to the advanced, one step at a time, on one small shop's data all the way through. A gift of knowledge: free to use, free to learn, free to pass on.
Where to start
If you have never written SQL
That's fine: this guide is written for people starting from zero. A way through it:
- Read chapter 1 to meet the practice shop; every chapter uses it.
- Go in order. Type each example yourself, then change it and see what changes.
- Do every Try it at the end of a chapter: yourself first, then the answer.
- The first two parts are what you will use every day: learn them well. The rest can come later.
Every example in this guide was run when the page was made, on Phai SQL, Phai's own database, and checked against SQLite to give the same answer. The results you see are real: if yours differ, something was typed differently.
Learn alongside the program
In Phai Database Studio, open Help > SQL Lessons (F1): it has the same shop as this guide, ready to type SQL into and run, a button that checks your answer, and one that makes the data again when you have deleted it all.
Phai (bamboo), given as a gift of knowledge: free to use, learn from and pass on · every example on this page was run on Phai SQL and checked against SQLite when the page was made