2.5. USER-DEFINED DATA TYPES
User-defined data types are data types based on intrinsic system types given a name by the user, which may then be used in future DDL statements within the database where they were created.
It is particularly useful to create a user-defined data type for a unique key that has foreign key columns (usually in another table) that refer to it. Creating a user-defined type and using it for the unique key and foreign key column definitions ensures that they are the same data type.
The following parts of user-defined data types must be provided when created.
Name.
Underlying System Data Type— see Table 2-50.
Nullability— 'NULL', 'NOT NULL', 'NONULL' in single quotes, see below. For a discussion of default nullability see ...
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