SQL DROP TABLE Statement

The SQL DROP TABLE statement is used to drop an existing SQL table in a database.

DROP TABLE Syntax

DROP TABLE table_name;

Important Points

  • DROP a table very carefull; check DROP query once before dropping a table.
  • Once deleting a table will result in loss of complete information stored in the table forever.

EXAMPLE: DROP TABLE

Field Type Null Key Default Extra
ID int NO PRI
FULL_NAME varchar (200) NO
ADDRESS varchar (200) YES NULL
CITY varchar (200) YES NULL
COUNTRY varchar (200) NO

DROP The Upper SQL TABLE

DROP TABLE STUDENTS;

SQL TRUNCATE TABLE Statement

The SQL TRUNCATE TABLE statement is used to to remove all rows inside a table.

The TRUNCATE TABLE statement is not used to dalete the table itself.

TRUNCATE TABLE Syntax

TRUNCATE TABLE table_name;

TRUNCATE TABLE vs DELETE TABLE

TRUNCATE TABLE is faster and uses lesser resources than DELETE TABLE command.

Email Us: advertise@gdatamart.com

Donate Us: Support to GDATAMART

© 2023 GDATAMART.COM (All Rights Reserved)