Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Thanksgiving SQL Teaser COUNT

Status
Not open for further replies.

SQLDenis

Programmer
Oct 1, 2005
5,575
US
Here is a small simple Thanksgiving teaser. What do you think will the result be of the select count query?

Code:
USE tempdb 
GO 

CREATE TABLE Customer (CustomerID INT PRIMARY KEY) 
INSERT Customer VALUES (1) 
INSERT Customer VALUES (2) 
INSERT Customer VALUES (3) 
INSERT Customer VALUES (4)

What will this return?
Code:
SELECT COUNT(*) Customer


Denis The SQL Menace
--------------------
SQL Server Code,Tips and Tricks, Performance Tuning
SQLBlog.com, Google Interview Questions
 
my guess:
1

denis, this was the first one of your teasers in a long time that i was able to guess correctly

they are usually a lot harder :)



r937.com | rudy.ca
 
Denis, don't suppose that was inspired by the recent blogspot post?

-kaht

Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson
[small]<P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <.</B> bites again.[/small]
 
You are saying I am losing my 'touch'

That would imply you had it to begin with ;-)

Hopefully we get some nice new teasers soon since there will be some new stuff to play with in SQL 2008 :-D



[small]----signature below----[/small]
You can't fit a square data in a round table
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top