Q.Which is more efficient GROUP BY or DISTINCT to find duplicates?Īnswer: With more duplicates GROUP BY is more efficient, if only a few duplicates exist DISTINCT is more efficient.Īnswer: CASE value_expression_1 WHEN value_expression_n THEN scalar_expression_n END Q.How do you see a DDL for an existing table? It must be entered from BTEQ and not from MultiLoad.Īnswer: Group by those fields and select id, count(*) from table group by id having count (*) > 1Īnswer: I use explain statement to check if the query is doing what I wanted it to do.Īnswer: UPPER Function is used to convert all characters in a column to the same characters in upper case.Īnswer: LOWER function is used to convert all characters in a column to the lower case characters. It removes access locks from the target tables in Teradata. What do I do to perform other operations on it?Īnswer: Using RELEASE MLOAD. Q.My table got locked during MLOAD due to a failed job. This is done when AMP goes down or disk fails. What is that?Īnswer: FALLBACK requests that a second copy of each row inserted into a table be stored on another AMP in the same cluster. Q.While creating table my DBA has FALLBACK or NO FALLBACK in his DDL. When a case has to be selected depending upon the value of the expression. Can you tell us a little about it?Īnswer: Yes. Or hour or minutes if it’s a time stamp (select extract (minute from column name).Īnswer: SUBSTRING (string_expression, n1 ) To extract month from a date column, ex select extract (month from ). If I want to get just month how It can be done? Can I use sub string?Īnswer: Sub string is used with char fields. Q.Is it necessary to add? QUIT statement after a Bteq query when I am calling it in a Unix environment?Īnswer: Not necessary but it is good to add a QUIT statement after a query.
Toad data modeler reverse engineer from script update#
What do you suggest?Īnswer: In Teradata it is not recommended to update more than 1 million rows due to journal space problems, if it is less than that and it’s slow in the Bteq, you might want to add collect statistics statement before the update statement. It has to update a large number of rows, so it’s really slow. Q.Did you use Query man or SQL assistance? Q.What is the use of having index’s on table? Q.Did you write stored procedures in Teradata?Īnswer: No, because they become a single amp operation and my company didn’t encourage that. Q.Can you FastExport a field, which is primary key by putting equality on that key? You can do it like this ERRORLEVEL (3807) SEVERITY 0 DROP TABLE EMPLOYEE ERRORLEVEL (3807) SEVERITY 8 Q.How can you do it without throwing the error?Īnswer: You can it by setting error level to zero before dropping and resetting the error level to 8 after dropping. It will throw an error if the table does not exist. Q.You are calling a Bteq script, which drops a table and creates a table. Q.What is the opening step in Basic Teradata Query script?Īnswer: Logon tdipid/username, password. Q.How do you create a table with an existing structure of another table with data and with no data?Īnswer: Create table Customerdummy as Customer with data / with no data Insert into Sales “select * from customer” Insert into Loan “select * from customer” 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. An outer join gets data from the source table at all times, and returns data from the outer joined table ONLY if it matches the criteria.Īnswer: Inserting data records into the table using multiple insert statements. Q.Difference between Inner join and outer join?Īnswer: An inner join gets data from both tables where the specified data exists in both tables. Maximum 5 tables can be used in MultiLoad.Īnswer: FastLoad. MultiLoad is used for high-volume maintenance on tables and views.
Q.What is the difference between FastLoad and MultiLoad?Īnswer: FastLoad uses multiple sessions to quickly load large amount of data on empty table. Q.How do you load Multiple files to a table by using fast load scripts?Īnswer: Loading statement in the script and Replace the file one by one in the script till last file and submit every time so that data appended in Amp Level.For the last file specify End Loading statement in the script and Run.so that it runs from Amp to table.
Q.How do you Generate Sequence in Teradata?Īnswer: By Using Identity Column 1-for storing purpose using identity. Q.How do you Generate sequence at the time of Display?