Question d’entretien chez Infosys

Basic question on CPP,SQL and interviewer asked me to write the code.