Visa Inc. interview question

Some simple sql qns