Oracle
Constraints
Figo Kim
2006. 11. 23. 21:14
- NOT NULL
- UNIQUE
- PRIMARY KEY
- FOREIGN KEY
- CHECK
- UNIQUE
- PRIMARY KEY
- FOREIGN KEY
- CHECK
- You can name a constraint, or the Oracle server automatically generates a name by using the SYS_Cn
- All constraints are stored in the data dictionary.
- SYS_Cn n is an integer so that the constraint name is unique.
- Define a constraint at the column or table level.
* Syntax
CREATE TABLE [schema.]table
(column datatype [DEFAULT expr]
[column_constraint],
...
[table_constraint][,...]);
* Column level constraint:
column [CONSTRAINT constraint_name] constraint_type,
*Table level constraint:
column, ...
[CONSTRAINT constraint_name] constraint_type
(column, ... ),
- NOT NULL constraints must be defined at the column level.