How to move columns in a MySQL table?

If empName is a VARCHAR(50) column: ALTER TABLE Employees MODIFY COLUMN empName VARCHAR(50) AFTER department; EDIT Per the comments, you can also do this: ALTER TABLE Employees CHANGE COLUMN empName empName VARCHAR(50) AFTER department; Note that the repetition of empName is deliberate. You have to tell MySQL that you want to keep the same column … Read more

How to DROP multiple columns with a single ALTER TABLE statement in SQL Server?

For SQL Server: ALTER TABLE TableName DROP COLUMN Column1, Column2; The syntax is DROP { [ CONSTRAINT ] constraint_name | COLUMN column } [ ,…n ] For MySQL: ALTER TABLE TableName DROP COLUMN Column1, DROP COLUMN Column2; or like this1: ALTER TABLE TableName DROP Column1, DROP Column2; 1 The word COLUMN is optional and can … Read more