Assertion: Assertion is a database constraint used for specifying a relationship between data values which crosses multiple tables with in the database. An assertion can be created by using CREATE ASSERTION statement.
CREATE ASSERTION PERKSLIMIT CHECK ((EMPLOYEES.EMPL_NUM = SALARY.CUST) AND (SUM (PERKS) <= PERKS_LIMIT
The above query creates an assertion which makes sure that perks do not exceed perks limit for any employees.
An assertion can be dropped by using a DROP ASSERTION statement.
DROP ASSERTION PERKSLIMIT
Domain: A domain is a collection of valid data values defined with a name in a database. A domain can be created by using CREATE DOMAIN statement.
CREATE DOMAIN EMPL_NUM INTEGER CHECK (VALUE BETWEEN 51 AND 300)
The above query creates a domain of employee numbers having values between 51 and 300.
A domain can be dropped by using a DROP DOMAIN statement. Standard CASCADE and RESTRICT drop rules are used to drop the domain.
For Example: By using CASCADE
DROP DOMAIN EMPL_NUM CASCADE
By using RESTRICT:
DROP DOMAIN EMPL_NUM RESTRICT