Cognizant interview question

OOPs Concept and code for encapsulation and SQL queries