SQL basics
Start with relational data for a complete example.
Read and write
Section titled “Read and write”- SELECT: choose columns, filter, sort and limit.
- Writes: insert, update and delete.
- Joins: combine related records.
- Aggregations: summarize groups.
Define data
Section titled “Define data”Choose types, create tables and indexes and use schemas to organize objects.
Use application inputs safely
Section titled “Use application inputs safely”Bind values through the client’s parameter API. Use an allowlist for dynamic identifiers. Handle nulls and conversion errors explicitly.
Group changes
Section titled “Group changes”Use transactions when database changes form one application operation. Schema commands may have different transaction requirements.