Editorial for DMOPC '18 Contest 6 P0 - SQL Queries
Submitting an official solution before solving the problem yourself is a bannable offence.
If there are 0 or 1 queries that have dependencies, then you can always debug all of the queries.
If all three queries have dependencies, then it is impossible to debug all the queries.
If exactly 2 queries have dependencies, it suffices to check if they depend on one another.