We all know as SQL professionals that a common use of the
ALTER TABLE
command is that we can change a tables’
structure in a myriad number of ways. And, that’s a good thing
too because chances are, you won’t always nail down the
initial structure. Due to changing business or application
requirements, you may even have to add additional columns that
were not considered during the schema design phase. Suppose you
have many tables that are structured similarly and they all need
a specific column added to their already-existing design. Under
certain circumstances, using the MySQL Shell in Python mode
(\py
), can reduce the number of manual
ALTER TABLE
statements you have to type. Continue
reading to see examples in the MySQL Shell…
Photo by elCarito …
[Read more]