Cvent interview question

sql queries....really complicated