My issue
Can anyone tell what’s wrong in this query
My code
/* **Debug this query** to output the minimum and maximum value of payout, round to 2 decimal places. */
select round(MIN(Payout), 2),round(MAX(Payout), 2)
from employee;
Learning course: Learn SQL
Problem Link: CodeChef: Practical coding for everyone
SQL queries which uses aggregate functions in select statement currently need to have no extra spaces. The below solution will work because there is no extra space in round(min(Payout),2)
and round(max(Payout),2)
.
select round(min(Payout),2),
round(max(Payout),2)
from employee;
The reason for this is because the column name is also part of the output which gets judged, so it should be according to what is present in the test case.
1 Like