Introduction to SQL
Explore the core principles of SQL as a declarative language used to query and manipulate data in PostgreSQL. Understand the importance of data structures, type systems, and how to construct effective queries for robust database management.
We'll cover the following...
Declarative programming language
SQL is a declarative programming language. As a user, we declare the result we want to obtain in a data processing pipeline executed against a known database model and a dataset.
The database model has to be statically declared so we know the type of every bit of data involved at the time the query is being carried out. A query result set defines a relation of a type determined or inferred when parsing the query.
SQL developers
As a developer, when working with SQL we work with a type system and something similar to relational algebra. We write code to retrieve and process the data we’re interested in, in the specific way we need.
RDBMS and SQL enable developers to think in terms of data structures and how to declare both the data structure and the dataset we want to obtain via our queries.
Some might then say that SQL forces us to be good developers because good programming involves good code and good data structures.