Read the Diagram

Read the diagram in three passes:

  1. Start with the input table and name the columns out loud.
  2. Read SELECT * as "keep every column".
  3. Compare the output table with the input table; the shape and rows should match. Nothing has been filtered, sorted, or deduped yet. This page is the baseline for the later SELECT lessons where one part of the table changes.

SELECT all columns preserves the whole table shape before narrowing the analysis.

highlighted = computed this step

Input table

Start with the full Orders table.

Orders\text{Orders}
Ordersorder_idcategoryamounto1book20o2book35o3pen5

Select query

SELECT all named columns keeps the same table shape.

SELECT all columns\text{SELECT all columns}
SELECT all columnsselect order_id,category,amountarity 3 rows 3Ordersarity 3 rows 3

Output table

The output has every column and every row from the input.

same rows, same columns\text{same rows, same columns}
Outputorder_idcategoryamounto1book20o2book35o3pen5