liveBook · Manning

Select

As explained in A Pythonic Adventure: From Python basics to a working web app

An SQL SELECT statement retrieves data from one or more database tables.

SELECT retrieves data from a database table. In the order application, it asks SQLite for every row in the orders table, then makes those rows available to the program.

Find every order

The query `SELECT * FROM orders;` chooses all columns from orders. `fetchall()` collects the matching rows, which the application returns for display.

How A Pythonic Adventure: From Python basics to a working web app covers it

How deep it goes
Demonstrates one SELECT query with all columns and fetchall(), without covering filtering, sorting, or joins.
Examples
Uses SELECT * FROM orders; to retrieve order rows for an HTML list.
What it assumes
Assumes familiarity with SQLite connections, cursors, tables, and basic Python functions.
What you can do after
Builds a retrieval function that executes a SELECT query and returns database rows to an application.
How it connects
Connects SELECT with SQLite, database tables, cursors, fetchall(), and Flask route rendering.

Also explained in

Compare how 5 books explain select →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of A Pythonic Adventure: From Python basics to a working web app. The section links point to the parts of the book it draws on.