Files
oam/knowledge base/sql.md
2024-10-07 22:42:35 +02:00

1.4 KiB

Structured Query Language

Standard language for relational database management systems.

TL;DR

NULL represents unknown or missing information.
It is not the same as an empty string or the number 0.

Constraint Description
NOT NULL The value cannot be NULL
UNIQUE The value must be unique in the table's column

Primary keys are one or more columns in a table used to uniquely identify a single row.
Tables can have zero or one primary keys. They cannot have more than one primary key.

Technically, primary key constraints are the combination of a NOT NULL constraint and a UNIQUE constraint.

Foreign keys are one or more columns in a table that uniquely identify a row in another table.
They reference either the primary key or another UNIQUE constraint of the referenced table.

Further readings