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
Sixteen pineapples in a row by size, split into four groups by wooden slats, one huge pineapple set apart.

Quartiles With PERCENTILE_CONT and NTILE

January 1, 2021
Pinal Dave
SQL Tips and Tricks
Mathematical Function, Ranking Functions, SQL Function, SQL Server

Compare quartiles from PERCENTILE_CONT with NTILE row buckets, calculate interquartile range, and flag candidates beyond 1.5 IQR.

Read More
A glass water jug refilled from three tumblers, stopping just below its red rim line.

Why FLOAT Math Does Not Add Up in T-SQL Queries

May 13, 2020
Pinal Dave
SQL Tips and Tricks
Mathematical Function, SQL Datatype, SQL Server

See why FLOAT math produces approximate sums and comparisons in SQL Server, then use DECIMAL or tolerance checks for the right data.

Read More
A bowl of cake batter, a big scoop of flour and a small spoon of cocoa going in, the mix turning only faintly brown.

Weighted Averages in T-SQL

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

Calculate weighted averages with matching numerator and denominator populations, decimal arithmetic, NULL rules, and calendar windows.

Read More
Three bowls with equal heaps of toffees, one last toffee resting in an open palm above them

Splitting an Amount Across Rows Without Losing a Cent

April 16, 2019
Pinal Dave
SQL Tips and Tricks
Mathematical Function, SQL Datatype, SQL Scripts, SQL Server

Make splitting an amount preserve every cent by checking rounded shares, allocating weighted remainders, and documenting deterministic ties.

Read More
Gouache painting of three whole pies and one separated slice in vermilion on a small plate

Extract Decimal Part of a Number in SQL Server

September 12, 2018
Pinal Dave
SQL Tips and Tricks
Mathematical Function, SQL Datatype, SQL Scripts

To extract decimal part of a number in SQL Server, use ABS(value) % 1. This post compares four methods on positive and negative amounts and explains why the result is sometimes 0. It also covers float columns, digits as whole numbers and trailing zeros.

Read More
Sash counterweight balancing a window beside a loose iron weight

Constant Folding: Expressions the Optimizer Solves Before Running

July 13, 2014
Pinal Dave
SQL Tips and Tricks
Execution Plan, Mathematical Function, SQL Performance

SQL Server does the math on your literals once, while it builds the plan. Here is where that helps, and where it quietly stops.

Read More
Gouache painting of a tidy desk with no one at it: a magnifying glass, an open notebook showing a hand-drawn curve and plain dots, a rack of test tubes with colored liquids and a brass compass, one test tube painted vermilion.

What a Data Scientist Does: The Skills That Still Matter

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

What a data scientist does is turn a vague question into an answer that people can trust and act on. This post walks through the work as a loop, and shows the summary statistics step in T-SQL on a small bike rental log.

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

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