
44
Chapter 4: Lesson 1: Preparing to Build the Sample Application
If you had to create the Compass Travel database, you would create a table named trips to store
the information that you plan to collect about each trip. The table would look something like the
following table:
Recognizing the data types
Each field in the Trips table has a data type attribute that describes the type of data that can be
stored in the column. For instance, the tripName column can contain text data, while the price
column can only contain numeric data. It is important to know what type of data is valid for
each column so that your data collection forms can validate
against incorrect values entered by
the user.
Looking closer, you might wonder why the eventType column is a number and not a text data
type column. Recall that data requirements analysis identified the need for a type of event
(surfing, mountain climbing, kayaking, and so on). The purpose of this column is to classify trips
into various categories based on the trip activity. It is essential that the application classify the trips
consistently. Therefore, it is important to offer a list of event types for the user to select, rather
than to accept free text input.
To present a list of event types for user selection, the event types are stored in a separate table, the
eventtypes table. This table is already populated and contains the following rows:
Содержание COLFUSION MX 7-GETTING STARTED BUILDING COLDFUSION...
Страница 1: ...COLDFUSION MX7 Getting Started Building ColdFusion MX Applications...
Страница 6: ...6 Contents...
Страница 10: ......
Страница 14: ...14 Chapter 1 Introducing ColdFusion MX...
Страница 38: ...38 Chapter 3 Database Fundamentals...
Страница 40: ......
Страница 58: ...58 Chapter 5 Lesson 2 Configuring Your Development Environment...
Страница 70: ...70 Chapter 6 Lesson 3 Retrieving Data...
Страница 84: ...84 Chapter 7 Lesson 4 Building Dynamic Queries...
Страница 96: ...96 Chapter 8 Lesson 5 Creating a Trip Detail Page...
Страница 102: ...102 Chapter 9 Lesson 6 Creating a Main Application Page...