ByteDance Interview Question

how to imporve SQL querries