advanced sql hw