Previous Topic

Next Topic

Book Contents

Book Index

Understanding Foreign Keys

Within your database, various tables may be related to each other. The following shows a typical relationship between tables:


In this example:

Looking at the relationship the other way:

Defining a Foreign Key Relationship

Most databases allow you to define foreign key relationship. You can do this within AQT by clicking on the table then (on the Admin Toolbar), clicking on the Create (left-most) icon and selecting Foreign Key.

You can also create relationships by defining User-Defined Relationships. When you define a relationship, you need to specify whether it is a Foreign Key relationship, eg. whether the To Table is a Referenced Table or Dependent table of the From Table. To help you determine this:

Advanced Query Tool
© 2023 Cardett Associates Ltd. All rights reserved.