The Home Depot interview question

SQL study case in GBQ