How a database table is organized
Concepts
- A relational database consists of tables. Tables consist of rows and columns, which can also be referred to as records and fields.
- A table is typically modeled after a real-world entity, such as a product or customer.
- A column represents some attribute of the entity, such as the list price of a product or a customer’s email address.
- A row contains a set of values for one instance of the entity, such as one product or one customer.
- The intersection of a row and a column is sometimes called a cell. A cell stores a single value.
- Most tables have a primary key that uniquely identifies each row in the table.
- The primary key is usually a single column, but it can also consist of two or more columns (compound key).
- In addition to primary keys, most database management systems (DBMS) let you define one or more non-primary (secondary)keys. In MySQL, these keys are called unique keys. Like a primary key, a non-primary key uniquely identifies each row in the table.
- A table can also be defined with one or more indexes. An index provides an efficient way to access data from a table based on the values in specific columns. An index is automatically created for a table’s primary and non-primary keys.
Back