Appinventiv interview question

Extract data without using array from the database.