liveBook · Manning

Database table

As explained in Data Analysis with LLMs

Relational data is data organized as collections of tables whose rows and columns represent related records and attributes.

A database table organizes related data into named columns and rows. Think of it as a spreadsheet: columns describe attributes, while each row holds values for one record. A relational database is a collection of such tables. section 5.2.1

Video games as records

A games table can give each game a row with columns such as Name, Platform, Year, and Genre. Name and Genre contain text; Year contains a number. Once the data is loaded into SQLite, SQL queries can analyze the full table rather than just the sample shown here. section 5.2.1

Table 5.1 Sample of data table. Each table row describes one video game.
Name Platform Year Genre
Wii Sports Wii 2006 Sports
Super Mario Bros. NES 1985 Platform
Mario Kart Wii Wii 2008 Racing
Wii Sports Resort Wii 2009 Sports
Pokemon Red/Pokemon Blue GB 1996 Role-Playing

The sample makes the row-and-column structure concrete: each row describes a game, and each column supplies a particular attribute. section 5.2.1

Tables also make large amounts of data easier to analyze. A review table, for example, can hold one review per row and columns for its ID, satisfaction flag, and product category. Instead of reading every row, you can ask for an aggregate that reveals a trend. section 2.4

To answer a question about a table using a language model:

  • Load the data into a relational database management system such as SQLite. section 5.2.1
  • Supply the question and the table structure—including table names, column names, and data types—so the model can translate the request into SQL. section 5.1
  • Run the query in the database system, which processes the table and returns a result. Check generated queries rather than trusting them blindly; copy the database before executing them. section 5.1 section 5.5

A table can also be the output of text analysis. For example, extracting requested attributes from emails can produce a CSV file with one row per email and one column per attribute. The model’s answer is initially text, so the extracted values need postprocessing before they form a structured table. section 4.3.1

How Data Analysis with LLMs covers it

How deep it goes
Defines rows, named columns, and column types, then walks through loading tabular data into SQLite.
Examples
Uses customer records, product reviews, video games, survey results, and extracted email attributes as tabular data.
What it assumes
Introduces tables through a spreadsheet analogy and provides SQLite installation steps before database analysis.
What you can do after
Operate/configure it in SQLite by creating a table and loading data, then evaluate/understand queries generated from natural-language questions.
How it connects
Connects tables to structured data, relational databases, SQL, aggregation, and natural-language query interfaces.

Also explained in

Compare how 12 books explain database table →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data Analysis with LLMs. The section links point to the parts of the book it draws on.