Having established the need for organized data storage beyond simple files, we now look at how the relational model achieves this. The most fundamental concept in a relational database is the table. Think of a table as the primary container for your data, similar in appearance to a spreadsheet grid, but with more structure and rules.
Each table is designed to hold information about a specific type of entity, like customers, products, or orders. For instance, you might have a Customers
table to store information about people who buy from you, and a separate Products
table for the items you sell.
A table organizes data into a two-dimensional structure of columns and rows.
Columns run vertically down the table. Each column represents a specific attribute or piece of information about the entity the table describes. For example, in a Customers
table, you might have columns like:
CustomerID
FirstName
LastName
Email
SignupDate
Each column has a unique name within the table (e.g., FirstName
) and is defined to hold a specific type of data (like text, numbers, or dates). This concept of data types is important for ensuring data integrity and will be discussed in the next section. The set of column names defines the structure of the table.
Rows run horizontally across the table. Each row represents a single instance or record of the entity the table describes. In our Customers
table, each row would contain the information for one specific customer. For example, one row might hold the CustomerID
, FirstName
, LastName
, Email
, and SignupDate
for Alice Smith, while another row would hold the same pieces of information for Bob Jones.
Every row in a table adheres to the structure defined by the columns. It contains a value for each column, even if that value is sometimes designated as unknown or NULL
(a special database marker we'll encounter later).
Let's visualize a simple Products
table structure.
A basic representation of a
Products
table. Columns (ProductID
,ProductName
,Category
,Price
) define the structure, and each row represents a specific product record.
In this example:
Products
.ProductID
, ProductName
, Category
, and Price
. These define the attributes stored for each product.While the grid format resembles a spreadsheet, database tables are governed by stricter rules defined by the relational model and the Database Management System (DBMS). These rules ensure data consistency, allow for efficient querying, and enable relationships between different tables, which we will explore shortly.
Understanding this basic structure of tables, columns, and rows is foundational. It's the scaffolding upon which all relational database operations are built. In the following sections, we'll examine columns and data types more closely, introduce the concept of keys for uniquely identifying rows, and see how tables can be linked together.
© 2025 ApX Machine Learning