ByteDance interview question

how to imporve SQL querries