DDL (Data Definition Language)
It is used to define the structure of the database schema, including creating, altering, and dropping schema objects like tables, views, indexes, and users.
DDL does not include creating the database itself in oracle context. DDL commands are specifically used to define the structure of objects within an existing database. It is included in some database management systems (DBMS), such as MySQL and PostgreSQL.
CREATE
Creates a new database object.
Syntax
Example
ALTER
Modifies the structure of an existing database object.
Syntax
Example
DROP
Removes a database object from the schema.
Syntax
Example
TRUNCATE
Removes all rows from a table, but preserves the table structure. This is a faster alternative to DROP and then CREATE, but cannot be rolled back.
Syntax
Example
COMMENT
Adds a comment to a database object to provide descriptive information
Syntax
Example
RENAME
Renames a database object.
Syntax
Example
Last updated