a) alter table tt.sales add column bla1 varchar(200), add index bla_idx(bla), add column bla2 varchar(200) default ' '; b) alter table tt.sales add column bla1 varchar(200); alter table tt.sales add index bla_idx(bla); alter table tt.sales add column bla2 varchar(200) default ' '; c) a and b do exactly the same: they will execute in the same time.
[ Tables and Indexes (15%) - Altering Tables ]
Answer:
a
ALTER TABLE
will (mostly) create a temporary table with the new structure, fill it and finally rename it. So it is better, to do as much as possible in a singleALTER TABLE
command.Especially with large tables, this can save a lot of time.