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
SQL Server Top Scoring High Scores.

How to Get Top N Records Per Group? – Ranking Function – Interview Question of the Week #156

January 14, 2018
Pinal Dave
SQL Interview Questions and Answers
Ranking Functions, SQL Function, SQL Scripts, SQL Server

I gave 40 candidates this puzzle: get the top N records per group from a student marks table. Here is the simple answer using a Ranking Function.

Read More
A sheet of paper on a cutting board with its ragged edges being squared off by a steel rule.

SQL SERVER – 2017 – How to Remove Leading and Trailing Spaces with TRIM Function?

January 10, 2018
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL Server, SQL String

TRIM finally arrived in SQL Server 2017. Here is how to remove leading and trailing spaces with the new TRIM function, in a few simple words.

Read More
A play kitchen shelf stocked with handmade felt food, many eggs, fewer carrots and one red felt fish.

Building Demo Data With GENERATE_SERIES

December 4, 2017
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Sample Database, SQL Server, Testing

Build demo data with GENERATE_SERIES, weighted categories, customer skew, random amounts, and validation that preserves repeatable tests.

Read More
SQL Server Identity Tool Window.

When to Use IDENT_CURRENT? – Interview Question of the Week #150

December 3, 2017
Pinal Dave
SQL Interview Questions and Answers
SQL Function, SQL Identity, SQL Scripts, SQL Server

When should you use IDENT_CURRENT instead of SCOPE_IDENTITY()? A question I heard at the Group By conference, answered with the key difference.

Read More
Multiple variable assignments.

How to Assign Multiple Variables in a Single T-SQL Query? – Interview Question of the Week #148

November 19, 2017
Pinal Dave
SQL Interview Questions and Answers
SQL Function, SQL Scripts, SQL Server

How do you assign Multiple Variables in a single T-SQL query? Here are three ways, from separate SET statements to my preferred one-line style.

Read More
How to Validate.

How to Validate Email Address in SQL Server? – Interview Question of the Week #147

November 12, 2017
Pinal Dave
SQL Interview Questions and Answers
SQL Function, SQL Scripts, SQL Server

How do you validate an Email Address in SQL Server? Here is a simple query that separates valid addresses from invalid ones in a sample table.

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
Previous 1 … 12 13 14 15 16 17 18 … 62 Next
  • Books
  • Testimonials
  • Privacy Policy

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