Database:MariaDB ALTER TABLE syntax

From Juneday education
Jump to: navigation, search

You might have noticed that the alter table capabilities for SQLite are a little limited (you basically only can rename a table with it), and now you wonder how ALTER TABLE works in MariaDB.

Here's the MariaDB ALTER TABLE manual page.

MariaDB (and MySQL) allows you to alter a table in basically any way you'd like. With SQLite3, you typically create a new table with the specification you want, and copy the data from the old table into the new one, drop the old table and rename the old table to match the old table's name. With MariaDB/MySQL, you don't have to do that. The ALTER TABLE syntax for MariaDB is quite powerful and will let you modify and alter an existing table.

You'll have to read up on the MariaDB manual page linked above in order to find out how it works in detail. This page serves as a reference for those who read our database book using SQLite3 and later want to see how the concepts used in the book works in MariaDB.