Friday, April 13, 2007

Tutorial

MSAN Transact-SQL Statements Tutorial

Count() Function

Count(*) counts the rows in a table.

DROP TABLE

DROP TABLE - removes the table and its definition from the database.

Books

The question is do I really need a book?


This looks like a good book: http://websiteowner.info/books/databases/sqlreference.asp











Book on SQLServer2005: http://www.mhprofessional.com/product.php?isbn=0072261528

Is there a book on SQLServer2003?

Here is one for SQL Server 2000: http://www.amazon.com/SQL-Server-2000-Complete-Reference/dp/0072125888

Query within Query (SubQuery)

I was searching through some Borland C++ querys to an ACCESS database and I could not find some of the tables being referred to in the code. I was about to go ask my boss, when it hit me that perhaps these were not table but internal queries in ACCESS. Yes, that is what they were.

This is about 12 pages of information on subquerys: http://www.aspfree.com/c/a/MS-SQL-Server/Subqueries-and-Query-Expressions/

Example:

SELECT city
FROM offices
WHERE target >
(
SELECT SUM(quota)
FROM salesreps
WHERE rep_office = office
)