Teradata Interview Questions 3

download Teradata Interview Questions 3

of 36

Transcript of Teradata Interview Questions 3

Teradata Interview Questions

TERADATA VERSION DIFFERENCES V2R5 New Features and Eliminated Features 1. Added Identity column features to implement Primary key and Unique key concepts. 2. Statistics can be collected on a. Multiple Non Indexed columns of a table. b. Using sampling data from a table. 3.Partition Primary Indexed Added and types described. 3. Materialized View concept provided through a. Partialy covered join Index. b. Sparse Join Index. 4. Stored procedure features like a. Implementing Cursors using declare cursor statements. b. Altering a Procedure Using Nested computed statements. c. FETCH to get the rows one by one sequentially. d. Get help information on Stored Procedure and Attributes etc. 5. Multi Column Compression for Table Columns. 6. Setting the default DATEFORM form Options. 7. Implementing Multiple Distinct Aggregations in a Select Query etc. V2R5.1 Features 1. ANSI Triggers Introduced. 2.Row Triggers, statement triggers are supported. 3. It allows Recursion and Aggregation inside Triggers. 4. Stored Procedure Enhancement achieved Implemented different recompilation methods of a stored procedure. 5. Recognised requirements for running C compilers in the Teradata UNIX Environment. 6. Provided more Contextual Information for Internal Error 5547. 7. Large Objects supported. a. we can load and unload large objects even in BTEQ(BLOB,CLOB) By Using LargeDatamode.

