Loading

SQL DROP Statement

Submitted by: 
Language: 
Visitors have accessed this post 7261 times.


The DROP statement is used to delete object in SQL, with the DROP statement we can remove index, tables and even databases easily.

DROP INDEX

The indexes of the table can be dropped by the using the following command.

SYNTAX for MS Access

  1. DROP INDEX index_name
  2. ON TABLE_NAME

SYNTAX for SQL SERVER
DROP INDEX TABLE_NAME.index_name

SYNTAX for Oracle
DROP INDEX index_name

SYNTAX for MySQL
ALTER TABLE TABLE_NAME DROP INDEX index_name

For various DBMS the respective statement will drop the indexes from the table.

TO DROP TABLES

To drop the tables from the database the following syntax is used and it is same for all DBMS.

SYNTAX
DROP TABLE TABLE_NAME

TRUNCATE

If we do not want to drop the complete table but only want to flush/delete the data inside it you can use the TRUNCATE statement.

SYNTAX
TRUNCATE TABLE TABLE_NAME

TO DROP Databases

To drop the complete database we can use the following method and is same across all DBMS.

SYNTAX
DROP DATABASE database_name




Comments

hi sir,,bakit nyo inalis ung SMS w/Broadcasting ko po?...
dahil ba sa walang code?....mas madami pa nga dyan na walang code eh!!!comment lang po..

thanks,

IT Administrator
joelandtogonon@yahoo.com
09071769308

admin's picture

Please let me know the link that don't have a source code so I can also remove it.

Thank you

please help me to my project about grocery store pos inventory using visual basic 6.0

thanks :)

Add new comment

(If you're a human, don't change the following field)
Your first name.
(If you're a human, don't change the following field)
Your first name.

Filtered HTML

  • You may insert videos with [video:URL]
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <asp>, <c>, <cpp>, <csharp>, <css>, <html4strict>, <java>, <javascript>, <mysql>, <php>, <python>, <sql>, <vb>, <vbnet>. The supported tag styles are: <foo>, [foo].
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
To prevent automated spam submissions leave this field empty.