AdBlock Detected!
Our website is made possible by displaying ads to our visitors. Please supporting us by whitelisting our website.
SQL Drop Column Syntax |
|
SQL > ALTER TABLE >
Drop Column Syntax
Sometimes we will wish to delete a column from an existing table in SQL. To do this, we specify that we want to change the table structure via the ALTER TABLE command, followed by a specification indicating that we want to remove a column. The detailed syntax for each database is as follow: ALTER TABLE DROP COLUMN permanently removes a column and all its data from a table. The COLUMN keyword is optional in MySQL but required in Oracle, SQL Server, and BigQuery — always back up data before dropping columns.
In MySQL, the syntax for ALTER TABLE Drop Column is, In Oracle, SQL Server, and Google BigQuery, the syntax for ALTER TABLE Drop Column is, Let's look at the example. Assuming our starting point is the Customer table created in the CREATE TABLE section: Table Customer
Our goal is to drop the "Birth_Date" column. To do this, we key in: MySQL:
SQL Server:
Oracle:
Google BigQuery:
The resulting table structure is: Table Customer
Frequently Asked Questions
|
Our website is made possible by displaying ads to our visitors. Please supporting us by whitelisting our website.