MySQL DROP statement using phpMyAdmin
The MySQL DROP
statement is one of many powerful DDL commands. Be it ALTER TABLE some_table DROP some_column
or DROP some_table
, this type of command can drastically change your data landscape because in executing MySQL DROP
, you are completely removing objects from the database! If you are using the phpMyAdmin web interface, you can execute the MySQL DROP
statement with just a few mouse clicks. Continue reading to see how…
Self-Promotion:
If you enjoy the content written here, by all means, share this blog and your favorite post(s) with others who may benefit from or like it as well. Since coffee is my favorite drink, you can even buy me one if you would like!
Note: The DROP
statement is prevalent in most SQL dialects and is not limited in use to only MySQL.
Suppose we have a common ‘users’ table with 4 columns: ‘user_id’, ‘first_name’, ‘last_name’, and ‘country’:
For whatever reason, we have decided we no longer need the ‘country’ column and want to remove it completely from the ‘users’ table. How can we do that using MySQL DROP
statement?