Delete a Column SQL

In order to delete a column from a table using SQL (Structured Query Language), you need to run the following SQL query:

ALTER TABLE <table-name> DROP COLUMN <column-name>;

For example, let’s say that you have table name called users that has the following fields:

id, first_name, last_name, middle_name, email, phone

If you would like to drop the middle_name field from the users table, you would run the query below:

ALTER TABLE users DROP COLUMN middle_name;

This would leave you with the following fields in that table:

id, first_name, last_name, email, phone

Leave a Reply

Your email address will not be published. Required fields are marked *