-
Notifications
You must be signed in to change notification settings - Fork 22
The SQL Language
"Many relational database systems have an option of using the SQL (Structured Query Language) for querying and maintaining the database."
From https://www.postgresql.org/docs/12/tutorial-table.html:
You can enter [code] into psql with the line breaks. psql will recognize that the command is not terminated until the semicolon.
White space (i.e., spaces, tabs, and newlines) can be used freely in SQL commands. That means you can type the command aligned differently than above, or even all on one line.
Two dashes (“--”) introduce comments. Whatever follows them is ignored up to the end of the line.
SQL is case insensitive about key words and identifiers, except when identifiers are double-quoted to preserve the case (not done above).
create / alter / drop table insert / copy
select
- where
- math
- extract
- order by
- distinct
- group by
- join / left / right
- count / sum / avg / max / min (aggregate functions)
- subqueries
- having
- update
- delete