8. User Defined Functions Added. Note: 1. we cannot write Print Statement inside Procedure. 2. Stored Procedures Created in V2R5.1 require Recompilation. V2R6 FEATURES 1. Queue Tables are added. 2. Triggered Stored Procedure added. 3. Stored Procedure Grammar Merge added. 4. Multi statements request submitted (supported in stored procedures by using BEGIN REQUEST -----END RESQUEST. 5. External Stored Procedures (xSP added). 6. BLOB s are supported by stored procedure and External stored procedure. V2R6.1 FEATURES 1. Stored Procedure OUT Parameter Changes. 2. PPI on Volatile and Global temporary tables. 3. User Defined types Added (UTDs) 4. PPI on Join Index added. V2R6.2 FEATURES 1. Alter Table column Compression added. 2.'CREATE TABLE AS WITH STATISTICS ' ADDED. 3. Auto generated key Retrieval added. TD 12 FEATURES 1. Stored Procedure Enhancements a. Retrieval of one or more results set from a stored procedure. 2. Error Tables Added with external syntax. 3. TERADATA 12 Provides complex error handling capabilities in conjunction with a MERGE INTO (or) INSERT SELECT statements accomplished

through the Usage of new SQL based error tables. 4. Usage of ANSI Merge Operation at the time of loading added. 5. Compare and contrast the advantage of Merge instead of MULTILOAD. 6. TD 12 MERGE plan is different from V2R5 MERGE plan. 7. Multilevel Partitioning provided. 8. Added many changes to the User defined functions and Table functions. 9. Supports SQL Invocation Using External Stored Procedures. 10. Teradata Extended Support for Windows Aggregate Function. example STDDEV_SAMP[standard deviation sample] CORR ---Corelation COVAR_SAMP (Corelation Variable sample ) VAR_SAMP etc. 11. It supports DSW of 20 bits also. 12. BLOB and CLOB Extended till 10 GB. Teradata Interview Questions 1,2,3 (Typical) Entire set of Standard Teradata Questions.This Complete Set will repeat for all Interview sessions.

1.Definition of Teradata? Tell me important components of Teradata? Definition: It is an RDBMS that drives company's Datawarehouse,Datamart,OLTP,OLAP,DSS Appliances. a.An "Open system which executes on UNIX MR-RAS(Discontinued in teradata 13),WIN2K, Suse Linux ETC & Above OS. b.Compatible with ANSI standards c.Runs on Single or Multi nodes. d.Built in Parallelism e.Acts Like a Server. New Featues (Teradata 13): Designed with the below appliances. a.Extreme Data warehouse 1550. d.Active Enterprise Datawarehouse 5550 H,5555 C/H c.Internet and E-business d.Customer Relationship Management. e.Datamart Appliance 2500,2550,2555

Important Components: a.PE(Parsing Engine ) b.Bynet c.Amp (Access Module Processor) d.VSS(Virtual Storage System) (from Teradata13) e.Vdisk(Virtual Disk) 2.How to run the Teradata jobs in unix environment ? At unix prompt,Please execute in the below way. $Sh>BTEQ[Logfile Path] or $Sh>BTEQ This one is opted by optimizer when the non-PI column is on a small table. 2. Redistribution of the non PI rows of the table to the amp containing the matching PI row amp. --> This one is opted when the tables are large. The non PI column is in one table is redistributed to the amp containing the matching PI. 3. Redistribute both the rows of the table by hash values. --> This is chosen when the join is on a column that is not the PI in either table. This will require the most spool space.

44. what is common practice in creating views and tables in teradata?

It is a common practice in Teradata to have some databases with PERM space that contain only tables. Then, other databases contain only views. These view databases require no PERM space and are the only databases that users have privileges to access. The views in these databases control all access to the real tables in other databases. They insulate the actual tables from user access . 45.PERM space is a pre allocated space? True/ False?

False. PERM space is not pre allocated space. its a maximum allowed space to user or a database. 46.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. 47.what is FALLBACK in teradata? FALLBACK is a table protection feature used in case an AMP fails. You can use FALLBACK on all tables. FALLBACK tables use twice as much disk space as NON-FALLBACK rows . 48. How many types of Skew exist? If you utilized unequally TD resources (CPU,AMP,IO,Disk and etc) this is called skew exists. Major are 3 types of skews (CPU skew, AMP/Data skew, IO Skew). -Data skew? When data is not distributed equally on all the AMPs.

-Cpu skew? Who is taking/consuming more CPU called cpu skew. -IO skew? Who perform more IO Operation? Resulting in IO Skew. 49.What are Differences between Teradata and ANSI Session modes in Teradata? TERADATA MODE ------------1. Comparison is not Case sensitive 2. Create table are default to SET tables 3. Each transaction is committed implicitly 4. Supports all Teradata commands 5. It follows BTET (Begin and End Transaction) Mode ANSI MODE ------------1. Comparison is CASE sensitive 2. Create table are default to MULTISET tables 3. Each transaction has to be committed explicitly 4. Does not support all Teradata commands . 5. It does not follow BTET Mode. 50.How to skip 1st record while using Bteq IMPORT? By using SKIP=1 ; , we can skip first record. .import infile=, skip=1;

Teradata Typical Questions 3

Hi All, 1.Which statement about spool space is true? A.) Spool space must be specified during creation of the user B.) Spool space is used to hold the intermediate result set. C.) Spool space is permanent space. D.) Spool space is limited to the size of the table. Answer--- B 2. Which Utility used to copy a table and restore it to another database? A.) BTEQ B.) Archive Recovery C.) Fastload D.) Table rebuild Answer ---B 3.The Given below, which tool should you use to collect and analyze database performance? A.) BTEQ B.) TDQM C.) Teradata SQL Assistant D.) Teradata Manager Answer --- D 4. In Which way is data distributed with a partitioned primary index? A.) based on the secondary unique index B.) based on the Primary key of the table C.) Based on the Primary Index of the table D.) based on the partitioning column . Answer --- c 5. Batch process block level loading are performed against populated tables by which utility? A.) Multiload B.) bulkload

C.) Tpump D.) Fastload Answer-- A 6. . Teradata Index wizard used for to A.) compare performance of multiple workloads B.) recommend secondary indexes for a table C.) recommend primay indexes for a table D.) compare primay and secondary indexes for a table Answer --B 7. Which statement is true if using NUPIs to accomplish data distribution? A.) The increase of hash buckets has resulted in more hash collisions. B.) Duplicate NUPI values will produce the same row hash. C.) Uniform row distribution is accomplished using UPIs. D.) The low-order 16 bits of the row hash are input to the hash map. Ans -- B 8. Which is the component limits queries based on set thresholds A.) TDQM B.) Teradata Manager C.) BTEQ D.) Query Man Answer --- A 9.How many BYNETs in a teradata system? Well, BYNET is both a hard ware and software BYNET. Hard ware BYNET connects every PE and AMP in the sytem . It can be scalable at any time. Every teradata system has two BYNETS . one for backup in case of one failed However both BYNETS can be used at same time by AMP or PES . 10. What is TENACITY? What is its default value?

