Database Wisdom: SQL - Data Types
Chapter 1: Introduction
Data Types
A data type defines the type of data that can be stored in a column or variable. In programming, everything starts with variables. In a database, everything starts with columns. Some languages let you change data types on the fly; in one case you might store date data and then ten lines later, store a number.
SQL is not so forgiving. Because the database's role is the management of data and because data integrity is paramount, data types and type checking are major components of a relational database engine.
As you will find when using various databases, even though SQL is a standard and the SQL standard identifies data types, each vendor can choose what to implement, how to implement it and when to extend it. That is a long way for me to say that while you will find the same classes of data type in almost all databases, the exact names, features and constraints change per the vendor's chosen implementation.
Some vendors support many custom data types, including object types and user defined types. Because the number of types can be so large, this book does not try to cover all of those. Most databases also support binary data types. I will not try to cover that at this point; I believe binary topics are better served in an advanced SQL book. This book will explain the four most common classes of data type: string, numeric, date and boolean.
Topic: String Number Date Boolean
Topics:
|