I've recently began learning T-SQL and have found that there are some rules to using single table queries. For instance:


If aggregate and non-aggregate expressions are used together in a SELECT statement, the GROUP BY clause must be used.


The HAVING clause is generally used with GROUP BY


The TOP statement relies on the ORDER BY clause for logical precedence among rows


Data returned when using an ORDER BY clause results in a cursor, whereas a table result is returned when not using the ORDER BY clause

I was curious if anyone else had any tips for learning the relationships among the different DML statements.

Thanks in advance!

  • 1
    This question is too broad for the Stack Exchange format. If you narrow it down to a specific aspect of T-SQL we can better help you. – Nick Chammas Mar 15 '12 at 22:10
  • The resources for deep learning of SQL are discussed here: dba.stackexchange.com/questions/14757/… – Alex_L Mar 15 '12 at 22:36
  • Thank you all for your helpful responses. I will continue to read and take more notes. – matrixx333 Mar 15 '12 at 23:44

As @Nick suggested, this question is too broad to have straight forward answer. Are you looking for how to write queries ?? Or you are looking for commonly used best practices for any query ?? Or something else ?? May be for starter you can google around this question, or look at some of the following sites,





Not the answer you're looking for? Browse other questions tagged or ask your own question.