Oracle (2) DDL statement create, alert, drop, truncate II. data Definition (DDL) Section www.2cto.com 1. CREATE (create table, index, view, synonym, process, function, database link, etc.) Common ORACLE field types include CHAR fixed length string VARCHAR2 Variable Length string www.2cto.com NUMBER (M, n) number M indicates the total length of digits, and N indicates the length of decimal places. When creating a table of the DATE type, we need to put a smaller field that is not empty in front, the field names that may be blank can be used to create a table later than the field names in Chinese. However, it is best to add the default value to the field when creating a table using the field names in English, for example, if the default sysdate parameter is used for each insert or modification, you do not need to perform any program operation on this field to obtain the operation time. When creating a table, you can add constraints to the field. For example, duplicate UNIQUE is not allowed, key word PRIMARY KEY2. ALTER (change TABLE, index, view, etc.) a. Change TABLE name alter table name 1 to table name 2; b. ADD a field ALTER TABLE name ADD field name (column) Field Name Description after the TABLE; c. MODIFY the definition description of the field in the TABLE ALTER TABLE name MODIFY Field Name field name description; d. ADD constraints to the fields in the TABLE: alter table name add constraint name primary key (field name); alter table name add constraint name UNIQUE (field name ); put the TABLE in or out the database's memory zone alter table name CACHE; alter table name NOCACHE; 3. DROP (delete TABLE, index, view, synonym, process, function, database link, etc.) delete a TABLE and all its constraints drop table name cascade constraints; 4. TRUNCATE (clear all records in the table and keep the table structure) the name of the TRUNCATE table;