Facebook Interview question: SQL