There are a lot of ways to write a SQL query against a set of tables, given a set of input parameters, to get the desired result. (Not just syntactic or other superficial differences, but differences in logic and how relationships are specified.)
And, of course, an optimizer will handle different SQL queries differently.
And, of course, an optimizer will handle different SQL queries differently.