Images

9

Field Specifications

It has long been an axiom of mine that the little things are infinitely the most important.

—SHERLOCK HOLMES,
THE ADVENTURES OF SHERLOCK HOLMES

Topics Covered in This Chapter

Why Field Specifications Are Important

Field-Level Integrity

Anatomy of a Field Specification

Using Unique, Generic, and Replica Field Specifications

Defining Field Specifications for Each Field in the Database

Example: Defining Field Specifications

Summary

Review Questions

Fields are the bedrock of the database. They represent characteristics of the subjects that are important to an organization. Fields store the data that the organization uses as the basis of information—information that is vital to its daily operations, success, and future growth. Despite their inherent value, fields are still the most overlooked, underutilized, and neglected assets of the organization! Frequently, little or no time is spent ensuring the structural and logical integrity of the fields in the database.

Much is said and written about data integrity, but little is done about it. Many people believe that keeping an eye on their data entry personnel and having a “foolproof” user interface for the database will greatly minimize potential data-related problems. This superficial approach to data integrity commonly stems from an incorrect belief that proper data integrity takes too much time to establish. It’s important to note, however, that the people who don’t have time to establish data integrity usually spend a large amount of time fixing their improperly designed databases—typically spending up to three times as long as it would have taken them to design the database properly in the first place!

In this chapter, you’ll learn how to establish data integrity by defining field specifications for each field in the database. First, you’ll learn about the three sets of elements that compose a field specification; then you’ll learn how to conduct interviews with users and management to enlist their help in defining the specifications for the fields.

Why Field Specifications Are Important

Despite what you may have heard, the time it takes to establish field specifications for each field in the database is an investment toward building consistent data and quality information—you are not wasting time whatsoever by performing this process. In fact, you’ll waste more time in the end if you only partially perform this process or neglect it entirely. Shirking this duty means you’re bound to encounter (and suffer from) inconsistent and erroneous data and inaccurate information.

Field specifications are crucial for several reasons:

  • Field specifications help establish and enforce field-level integrity. Implementing these specifications enables you to guarantee that the data in each field is consistent and valid.

  • Defining field specifications for each field enhances overall data integrity. Remember that field-level integrity is one of the four components of overall data integrity. Field-level integrity enhances (to some extent) the table-level integrity you established in the previous stage of the design process. (This will become apparent when you work with the logical elements of the field specification.)

  • Defining field specifications compels you to acquire a complete understanding of the nature and purpose of the data in the database. Understanding the data means that you can judge whether the data is truly necessary and important to the organization, and you can learn how to use it to your best advantage.

  • Field specifications constitute the “data dictionary” of the database. Each field specification stores data on the characteristics of a particular field within the database. The complete set of specifications you establish for all the fields in the database composes a literal dictionary of the database’s structure. This data dictionary is particularly useful when you implement your database in an RDBMS—you can use it as a guide for creating the fields and setting their fundamental properties. These specifications will also help you determine what type of data entry and data validation procedures you need to implement within any user interface application you create for the database.

Keep in mind that the levels of consistency, quality, and accuracy of the data in the database (and information retrieved from that data) are in direct proportion to the degree to which you complete these specifications. Establishing each field specification completely is of paramount importance if your organization depends heavily on the information you retrieve from the database.

Field-Level Integrity

A field attains field-level integrity after you’ve defined a complete set of field specifications for the field. Field-level integrity warrants the following.

  • The identity and purpose of a field are clear, and all the tables in which it appears are properly identified.

  • Field definitions are consistent throughout the database.

  • The values of a field are consistent and valid.

  • The types of modifications that can be applied to the values in the field are clearly identified.

You can guarantee that a field structure is sound and optimally designed when it has a complete set of field specifications and fully conforms to the Elements of the Ideal Field. In fact, ensuring that the field complies with the Elements of the Ideal Field makes defining a set of specifications a relatively easy task.

If you’ve had any lingering doubt about a particular field’s conformance to the Elements of the Ideal Field, now is a good time to review that field once more. If you determine that it is not in conformance, use the appropriate techniques to resolve the problem and make the proper adjustments to the table; otherwise, you can begin the process of defining field specifications for each field in the database. Here are the Elements of the Ideal Field once again for your convenience.

  • It represents a distinct characteristic of the subject of the table.

  • It contains only a single value.

  • It cannot be deconstructed into smaller components.

  • It does not contain a calculated or concatenated value.

  • It is unique within the entire database structure.

  • It retains a majority of its characteristics when it appears in one or more tables as a foreign key.

