Click here to monitor SSC

Tony Davis

Simple-Talk Editor
News, views and good brews

Running before you can walk

Published Tuesday, January 13, 2009 1:55 PM

Everyone here knows what a nested loop join is, right? However, I am still willing to bet that if you ask three different people, you will get four subtly different answers.

 

I admire a person who can take a subject that has apparently been "done to death" and bring a new clarity to it. I think Stephane Faroult manages that with his video, SQL Joins, nested loops and all that in less than 6 minutes. His line in deadpan French humour appealed to me, and the "dance floor" analogy, with prospective dancers needing to choose suitably-sized partners, will stay with me the next time I'm asked to explain a merge join.

 

My first thought was that it would be great if we could bring this sort of clarity to some of the contentious topics of the day, such as cloud computing, MDX, entity framework, extended events and so on. Arguments are flaring up already and if we can get a short and clear explanation in early, it may save everyone a lot of pain.

 

Almost immediately, though, I realized the futility of this. What mileage is there in debating the intricacies of MDX until we can agree on something as fundamental as how date intervals work in SQL Server? It seems pointless to dissect complex internal structures of SQL Server until we can agree on how to pronounce SQL.

 

We need to unite behind a common understanding of some of the absolute basics of our trade. Otherwise how can we expect to be taken seriously? I propose that we compile a "top ten" list of questions to which we want straight answers.

 

Send in your topic suggestions, along with who you think could provide the guide. If you have a fresh way to present one of the endlessly-debated SQL Server topics, we'll do our utmost to persuade our current Geek of the Week, the famous cartoonist Larry Gonnick, to animate your script (as soon as he's finished work on his latest book!). It will then become the definitive 5-minute guide to which we will henceforth defer on Simple-Talk.

 

To get us started, I suggest the following candidate topics:

  1. SQL: A definitive 5-minute guide to its pronunciation
  2. What is NULL: The Final Answer
  3. How date intervals work in SQL Server
  4. The thinking person's guide to using cursors.
  5. Table Variables. Their hidden purpose.
  6. Should we be allowed to view Transaction logs?
  7. At what level should we stop normalising databases?

We will get these videos made and, as usual, the best suggestions will receive a prize so add them as a comment to this blog!

 

Cheers,

 

Tony.

Comments

 

