Nearbuy interview question

OOPs and SQL queries