Database Basics |

Relational databases are made up of a collection of tables which store data. It's helpful to think of each table as being similar to a spreadsheet. When you design your table, you define the columns or fields that it will contain.
For example, the staff table design shown above will contain information about employees of a company. Each row will store the information for one employee. Below, is the Staff table filled with sample data:
|
Staff_ID |
Staff_Name |
|
1 |
Joe Smith |
|
2 |
Amy Davis |
|
3 |
Ahmed Aziz |
A well-designed table always has a primary key consisting of one or more columns that are unique to each row in the table. In the staff table above, the Staff_ID is the primary key column. This means that each record in the table will be uniquely defined by a Staff_ID.
In the case above, the Staff_ID is set up as an autonumber field which means that the database system will be responsible for assigning unique values for each record.
Indexes make it faster to find and sort the information stored in a table.
By correctly applying referential integrity rules in your database design, you can prevent inconsistent data from being entered into the database. This is accomplished by setting up a relationship, called a foreign key, between two tables.
Related Topics: