Data Types
Recall from “Tables, Columns, and Rows” in Chapter 2 that a column’s domain constrains the values that can be stored in the column. You can use a column’s data type for this purpose. A data type has these characteristics:
Each column in a table has a single data type.
A data type falls into one of categories listed in Table 3.4 (covered in the next six sections).
The data type determines a column’s allowable values and the operations it supports. An integer data type, for example, can represent any whole number between certain DBMS-defined limits and supports the usual arithmetic operations: addition, subtraction, multiplication, and division (among others). But an integer can’t represent a nonnumeric value such as ’schadenfreude’ and ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access