Anatomy of a Field Specification

A field specification incorporates various elements that define every attribute of a field. All the elements within the specification are categorized as general elements, physical elements, or logical elements. These element categories enable you to focus on a distinct aspect of the field as you’re defining the specification, and they provide a way for you to find a particular element quite easily.

Here are the elements within each category.

  • General Elements: Field Name, Parent Table, Specification Type, Source Specification, Shared By, Alias(es), Description

  • Physical Elements: Data Type, Length, Decimal Places, Character Support

  • Logical Elements: Key Type, Key Structure, Uniqueness, Null Support, Values Entered By, Required Value, Range of Values, Edit Rule

Figure 9.1 shows an example of a Field Specifications sheet. We’ll use this sheet (or various portions of it) as we work on field specification examples throughout the remainder of the book.

A sample field specification sheet is given.

Figure 9.1 Field Specifications sheet.

General Elements

Items under the General Elements category represent the most fundamental attributes of the field. They provide information on the field’s purpose, the name of the table(s) in which the field appears, and the pseudonyms the field assumes under certain circumstances.

Field Name

The Field Name is the set of absolute minimal words that uniquely identifies a particular field throughout the database. You created and refined field names earlier in the database design process (see Chapter 7, “Establishing Table Structures”), so you’ll just take each name and use it as the setting for this element.

Parent Table

The table that incorporates a given field within its structure is known as the field’s parent table. This is the only table in which the field will appear unless the field is participating in establishing a relationship. (You’ll learn more about this exception in Chapter 10, “Table Relationships.”) For example, STUDENTS is the parent table of the STUDFIRST NAME field.

Specification Type

The elements you set for a given field depend upon the type of specification you define for the field. You can define a specification in three ways.

  1. Unique: This is the default specification for all fields except those that serve as a template for other fields or those that participate within a table relationship as foreign keys. You can incorporate all but the Source Specification element for this type of specification, and the element settings you establish will apply only to the field indicated in the Field Name element.

  2. Generic: This specification serves as a template for other field specifications and helps you ensure consistent definitions for fields that have the same general meaning. For example, you could create this type of specification for a generic STATE field and then use it as the basis for every other STATE field in the database. Fields such as CUSTSTATE, EMPSTATE, and VENDSTATE all have the same meaning (they represent a state within the United States), but enough of an obvious distinction exists between them to require that they remain separate fields. (If you recall, you learned about generic fields in Chapter 6, “Analyzing the Current Database,” when you were developing the Preliminary Field List and in Chapter 7 when you were working with the Elements of the Ideal Field.)

    A generic specification requires you to use a nonspecific field name and element settings that are as broad and general as possible. You can, however, incorporate any element except Parent Table, Shared By, Alias(es), and Source Specification.

  3. Replica: This is the default specification for a field based on a generic field or a field that serves as a foreign key within a table relationship, and it draws a majority of its element settings from an existing specification. You can incorporate elements that were not already incorporated by the source specification, and you can alter any element settings drawn from the source specification.

You’ll learn how to define each type of specification in the section “Using Unique, Generic, and Replica Field Specifications” later in this chapter.

Source Specification

The Source Specification element is set only on a Replica specification and indicates the name of the specific field specification upon which the current specification is based. (You’ll see a good example of this element in the next section.)

Shared By

The Shared By element indicates the names of other tables that share this field. The only table names that should appear here are those that have an explicit relationship to the field’s parent table. For example, assume you have a data table called EMPLOYEES that is related to two subset tables called PART-TIME EMPLOYEES and FULL-TIME EMPLOYEES via a field called EMPLOYEE ID NUMBER. As you create a field specification for EMPLOYEE ID NUMBER, you would use “PART-TIME EMPLOYEES, FULL-TIME EMPLOYEES” as the setting for this element.

Alias(es)

The Alias is a name (or set of names) that you use for the field in very rare circumstances. One instance in which you would use an alias is when there must be two occurrences of the field in the same table. Let’s assume that an organization is accustomed to identifying its employees by unique values within an EMPLOYEE ID NUMBER field. Now, consider the SUBSIDIARIES table structure in Figure 9.2 (this is a partial structure only).