Arjan`s World said:

January 13, 2009 1:36 PM
 

ALZDBA said:

How about:
- does datatype still matter (why not make it all nvarchar(max), storing date and time in char(23), ... )
- when to use N-datatypes
- (dis)advantages of stored procedures
- when to call for a DBA
- Keys: why to keep them small, natural vs surrogate, when not to have a primary key, ...
- to index or not to index, why have clustered ix by default, ...
- sqlserver migration (version to version1) : the task list (upgrade advisor, desinging the new sqlserver topology, backup before, restore vs attach, post upgrade maintenance, the new backup, how to migrate users, jobs, alerts,...)
- Toy story: tools that make life comfortable : out of the box / Red Gate
- SQLServer Books Online: should it be the first ref  ? Yes it should (do she Shift+F1 trick)
- A dedicated SQLServer developer edition: a must have for any DBA. "Learn to play, play to learn" : the cradle for founded knowledge
January 14, 2009 3:33 AM
 

jtklopcic said:

It should be "The thinking person's guide to NOT using cursors".
January 14, 2009 9:21 AM
 

GSquared said:

Topic:

Absolute answers to subjective questions
Does it ever not "depend"?
January 14, 2009 9:59 AM
 

JJEugene said:

My thoughts:

> Competent Commenting For Stored Procs and Other Code

> Minimum Human Operating Requirements (not whether or not an official full-time DBA is needed for every organization, but more practically: what set of knowledge and steps are needed by a staff or hired person in order for SQL Server to be safely operated - perhaps based on size of systems run in the organization)

> Super Size Me - How to determine hardware requirements based on business needs, the cliff notes.

> Secure SA - The best way to secure and use (or not use) the account.  OR:

> Up And Running IN X Minutes - A step by step guide to safely installing a new instance of SQL Server.

> Why SQL Server Rocks - there are wars about the different database options (Oracle, Sybase, MySQL, etc.)  It would be nice to have a definite, quick movie to point to show people why SQL Server is awesome.  It doesn't matter how you Pronounce SQL if SQL Server isn't a good choice to begin with.

> First Step Index Strategy - Indexes are vital to SQL Server operating as needed.  While the appropriate indexes for each database will "depend", I think that we should be able to come up with a "first cut" on an index strategy/approach that is generally a good idea at least 95% of the time.  And it shouldn't be that hard to explain.  Ex: every table with a small, ever increasing primary key, clustered index.  All foreign keys indexed.  All natural keys given a unique index.  And after that, index based on performance needs.  Something like that.
January 14, 2009 12:53 PM
 

MrDee said:

NULL to me is we do not know what the value is... yet OR there is no current value. E.g. an employee termination date.

A NULL is "how much money is in a wallet"
It has a knowable value, but you do not know what it is at the moment (Unless you are married and therefore know there is nothing IN your wallet).
You are unlikely to know exactly how much you have and conversely the chance of you knowing the contents of some else’s wallet is extremely close to zero.
So, given that your wallet contains NULL money and their wallet contains NULL money:

* NULL <> NULL (it is very unlikely we have exactly the same money in our wallet)

* NULL < NULL maybe - consult your implementation of SQL. (Although statistically the chance of your wallet having more cash than mine is high)

* NULL > NULL maybe - consult your implementation of SQL. (And give up the single lifestyle)

* 1 + NULL = NULL ( I look in my wallet and find $1 that my wife did not find, I still do not know if you and I can get together and buy a $1.20 cheeseburger)
January 14, 2009 2:43 PM
 

MrDee said:

See Quill
all others are pretenders.
January 14, 2009 2:45 PM
 

BuggyFunBunny said:

jtklopcic got it right, and before I had the chance.  But, of equal importance is a discussion of *why* it should be NOT cursors.  The why, it seems to me, derives from the notion that cursors exist either for app code or in SPs.  As such, they are procedural, not declarative or relational.  In particular, when used to support app code the result is that data logic gets shipped out to the client; always a bad thing.   A comment here is certainly not sufficient.

As to normalization, well...  There is a new player (which Mr. Celko, among others, has discussed elsewhere), the solid state disc database machine.  In that context, argument can be made that normalization should proceed until there is no more to be done.  In rotating rust machines, may be not so much.  This is perhaps the most important topic to discuss.  It is the future of RDBMS, not just SS, and deserves the attention.
January 14, 2009 3:28 PM
 

Philip Kelley said:

I’d really like a quick and concise guide to how to get SQL to tell me precisely what query is being run, and as optional add-ins what resources (tables, indexes, locks) and other stuff (blocks, latches, cahced-for-how-long execution plans, and I don’t know what) are being used by it, for a specified SPID, as of the point in time I run the query. I’ve waded through BOL system tables, and dynamic management views, and I still get lost whenever I try to figure out why the fool box isn't doing what I know perfectly well [ha!] it should be doing.

Too esoteric for your purposes, I’m sure, but hey, you wanted to know what we wanted.
January 15, 2009 8:47 AM
You need to sign in to comment on this blog
<January 2009>
SuMoTuWeThFrSa
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567
Migrating from OCS 2007 R2 to Lync: Part 4
 Having migrated the rest of our users and legacy resources across, and start getting ready to... Read more...

Automated Script-generation with Powershell and SMO
 In the first of a series of articles on automating the process of building, modifying and copying SQL... Read more...

Seth Godin: Big in the IT Business
 Seth Godin has transformed our understanding of marketing in IT. He invented the concept of 'permission... Read more...

Using SQL Test Database Unit Testing with TeamCity Continuous Integration
 With database applications, the process of test and integration can be frustratingly slow because so... Read more...

Converting String Data to XML and XML to String Data
 We all appreciate that, in general, XML documents or fragments are held in strings as text markup. In... Read more...