Microsoft interview question

Surprise is my first interviewer asked me to write a SQL query..I expected i would be given to solve a algorithm question. There are not difficult questions as such...They asked some simple algorithm questions in the interviews which also can be found in Cracking the coding interview book.