A figure shows the subsidiaries table structure. The fields such as Subsidiary ID Number, Subsidiary Name, Employee ID Number, Employee ID Number, SubsStreet Address, and SubsCity are listed.

Figure 9.2 A table requiring two occurrences of the same field.

In this instance, each subsidiary has a president and a vice president. Both of these individuals must be represented in the table because of their positions within the subsidiary organization, so there are two EMPLOYEE ID NUMBER fields in the table structure. Proper database design, however, dictates that there can only be one occurrence of this field within the table; there is an obvious problem here. The only solution is to use an alias for one or both occurrences of the EMPLOYEE ID NUMBER field. For instance, you could (for sake of clarity) use PRESIDENT ID as an alias for the first occurrence of EMPLOYEE ID NUMBER and VICE PRESIDENT ID as an alias for the second occurrence of EMPLOYEE ID NUMBER. With the aliases in place, both employees are properly represented within the table. Figure 9.3 shows the revised table structure.

The table structure of the subsidiaries is presented.

Figure 9.3 Using aliases in place of the EMPLOYEE ID NUMBER fields.

Although using an alias is acceptable under these circumstances, you should use them very judiciously; otherwise, they can become difficult to manage and maintain, eventually conceal or disguise the true meaning of the original fields, and cause you to misunderstand what the data actually represents. This issue will become even clearer when you begin to establish table relationships.

Description

Description is a complete interpretation of the field. Composing a field description is extremely beneficial because it forces you (and everyone in the organization) to think carefully about the nature of the data that will be stored in the field. You can be relatively sure that the field requires further refinement if you have difficultly composing a suitable description.

Earlier in the database design process, you learned a set of guidelines for composing a table description. Similarly, a set of guidelines exists that governs how you compose a proper field description:

Guidelines for Composing a Field Description

  • Use a statement that accurately identifies the field and clearly states its purpose. The description should supplement the field name in terms of defining what the field represents. It should also state the field’s role within the table or its relationship to the table’s subject. Here’s an example of such a description:

    CustCity—The metropolitan area in which a customer resides or conducts business. This is an integral component of a customer’s complete address.

  • Write a clear and succinct statement. The description should be free of confusing sentences or ambiguous phrases. Although the description should be as complete as possible, use the minimum number of words necessary to convey the required information. As you’ve seen with table descriptions, verbose statements are difficult to read and understand.

  • Refrain from restating or rephrasing the field name. Neither of these practices does anything to illuminate the identity or purpose of the field. Remember that the purpose of a description is to provide a complete interpretation of the field. Here’s an example of a poor description:

    CustLast Name—the last name of a customer.

    A description is far more useful when you write it in this manner:

    CustLast Name—the surname of a customer, whether original or by marriage, that we use in all formal communications and correspondence with that customer.

  • Avoid using technical jargon, acronyms, or abbreviations. Although some people within the organization will understand these types of idioms, it’s better for you to use terminology that everyone understands. Remember that a description must be as clear as possible to anyone who reads it. For example, you should avoid this type of statement:

    Employee ID Number—A unique number used to identify an employee within the organization. It is a component of the SSP.

    The problem with this description is that there is no inherent way to determine the meaning of the acronym SSP. You could resolve this problem by spelling out the complete term, but it would be better for you to restate the purpose of the field.

  • Do not include implementation-specific information. There’s no reason to include the fact that a given field appears on a particular data entry screen or is used within a specific piece of programming code. This type of information is more appropriate for the implementation phase of the overall database development process.

  • Do not make this description dependent upon the description of another field. Each description should be as complete as possible and independent of every other description in the database. Interdependent descriptions introduce unnecessary confusion and can inadvertently obscure the field’s true identity and purpose. Avoid using a description such as this:

    Item Reorder Level—Minimum number of items that must exist for a particular product. (See description for Quantity On Hand.)

  • Do not use examples. As you learned in Chapter 7, using examples in a description is a bad idea because they depend on supplemental information to convey their full meaning. You can ensure that a description is clear and succinct by keeping it absolutely free of examples.

Figure 9.4 shows the General Elements section of a Field Specifications sheet for an EMPLOYEE ID NUMBER field.

The general elements section of the employee ID number field.

Figure 9.4 The General Elements category for an EMPLOYEE ID NUMBER field.

Physical Elements

