CREATE TABLE table_name_37 (laps INT, time_retired VARCHAR, grid VARCHAR)

Name the highest laps for time/retired of engine and grid of 5
SELECT MAX(laps) FROM table_name_37 WHERE time_retired = "engine" AND grid = 5
SELECT MAX("laps") FROM "table_name_37" WHERE "engine" = "time_retired" AND "grid" = 5