SQL99 and Vendor-Specific Datatypes
The previous section mentioned that a table could contain one or many columns, each with a single defining datatype. In real world applications, datatypes provide some control and efficiency as to how tables are defined. Using specific datatypes enables better, more understandable queries and controls the integrity of data.
The tricky thing about SQL99 datatypes is that they do not map directly to an identical implementation in a given vendor’s product. Although the vendors provide “datatypes” that correspond to the SQL99 datatypes, these vendor-specific datatypes are not true SQL99 datatypes. Nonetheless, each vendor’s datatypes are close enough to the standard to be both easily understandable and job-ready.
The official SQL99 datatypes (as opposed to vendor-specific) fall into the general categories described in Table 2.1.
Table 2-1. SQL99 Datatypes
Category |
Example Datatypes and Abbreviations |
Description |
---|---|---|
binary |
|
This datatype stores binary string values in hexadecimal format. |
bit string |
|
These datatypes store either binary or hexadecimal data.
|
boolean |
|
This datatype stores truth values — either
|
character |
|
Get SQL in a Nutshell 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.