
Chapter 7: Working with Data | 187 |
Figure 7-5 The Order table
customer data. Notice that you need only type a name in the Name column (replacing the word NULL) and do not need to enter a value for the CustomerID, since we’ve made the CustomerID column
In a database of any sophistication, you have multiple tables. In the MyShop database, a Customer has an Order. So, create a new table named Order, shown in Figure
The Description in the Column Properties for the CustomerID field says FK to
Customer. FK is an abbreviation for foreign key, which is used to create a relationship between a parent table and a child table. The next section explains more about what a foreign key is and how to create one.
Relating Tables with Foreign Keys
Foreign keys allow you to establish a relationship between two tables. You can think of this relationship as being parent/child, master/detail, or