Upstream interview question

Q: Given some database tables, write some SQL queries.