The Physical Elements category pertains to the structure of a field. Its elements are expressed in general terms because each RDBMS program implements them in a slightly different manner. Establishing these elements during this phase of the design process helps you ensure consistent field definitions throughout the database and reduces the time it will take you to implement the field structures in an RDBMS program.

Data Type

The Data Type element indicates the nature of the data that the field stores. The three data types we’ll use as the setting for this element are:

  1. Alphanumeric: This data type stores any combination of letters, numbers, keyboard characters, or special characters. Keyboard characters include the comma, dollar sign, exclamation mark, percent sign, and period. Special characters include the copyright symbol, the trademark symbol, and the symbol for pi.

  2. Numeric: This data type stores only whole numbers and real numbers. It will not accept numbers with leading zeroes (for example, 0000234) because they are not genuine numbers.

  3. DateTime: This data type stores dates, times, or a combination of both.

Keep in mind that the RDBMS program you use to implement the database will have a wider variety of data types available for you to use. I use these general data types, however, to keep things as simple and clean as possible during the design process.

Length

The Length element specifies the total number of characters that a user can enter for any given field value. The RDBMS program you use to implement the database will determine the maximum number of characters you can set for this element. Although you can theoretically set the length element for any data type, you should be aware that some RDBMS programs do not allow you to specify a length for a numeric field. Instead, the RDBMS program sets the length of a numeric field based on the type of number the field stores, such as an integer, a long integer, or a real number.

Decimal Places

The Decimal Places element denotes the number of digits to the right of the decimal point in a real number. The number of digits determines the real number’s precision. For example, many businesses require that all currency values have four digits of precision to the right of the decimal point.

Character Support

The Character Support element indicates the type of characters that a user can enter into a given field value. Setting and enforcing this element helps you ensure that the user cannot introduce meaningless data into the field, thus enhancing field-level integrity.

Let’s say you’re working with a CUSTSTATE field and its data type is Alphanumeric. This data type is appropriate for the field because it allows a user to incorporate letters as part of a given field value. But it also allows him to use numbers, keyboard characters, and extended characters, which means that he can enter a meaningless value into the field—there are no state names or state abbreviations that contain characters other than letters. You solve this problem by using the Character Support element to define the characters that the user can incorporate within a field value. (I address the issue of a valid combination of letters later in the “Logical Elements” section.)

You can choose to include or exclude any of the following types of characters.

  • Letters: All letters of the alphabet including foreign language letters such as é and ñ.

  • Numbers: 0 through 9.

  • Keyboard characters: Any standard character other than letters and numbers, such as asterisk, ampersand, bracket, caret, comma, equals sign, exclamation point, parenthesis, percent sign, period, pound sign, question mark, quote, semicolon, slash, or vertical bar. Note that the Field Specifications sheet includes examples of the characters that belong to this category.

  • Special characters: Any character that you can produce only through specific combinations of standard keys and the CTRL, ALT, and/or SHIFT keys, or with the aid of a special software program. Characters in this category include complex mathematical symbols, the copyright symbol, fractions, the symbol for pi, and the trademark symbol. The Field Specifications sheet includes examples of these characters as well.

Figure 9.5 shows the Physical Elements section of a Field Specifications sheet for an EMPLOYEE ID NUMBER field.

The physical elements section of the employee ID number field.

Figure 9.5 The Physical Elements category for an EMPLOYEE ID NUMBER field.

Logical Elements

The Logical Elements category pertains mainly to the values within a field. Its elements govern matters such as its role within a table, whether each value should be unique, when a value should be entered, and whether a value can be edited. Setting these elements helps you establish and enforce a large part of field-level integrity.

Key Type

The Key Type element designates a field’s role within a table, which you identified as you were establishing a primary key for the table. As you already know, a field can serve as a non-key, a primary key, or an alternate key. In Chapter 10, you’ll learn all about foreign keys and when to designate a field as a foreign key on the Field Specifications sheet.

Key Structure

The Key Structure element denotes whether a field designated as a primary key is acting as a simple (single-field) primary key or as part of a composite (multifield) primary key.

Uniqueness

This element indicates whether a field’s values are unique. You set it as “Unique” when the Key Type element is set to “Primary”; otherwise, you’ll typically set this element as “Non-unique.”

When you work with a non-key field, think about how its values are going to be used so that you can determine whether they should be unique. Consider the DEPARTMENTS table structure in Figure 9.6.

A figure shows the departments table structure. The fields such as department ID number, department name, and employee ID number are listed.

