T-SQL Challenges

Technical Article

TSQL Challenge 28 - SELECT TOP N articles from each category from a SQL Server 2000 database

  • Article

The challenge is to write a query that returns the articles to be displayed in the home page of the website. N number of articles from each category is to be selected where N is configured in the Categories table. Each category should select the most recent N articles. ArticleID can be used to identify the most recent articles. An article with a higher number indicates a more recent article.

2010-04-19

2,022 reads

External Article

Celko's SQL Stumper: The Class Scheduling Problem

  • Article

What can we use in SQL instead of E. F. Codd's T theta operators for best-fit? Joe Celko returns with another puzzle that isn't new, in fact it already features “Swedish”, “Croatian” and “Colombian” solutions in chapter 17 of Joe's 'SQL for Smarties' book. These were all written before CTEs or the new WINDOW functions. Is there now a better solution? Was there one even then? We leave it to the readers to provide the answer!

2010-01-27

1,535 reads

Technical Article

TSQL Challenge 21 - Reading, recognizing and processing graphical representation of digits.

  • Article

Here is a challenge that takes you away from those repetitive boring type of queries that you write over and over again, several times a day. All of us, the database people, are familiar with thinking in set based manner as well as row by row style. Here is something that is very interesting where you might need to process records in a 'three-line-at-a-time' fashion.

2010-01-11

2,826 reads

Blogs

Tired of Tedious SQL Queries? AI Tools Can Automate The Boring Parts

By

If you've ever wrestled with complex SQL code, you know the drill. Hours spent...

Check your regions people

By

Today I was having a nice discussion with some colleagues about Fabric and pricing/licensing...

Using Git Prune–#SQLNewBlogger

By

As I’ve been working with SQL Saturday and managing changes to events, I’ve accumulated...

Read the latest Blogs

Forums

Issues backing up Analysis Services databases - silent failures

By Pete Bishop

I have a PowerShell script that I use to automate the backup of Analysis...

Read Only Replica in SQL Server Standard

By Stewart "Arturius" Campbell

Comments posted to this topic are about the item Read Only Replica in SQL...

Identifying Customer Buying Pattern in Power BI - Part 1

By Farooq Aziz

Comments posted to this topic are about the item Identifying Customer Buying Pattern in...

Visit the forum

Question of the Day

Read Only Replica in SQL Server Standard

Our environment runs using SQL Server Standard. We are implementing Availability groups. Our database has been experiencing high read volumes, so I want to let the application read the Synchronized Secondary replica, as I read that HADR does this. Can we implement this?

See possible answers