Posts

Showing posts from January, 2015

ALTER Table in Teradata

One interesting thing I have noticed in Teradata. I have an existing table, I want to ADD one new column to it. I have given below query. I am getting an error. Resolution for Varchar Error Query: ALTER TABLE SAMPLES.LOAN_ACCOUNT ADD MY_NEW VARCHAR2(1); Error: 3706: Syntax error VARCHAR2 does not match defined type. Correct Query: ALTER TABLE SAMPLES.LOAN_ACCOUNT ADD MY_NEW1 VARCHAR(1); Comparison Oracle Vs DB2 Teradata ODBC Driver Type  Native type for Oracle 9i or 10g staging data source Data type for Oracle 9i or 10g staging data source Native type for DB2 staging data source Data type for DB2 staging data source BYTEINT integer NUMBER(38) integer VARCHAR(3) SMALLINT integer INTEGER integer INTEGER INTEGER Integer INTEGER Integer INTEGER DECIMAL Decimal NUMBER(18) Decimal DECIMAL(18,0) FLOAT Float FLOAT(126) Float DOUBLE CHAR Varchar VARCHAR2(n BYTE) Varchar VARCHAR(n BYTE) VARCHAR Varchar VARCHAR2(n BYTE) Varchar VARCHA

Hash Functions in Teradata

Image
There are four hash functions in Teradata.These are pre-defined functions in Teradata. HASHROW Returns the hexadecimal row hash value for an expression or sequence of expressions. If no expression is specified, HASHROW returns the maximum hash code value. HASHBUCKET  Hashmap defines the correspondance between Hashbucket and AMP. The size of Hashbucket is corresponds to the number of busckets available in the system. HASHBAKAMP Returns the identification number of the fallback AMP corresponding to the specified hash bucket. If no hash bucket is specified, HASHBAKAMP returns one less than the maximum number of AMPs in the system. HASHAMP Returns the identification number of the primary AMP corresponding to the specified hash bucket number. If no hash bucket number is specified, HASHAMP returns one less than the maximum number of AMPs in the system. Also read More on Hash Functions

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.

Teradata Unique Architecture

Image
#Teradata Unique Architecture: The main cmponents of Teradata are PE, BYNET and AMP PE - Also called Parsing Engine. It is called OPTIMIZER. BYNET- It is the communication channel between PE and AMP AMP - Is called Access Module Processor. It acts like processor in its own disk. AMP to AMP we can not share the data. So it is called "SHARED NOTHING ARCHITECTURE".

Teradata SQL Assitant Setup

Image
#Teradata SQL Assitant Setup: Open Teradata SQL Assistant: Start > All Programs > Teradata v1??> Teradata SQL Assistant Go to Tools > Define ODBC Data Source In the User DSN tab, click the Add button. In the Create New Data Source window, select “Teradata” from the list and click the Finish button. Fill out the form that appears with the following values: Name: Teradata Description: Teradata Name or IP Address: {insert the name of your database} Under Optional, click Options. Ensure that “No HELP DATABASE” is checked, then click OK. Click OK to finish.

Top 70 Teradata Interview Questions

Image
1. Difference between Teradata and Other RDBMS? 2. Draw the picture of Teradata warehouse? 3. What are the differences between Star schema and Snow flake schema? 4. Differentiate Dimension table and Fact table? 5. What is Fact less fact table? 6. Describe the different types of dimension tables? And explain with Examples? 7. Explain Teradata important components with architecture? 8. Difference between SMP and MPP? 9. Explain the Shared nothing architecture? 10.What is a set table? When we will use multiset table? 11.What is the usage of Fallback? 12.How many primary keys we will apply on a table? 13.How does rows store in Teradata? 14.Tell me the types of Indexes? 15.Difference between UPI and NUPI and the situation where exactly We will use these.? 16.The role of SI in teradata and explain the types? 17. How do we create a join and hash indexes and explain the scenerios? When we will use exactly? 18.What is the meaning of Transient journal overhead? 19.Wha