Complex task

sql requests