In a relational database, all data is contained in tables, which are made up of rows and columns.
Each table has one or more columns, and each column is assigned a specific data type, such as an integer number, a sequence of characters (for text), or a date. Each row in the table has at most one value for each column.Where there is no value for a particular row and column, we sometimes say that the value is NULL, which may be interpreted as not currently known, or not applicable, or not yet available.
An example of a table containing employee information may appear as follows:
emp_ID |
emp_lname |
emp_fname |
emp_phone |
---|---|---|---|
10057 |
Huong |
Zhang |
1096 |
10693 |
Donaldson |
Anne |
7821 |
The tables of a relational database have some important characteristics:
There is no logical significance to the order of the columns or rows. However, the column order does affect a few special queries. Likewise, the row order does affect the order in which some queries return the row, and can affect the performance of queries. If you care about the order of the rows, then the query should specify the order in which the rows are to be returned. If a particular order is very common and all other orders are uncommon, it may be best to keep the rows in that particular order.
Each row contains either no value (a NULL column) or contains one and only one value for each column.
Each value for a given column is of the same type
.
The following table lists some of the formal and informal relational database terms describing tables and their contents, together with their equivalent term in other nonrelational databases. This manual uses the informal terms.
Formal relational term |
Informal relational term |
Equivalent nonrelational term |
---|---|---|
Relation |
Table |
File |
Attribute |
Column |
Field |
Tuple |
Row |
Record |
When you are designing your database, you should make sure that each table in the database holds information about a specific thing, such as employees, products, or customers.
A relational database is not a set of unrelated tables. You can use primary and foreign keys to describe relationships between the information in different tables.