CRED interview question

SQL questions based on some scenarios.