the first reaction is an elimination reaction that takes place in an alcoholic media
the second reaction is a substitution reaction that takes place in aqueous media
the answer depends on the medium of solvent
generally water favours subs and alcohol favours elimination
as in both reactions OH- is the base cum nucleophile
in alcohol R is a +I group so electrons are slightly displaced towards OH-
so OH- gets a strong -ve charge and hence can act as a base
which is not in the case of water