Example of an Update Query

Relating Tables in a Database

Tables are related by Key Data. The Primary Key is the best Field because it is unique: it is an AutoNumber that is Indexed (no duplicates).

 

Why Does This Matter? There has to be at least one Field that matches in both Tables to create a relationship. We'll use the Primary Key to create relationships between the Tables.

 

Plan: This lesson will create a Rental Table that has three prices: new movies cost more than old ones. The Movie Table will be linked to the Rental Prices by a common Field: RentalPriceID, the Primary Key in the Rental Table.

 

What Are the Steps? Create the Rental Table and Update the Movie Table to add RentalPriceID as a Foreign Key so these Tables can be linked.

 

Then we'll create an Action Query to update the Rental Prices in the Movie Table. The Update Query will use the Year that a movie was released to determine the Rental Price..