🚨 Get Your Free NFT Certificate Mint by Completing the Web3 Exam! START NOW

Code has been added to clipboard!

Learn Using SQL DROP TABLE and DROP DATABASE Functions

Reading time 1 min
Published Aug 9, 2017
Updated Oct 9, 2019

TL;DR – You can remove a database, a table or an index easily by using the DROP command.

The syntax for SQL DROP

In MS Access

Example
DROP INDEX indx_name ON tbl_name

In MS SQL Server

Example
DROP INDEX tbl_name.indx_name

In DB2/Oracle

Example
DROP INDEX indx_name
DataCamp
Pros
  • Easy to use with a learn-by-doing approach
  • Offers quality content
  • Gamified in-browser coding experience
  • The price matches the quality
  • Suitable for learners ranging from beginner to advanced
Main Features
  • Free certificates of completion
  • Focused on data science skills
  • Flexible learning timetable
Udacity
Pros
  • Simplistic design (no unnecessary information)
  • High-quality courses (even the free ones)
  • Variety of features
Main Features
  • Nanodegree programs
  • Suitable for enterprises
  • Paid Certificates of completion
Udemy
Pros
  • Easy to navigate
  • No technical issues
  • Seems to care about its users
Main Features
  • Huge variety of courses
  • 30-day refund policy
  • Free certificates of completion

In MySQL

Example
ALTER TABLE tbl_name DROP INDEX indx_name

SQL DROP TABLE

Example
DROP TABLE tbl_name

SQL DROP DATABASE

Example
DROP DATABASE db_name

Removing the data from the table

Example
TRUNCATE TABLE tbl_name

In SQLite

Example
DELETE FROM customers;