With the vertex on the y-axis at (0,5), the equation is of the form
To find the coefficient a and thus find the equation, plug in the coordinates of the other given point.
The equation is
There is another less formal method for finding the coefficient a which you can use if you understand parabolas and quadratic functions. The equation
tells you that the displacement in y is a times the displacement in x. From (0,5) to (1,-2) the displacement in x is 1; the square of that is 1. And the corresponding displacement in y is -7; -7 is -7 times 1, so a is -7.