TENACITY specifies the amount of time in hours, to retry to obtain a loader slot or to establish all requested sessions to logon. The default for Fast Load is no tenacity , meaning that it will not retry at all. If several FastLoad jobs are executed at the same time, we recommend setting the TENACITY to 4, meaning that the system will continue trying to logon for the number of sessions requested for up to four hours. 11. How do you create materialized view in Teradata? There is no such thing as a "materialized view" in Teradata. The equivalent in Teradata would be a join index (or aggregate index) with a corresponding view put on top of it. The command to create one is "CREATE JOIN INDEX...(lots of options)". Join indexes are maintained when the data is maintained. They cannot be accessed directly, but are invoked when the optimizer determines it is beneficial. Even though you cannot invoke a join index directly, you create a view that looks like the join index and in that way, it would be similar to having direct access. However, this approach does not guarantee that the join index will be used. 12.who will read and write data in teradata?

AMP works like a hard worker. AMP read and write data to their own assigned disks. 13. Failure 7547 Target row updated by multiple source rows.

-updating the same target row by multiple source rows -Remove the duplicate data. 14.How do you execute the given SQL statement repeatedly in BTEQ? Select top 1* from database.table1; =n Here "=n is to run the previous sql statement, "n" number of times. 15. Failure 2646 No more spool space

Check select query well tuned. Collecting stats on the table may fix this problem. 16. How do you declare a variable inside a Teradata macro and Teradata stored procedure? No facility to declare variables inside a Teradata macro, however you can pass values into the macro by means of input parameters. These values will then be embedded in the SQL statements that the macro contains. Teradata stored procedure supports IN, OUT and INOUT parameters, as well as the ability to declare variables within the procedure itself. Such variables could be useful as counters when you have looping logic. 17. What does SLEEP function does in Fast load? The SLEEP command specifies the amount minutes to wait before retrying to logon and establish all sessions. Sleep command can be used with all load utilities not only fastload. This situation can occur if all of the loader slots are used or if the number of requested sessions is not available. The default value is 6 minutes. If tenacity was set to 2 hours and sleep 10 minutes, Sleep command will try to logon for every 10 minutes up to 2 hours duration. 18. Given below, What is the maximum level of data protection?

A.) RAID 1 and Fallback B.) RAID 5 and Fallback C.) RAID 5 and No Fallback D.) RAID 1 and No Fallback ANswer - A 19. When utilizing a unique secondary index, how many AMP(s) are most probably accessed? A.) 1 AMP B.) Multi_AMP C.) 2 AMP D.) All-AMP Answer --- c

20. Difference between count(*) and count(1) ? Count is one of very important functions used in any database . But what many dont know that is the result count we get from COUNT function might be different based on how it is used. Let us consider the example of count(*) and Count(1) and understand how there is some difference the usage. Say for a given table with data

Xy -----------21 31 Null 32 Null 33 41 34 Null Null And this query:

select count(*), count(x), count(1) from table; Results: 5, 2, 4 * Count(*) counts all occurrences including nulls. This is a row count for a given table. * Count(x) counts all non null occurrences of values in column x. If x has null values, count(x) will be less than count(*). * Count(1) is similar to count(x) .It counts all null values in a "pseudo column" created by the constant. Since the constant 1 will never be null, this would, be like count(*) i.e row count . 21.What is use of compress in teradata?Explain? Compression is used to Minimize the table size, for example when the table size is increasing anonymously We can use Compression to reduce the size of the table. Conditions: 1.Compression can be declared at the time of table creation 2.We can compress up to 256 column values(not columns) 3.We can't compress variable length fields (vartext,varchar..)

22. What is the difference between start schema and Fsldm? FSLDM --> Financial Services Logical Data Model (Teradata FS-LDM 7.0) its developed by Teradata for the financial sectors (Specifically for Bank). it can be customised based on the user requirement. StarSchema --> Its a relational database schema for representing multidimensional data. The data is stored in a central fact table, with one or more tables holding information on each dimension. 23. Teradata performance tuning and optimization steps?

1. collecting statistics 2. Explain Statements 3. Avoid Product Joins when possible 4. select appropriate primary index to avoid skewness in storage 5. Avoid Redistribution when possible 6. Use sub-selects instead of big "IN" lists 7. Use derived tables 8. Use GROUP BY instead of DISTINCT ( GROUP BY sorts the data locally on the VPROC. DISTINCT sorts the data after it is redistributed) 9. Use Compression on large tables. 24. Explain command displays the execution plan of the query chosen by the Teradata Optimizer a) False b) True Answer: b

