Ads Here

Tuesday 9 January 2018

DDL Statements - Introduction

DDL stands for Data Definition Language. DDL means the language used for define anything in the database. In simple words,  any SQL statements that effect the structure of the database, we will categorized them in DDL. Now, all the DDL Statements are auto committed, that means when you execute a DDL statement you can not rollback them.
We have five DDL statements that are mainly used. So, let see some basic details of them.
1. Create Statement:
Create statement is used for create any database object. Now, when we create any database object it will change the structure as well as the meta data of the database. Using create statement we can create a lots of new database objects like tables, views, synonyms etc.
2. Alter Statement:
Alter statement is used for make changes in any created database object. For example, if we have created a table and now we want to add or remove a column of the table then we use the Alter Statement.
3. Drop Statement:
Drop statement is used for delete any database object we created. For example if we have created a table and now want to delete that then we use the drop statement.
4. Truncate Statement:
Truncate is used for deleting all data from a table. Now, truncate is mainly used for free space from database by removing the data from the table. For example, we have a table with some data & we want to delete only the data, not the table then we use Truncate Statement.
Remember that, you can not rollback or recover any data that is deleted or removed by using truncate statement.
5. Rename Statement:
Rename statement is used for rename a database object we previously created. Rename Statement is also change the structure as well as the meta data of the database. We can rename any database object like tables, views etc.
So, this is for now, in next articles we will discuss this DDL Statements in more detail. If any one have any question that ask me in the comments section below, thank you.

No comments:

Post a Comment