Capgemini interview question

oops, dbms, basic programing question