Posts

Showing posts with the label SQL

All You Need NULL Value Functions

Image
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 Null functions  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...

How to Know Teradata is in Pseudo table Lock

The pseudo table mechanism is a way to serially queue all table level locks through the use of an internal pseudo table. In this table the database locks the row hash of the table's table ID.

Teradata Data Dictionary-Frequently Used SQL (1 of 2)

Image
DBC is superuser in Teradata. Very often we need to know some information from Data dictionary tables of Teradata. Frequently used Tables are as follows. We have only Select DML access on data dictionary tables. 1. DBC.User Describes in detail all information about users that the requesting user controls, including passwords. User type: • End User • Teradata Database Administrator • Supervisory 2. DBC.Sessioninfo Gives one row for each time the user is logged on; used as a review of accounts set by user. User type: • Teradata Database Administrator • Supervisory • Teradata Database Security Administrator • [X]End User Select * from DBC.SessioninfoX ==> Will give information about only that user.