Wednesday, March 30, 2011

Basic database: Tables




Tables store data, so they're essential building blocks of any database.
A database should have a separate table for every major subject, such as employee records, customer orders, shipping methods, or suppliers. Data should not be duplicated in multiple tables. Duplicating data is a common error, but it's easy to avoid if you structure your tables well.
Each table contains rows called records and columns called fields.



The fields in your database have settings that determine the type of data they can store, how the data is displayed, and what you can do with the data.One important setting for fields is the data type, including number, text, currency (money), and date/time (shown together as one type in Access). Fields also have properties that control the details of information inside them, including a character length, a default value, and a validation rule that makes sure the data meets certain criteria.



To distinguish one record from another, tables can contain a primary key field. A primary key separates similar information and makes each record unique. It also brings information together. You relate one table to another using a primary key. This is how tables share data, and how you can avoid repeating information in both the tables. When tables relate, the primary key of one table becomes a foreign key of the other table.



No comments:

Post a Comment