BNP Paribas Interview Question

some sql questions, some comptency based