Overview
SQL or Structured Query Language is a DSL used to communicate with relational database management systems (RDBMS). Like the name suggests it is particularly good at handling structured data. In addition to querying data, SQL also supports modifying data, and modifying the structure of RDBMSes. It is fairly easy to follow once the syntax is learnt.
Syntax
Add info for section
Concepts
View
A View is akin to a "virtual table" in an RDBMS. Instead of creating an entirely new table to store to disk a Views are usually defined to do one of the following:
- Only expose a smaller subset of data out of an entire table
- Join and de-normalize a set of tables
- Virtually partitioning a table into different subsections
Views are much lighter to store as the only data stored is the definition of the view. By extension this also means the view doesn't need to be explicitly upgraded, only the related tables.
Views can be created with the following syntax:
CREATE VIEW my_view AS
SELECT col1, col3, col5 ...
FROM my_table
WHERE col3 > 10
Any querying conditionals, aggregates etc. can be added to create the needed view.
Resources
- This has an extensive list of pretty much every SQL feature you might use.
- It is mostly useful when you just want a short document that goes over a feature or topic.