Figure 9.6 Should the values of EMPLOYEE ID NUMBER be unique?.

In this example, the EMPLOYEE ID NUMBER field identifies the person who manages a particular department. Assuming that a person is allowed to manage only one department at any given time, the values in this field should be unique; therefore, you should set the Uniqueness element for this field as “Unique.”

Null Support

Null Support specifies whether a field accepts Null. “No Nulls” is the setting you’ll commonly use for this element, especially when a field serves as a primary key or an alternate key, or when the field’s Required Value element is set to “Yes.” You can set this element to “Nulls Allowed,” however, when there is a valid reason for a field to accept Nulls. A CUSTCOUNTY field, for example, must accept nulls because a customer may not know the name of the county in which she lives. (Of course, it will no longer be Null after she supplies the county name.)

Remember that Null does not represent a blank—it represents a missing or unknown value. Users commonly make the mistake of using a blank to represent a meaningful value, such as “None,” “Not Applicable,” “No Response,” and “Not Wanted.” If these values are valid for a particular field, then make sure you include them in the Range of Values element for the field. Above all, use Nulls judiciously and do not use blanks!

Values Entered By

The Values Entered By element indicates the source of a field’s values. Either a user will enter values into the field manually or a database application program will enter them automatically; the application program can provide values for the field only if the person who developed the program provided a means for it to generate the values. Note that the setting that represents the database application program is “System.”

Required Value

The Required Value element denotes whether a user is required to enter a value for a field. Although you’ll typically set this element to “No” for most of the fields in a table, you must set it to “Yes” when the field serves as the primary key. You may also need to set Required Value to “Yes” for a field such as CUSTZIPCODE—a letter or package you send to a given customer must include a ZIP code for the Postal Service to handle it properly and accurately.

Range of Values

The Range of Values element specifies every possible valid value for a field. You can set this element in various ways, such as with a lower and upper limit (1,000 to 9,999) or with a specific list of values (“WA,” “OR,” “ID,” “MT”). You can establish a range of values under three categories:

  1. General: A complete collection of every possible value for this field. For example, the general range of values for a CUSTSTATE field might include all valid abbreviations for every state in the United States.

  2. Integrity-specific: A collection of values based on the field’s role within a table relationship. (You’ll learn all about this category in Chapter 10.)

  3. Business-specific: A collection of values generated by a particular business requirement. Organizations commonly have various requirements that limit the range of values for a field. In an organization that conducts its business strictly in the Pacific Northwest, for example, the valid range of values for a CUSTSTATE field are “WA,” “OR,” “ID,” and “MT.” (You’ll learn more about this category in Chapter 11, “Business Rules.”)

You’re concerned only with the general range of values during this stage of the database design process, and you’ll revisit the Range of Values element later when you establish table relationships and business rules.

It’s important to note that “Other” and “Miscellaneous” are two values that you do not want to set within any category of the Range of Values element. Both values are nonspecific and absolutely meaningless within this context and are a sign of mental laziness in that their very presence indicates a need to review the field for possible refinement. You can avoid unnecessary confusion and potential problems by refraining from using these values.

Edit Rule

This element designates at what point a user can enter a value into a field and whether he can modify that value. You set this element to one of these five options.

  1. Enter Now, Edits Allowed: A user must enter a value for this field when she creates a new record in the field’s parent table. She can then edit the value at any time.

  2. Enter Later, Edits Allowed: A user has the option of entering a value for this field when creating a new record in the field’s parent table. This does not imply in any way that the field’s value can be Null for all time; the user must enter a value for this field at some point in the near future. After entering the value, she can then edit it at any time.

  3. Enter Now, Edits Not Allowed: A user must enter a value for this field when she creates a new record in the field’s parent table, but she cannot edit it at any time whatsoever.

  4. Enter Later, Edits Not Allowed: A user has the option of entering a value for this field when she creates a new record in the field’s parent table. This does not imply in any way that the field’s value can be Null for all time; the user must enter a value for this field at some point in the near future. After entering the value, she cannot edit it at any time whatsoever.

  5. Not Determined At This Time: The Edit Rule will be determined at the time the database is implemented in an RDBMS program.

Images Note

Options two and four give the user a choice to enter a value into the field at a later time. The length of time a user is given to enter a value will be determined and in some way enforced when the database is implemented into an RDBMS program.

