Download the BYJU'S Exam Prep App for free GATE/ESE preparation videos & tests - Download the BYJU'S Exam Prep App for free GATE/ESE preparation videos & tests -

DROP Statement in SQL

DROP is a type of DDL Command. Using the DROP statement, the objects are permanently deleted or lost from a database, and they cannot be rolled back. Unlike TRUNCATE, this command deletes the information of the table or the database, and it removes the entire structure/schema of the table or the entire database.

In this article, we will dive deeper into the DROP Statement in SQL according to the GATE Syllabus for (Computer Science Engineering) CSE. Keep reading ahead to learn more.

Table of Contents

What is a DROP Statement in SQL?

We use the drop statement when we want to delete just a table from a database or the entire database. Thus, the DROP statement would remove or delete the objects, such as an existing DB, a table, a view, or even an index.

DROP basically helps in removing a component from the relational DB management system or RDBMS in SQL.

Syntax

The Syntax of the DROP statement goes like this:

DROP object name_of_object

Example

DROP TABLE name_of_table;

where,

name_of_table: The name of the table that is to be deleted.

DROP DATABASE name_of_database;

where,

name_of_databse: The name of the database that is to be deleted.

Properties of DROP Statement in SQL

  • In a drop table, the table would be deleted along with its full structure, and there would be nothing preserved for further uses in the future.
  • The Database or Table Deletion done using the DTOP statement can never be rolled back. Thus, you must use it wisely.
  • Data is lost forever.

Keep learning and stay tuned to get the latest updates on the GATE Exam along with Eligibility Criteria, GATE Syllabus for CSE (Computer Science Engineering), GATE CSE Notes, GATE CSE Question Paper, and more.

Also Explore,

Comments

Leave a Comment

Your Mobile number and Email id will not be published.

*

*