The mechanisms in this problem and problem 706 are the most common mechanisms you will draw during second semester organic chemistry, and so it's a good idea to draw them out a few times.
In a), the nucleophile attacks the carbonyl carbon, and the double bond goes "up" to form a tetrahedral (sp3) carbon.
In b), one of the oxygen atoms acts as leaving group, and a lone pair on the other oxygen comes "down" to reform the double bond (and the sp2 carbon).
You will see this "up, down, kick" pattern in most mechanisms that involve attack at the carbonyl carbon, which is most of the reactions in second semester orgo!
a) Carbonyl to Hydrate (basic conditions) "UP"
b) Hydrate to Carbonyl (basic conditions) "DOWN"