liveBook · Manning

Record

As explained in Build Python Web Apps with Streamlit

A database row is a single record in a table containing values for that table's columns.

A record is one complete entry in a database table. It is also called a row. Each record contains a value for the table’s columns, such as a username, author, timestamp, or piece of text. section 8.2.1

Records provide persistent storage: unlike an in-memory dataframe row, a database row remains after the program finishes. SQL creates, reads, changes, and removes records. section 8.2.1 section 8.2.4

A record can also participate in table rules:

  • A primary-key value uniquely identifies one record; PostgreSQL requires it and prevents duplicates. section 8.2.4
  • A serial primary key can be assigned automatically as records are inserted. section 8.2.4
  • A foreign key can require a value in one record to match a value in a record from another table. section 8.2.4

User and haiku records

A users table can contain one record for Alice. A haikus table can contain records with an automatically assigned haiku_id, a creation timestamp, the author, and the haiku text. Queries can select Alice’s records, update one by its identifier, or delete another.

How Build Python Web Apps with Streamlit covers it

How deep it goes
Explains rows through columns, data types, keys, defaults, relationships, and CRUD queries without covering database engine internals.
Examples
Uses user and haiku rows, SELECT results, inserted records, identifier-based updates, and deletions.
What you can do after
Operate PostgreSQL records by inserting, selecting, updating, deleting, and identifying rows with SQL.
How it connects
Connects records to tables, columns, schemas, SQL, primary keys, foreign keys, relational databases, and dataframes.

Also explained in

Compare how 12 books explain record →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build Python Web Apps with Streamlit. The section links point to the parts of the book it draws on.