25. Success/Failure/Error responses from Teradata are received by a) Request Parcel b) Data parcel c) Response Parcel Answer: c 26. Teradata Database facilities for software fault tolerance on a) Vproc Migration & Fallback tables b) AMP Clusters & Journaling c) Backup/Archive/Restore d) Table Rebuild Utility e) All of the above f) None of the above Answer: e

27.Total Number of nodes suppport by BYNET are a)510 SMP Nodes a) 512 SMP Nodes b) 513 SMP Nodes c) 514 SMP Nodes Answer: b 28.SMP Stands for a) Symmetric Multi-processor b) Symmetric Massive-Processor c) System Multi-processor d) Symmetric Multi-Processor Answer: a 29.Terabytes represent a) 10 power 15 b) 10 power 12 c) 10 power 18 d) 10 power 24 Answer: b 30.Global Temporary Tables are stored in the TD are a) Perm Space b) Spool Space c) Temp Space Answer : c 31.What are the following object required for Teradata Database-Prem space?. a) Tables & Stored Procedure b) Tables & Views c) Macros & Triggers d) Views & Stored Procedures Answer: a. 32. HASHROW funtions is a. Returns the hash bucket number that corresponds to a specified row hash value. b. Returns the hexadecimal row hash value for an expression c. Returns the AMP number of the primary AMP corresponding to the specified hash bucket number. d. Returns the identification number of the fallback AMP corresponding to the specified hash bucket. Answer: b 33.Teradata A Brief History ?y

1979

Teradata Corp founded in Los Angeles, California.

Development begins on a massively parallel database computer.y y

1982

BYNET technology is patented.

1984 Teradata sells first DBC/1012 to Wells Fargo Bank of California. Total revenue for year $3 million. 1986 1989 1990 1991 1992 1995 1996 1996 1997 1997 1998 1999 2000 Product of the Year! Teradata and NCR partner on next generation of DBC. First Terabyte system installed and in production. NCR is acquired by AT&T. Teradata revenue $280M. Teradata is merged into NCR. Teradata Version 2 for UNIX operating systems released. NCR only vendor to run multi-user TPC-D Benchmarks. AT&T spins off NCR Corporation with Teradata product. Teradata database becomes industry leader in scalable data warehousing. 100 Gigabyte TPC-D Benchmark leader. 24 Terabyte system in production. 1 TB TPC-D winner 50+ TB system in production! Teradata Division created.

y y y y y y y y y y y y y

VN:F [1.9.8_1114] 34.What are the functions of a Tera data DBA? Following are the different functions which a DBA can perform: 1. User Management Creation and managing Users, Databases, Roles, Profiles and Accounts. 2. Space Allocation Assigning Permanent Space, Spool Space and Temporary Space. 3. Access of Database Objects Granting and Revoking Access Rights on different database objects. 4. Security Control Handling logon and logoff rules for Users. 5. System Maintenance Specification of system defaults, restart etc. 6. System Performance Use of Performance Monitor(PMON), Priority Scheduler and Job Scheduling.

7. Resource Monitoring Database Query Log(DBQL) and Access Logging. 8. Data Archives, Restores and Recovery ARC Utility and Permanent Journals. 35. what is Full table scan (FTS) ? What are the scenarios in which Full Table Scans occurs? A Full Table Scan (FTS) is a query that reads every row of a table. Scenarios Full table scan occurs 1. Where clause in SELECT statement does not use either primary index or secondary index. 2. SQL Statement which uses a partial value (like or not like), in the WHERE statement. 3. SQL Statement which does not contain where clause. 4.SQL statement using range in where clause. Ex. (col1 > 40 or col1 < =10000) 36. How to identify PPI columns? Select databasename , tablename , columnposition ,columnname from dbc.indexes where indextype ='Q' order by 1 ,2,3 ; 37.Can you create a table with no Primary Index in teradata? NO. Its not possible.... if you dont mention external primary index, teradata creates one for you. Teradata uses this Primary index to distribute data among AMPs. 38.In case of NUSI, does AMP has local subtable? Yes. In case of NUSI, AMP is going to have a subtable which has only information for the rows in the same AMP. But in case of USI, Each row in AMP is hashed and decide AMP number to store its information in Secondary index Sub table. 39. How long ROW ID is? 64 Bits... AMP receives 32 bit hash value and row data from PE. AMP then append a 32 bit unique value to row HASH to make 64 bit ROW ID.

