Lessons I learned from SQL Interview
So today I had a technical interview with a company in Seattle. It was my first technical interview after two months of job hunting in the west coast. I am writing this posts to remember what I made a mistake in SQL as people usually say we learn lessons from mistakes and failure. First, About the rule that "GROUP BY function only allows you to SELECT two columns at a time". Remark: This does NOT include the new column you generate by using COUNT!! Typical way you write a query with GROUP BY is like this: SELECT Column1, Column 2 FROM TableName GROUP BY Column1; HOWEVER, if you want to COUNT something else besides Column 1 and Column 2, you can write: SELECT Column1, Column2, COUNT(Column3) FROM TableName GROUP BY Column 1; SQL will not generate the errors when you put the third elements "COUNT(Column3) before "FROM TableName GROUP BY Column1" because "COUNT(Column3)" is not considered as the third column in the "GROUP BY...