Figure 9.7 shows the Logical Elements section of a Field Specifications sheet for an EMPLOYEE ID NUMBER field.

The logical elements section for the employee ID number field.

Figure 9.7 The Logical Elements category for an EMPLOYEE ID NUMBER field.

Using Unique, Generic, and Replica Field Specifications

Earlier in this chapter, you learned that you could define a specification as Unique, Generic, or Replica. You can ensure that you define the appropriate type of specification for a given field by following these simple guidelines:

  • Use a Unique specification for any field that will appear only once within the entire database or for a field that serves as a primary key.

  • Use a Generic specification for a field that serves as a template for other fields within the database. Remember to use a nonspecific field name and element settings that are as broad and general as possible.

  • Use a Replica specification for a field that you base on a given generic field or for a field that serves as a foreign key within a table relationship.

Figure 9.8 shows the complete Unique field specification for a VENDOR ID NUMBER field.

A field specification sheet for the vendor ID number field.

Figure 9.8 Unique field specification for the VENDOR ID NUMBER field.

Here are a couple of things to note about this specification.

  1. This field also appears in the PRODUCTS table, as indicated by the Shared By general element. This is both reasonable and necessary because each product must be associated with a specific vendor. (You’ll learn more about this type of issue in the next chapter.)

  2. Examine the settings for the Uniqueness, Null Support, Required Value, and Edit Rule logical elements. They are set in this manner because the Key Type element is set to “Primary.” You should, in fact, use these element settings for any field that serves as a primary key.

Figure 9.9 shows the complete Generic field specification for a generic STATE field.

A field specification sheet for the state field.

Figure 9.9 Generic field specification for a generic STATE field.

Take note of these items:

  1. The description is very general, as it should be for this type of specification.

  2. The Range of Values logical element is appropriately broad.

This field (and its specification) now serves as a template for all other state fields you create in the database. For example, you can create a VENDSTATE field based on the generic STATE field. You’ll define a Replica specification for the VENDSTATE field that is based on the STATE field’s Generic specification. Although the VENDSTATE field’s Replica specification draws its initial element settings from the STATE field’s Generic specification, you can modify any of the Replica specification’s element settings so that you can completely customize them for the VENDSTATE field. Figure 9.10 shows the customized Replica field specifications for the VENDSTATE field.

A field specification sheet for VendState field.

Figure 9.10 Customized Replica field specifications for the VENDSTATE field.

Here are a few things to note about this specification.

  1. The field name (VENDSTATE) accurately denotes what the field represents.

  2. The Source Specification general element properly references the generic STATE field’s specification.

  3. The Description element is now specific to this field. Recall that the description is more general in the source specification.

  4. The Range of Values element is now specific to this field; it was much broader in the source specification.

In the next chapter, you’ll learn how to define a Replica field specification for a field that serves as a foreign key.

Defining Field Specifications for Each Field in the Database

Now that you have all the necessary fields assigned to each table and you understand the various elements within a field specification, you can begin the process of defining a field specification for each field in the database. It will take you a considerable amount of time to complete this process, but remember that you’re working diligently to establish field-level integrity by ensuring that the data is consistent, valid, and as free from errors as possible. All your hard work will pay great dividends because the information you retrieve from the database will always be timely and accurate, and you will have a reliable set of structural blueprints you can use when you implement the database in an RDBMS program.

You can ensure that the specifications are as complete and accurate as possible by working with both users and management to define them. They can provide insights into the data and can be of special assistance in refining the specification’s logical elements. You don’t have to speak with everyone in the organization, but you do want to try to meet with a representative number of people who are very familiar with the data and how it is used. Schedule as many meetings as are necessary (or possible) to complete the interview process, and take the time you need to be as thorough as you can. Above all, do not rush through this phase! Doing so just diminishes the benefits of your overall efforts and increases your chances of making unnecessary mistakes.

The best strategy for this task is to define as many of the specifications as you can (as completely as possible) and then work with the participants to complete the rest. As you work with a field’s specifications, use your best judgment to define the settings for each element. Don’t worry if your settings seem slightly incorrect or if you have difficulty providing settings for some of the elements—you’re going to review them with the participants anyway. After you’ve defined specifications for all the fields that are familiar to you, begin meeting with the participants to work on specifications for the remaining fields.

