TDQ
TDQ
1. What is the difference between FastLoad and MultiLoad? FastLoad uses multiple
sessions to quickly load large amount of data on empty
table.
MultiLoad is used for high-volume maintenance on tables and views. It works with
non-empty tables also. Maximum 5 tables can be used in MultiLoad.
2. Which is faster? FastLoad. 3. Difference between Inner join and outer join? A
n inner join gets data from both tables where the specified data exists in both
tables.
An outer join gets data from the source table at all times, and returns data fro
m
the outer joined table ONLY if it matches the criteria.
4. What is multi Insert? Inserting data records into the table using multiple in
sert statements. Putting a
semi colon in front of the key word INSERT in the next statement rather than
terminating the first statement with a semi colon achieves it.
Insert into Sales select * from customer
; Insert into Loan select * from customer ;
5. Is multi insert ANSI standard? No. 6. How do you create a table with an exist
ing structure of another table with data and with no data? Create table Customer
dummy as Customer with data / with no data; 7. What is the opening step in Basic
Teradata Query script? .Logon tdipid/username, password. 8. You are calling a B
teq script, which drops a table and creates a table. It will throw an error if t
he table does not exist. How can you do it without throwing the error?
You can it by setting error level to zero before dropping and resetting the erro
r
level to 8 after dropping.
You can do it like this
ERRORLEVEL (3807) SEVERITY 0;
DROP TABLE EMPLOYEE;
9. ERRORLEVEL (3807) SEVERITY 8; 10.Can you FastExport a field, which is primary
key by putting equality on that key? No. 11.Did you write stored procedures in
Teradata? No, because they become a single amp operation and my company didn t enc
ourage that. 12.What is the use of having index s on table? For faster record sear
ch. 13.Did you use Query man or SQL assistance? SQL assistant 6.1 14.I am updati
ng a table in Bteq. It has to update a large number of rows, so it s really slow.
What do you suggest? In Teradata it is not recommended to update more than 1 mil
lion rows due to
journal space problems, if it is less than that and it s slow in the Bteq, you mig
ht
want to add collect statistics statement before the update statement.
15.Is it necessary to add? QUIT statement after a Bteq query when I am calling i
t in a Unix environment?
Not necessary but it is good to add a QUIT statement after a query.
16.There is a column with date in it. If I want to get just month how It can be
done? Can I use sub string? Sub string is used with char fields. So it cannot be
used. To extract month from a date column, ex select extract (month from <colum
n name>). Same thing for
year or day. Or hour or minutes if it s a time stamp (select extract (minute from
column name). 17.What s the syntax of sub string? SUBSTRING (string_expression, n1
[n2]) 18.Did you use CASE WHEN statement. Can you tell us a little about it? Ye
s. When a case has to be selected depending upon the value of the expression. 19
.While creating table my DBA has FALLBACK or NO FALLBACK in his DDL. What is tha
t? FALLBACK requests that a second copy of each row inserted into a table be sto
red
on another AMP in the same cluster. This is done when AMP goes down or disk
fails.
20.My table got locked during MLOAD due to a failed job. What do I do to perform
other operations on it? Using RELEASE MLOAD. It removes access locks from the t
arget tables in
Teradata. It must be entered from BTEQ and not from MultiLoad.
To proceed, you can do RELEASE MLOAD <table name>
21.How to find duplicates in a table? Group by those fields and select id, count
(*) from table group by id having count (*) > 1
22.How to you verify a complicated SQL? I use explain statement to check if the
query is doing what I wanted it to do.
23.How many tables can you join in V2R5 Up to 64 tables.
24.Did u ever use UPPER Function? UPPER Function is used to convert all characte
rs in a column to the same characters in upper case.
25.What does a LOWER Function do? LOWER function is used to convert all characte
rs in a column to the lower case characters.
26.How do you see a DDL for an existing table? By using show table command.
27.Which is more efficient GROUP BY or DISTINCT to find duplicates?
With more duplicates GROUP BY is more efficient, if only a few duplicates exist
DISTINCT is more efficient.
28.Syntax for CASE WHEN statement? CASE value_expression_1 WHEN value_expression
_n THEN scalar_expression_n END;
29.What s the difference between TIMESTAMP (0) and TIMESTAMP (6)? TIMESTAMP (0) is
CHAR (19) and TIMESTAMP (6) is CHAR (26) Everything is same except that TIMESTA
MP (6) has microseconds too.
30.How do you determine the number of sessions?
Teradata performance and workload
Client platform type, performance and workload
Channel performance for channel attached systems
Network topology and performance for network attached systems.
Volume of data to be processed by the application.
31.What is node? How many nodes and AMPs used in your previous project? Node is
a database running in a server. We used 318 nodes and each node has 2 to 4 AMPS.