Database Management System

Database Management System

Write a query with a function of DDL commands such as create, alter and drop.

DDL or Data Definition Language actually consists of the SQL commands that can be used to define the database schema. It simply deals with descriptions of the database schema and is used to create and modify the structure of database objects in the database. DDL is a set of SQL commands used to create, modify, and delete database structures but not data.

List of DDL commands:

  • CREATE: This command is used to create the database or its objects (like table, index, function, views, store procedure, and triggers).
    QUERY:
    create table bca2 (stu_name varchar(6), stu_roll int, stu_marks number(7));
    OUTPUT:
    Fig 1.1
  • DROP: This command is used to delete objects from the database.
    QUERY:
    drop table bca2;
    OUTPUT:
    Fig 1.2
  • ALTER: This is used to alter the structure of the database.
    1. alter table bca2 add (semester number(2));
    2. alter table bca2 modify(semester int);
  • TRUNCATE: This is used to remove all records from a table, including all spaces allocated for the records are removed.
  • RENAME: This is used to rename an object existing in the database.


Comments

Popular posts from this blog

SQL IS NOT NULL.

SQL BETWEEN Operator Example.