DROP multiple columns in MySQL with single ALTER statement

This article will see how to DROP multiple columns from a MySQL table with a single ALTER statement. Multiple columns can be deleted from the MySQL table using a single ALTER statement by separating the DROP keyword and column name list with a comma.


ALTER TABLE table_name DROP column1, DROP column2, DROP column3........;


Let us get started by preparing the sample data. We will be creating a table, sale_details, followed by inserting rows into it. Finally, we will be deleting three columns from the sale_details table in a single query.

#create the table sale_details
CREATE TABLE sale_details (
    id INT ,
	sale_person_id VARCHAR(255) ,
    sale_person_name VARCHAR(255),
    no_products_sold INT,
    sales_department VARCHAR(255)
#insert data into table sale_details
INSERT INTO sale_details (id,sale_person_id,sale_person_name,no_products_sold,sales_department) 
 VALUES(1,"sd1","Henry",2000,"Kitchen Essentials"),
 (4,"sd2","Richa",3000,"Kitchen Essentials"),
 (7,"sd3","Ved",100,"Kitchen Essentials"),

Action Output:-


To view the snapshot of the table sale_details, we will execute:

SELECT * FROM sale_details;



We will now be deleting columns sale_person_idno_products_sold, and sales_department from table sale_details. Observe the below query for the solution.

ALTER TABLE sale_details DROP sale_person_name,DROP no_products_sold, DROP sales_department;

Action Output:-


To verify if the query dropped the columns along with data from table sale_details execute:

SELECT * FROM sale_details;



The output in image_4 shows that multiple columns got deleted along with data.


We hope this article helped you delete multiple columns from a MySQL table in a single query. Good Luck!!!

Leave a Comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top