## DOMAINS

### Prerequisites

You have generated the demo data for the SQL Tutorial.

Log on to the demo database instance DEMODB as user MONA.

Create domains. Proceed as described in SQL Tutorial, Domains.

### Examples

You can use the system table DOMAINS to determine the following database information, among other things:

● All domains for which the data type DATE was defined

SELECT owner, domainname
FROM DOMAIN.DOMAINS
WHERE datatype = 'DATE'

● All of your domains in which a default value was agreed

SELECT domainname, datatype, len, dec, "DEFAULT"
FROM DOMAIN.DOMAINS
WHERE owner = 'MONA'
AND "DEFAULT" IS NOT NULL

Note that the column DEFAULT has to be defined as a special identifier (Identifier in double quotes) because DEFAULT is a reserved keyword.

Constraint of a domain: see DOMAINCONSTRAINTS

Domain for column definition: see COLUMNS