Download In This Chapter

Transcript
In This Chapter
After you prepare your data model, you must implement it as a database and
tables. To implement your data model, you first define a domain, or set of
data values, for every column. This chapter discusses the decisions that you
must make to define the column data types and constraints.
The second step uses the CREATE DATABASE and CREATE TABLE statements
to implement the model and populate the tables with data, as Chapter 4
discusses.
Defining the Domains
To complete the data model that Chapter 2 describes, you must define a
domain for each column. The domain of a column describes the constraints
and identifies the set of valid values that attributes (columns) can assume.
The purpose of a domain is to guard the semantic integrity of the data in the
model; that is, to ensure that it reflects reality in a sensible way. The integrity
of the data model is at risk if you can substitute a name for a telephone
number or if you can enter a fraction where only integers are valid values.
To define a domain, specify the constraints that a data value must satisfy
before it can be part of the domain. To specify a column domain, use the
following constraints:
■
Data types
■
Default values
■
Check constraints
■
Referential constraints
Choosing Data Types
3-3