Relational databases

 

Practical definition:  Organized collection of data stored in logically related tables.

 

Example: 

 

1. Open the Northwind training database in MS Access 2003 (C:\TEMP\NorthwindTraining.mdb in 116 PHTC)  by double-clicking on the file name or by opening MS Access from the Start menu and locating the database under File/Open.  The database opens behind a "splash screen":


splash screen

 

 

(NOTE:  For practice on your own computer, make a copy of the Northwind database before starting; or start in a blank new database and import the Northwind tables you  need.)

 

2.  Close the splash screen by clicking OK.  The Main Switchboard form becomes visible in front of the database window:


switchboard


3.  Close the Main Switchboard by clicking on Display Database Window.  Verify that "Tables" is selected in the Objects bar on the left.

4.  Double-click on the Products table to see the data (open it in Datasheet view, in MS Access terminology).  A partial view:


products table 


5.  Change to table Design view by clicking on the View button (circled above) and find the primary key.  To check for other indexed columns, select Indexes from the View menu:


products table design


6.  Close the table

 

 

Referential integrity constraints:  Primary / foreign key relationships or rules defined using SQL or vendor extensions that prevent loss or unwanted modification of data and maintain data consistency throughout all tables in the database.

 

 

Example:  Relationships diagram in the Northwind database

 

1.  Click the Relationships button (circled below) or choose Tools / Relationships:


relationships button


The relationships window opens:


relationshiops window


2.  Find the Products table and its related table or tables.


3.  Note the primary key (ProductID) and two foreign keys (SupplierID and CategoryID) in the Products table.