They are both similar but not entirely the same.
The first expression y/x means we divide y over x. We divide two values here and we are not subtracting first before division. This expression is useful for when you want to find the variation constant in the equation y = kx (for direct proportion equations).
The other expression (y2-y1)(x2-x1) is where we first subtract the y values, and do the same for the x values, before we divide. This computes the slope of the line through the two points (x1,y1) and (x2,y2). It's also useful to figure out the average rate of change (one application of slope). For problems involving time versus distance, the average rate of change is the average speed in which the object is moving.