What is SQL?

SQL is the query language of relational databases: you describe the rows you want from a set of tables, and the engine works out how to fetch them.

SELECT name FROM person WHERE age >= 18;

IEEE Spectrum calls SQL the second programming language everyone needs to know: whatever else you build with, you will meet a database.

We meet it here for a reason: the relational algebra of the last section is SQL's core. So Datalog and SQL are more similar than they first appear.