SQL Operations Explained: Arithmetic, Strings, Dates, Aggregates and Conditionals
A DEV Community tutorial breaks down key SQL operations used to transform and reshape data directly within queries, eliminating the need for external processing tools. The guide covers arithmetic operations such as calculating line totals and applying discounts, as well as string functions like TRIM, UPPER, CONCAT, and INITCAP for cleaning and formatting text. Aggregate functions including COUNT, SUM, AVG, MIN, and MAX are explained alongside GROUP BY for summarising data across rows. The article also demonstrates how the CASE statement enables if-else logic inside queries to categorise data into labels or flags. Date operations such as CURRENT_DATE, INTERVAL, EXTRACT, and TO_DATE are introduced for comparing, calculating, and formatting date values within SQL queries.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in