DWHPro Insights

SQL Tuning

Advanced GROUPING Methods in Teradata SQL: GROUP BY GROUPING SETS, ROLLUP, and CUBE

Illustration of a glossy orange database cylinder with data fragments across its surface

Teradata SQL and Advanced GROUPING Functions The advanced GROUPING functions will be demonstrated through the following example. The foundation of this demonstration is a table consisting of the flight count for each aircraft and date: CREATE MULTISET TABLE Flights ( PLANE AS BIGINT NOT NULL, FLIGHTDATE AS DATE NOT NULL, NR_FLIGHTS INTEGER NOT NULL ) …

Read more

How to Find ASCII Code of a Character Using Teradata SQL

Illustration of a glossy orange database cylinder with data fragments across its surface

This course focuses on Teradata indexing techniques. In this two-hour video, you will learn about Teradata’s architecture and Full Table Scans, different types of Primary Index Access such as UPI and NUPI, diverse Secondary Index Access including USI and NUSI, and Join Indexes. You will gain the comprehensive knowledge required to create an ideal indexing …

Read more

Benefits of Organizing Stored Procedures into Chapters and Steps

Illustration of a glossy orange database cylinder with data fragments across its surface

I made organizing Stored Procedures into Chapters and Steps a principle. These separation points are marked by comments and variables used in performance and result logging. A step refers to a technical or conceptual task that cannot be further divided without losing the abstraction of Stored Procedures or the main task. Examples of a step …

Read more

Teradata Built-In Functions: TO_NUMBER, TRUNC, CEILING, FLOOR, LEAST, GREATEST, ROUND Popular

Illustration of a glossy orange database cylinder with data fragments across its surface

TO_NUMBER I have often needed a function to verify whether a character column contains a numeric value. Typically, I have resorted to using a workaround, such as: CASE WHEN UPPER(‘12.77’) = LOWER(‘12.77’) THEN ‘IS_NUMERIC’ ELSE ‘IS_NOT_NUMERIC’ END Naturally, this workaround is limited and cannot manage certain situations, such as consecutive special characters. With the introduction …

Read more

An Introduction to Teradata Recursions: Generating Date Ranges Without a Physical Table

Illustration of a glossy orange database cylinder with data fragments across its surface

 Introduction to Teradata Recursions To link records from a primary table with a specific date range from a secondary table, a common requirement is to create a simulated history table with snapshot dates using a change history table with defined timelines. Consider the following illustration: The proposed solution would resemble this: You must create your …

Read more

Teradata Date Format and Time Values: Common Questions Answered Widely read

Illustration of a glossy orange database cylinder with data fragments across its surface

This article will address some common questions about formatting date and time values in Teradata. Teradata is a powerful relational database management system (RDBMS) that provides various functions to manipulate and manage date and time values. Understanding how to work with date and time data is essential for anyone using Teradata, so let’s look at …

Read more

Understanding Teradata’s SAMPLE Function: Randomly Select Rows and More Widely read

Illustration of a glossy orange database cylinder with data fragments across its surface

What is the Teradata Sample Function? The SAMPLE function returns a set of randomly selected rows. Here are the characteristics: The Syntax of the Sample Function SAMPLE [WITH REPLACEMENT] [RANDOMIZED ALLOCATION][WHEN <condition> THEN] {<number of row> | <percentage>} […,<number-of-rows> | <percentage>][ELSE {<number of rows> | <percentage } END] Here are some examples of how to …

Read more

DWHPro

Expert network for enterprise data platforms. Senior consultants, project teams built for your challenge — across Teradata, Snowflake, Databricks, and more.

📍Vienna, Austria & Jacksonville, Florida

Quick Links
Services Team Teradata Book Blog Contact Us
Connect
LinkedIn → [email protected]
Newsletter

Join 4,000+ data professionals.
Weekly insights on Teradata, Snowflake & data architecture.