This month's discount Comprehensive Database Performance Health Check · Testimonials
SQLAuthority with Pinal Dave
Home
  • Consulting
    • Health Check
  • Free Videos
  • All Articles
    • AI
    • SQL Performance
    • SQL Tips and Tricks
    • Interview Questions and Answers
    • SQL Puzzle
    • SQL Video
    • SQLAuthority News
    • Personal
  • Books
  • Consulting
A compact folded fitting is compared with a larger assembly beside a constrained guide channel.

SQL SERVER – Puzzle – Shortest Code to Produce the Number 1000000000 (One Billion)

October 3, 2017
Pinal Dave
SQL Puzzle
SQL Function, SQL Scripts, SQL Server

This shortest code puzzle asks for 1000000000 without writing that literal or using arithmetic operators. The earlier zero puzzle brought roughly 700 valid answers.

Read More
SQL Server query with 2 tables.

SQL SERVER – Select Unique Data From a Column Exist in Two Different Table

September 26, 2017
Pinal Dave
SQL Puzzle
SQL Scripts, SQL Server, SQL Union clause

A reader wanted to Select Unique Data from a column in two tables, keeping only values found in just one of them. Here is the query that does it.

Read More
A compact fitting sits within two stops while a longer candidate remains outside the allowed gap.

SQL SERVER – Puzzle – Write a Shortest Code to Produce Zero

August 24, 2017
Pinal Dave
SQL Puzzle
SQL Function, SQL Scripts, SQL Server

This Zero puzzle asks for the shortest SQL Server code within three restrictions. I want the exact code and character count.

Read More
SQL SERVER - Puzzle - Incorrect Results with Decimal

SQL SERVER – Puzzle – Incorrect Results with Decimal

June 28, 2017
Pinal Dave
SQL Puzzle
SQL Datatype, SQL Function, SQL Scripts, SQL Server

A new puzzle: a simple table with price and discount returns Incorrect Results with DECIMAL. Can you work out why without running the code in SSMS?

Read More
SQL SERVER - Why We have Audit Trace in DATA Folder? What are These Files?

SQL SERVER – Why We have Audit Trace in DATA Folder? What are These Files?

May 15, 2017
Pinal Dave
SQL Puzzle
File format, SQL Audit, SQL Scripts, SQL Server

The DATA drive filled up with thousands of audittrace .trc files. Here is why SQL Server writes audit trace files there and how to stop them.

Read More
SQL Server sp_spaceused window.

SQL SERVER – Puzzle – Why does sp_spaceused Show No Values?

February 8, 2017
Pinal Dave
SQL Puzzle
SPARSE Columns, SQL Scripts, SQL Server

Why does sp_spaceused show no values for a table that clearly has rows? It stumped me for 10 minutes. Here is the puzzle, try it before reading on.

Read More
SELECT Cast As Date.

SQL SERVER Puzzle – Conversion with Date Data Types

January 1, 2017
Pinal Dave
SQL Puzzle
SQL DateTime, SQL Scripts, SQL Server

Converting values with CAST can round in ways you don’t expect. A puzzle on Date Data Types: guess the output of each query before you run it.

Read More
Previous 1 2 3 4 5 6 7 8 … 22 Next
  • Books
  • Testimonials
  • Privacy Policy

© 2006 – 2026 All rights reserved. pinal @ SQLAuthority.com