Find the actual MAX time (6/9)


#1

https://www.codecademy.com/courses/sql-table-transformation/lessons/date-number-string-functions/exercises/numbers-ii?action=lesson_resume

People have commented that the results of the “correct” code are wonky because the cook_time and cool_down_time are actually TEXT fields from the schema table, not numeric fields. You can CAST the data elements to integer for real results.

Command:


select id, max(cast(cook_time as integer), cast(cool_down_time as integer)) 
FROM baked_goods;

Results:


#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.