Share this Page URL

Chapter 3. Managing the Consistency, For... > Fixing Referential Integrity Errors - Pg. 81

Managing the Consistency, Format, and Integrity of Your Data 81 7. Move CampaignID, Language, and EmployeeID from the Available Fields list to the Selected Fields list, and then click Next again. Enter a name for the query (you can use the name that Access provides in this exercise), and then click Finish. You'll see a list of records that don't match values in the primary table: 8. The wizard and query won't enter correct data for you, but they do provide a list of the records that you need to fix. In the list of records the query displays, you can change thedata (in this case, assign the campaign to an employee with a valid ID) so that referential integrity can be implemented. If you want, update the EmployeeID for the Spanish campaign to a value with a match in the Employees table (1 through 9), and then follow the steps in the preceding procedure to create a relationship between these tables with referential integrity enforced. When you've finished, close the ReferentialIntegrityTest database. Relationships and joins The Edit Relationships dialog box includes a button labeled Join Types. Joins are an aspect of a relational database that are used to retrieve records in queries. In general, the type of join reflects the relationship be- tween two tables. In the most common type of join--often called an inner join or an equi-join --only the records with values that match one another in the linking fields are returned by a query. In other types of joins--called outer joins--you can return all records from one table and only those records in the related table that match. For example, in a query retrieving records for customers and orders, you could use an outer join to retrieve all customer records whether or not a customer has placed an order. In,Chapter 9 when we examine queries in more detail, you'll learn more about inner and outer joins. Just the Steps Enforce referential integrity 1. On the Tools menu, click Relationships.