Task 4: Advanced SQL