MySQL

How to Delete a Column in a Table in MySQL

In this tutorial, we are going to see how to delete a column in a table in MySQL. The ALTER TABLE statement is used to add, remove or modify columns in an existing table. Here is the syntax to delete a column in a MySQL table:

ALTER TABLE tableName DROP COLUMN columnName;

 

How to Delete a Column in a Table in MySQL

The following query will remove the “address” column from the “users” table.

ALTER TABLE users DROP COLUMN address;
mcqMCQPractice competitive and technical Multiple Choice Questions and Answers (MCQs) with simple and logical explanations to prepare for tests and interviews.Read More

Leave a Reply

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