liveBook · Manning

Database table

As explained in Building Web APIs with ASP.NET Core

A database table is a relational data structure consisting of rows and named columns that store records of a particular type.

A database table stores one type of record in named columns and rows. In a relational database, tables have a fixed schema: each table has a defined structure rather than a flexible collection of fields. A board-game API might use separate Users, Roles, BoardGames, and Comments tables. section 4.1.1

Separate tables still need a way to connect related records. A primary key uniquely identifies a record; another table can store that identifier as a reference. For example, a BoardGameID column in Comments can associate each comment with a particular board game. These references help form a structured database schema. section 4.1.1

This differs from a document-oriented NoSQL approach, where a board-game document might include its comments. A relational design keeps those record types in separate tables and connects them through identifiers. section 4.1.1

Figure 4.1 MyBGList database schema diagram for a table-oriented SQL database
04-01

Use the table-oriented board-game schema diagram to see how the record types are arranged as tables. section 4.1.1

A table is only part of a database schema, which also includes relationships, views, indexes, and constraints. An EF Core data model is different: it consists of C# classes used to interact with the database structure. Creating the MyBGList database in SQL Server Management Studio makes a Tables folder available; it does not, by itself, define the project’s tables. section 4.0 section 4.2.4

How Building Web APIs with ASP.NET Core covers it

How deep it goes
Defines fixed-schema tables and explains identifier-based relationships, but does not provide a worked table definition.
Examples
Illustrates Users, Roles, BoardGames, and Comments tables, including a BoardGameID column that associates comments with board games.
What it assumes
Introduces the table storage model without requiring prior knowledge of relational database structure.
What you can do after
Evaluate/understand how separate tables and identifier-based references differ from documents containing related information.
How it connects
Links tables to primary keys, database schemas, document databases, and EF Core data models.

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 Building Web APIs with ASP.NET Core. The section links point to the parts of the book it draws on.