DAM Lecture # 5
DAM Lecture # 5
What Is DDL?
• DDL is a Data Definition Language that is used to define data
structures. For example: creating a table, and altering a table are
instructions in SQL.
• DDL is used to specify a database’s structure, which includes its
tables, views, indexes, and constraints.
• DDL commands come in the following types: CREATE, ALTER, DROP,
RENAME, and TRUNCATE.
• DDL statements only modify the database’s schema; they have no
direct effect on the data within the database.
• DDL declarations are irreversible and difficult to undo.
What is DML?
• DML is a Data Manipulation Language that is used to manipulate
data itself. For example: insert, update, and delete are instructions in
SQL.
• Inserting, updating, removing, and retrieving data from a database
are all possible with DML.
• DML commands come in the following types: SELECT, INSERT, UPDATE,
DELETE, and MERGE.
• DML statements have a direct impact on the database’s data.
• In the event of an error, data can be recovered thanks to the
reversibility of DML statements.
Database Schema
• The REBUILD statement uses the existing index as the basis for the
new one.
• ALTER INDEX … REBUILD is usually faster than dropping and re-
creating an index.
• SYNTAX: