Appendix C. Using SQL Datatypes

As explained in Lesson 1, “Understanding SQL,” datatypes are essentially rules that define what data may be stored in a column and how that data is actually stored.

Datatypes are used for several reasons:

Image Datatypes enable you to restrict the type of data that can be stored in a column. For example, a numeric datatype column will only accept numeric values.

Image Datatypes allow for more efficient storage, internally. Numbers and date-time values can be stored in a more condensed format than text strings.

Datatypes allow ...

Get Sams Teach Yourself SQL in 10 Minutes a Day, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.