ORACLE SQL DDL language

ORACLE SQL DDL language

开发工具与关键技术:Oraclesql*plus PLSQL Developer
作者:黄元进
撰写时间:2019年03月25日

DDL: Data Definition Language
DDL defines the structure of the database, comparing to create, modify or delete database objects, rename the table, including the following SQL statement:

Create table: create database tables
must have: you must specify:
-create TABLE privilege - table
- storage space - the column name, data type, size,
Here Insert Picture Description
ALTER TABLE: change the table structure, add, delete, modify the column length
ALTER TABLE ADD: append a the new column
Here Insert Picture Description
a new column in the table is the last one
Here Insert Picture Description
MODLFY: can modify the data type, size, and default value of the column
Here Insert Picture Description
using the column DROPCOLUMN clause deleted are no longer needed.
Here Insert Picture Description
use rENAME cOLUMN ***** TO clause to rename columns
Here Insert Picture Description
delete table
data structures are removed and
all matters related to the running submitted
all the relevant index has been dropped
DROP tABLE statement can not be rolled back,
Here Insert Picture Description
empty table
TRUNCATE tABLE statement:
delete all the data in the table
release table storage space
Here Insert Picture Description
Note: these DDL commands after the operation, are not rolled back!

Guess you like

Origin blog.csdn.net/weixin_44547949/article/details/88917888