Home › Systems › Briefs

Briefs

One or two sentences on every term the SQL lessons use, each with its own source, so you can check a word before a lesson or look it up again after one. In a lesson, tap a dotted word to see it there.

40 briefs · updated

SQL

aggregate

A function that answers for many rows with one value, like COUNT, SUM, AVG, MIN or MAX; every one of them except COUNT(*) skips empty cells.

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: Aggregates →

aggregate query

A query with an aggregate function or a GROUP BY clause; it answers per group, and "An aggregate query without a GROUP BY clause always returns exactly one row of data, even if there are zero rows of input data."

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: GROUP BY & HAVING →

alias

A name given to a result column or a table with AS, used in the output heading and in ORDER BY; the grammar's "expr AS column-alias".

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: SELECT →

AND

Both tests must be true; in a chain without brackets AND binds tighter than OR, which SQLite shows by listing AND above OR in its precedence table.

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: WHERE & NULL →

AVG

"the average value of all non-NULL X within a group", so an empty cell is left out of both the total and the count it divides by.

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: Aggregates →

bare column

A selected column that is neither inside an aggregate nor in the GROUP BY clause; SQLite fills it from "one of the input rows that form the aggregate", and "in many cases the value for "b" is undefined", while PostgreSQL rejects the query.

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: GROUP BY & HAVING →

BETWEEN

A shorthand for a range, both ends included: "'x BETWEEN y AND z' is equivalent to 'x >= y AND x <= z'".

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: WHERE & NULL →

clause

One part of a query that does one job; a simple SELECT runs "FROM clause processing", then "WHERE clause processing", then the result columns, then ORDER BY and LIMIT.

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: SELECT →

COALESCE

A function that "returns a copy of its first non-NULL argument", the usual way to turn the NULL of an empty total into 0.

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: Aggregates →

column

One named field that every row of a table has; a column definition "consists of the name of the column, optionally followed by the declared type of the column".

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: SELECT →

comparison

A test between two values with =, !=, <, > and the like; it answers true or false, and NULL when either side is empty.

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: WHERE & NULL →

COUNT

How many; COUNT(*) counts rows, while COUNT(column) "returns a count of the number of times that X is not NULL in a group".

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: Aggregates →

COUNT(DISTINCT)

How many different values a column holds; "count(distinct X)" returns "the number of distinct values of column X instead of the total number of non-null values".

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: Aggregates →

DISTINCT

A word after SELECT that removes duplicate rows from the result: "duplicate rows are removed from the set of result rows".

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: SELECT →

FROM

The clause that names the table or tables the query reads; "the data on which a simple SELECT query operates comes from the one or more tables or subqueries … specified following the FROM keyword".

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: SELECT →

functional dependency

PostgreSQL's reason a primary key alone can be grouped by: the other columns of that table "would be functionally dependent on the product ID, and so there would be no ambiguity about which name and price value to return for each product ID group".

Source: postgresql.org ↗ · checked 13 Oct 2026

Lesson: GROUP BY & HAVING →

group

The set of rows one aggregate answers for; without GROUP BY the whole result is one group, and "The count(*) function (with no arguments) returns the total number of rows in the group."

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: Aggregates →

GROUP BY

The clause that deals rows into groups, one group per distinct set of values of the listed columns or expressions, so that each aggregate answers once per group; "For the purposes of grouping rows, NULL values are considered equal."

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: GROUP BY & HAVING →

GROUP_CONCAT

An aggregate that "returns a string which is the concatenation of all non-NULL values of X", with Y as the separator, so a group can show every value it holds instead of one; "The order of the concatenated elements is arbitrary unless an ORDER BY argument is included immediately after the last parameter."

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: GROUP BY & HAVING →

grouped column

A column named in the GROUP BY clause; each output row "contains one of the distinct values" of it, which is why it can be selected as it is.

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: GROUP BY & HAVING →

HAVING

A filter on groups, not rows; it "is evaluated once for each group of rows as a boolean expression. If the result of evaluating the HAVING clause is false, the group is discarded."

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: GROUP BY & HAVING →

IN

A shorthand for several ORs on one column: "The IN and NOT IN operators take an expression on the left and a list of values or a subquery on the right."

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: WHERE & NULL →

IS NULL

The one test that gives a straight yes or no about an empty cell: "It is not possible for an IS or IS NOT expression to evaluate to NULL."

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: WHERE & NULL →

LIKE

A pattern test on text, where "%" matches "any sequence of zero or more characters" and "_" "any single character"; SQLite ignores case for ASCII letters.

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: WHERE & NULL →

LIMIT

The clause that keeps only the first N rows of the sorted result; when there are fewer than N rows, all of them come back.

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: SELECT →

MIN and MAX

The smallest and the largest value present; each "returns NULL if and only if there are no non-NULL values in the group".

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: Aggregates →

NULL

A missing value, not zero and not an empty string; in comparisons it "is considered less than any other value (including another value with storage class NULL)".

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: SELECT →

operator

The symbol or word that does a test or a sum, such as =, <, AND or LIKE; SQLite lists them "in precedence order (top to bottom / highest to lowest)".

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: WHERE & NULL →

OR

Either test may be true; brackets around an OR keep it from being swallowed by a neighbouring AND.

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: WHERE & NULL →

ORDER BY

The clause that decides the order of the rows; without it "the order in which the rows are returned is undefined". ASC is the default and NULLs come first in it.

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: SELECT →

order of evaluation

The order a database works through a SELECT, which is not the order it is written in: SQLite's page describes FROM, then WHERE, then the groups with GROUP BY and HAVING, then the result expressions, DISTINCT, ORDER BY and LIMIT.

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: GROUP BY & HAVING →

query

A question put to the database in SQL; a SELECT is the kind that only reads, since "A SELECT statement does not make any changes to the database."

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: SELECT →

result set

The rows a SELECT returns; "zero or more rows of data where each row has a fixed number of columns".

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: SELECT →

ROUND

"The round(X,Y) function returns a floating-point value X rounded to Y digits to the right of the decimal point. If the Y argument is omitted or negative, it is taken to be 0."

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: GROUP BY & HAVING →

row

One record of a table or of a result; "The result of a SELECT is zero or more rows of data where each row has a fixed number of columns."

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: SELECT →

SELECT clause

The part that names the columns or expressions that come back; the star, *, stands for every column of the input.

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: SELECT →

SUM

The total of the values that are there; "If there are no non-NULL input rows then sum() returns NULL", because "the SQL standard requires it".

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: Aggregates →

table

A named set of rows that all have the same columns; CREATE TABLE "is used to create a new table in an SQLite database" and names "each column in the table".

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: SELECT →

three-valued logic

SQL's three answers to a test, true, false and unknown; WHERE keeps only true, and "When paired with NULL: AND evaluates to 0 (false) when the other operand is false; and OR evaluates to 1 (true) when the other operand is true."

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: WHERE & NULL →

WHERE

The clause that keeps only the rows whose test comes out true; a row whose test is false, or unknown because a cell is empty, is dropped without a message.

Source: sqlite.org ↗ · checked 13 Oct 2026

Lesson: WHERE & NULL →