# The Learning SQL chapter FDEs need most is near the back

> Read chapters 3 to 5, jump straight to chapter 15 on metadata, and save the rest of Alan Beaulieu's book for when a project demands it.

Original: https://fdetimes.net/en/books-courses/learning-sql-book-chapters-for-fdes/

Of the 380 pages in *Learning SQL: Generate, Manipulate, and Retrieve Data*, the chapter most useful to a Forward Deployed Engineer facing a client's database comes 15th. It is called Metadata, and it sits between Views (chapter 14) and Analytic Functions (chapter 16).

The book is the third edition, written by Alan Beaulieu and published by O'Reilly Media on March 4, 2020 (ISBN-13 9781492057581). The publisher's description opens with an argument close to FDE work: companies are taking in ever more data, and you need to be able to put it to use right away.

That is usually the first job at a new client. You are given access to a database you have never seen, and you have to answer a business question before writing a single line of integration code.

So the book is best read in the order the work happens rather than the order of its contents page. Each chapter is a self-contained lesson with its own exercises, so skipping ahead leaves no gaps.

## Three chapters are enough to start asking questions

Chapter 3 (Query Primer), chapter 4 (Filtering) and chapter 5 (Querying Multiple Tables) are the core. They teach SELECT, WHERE and basic joins, which covers almost every question you will put to a client's data in the first week. Chapter 6, on set operations, can be skimmed.

Knowing how to join is still not enough, because a join requires knowing which table connects to which. At a client, an up-to-date relationship diagram is rarely there to lean on. That is why the next step is chapter 15.

## Chapter 15 is the map of an unfamiliar schema

The Metadata chapter is about INFORMATION_SCHEMA. According to the MySQL documentation, it tells you database and table names, the data type of each column and access privileges. The database describes itself; you only need to know how to ask.

The detail that matters most to an FDE is a single line in the MySQL documentation: these tables can only be read, with no INSERT, UPDATE or DELETE. On a client's production system, a place where you can poke around freely without being able to break anything is rare.

Take a hypothetical logistics company that gives you read access to a database with hundreds of tables and asks: how many orders does each customer have in each status? The first query does not touch order data at all. It looks for columns that might serve as join keys:

```sql
SELECT table_name, column_name, data_type
FROM information_schema.columns
WHERE column_name LIKE '%customer%'
ORDER BY table_name;
```

Say the results show two candidates: a `customers` table with a `customer_id` column, and an `orders` table that also has `customer_id`, both of the same data type. Matching types are the first sign that this is the right pair of keys. Before going further, ask once more to see what other columns `orders` contains:

```sql
SELECT column_name, data_type
FROM information_schema.columns
WHERE table_name = 'orders'
ORDER BY ordinal_position;
```

The list gives you a `status` column to group by and a date column such as `created_at` to limit the scope. Only now do you touch the real data, using the joins of chapter 5 and the GROUP BY of chapter 8:

```sql
SELECT c.customer_id, o.status, COUNT(*) AS order_count
FROM orders o
JOIN customers c ON c.customer_id = o.customer_id
WHERE o.created_at >= '2026-11-01'
GROUP BY c.customer_id, o.status
ORDER BY c.customer_id, o.status;
```

Three queries make a complete loop: metadata supplies the map, the join connects the two tables, and the aggregate answers the client's question. The narrow date filter keeps the first run light; once the numbers look sensible, widen the window.

## The skill travels to other engines

The descriptions of INFORMATION_SCHEMA above come from the MySQL documentation, and your client may run a different engine. But the information schema is a set of read-only views defined by the ANSI standard, and MySQL is only one of many systems that implement it.

Wikipedia's list of database systems that support it includes PostgreSQL, Microsoft SQL Server, MySQL, MariaDB, Snowflake and Amazon Redshift, which covers many of the engines you are likely to meet at clients.

**Key point:** Before you question a client's data, let the database tell you what it holds.

Time spent on chapter 15 therefore pays off far better than time spent memorizing one engine's dialect. A few column names or extension views may differ, but the method stays the same: list the tables, read the columns, infer the relationships, then query.

## Read the rest as you need it

Once you have the map, chapters 7 to 11 are the next step for analytical queries. They cover data generation and manipulation, grouping and aggregates (chapter 8), subqueries (chapter 9), advanced joins (chapter 10) and conditional logic (chapter 11). This is the toolkit for questions such as counting by customer or by status, or flagging late orders.

Chapters 12 to 14 cover Transactions, Indexes and Constraints, and Views. This is the part that helps you read production data safely: knowing which constraints govern the data, and why a query that scans a large table can slow down a client's system.

The last three chapters, Analytic Functions, Working with Large Databases and SQL and Big Data, are new in the third edition. Save them for when the project moves to a large data warehouse.

## The easy mistake in a client's database

The mistake most worth avoiding is running a GROUP BY that scans the whole orders table on production before you know what indexes it has. Read chapter 13 before writing analytical queries, test on a narrow time range, and only then expand.

If you are trying to move into an FDE role, turn this route into an interview answer: faced with an unfamiliar database, read the metadata first, join second, aggregate last. A clear sequence like that, backed by scripts you have written, says more than knowing the syntax by heart.

People who write SQL every day can skip the first half of the book. Chapter 15 is still worth reading, because at a client the first question is always what this database actually contains.

**Try this week:**

- Install PostgreSQL or MySQL locally, load any sample dataset, and write three queries against INFORMATION_SCHEMA to list tables, columns and data types
- Read chapters 3, 4 and 5 and finish every end-of-chapter exercise before opening chapter 15
- Save your schema-exploration scripts as a repo or gist, and note on your CV that you have a process for reading an unfamiliar database

## Sources

- [Learning SQL: Generate, Manipulate, and Retrieve Data - Alan Beaulieu - Google Books](https://books.google.com.vn/books/about/Learning_SQL.html?id=Ml3UDwAAQBAJ&redir_esc=y)

- [MySQL 9.7 Reference Manual, 28.1 Introduction](https://dev.mysql.com/doc/refman/9.7/en/information-schema-introduction.html)

- [Information schema](https://en.wikipedia.org/wiki/Information_schema)
