Cvent Interview Question

Writing a complex SQL query