views:

1964

answers:

2

Thus far all I have done with SQL are simple select statements, but now I've also started learning about INNER JOINs, GROUP BY clauses and inner queries. I learned the concepts, but now I’d like to do some exercises using the Northwind database, so that such queries would become second nature.

I tried to come up with good examples that would really test my skills and enable me to become more proficient, but I’m not really good at coming up with any worthwhile examples. Perhaps you guys could help me come up with some examples?

  • Examples should include just the following parameters ( INNER JOINs, inner queries, GROUP BY, HAVING, IN, ANY, SOME, ALL, EXISTS, MIN, MAX, SUM, AVG)
  • They shouldn’t include any fancy business/economic terms, since I don’t have a clue about those things
  • Solutions to these examples would also be required


EDIT:

Hello,


I would suggest buying Itzik Ben-Gan's book about SQL Fundamentals - that excellent book will save you a lot of time!

I'm afraid that it will be like most other books where with each topic there will be few example queries to make a point across, but they won't be the kind of examples that would forward you from understanding the topic ( and being able to use it in simpler cases ) to being really proficient at using it( namely, I already understand the concepts I named in my initial post and can use them in simpler queries, thus I don't really need a book that would explain the basics to me ).

Point I'm trying to make is that there's a big difference between understanding a particular kind of query and actually being able to use it in more advanced/complex ways ( I just want to be sure I won't spend money on something I don't really need )


thanx

+2  A: 

Hi

This link http://www.learn-sql-tutorial.com/SimpleSelects.cfm might be of some help to you. They have used Northwind database to elucidate most of the SQL query examples. Albeit this link pertains to simple select queries, on the left pane there are advanced 'select' queries which include aggregation operators and also queries involving joins, case statements etc.

cheers

Andriyev
+1  A: 

I would suggest buying Itzik Ben-Gan's book about SQL Fundamentals - that excellent book will save you a lot of time!

A more complex book is Inside Microsoft SQL Server 2008: T-SQL Querying (MSPress, March 2009)

You can also have a look at the following puzzles: Puzzled by T-SQL

AlexKuznetsov
Sorry for bothering you - I hope I'm not breaking any rules - but I've made a reply in my original post
SourceC