SQL – Data Definition Language

Advertisement by Google

Data definition language (DDL) is concerned with the definition of data in SQL. It allows you to create, modify and delete the database objects like database, tables, views, indexes etc.

DDL commands are divided into three categories of commands namely:

  • CREATE
  • ALTER
  • DELETE

Let’s understand these from implementation point of view.

Database DDL commands

An RDBMS can have one or multiple databases. We can create  or delete a database.

  • CREATE DATABASE
    Before doing any operation in RDBMS, we have to create a database.Let’s say we want to create a School database. The syntax to create database is:

    CREATE DATABASE School;
    It will create a database named School . The database name should be unique.
  • DROP DATABASE
    Sometime situation so arises that we need to delete a database from the system. To delete a database completely, DROP command is used.
    If we want to delete School database, we need to use following command:
    DROP DATABASE School;

Download as PDF

Read next:  SQL – Table DDL Commands ››

« Back to Course page

Advertisement

Comments

Subscribe Us

Join us to get latest article in your inbox

Advertisement

SUBSCRIBE US ON YOUTUBE

Article of the Week

Follow Us On Facebook