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
Error dialog of query execution.

SQL SERVER – Puzzle – Strange Behavior With Extra Comma in Create Table Statement

January 30, 2018
Pinal Dave
SQL Puzzle
SQL Command, SQL Scripts, SQL Server, SQL Table Operation

My favorite icebreaker puzzle: a strange behavior with an extra comma in CREATE TABLE statement. Why does SQL Server accept it for temp and regular tables?

Read More
SQL Server UNION vs UNION ALL Error.

SQL SERVER – Puzzle – Solution – Why Does UNION ALL Work but UNION Produces Error?

January 8, 2018
Pinal Dave
SQL Puzzle
SQL Scripts, SQL Server, SQL Union clause

Here is the answer to my puzzle: why does UNION ALL work but UNION produces an error with a TEXT column? It comes down to how UNION removes duplicates.

Read More
SQL Server UNION vs UNION ALL Error.

SQL SERVER – Puzzle – Why Does UNION ALL Work but UNION Produces Error?

January 4, 2018
Pinal Dave
SQL Puzzle
SQL Scripts, SQL Server, SQL Union clause

A puzzle with TEXT columns: UNION ALL works fine, but UNION produces error. Can you tell why? The hint is in how UNION removes duplicates.

Read More
Changing Data Type is Changing the Default Value.

SQL SERVER – Puzzle – Brain Teaser – Changing Data Type is Changing the Default Value

December 8, 2017
Pinal Dave
SQL Puzzle
SQL Column, SQL Datatype, SQL NULL, SQL Server

A brain teaser on data types: changing data type is changing the default value of a column. Can you name the original and new datatype and default value?

Read More
SQL Server Puzzle.

SQL SERVER – Puzzle – Adding Two Dates Resulting Strange Results

October 17, 2017
Pinal Dave
SQL Puzzle
SQL DateTime, SQL Scripts, SQL Server

I typed a plus instead of a comma and got strange results when adding two dates in SQL Server. Can you explain the output of this little puzzle?

Read More
Puzzle.

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

After 700 answers to my zero puzzle, here is the next one: write the shortest code to produce 1000000000 without typing it or using arithmetic operators.

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
Previous 1 2 3 4 5 6 7 … 27 Next
  • Books
  • Testimonials
  • Privacy Policy

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