SQL Drop Table, SQL Tutorial, Global Guide Line Technology.
Forum | Blog |


Basic SQL Guide.           
SQL Introduction.               
 What is Table?                  
 SQL Create Table.            
 SQL Insert Statement.      
 SQL Select Keyword.        
 SQL Order by clause.        
 SQL Count Statement.      
 SQL Group By Clause.      
 SQL Having Clause.          
 SQL Alias Tables.             
 SQL Join Tables.              
 SQL Outer Join.               
 SQL Update Statement.   
 SQL Delete Statement.    
 SQL Distinct Keyword.      
 SQL Where Keyword.       
 SQL And Or Keyword.      
 SQL In Keyword.              
 SQL Between Keyword.   
 SQL Like Keyword.          
 SQL Functions.                
 SQL Concatenate.           
 SQL Substrings.               
 SQL Trim Function.         
 SQL Constraints.              
 SQL Primary Key.            
 SQL Foreign Key.            
 SQL Create Views.           
 SQL Create Index.           
 SQL Alter Table.             
 SQL Drop Table.
 SQL Truncate Table.      
 SQL Summary.                

SQL Tutorial >> SQL Drop Table.

     Back             Next     

Sometimes we may decide that we need to get rid of a table in the database for some reason or may be we don't need that's table now. In fact, it would be problematic if we cannot do so because this could create a maintenance terrifying for the DBA's. auspiciously, Any how SQL allows us to do it with SQL Drop Statement, as we can use the SQL DROP TABLE command to delete or remove any table from the database.
The syntax for SQL DROP TABLE is as under.

Syntax for SQL Drop Table

DROP TABLE "table_name"

So, if we want to drop the table of Employees that were created in the CREATE TABLE section of our SQL Tutorial, we simply type the below query to drop this table.

Example of SQL Drop Table

DROP TABLE Employees.

With the above simplest SQL Drop command we can drop any table from the database easily.

One thing we should clear is that if we try to drop a table which is based on other table with the constraints of Foreign Key relationship then we can't drop this table from the database until we drop the Foreign key relationship first. After that we can do so.  Second thing is the most important in traditional databases if we drop any database table then it couldn't be recover.  For this we may need to use database triggers.  And some databases did not support this database object.

     Back             Next     

[ About ] [ Contact ] [ Home ]
[ Links ] [ Site Map ] [ Services ] [ Privacy ]

Copyright 2005 -  2022 www.globalguideline.com All rights reserved. (Best viewed in IE 6.0+ or Firefox 2.0+ at 1024 * 768 or higher) 331 visitors are online now