User:Ghosts of Europa/sandbox/SQL

SQL is a programming language for interacting with relational databases

Overview
-Summarize what a relational database is, mention ACID

Syntax and features
-Overview of tables and data types

-Data types

-Basic Select/From/Where queries

-Insert/Update/Alter

-Aggregations and Having clauses

-Window functions and Qualify clauses

-Nulls

-Transactions

Joins
This code will produce the cartesian product of all pairs of rows from both tables:

This full cartesian product can also be expressed as "cross join".

A join is a subset of this cartesian product, filtered to only the rows that match a given condition. The following two queries are equivalent:

An outer join is equivalent to first performing an inner join, then adding each unmatched row from the first table with NULLS for the columns of the second table, then each unmatched row from the second table with NULLs for all the columns of the first table. Every row will be "preserved" at least once.. A left outer join will only preserve unmatched rows from the first table, while a right outer join will only preserve unmatched rows from the second table.

Differences from the Relational Model
-Order -Nulls

Implementations
-SQLite, Postgres, Snowflake, etc -Note some of the incompatibilities