Deleting Database Objects






Deleting Database Objects

For each type of database object for which a CREATE statement exists, there is also a corresponding DROP statement with which the object can be deleted. Here are a few examples:

Figure. Delete the MATCHES table.

DROP TABLE MATCHES

Figure. Delete the view NUMBER_SETS.

DROP VIEW NUMBER_SETS

Figure. Delete the PENALTIES_AMOUNT index.

DROP INDEX PENALTIES_AMOUNT

Figure. Delete the TENNIS database.

DROP DATABASE TENNIS

All dependent objects are also removed. For example, if the PLAYERS table is deleted, all indexes (which are defined on that table) and all privileges (which are dependent on that table) are automatically removed.

Portability

All SQL products support the DROP TABLE, DROP VIEW, and DROP INDEX statements. But there does not always exist a DROP statement for every type of database object. For example, MySQL supports a DROP DATABASE, but MaxDB does not.




 Python   SQL   Java   php   Perl 
 game development   web development   internet   *nix   graphics   hardware 
 telecommunications   C++ 
 Flash   Active Directory   Windows