Data Definition Language in Structured Query Language (SQL) :
- Data Definition Language is also known as “Data Description Language”.
- Data Definition Language is used to define Data and Objects in a Database.
- Data Definition Language Commands are used to make entries in the Data Dictionary.
- Data Definition Language is used to define -
- Data and Objects in Database
- Tables in a Database
- Database Structure
- Generally DDL Commands are used for Data Administration.
Some Commands Used in Data Definition Language [DDL Commands] :
| Command | Use of Command | Explanation |
|---|---|---|
CREATE DATABASE <database-name> ; | Creating Database | To create new database we use this command. |
DROP DATABASE <database-name> ; | Deleting Table | Command is used to drop complete table |
CREATE TABLE <table-name> ( ... ); | Creating Table | New table is created using this command inside a database |
DROP TABLE <table-name> ; | Deleting Table | Command used to delete any database table |
ALTER TABLE <table-name> ADD <field-name> <data-type> | Alter Table | Command is used to Add/remove/modify table record |
Summary of Data Definition Language
| Command | Explanation |
|---|---|
| Create Database | Used to Create Database |
| Drop Database | Delete Complete Database (including all tables) / Drop Database |
| Create Table | Creating table inside database |
| Drop Table | To delete any table from the database |
| Create Index | Used to create index |
| Grant | Used to grant access privileges to user |