The DB2 table creation statements described below contain constraints. the DB2 table creation statements are for your reference and hope to help you learn about the DB2 table creation statements.
- CREATE TABLE EMPLOYEE
-
- (Empno intgrate not null primary key,
-
- Job varchar (10) CONSTRAINT CHECH_JOB
-
- CHECK (job in ('engineer ', 'sales', 'manager ')),
-
- ...,
-
- CONSTRAINT CHECK_AGE_SALRY CHECK (NOT (AGE <30 and salary> 6000 ))
-
- )
-
- 2. CREATE TABLE EMPDATA
-
- (Empno intgrate not null,
-
- Sex char (1) not null constraint sexok check (sex in ('M', 'F '))
-
- Not enforced // DB2 do NOT force this column check when inserting or updating
-
- Enable query optimization, // DB2 uses it when running the SELECT statement on the table
-
- Salary intgrate not null,
-
- Constraint salaryok check (salary between 0 AND 100000)
-
- NOT ENFORCED
-
- ENABLE QUERY OPTIMIZATION
-
- )
Three types of DB2 database backup solutions
DB2 logfilsiz parameter settings
DB2 command line connection
How to reset the silent State of the DB2 tablespace
Create a DB2 tablespace in windows