Introduction

These are my introductory tutorials on SQL. The motivation for these tutorials are a couple of people at work who are trying to learn SQL. I'm not the best person to call on the phone and ask technical questions. I find it difficult to explain technical procedures while appropriately scaling the technological jargon to match the experience level of the person asking.

Besides, SQL needs code listings and graphics. Lots of code examples.

So I need my own personal site where I can post code, examples, and graphics. Fortunately, I have a site that has been just sitting around for months with virtually no content. Now it has content; a raison d'etre.

The tutorial pages are listed in the left menu. They are roughly in the order they should be read. But your mileage may vary.

SQL

SQL does not stand for Structured Query Language. When SQL was first invented in the middle of the previous century it was originally named "Sequel". Later the name was changed to SQL. Because of this, many insist that SQL be pronounced "sequel". But along the way it picked up the acronym name of Structured Query Language. So many people insist is should be pronounced S-Q-L.

I don't care. You be you. Just be aware some people have definite beliefs about this because they are humans.

In order to practise your SQL you will need a database application. If you don't already have a playground, see my SQL Applications page for some ideas. For any examples I am going to use DB Browser for SQLite. But it really doesn't matter which database you use. Part of the reason for SQL is to have a standardized language that can be used in (almost) any application.

A Tour

For our examples we will need to create tables so we can mock up some tables. The Tables page discusses creating tables. Then we need to mock up some data. The Insert page teaches how to put data into a table. The Update page shows how to correct the data, if needed.

Now that we have some mock data we can start doing queries to pull that data back out of the database in creative ways. The Query page shows how to write SQL that will extract data.

The Joins page shows how to combine data from two or more tables. This is very important. You probably don't know yet how much joins will subsume your life.

The String Aggregation page discusses how to join together a group of values and use them as a single value, if that is what you are into. I'm not here to judge.

Other Resources

There is a huge body of SQL tutorials on the inter-webs. May I recommend a few.

W3 Schools is an awesome site with free beginner lessons and reference materials on SQL, HTML, Python, and so much more.