Your first order of business during the initial meeting is to explain the various elements within a field specification and make sure that everyone understands them as much as possible. Providing the participants with a brief and succinct education on the specification’s elements gives them the knowledge they need to help you define a specification properly. (In subsequent meetings, just review the elements to make certain that everyone remembers what they represent.)

Next, review all the specifications you’ve defined and ask the participants whether the settings for the elements are suitable and correct. In some cases, the participants will reveal new information about a field that will affect that field’s specification. For example, a participant may remember (prompted by some topic in the discussion) that a specific set of values has always been used for a particular field; therefore, you set the field’s Range of Values element to reflect this new information. Make sure that you examine each part of the specification and then move on to the next specification when the participants have no further suggestions for refinement. Repeat this process for each specification.

Now, work with the participants on the specifications you were unable to define or complete. Try to work with the people who are most familiar with the fields under discussion because they are likely to know what settings should be used for the Logical Elements category. Identify the appropriate element settings for each field and mark them on the Field Specifications sheet. After you’ve defined specifications for every field in the database, the entire process is complete.

The design of the new database is now close to completion. In the next chapter, you’ll learn how to establish relationships between the tables in the database. Relationships are important because they allow a view to draw data from multiple tables simultaneously.

EXAMPLE: DEFINING FIELD SPECIFICATIONS

Now that you have all the appropriate fields assigned to the tables in the Mike’s Bikes database, it’s time to define field specifications for each field. Before you meet with Mike and his staff, you define as many field specifications as you can. None of the tables are unusual in any way, and the fields are pretty straightforward, so you have little difficulty in defining the specifications. Figure 9.11 shows the specifications for the PRODUCT DESCRIPTION field in the PRODUCTS table.

The product description field’s specification sheet.

Figure 9.11 Field specifications for the PRODUCT DESCRIPTION field.

Now you meet with Mike and his staff to discuss the field specifications you’ve defined. No one seems to have problems with any of the specifications; everyone confirms that all the element settings seem suitable and correct. You do have a question, however, regarding the CATEGORY field in the PRODUCTS table: You want to know the appropriate setting for the Range of Values element. The response to your question is mixed—no one seems to know the complete list of categories that are valid for the field, so you decide to specify a general range of values for now. Figure 9.12 shows the revised logical elements for the CATEGORY field.

The logical elements section of the category field.

Figure 9.12 The logical elements for the CATEGORY field in the PRODUCTS table.

You’ll revisit this field (and its elements) when you establish business rules for the database. With this problem solved, your meeting—as well as the process of establishing field specifications—is complete.

Summary

The chapter opened with an explanation of why field specifications are important and the benefits you derive from defining them. You learned that defining specifications helps you establish and enforce field-level integrity, enhances overall data integrity, and compels you to acquire a complete understanding of the nature and purpose of the data in the database. This level of understanding enables you to leverage the data to your best advantage.

Next, we discussed the anatomy of a field specification. You’re now familiar with the three categories of elements within the specification and the sheet you use to record them. We then discussed each category and its elements in detail. As you now know, the General Elements category represents the most basic attributes of the field. During this discussion, you learned a set of guidelines that will help you compose a good field description. You also learned that you could define three types of specifications, thus enabling you to establish and maintain consistent field definitions. We examined the Physical Elements category next, and you learned that it pertains to the structure of the field. The Logical Elements category was the last topic of discussion in this section. You now know that it mainly pertains to a field’s values and that it includes elements such as Key Type, Null Support, Range of Values, Edit Rule.

We then discussed how to use each type of specification, and you learned a set of guidelines that will help you determine which one to define for a given field. You also examined samples of the specifications, and you know how they differ.

The chapter ended with a discussion of defining field specifications for each field. Here you learned that the best way to ensure complete and accurate specifications is to work with users and management to define them. You should first define as many specifications as you can and then work with the staff to define specifications for the remaining fields. You also learned that you could work with staff to refine the specifications you initially defined.

Review Questions

1. State two major reasons why field specifications are important.

2. What do you gain by establishing field-level integrity?

3. What are the three categories of elements in a field specification?

4. Name the three types of specifications.

5. Why is it beneficial for you to compose a proper field description?

6. What does the Data Type element indicate?

7. What does the Character Support element indicate?

8. What types of keys are indicated on a field specification?

9. True or False: Null represents a blank value.

10. What is the significance of the Range of Values element?

11. What is the purpose of an Edit Rule?

12. When do you use a generic specification?

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.161.222