Thursday 11 October 2012

DROP TABLE STATEMENT





‘Drop table’ removes one or more table definitions and all data.

Syntax:
DROP TABLE <Table 1>, <Table 2>, …,<Table N>;

Example:
Use the below script and create tables.



CREATE TABLE Sample_Table
(
ID INT,
NAME VARCHAR(20)
);

CREATE TABLE Sample_Table1
(
NAME VARCHAR(20),
TYPE VARCHAR(10)
);

CREATE TABLE Test_Table
(
PRODUCT_ID INT,
PRODUCT_NAME VARCHAR(30)
);

Drop single table:
DROP TABLE Sample_Table;

O/P:


Drop more-than one table:
DROP TABLE Sample_Table1,Test_Table;

O/P:

1 comment:

  1. It would be great if you can add a screen shot after running DROP statement.

    ReplyDelete