Change the statement of a table
ALTER table related declarations are used to add, delete, or modify columns in an existing table.
Database ALTER TABLE syntax
To add a column to a table, use the following syntax:
ALTER TABLE table_name ADD column_name datatype
to delete a column in a table, use the following syntax (notification, some database systems are not allowed to delete a column): ALTER TABLE table_name DROP column column_name
To change the data type column in a table, use the following syntax: ALTER TABLE table_name ALTER COLUMN COLUMN_NAME datatype
Okay, now let's take a look at how SQL drop is used.
SQL drop INDEX, drop TABLE, and drop DATABASE
Indicators, tables and databases can easily be deleted/canceled with the drop spoke. The declining indicator of the index decline indicates that it is used to delete the index table. Drop INDEX syntax for MS Access: Drop INDEX index_name on table_name
The DROP index syntax is MS SQL Server:
Drop index Table_name.index_name
DROP index Syntax for db2/oracle:
DROP Index Inde X_name
DROP index Syntax for mysql:alter TABLE table_name DROP index index_name
with Dr The OP deletes the table as follows.
Drop TABLE table_name
with DROP database.
DROP DATABASE database_name
&NBSP
Truncate the declaration of the table if we only want to delete the data table, not the table itself? Then, use the TRUNCATE TABLE statement