MACROMEDIA COLFUSION MX 7-GETTING STARTED BUILDING COLDFUSION MX Getting Started page 45

Building coldfusion mx applications
Table of Contents

Advertisement

Establishing a relationship between the two tables
When the user selects an event type from the list obtained from reading the eventtypes table, the
correct event type must be saved to the trips table with all the other trip-related data. The
application could store the eventType (for example, mountain climbing) itself into the eventType
column in the trips table. But if the name Mountain Climbing were later shortened to Climbing
in the eventtypes table, new mountain climbing trips would be classified differently than ones
saved before the change. For this reason and to save space in the database, the key to the
eventtypes row (eventTypeID) is stored in the trips table instead.
The two tables are said to have a relationship. This relationship works by matching data in key
fields. In this case, the matching fields consist of a primary key (eventTypeID) from the eventtypes
table, which provides a unique identifier for each record, and a foreign key (eventType) in the trips
table. The foreign key contains the same value as the primary key, pointing to a unique event
type. The following figure shows this relationship:
Exercise 3: Designing the database for your application
45

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLFUSION MX 7-GETTING STARTED BUILDING COLDFUSION MX and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Colfusion mx 7 - installing and using coldfusion mx

Table of Contents