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
Gouache painting of a wooden ladder with four rungs leaning against a tall window, with a small brass telescope on the sill at the top looking out over a wide landscape, the top rung painted vermilion.

Big Data Analytics: Descriptive, Diagnostic, Predictive and Prescriptive

October 24, 2013
Pinal Dave
SQL Tips and Tricks
Business Intelligence, Data Warehousing, Mathematical Function, SQL Function

Big Data Analytics answers four kinds of questions: what happened, why it happened, what will happen next and what to do about it. This post climbs that ladder with one small business and shows each step in T-SQL window functions.

Read More
A row of meshed brass gears getting smaller, ending in a tiny red gear, one broken gear set aside

The PRODUCT Aggregate: Multiplying Values Across Rows

October 22, 2013
Pinal Dave
SQL Tips and Tricks
Mathematical Function, SQL Function, SQL NULL, SQL Server

Use the PRODUCT aggregate in SQL Server 2025 for growth factors and independent probabilities, with checks for NULL, zero, and precision.

Read More
Equal lengths of plank stacked neatly, a large leftover piece dropped in a red scrap bin.

Integer Division in T-SQL: Why Your Percentages Come Out Zero

August 17, 2013
Pinal Dave
SQL Tips and Tricks
Mathematical Function, SQL Datatype, SQL Server

Fix integer division in T-SQL percentages from COUNT, SUM and window calculations with decimal types and rounding at the right step.

Read More
Two rows of tulips, one all red and one in randomly mixed colors.

Generating Random Numbers Per Row: RAND, NEWID and CRYPT_GEN_RANDOM

February 2, 2013
Pinal Dave
SQL Tips and Tricks
Mathematical Function, SQL Function, SQL Random, SQL Server

Generate random numbers per row with NEWID or CRYPT_GEN_RANDOM, compare seeded RAND, inspect bucket spread, and pick a row without a sort.

Read More
Three ceramic bowls hold wooden sticks beside a loose pile on an ochre workbench.

Whole Unit Allocation: Keep a Proportional Split Exact

May 14, 2011
Pinal Dave
SQL Tips and Tricks
Mathematical Function, Ranking Functions, SQL Scripts, SQL Server

Whole unit allocation keeps a fixed budget intact. I’d calculate base shares first, then distribute residual units using a stable tie rule. Check equal weights, a zero budget and zero-weight members.

Read More
Two wooden trays hold terracotta pots with plants of different sizes beside a bright stone-room window.

VAR and VARP: Choose the Variance Denominator

March 28, 2011
Pinal Dave
SQL Tips and Tricks
Mathematical Function, SQL Function, SQL Server

VAR and VARP describe sample and population variation. Keep observation count and missingness visible when reporting their results.

Read More
Gouache painting: beside a river, a thin reed clump and a dense tall one both lean left with the current

SIGN: Classify Positive, Negative and Zero Values

June 26, 2010
Pinal Dave
SQL Tips and Tricks
Mathematical Function, SQL Function, SQL Server

SIGN describes which side of zero an amount occupies. Preserve the original quantity and distinguish a zero value from missing input.

Read More
Previous 1 2 3 4 Next
  • Books
  • Testimonials
  • Privacy Policy

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