SQL Drop Table

Drop table is used to delete the table with all records.

Syntax:-


DROP TABLE tableName

Example:- Suppose we have an employees table


+----+------------+-----------+----------------+------------+
| id | first_name | last_name | email          | address    |
+----+------------+-----------+----------------+------------+
|  1 | John       | Tailor    | john@abc.com   | California |
|  2 | Rom        | Tailor    | rom@abc.com    | California |
|  3 | Andrew     | Symonds   | andrew@abc.com | Sydney     |
|  4 | Miacle     | clerk     | miacle@abc.com | sydney     |
|  5 | Sachin     | Tendulkar | sachin@abc.com | Mumbai     |

Now Drop the table


DROP TABLE employees

After performing the operation, Now check employees table is exists or not


SELECT * FROM employees

Output:-

Table ’employees_system.employees’ doesn’t exist