I need to run a batch of "Alter table" statements on a set of database tables.
However, some of the databases may not exist, and even if they exist, the specific table might not exist.
Alter table only works if the table exists.
Is there a way to tell MySQL to execute the "Alter table" statement only if the database and table exist?
If so, how?