ROW ID is used to sort rows in AMP First AMP checks is there any row with same HASH value? If yes, then it append32 bit 1 to (0000 0000 0000 0000 0000 0000 0000 0001) to row hash and make it 64 bit ROW ID... If one more row comes with same hash value then it appends 2( 0000 0000 0000 0000 0000 0000 0000 0010) to Row HASH. 40.Can a user creates any object who assigned no perm space? A user with No permspace can't create any tables in his user space. But He can create Macro, Views and triggers. Because these objects will be stored in Global Space . 41. When a user query fails because of spool space? Query may fails because of spool space in two cases When there is no empty perm space. i.e complete system is full. User query requires more spool space than user spool space limit . 42.Does AMP will do row by row search once it has Hash value to retrieve a row? AMP receives a hash value from PE for which data is required. AMP applies a Binary Search to find that row.... Its never do linear search. 43.A Table has UPI on EMP no. I wrote a query in which i used deptno in emp table? How many amps gets this data? Even though table has Primary Index , my SQL query written on dept number on which there is not index.... So its a Full table scan. 44.While Multiload is running client system restarted? We need to manually resubmit the script so that it runs from Last configuration check point. 45.While Executing Multiload script teradata server restarted? Along with server multiload script restarted and Runs from last checkpoint. 46.Can we concatenate Multiple files with same structure and load in multiple tables? NO ,only in fastload its possible.

47.How do you load data from a file to multiple tables MLOAD? In this apply class we use where conditions while loading data into multiple tables. Apply Ins_table where Recind = T1 Apply Ins_table where Recind = T2 48.If Multiload is fail in Acquistion or Application phase how do you restart? a.Incase of old file to Run Dont drop ET,UV,WT and log tables Dont Release locks on target tables Rectify errors in the File or script and Run again. b.Incase of new file to Run Drop ET,UV,WT and log table. Release locks on target tables by using Release MLOAD command. RELEASE MLOAD Table1, ...Table 5 RELEASE MLOAD Table1, ...Table 5 IN APPLY 49.Terdata Data Dictonary Directory explain? The DD/D ( Data Dictionary Directory)y y y y y y y

is an integrated set of system tables contains definitions of and information about all objects in the system is entirely maintained by the RDBMS is data about the data or metadata is distributed across all AMPs like all tables may be queried by administrators or support staff is accessed via Teradata supplied views

Examples of DD/D views: DBC.Tables > information about all tables DBC.Users > information about all users

DBC.AllRights > information about access rights DBC.AllSpace > information about space utilization. 50.Can I use drop statement in Fload utility? YES, But you have to declare it out of the FLOAD Block it means it should not come between .begin loading,.end loading FLOAD also supports DELETE,CREATE,DROP statements which we have to declare out of FLOAD block. In the FLOAD Block we can give only INSERT

1.Fload, Mload and error tables

2. What is the difference between Multiload & Fastload interms of Performance? 3. what is explain in teradata? 4. How many codd's rules are satisfied by teradata database? 5. Teradata performance tuning and optimization 6. What is the difference between Global temporary tables and Volatile temporary tables? 7. How teradata makes sure that there are no duplicate rows being inserted when its a SET table? 8. What are the enhanced features in Teradata V2R5 and V2R6? 9. What is cliques? What is Vdisk and how it will communicate with physical data storage at the time of data retrieval through AMP ? 10. In which phase of the Active Data Warehouse evolution do you use data to determine what will happen? 11. What are two examples of an OLTP environment? 12. After creating tables dynamically in the Teardata, where is the GRANT table option usually done ? When tables are newly created, what is the default role and what the default privileges which get assigned ? 13. what is basic teradata query language? 14. How many types errors will be occur in total SPOOL process and How can we connect a database server from to other server(i.e., i have to connect another server from a present server)

15. How does indexing improve query performance? 16. Does SDLC changes when you use Teradata instead of Oracle? 17. How can we build data marts from FSLDM. is there any standard approach for this? Is FSLDM supports place holder for aggregated data? 18. Which two can be implemented as a centrally located logical architecture? 19. Can we have an unconnected lkp to lookup a DB2 record against a Teradata record? doesnt seem to work. I could be wrong. 20. Which two statements are true about a foreign key? 21. What is the difference between start schma and Fsldm? 22. What is a common data source for the central enterprise data warehouse?