Thursday, 3 November 2016

Teradata Quick refresher for most popular Utilities

Teradata Popular utilities
Teradata Popular Utilities
Teradata utilities are very important while working with SQL and in data warehousing projects. The below short and crispy definitions help you can use while attending for interviews or in your day to day work to refresh your Teradata knowledge.

MultiLoad -
Inserts, updates, deletes, or upserts rows in a Teradata table by using the MLOAD command-line utility. It can handle multiple SQL statements in a single operation. You can provide user-defined SQL for complex operations. This stage is best used for bulk updates, deletes, upserts, and complex interface operations.
 
TPump - Inserts, updates, deletes, or upserts rows in a Teradata table using the TPUMP command-line utility. It can do concurrent updates on the same table. It can handle multiple SQL statements in a single operation. You can provide user-defined SQL for complex operations. 

FastExport -
Exports data from a Teradata table by using the FEXP command-line utility. You can customize it to use user-defined SQL statements for extraction. This stage is best used for bulk extracts from Teradata.

Sunday, 25 September 2016

All You Need To Know About NULL Value Functions

Teradata SQL Null functions
NULL functions
The below are the Null value functions in Tearadata. One is "NVL" and another one is "NVL2". These two functions are part of Teradata SQL.

NVL -The NVL function replace null value with a string or numeric value. This is the functionality is same as Teradata function NULLIF. It requires two arguments. If the value is not null, it will not do anything.

The best SQL NVL function:

SELECT NVL (NULL,'USA'), NVL('SPAIN','USA');
-----------
USA  SPAIN

Also Read: Top 70 Teradata Interview Questions

The NVL2 function: Returns one of two specified values (arguments#2 and Arguments#3) based on weather the first arguments in NULL or not. It requires three arguments. The rule is as follows:
  • If expression 1 is not null, expression 2 is returned
  • If expression 1 is null, expression 3 is returned
The best NVL2  example

SELECT NVL2(NULL,'FRANCE','SPAIN'), NVL2('ENGLAND','FRANCE','SPAIN')
-------------------
SPAIN   FRANCE