I am using these two queries to fetch records whose salary is less than 1/10th of the 200000.
select first_name, last_name, salary from employee where salary < 200000 * 1/10
select first_name, last_name, salary from employee where salary < 1/10 * 200000
The first query gives the required output(attached below in the image). But the second query doesn't gives any record in the output(no-error).
According to my understanding of precedence in SQL both query should work in same way. That division and multiplication operator should execute first than the comparison(here <) operator.
Even, If I put parenthesis in the Second query, then also it's not giving any output.
select first_name, last_name, salary from employee where salary < ((1/10) * 200000)
So, why the Second query is not giving any output?

When there is more than one arithmetic operator in an expression, SQL performs multiplication and division first, followed by subtraction and addition. When all arithmetic operators in an expression have the same level of precedence, the order of execution is left to right.