Tech moves fast! Stay ahead of the curve with Techopedia!
Join nearly 200,000 subscribers who receive actionable tech insights from Techopedia.
A table is a named relational database data set that is organized by rows and columns. The relational table is a fundamental relational database concept because tables are the primary form of data storage.
Columns form the table’s structure, and rows form the content. Tables allow restrictions for columns (i.e., allowed column data type) but not rows. Every database table must have a unique name. Most relational databases have naming restrictions For example, the name may not contain spaces or be a reserved keyword such as TABLE or SYSTEM.
Relational tables store data in columns and rows. When creating a table, columns must be defined, but columns may be added or deleted after table creation. During this time, column data restrictions may or may not be defined. For example, when creating a CUSTOMER_MASTER table for storing customer information, definitions may be added, e.g., a DATE_OF_BIRTH column accepting dates only or a CUSTOMER_NAME column that may not be null (blank).
Table rows are the table’s actual data elements. In the CUSTOMER_MASTER table, the rows hold each customer record. Thus, a row consists of a data element within each table column. If a row value is not entered, the value is termed “null,” which does not have the same meaning as a zero or space.
Tables also have other table relationships that are defined by special columns, and the most prominent are primary and foreign keys. For example, the CUSTOMER_MASTER table has a CUSTOMER_ID column that is used to uniquely identify each table customer. If another table needs to refer to a certain customer, a corresponding column (also known as a foreign key) that references the CUSTOMER_MASTER table’s customer id may be inserted. Other tables do not need to store additional customer details that are already stored in the CUSTOMER_MASTER table.