# Reading Rows: SELECT, WHERE and ORDER BY

SELECT asks a table for the columns you name, WHERE keeps only the rows that pass its test (with AND, OR and LIKE), ORDER BY sorts them and LIMIT caps how many come back, and in Python fetchone and fetchall read the answer, with sqlite3.Row giving rows you read by column name.

![Cheat sheet: Reading Rows: SELECT, WHERE and ORDER BY](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/732d22a734d14f0db1a4aec8ffe24d68.webp)

- Category: FastAPI
- Level: Apprentice
- Tags: database, LIKE Predicate, order by, Query (sql), select, sql, sqlite, where
- Author: Gregor Dzierzon
- Updated: November 23, 2026

Source: https://www.ask-codey.com/cheat-sheets/fastapi-sql-select-cheat-sheet
