Choosing Datatypes

The datatype of a column specifies what kind of information the column will hold (characters, numbers, dates, and so on) so that the system will know how the data is to be physically stored and how it can be manipulated. For example, a character datatype holds letters, numbers, and special characters, while an integer datatype holds whole numbers only. Data in integer columns can be manipulated with arithmetic operators, while character data cannot.

Relational systems can handle a wide variety of datatypes, but be careful in making assumptions—even when two systems use the same datatype name, their meanings may be different. You'll want to check your system's reference manuals to find out what datatypes are available to you ...

Get Practical SQL Handbook, The: Using SQL Variants, Fourth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.