A SELECT list starts with visible input rows.

highlighted = computed this step

Base rows

A SELECT list starts from visible input rows.

base rows first\text{base rows first}

Read the input size

The table has 4 input rows.

input rows=4\text{input rows}=4

SELECT-list examples are tiny finite-table transforms; DISTINCT, aggregation, type coercion, optimizer behavior, and database-product claims are out of scope.

Base rows: base rowsitemqtybonusstatuspen31openmug20opencup21closedtagNULL1open SELECT list itemspositionkindsourceoutput0columnitemitem SELECT output rowsitempenmugcuptag SELECT factsfactvalueinputRowCount4outputRowCount4outputColumnCount1duplicateOutputRows0rowOrdersource_orderdistinctAppliedno

Output keeps source order

The output rows follow the same source-row order.

source order\text{source order}

Summary

SELECT chooses what columns or values appear in each output row.

choose output cells\text{choose output cells}