Archives: May 2011
A followup to a post about subqueries with an estimation for how long it would take for the query to run.
In a recent post about subqueries, I compared 4 queries and how they handled 4 million rows of data. The queries involved:
1) Joins with AND conditions.
2)… Read more
A discussion of how views give a more denormalized means for querying against normalized tables.
Ad-hoc reports are frequently requested at the Boston Public Schools. Generally each request is different but similar to ones previously made. To the degree that such requests are unique, there’ll always be work involved in… Read more
A discussion of how NEWID can be used to help randomize the results returned from a SQL query.
A scenario I hadn’t encountered until recently is as follows: How does one get a certain number of randomly selected records from a table? Nope, I didn’t need to do this for… Read more
A discussion of how joins significantly outperform subqueries and how this is more evident when OR conditions are involved.
Thank you to everyone reading this site - Please enjoy your stay!
HelpWithSQL has hit double digits in posts! I hope everyone visiting the site finds the content and examples useful and interesting. The site has quickly evolved over the last couple weeks and it will continue to do so.… Read more
A discussion about SQL joins and subqueries with information about how to format join statements properly.
In any non-trivial task, developers need to join tables together. Joins are important when we want to:
1) Display/get data from more than 1 table in a result set.
2) Filter out records based…
A discussion about a forum post for handling a running subtraction in a SQL query.
For my first forum fun post, I’m going to discuss a running calculation SQL question posted by a user, asyssolvers, on the SQLTeam website here. Here’s the question [slightly shortened]:
I need to get…
Why SQL questions are interesting and how I'm using forums to challenge myself and help others.
I like a good SQL challenge. If I see a problem and it looks complex but do-able, I jump at it. Similar to how some people work through a crossword puzzle or a Sudoku… Read more
A discussion of where logic should go and why SQL might be the best place.
SQL is a powerful language and is very good at what it was made for – querying sets of data. C#, Java, and other languages are also powerful – more powerful than SQL in many… Read more