17 Jul 2013

Can we take collect stats on Derived Tables and Volatile tables and Temporary tables? What is Global Temporary table? What is the use of this Global Temporary table?

1. No for volatile and derived tables and yes for global tables.
2. Global tables are temp tables like volatile tables but unlike volatile tables, their definitions are retained in dd.
3. It is used whenever there is a need for a temporary table with same table definition for all users.


How to handle nulls in Teradata???
How many columns can be there in a table???
How to find average sal with out using avg function????
Answer
1. Use zeroifnull, nullifzero in select and NULL in insert directly.
2. 256 columns max per table.
3. Without using "avg" we can find the avg salary by using sum (sal)/count (sal);
sel sum(sal)/count(sal) as avgsal from tablename

No comments:

Post a Comment