tags:

views:

46

answers:

3

Any suggestions on books that might focus on developing SQL queries for reports? Just to clarify, I am not looking for books covering SQL Server Reporting Services, but rather books that might cover writing SQL queries to serve as the basis for reports. Thank you.

EDIT I just want to further clarify I am quite familiar with SQL syntax. I am just looking for books that might focus on examples of SQL used in complex queries used for reports.

+1  A: 

Any SQL which you write can be used for a report. So you'll need to learn the fundamentals of SQL.

Useful books are:

Sams Teach Yourself SQL in 10 Minutes

Head First SQL

Alternatively use online resource such as:

W3 SQL Tutorial

You might want to then target books for the specific database technology (Microsoft, Oracle, MySQL, etc) as they all have their nuances.

Stagg
+1: Pretty much what I was going to say. The SELECT statement *is* reporting
OMG Ponies
I am familiar with SQL. I guess what I am looking for is a text that really focuses on SQL for reporting.
webworm
+1  A: 

Hi,

To write better SQL queries you have to follow the following steps.

  1. Be clear about all the Keys.
         (a) Primary key.
         (b) Foreign key
         (c) Candidate Key.
         (d) Alternative Key.
         (e) composite Key.
         (d) Multivalued Key.
         (e) Super key.
  2. Be clear about your tables and their relationships.
  3. Be clear about JOINS.
         (a) Simple joins
         (b) inner Joins
         (c) outer joins ( Left,Right)
         (d) Full outer joins.
  4. Be clear about constraints.
  5. Be clear about SQL Basics.
  6. Start writing your own quires.

I think above steps will make you to write a perfect SQL quires. For books Refer the following link for good SQL tutorials. http://www.wiziq.com/tutorial/54934-SQL-Queries.

Thanks Regards Kolla Sanjeeva Rao

ksrao
A: 

This highly depends on the particular problem domain, your customer requirements and kind of intelligence/information are you trying to extract from your reports.

Like others, I would suggest you to go through table relationships to determine how you can

  1. SELECT
  2. JOIN and
  3. GROUP BY

to extract information.

Venkateshwar