The Teradata EXPLAIN command can be added to the front of the SQL
statement and while execution it gives a detailed analysis for particular statement. The EXPLAIN command can be used to estimate what are the indexes to be used,how much time
a query will take and how many rows a query will be return. This command can be used as a useful debug tool to resolve problems with long processing times.
Teradata HELP TABLE Command
The Teradata HELP TABLE command displays the information regarding name, data type, and comment (if
applicable), of all columns in particular table:
HELP TABLE Customer_Service.emp;
HELP TABLE Customer_Service.emp;
ColumnName
|
Type
|
Comment
|
emp_number
|
I
|
System assigned identification
|
mgr_emp_number
|
I
|
|
dept_number
|
I
|
Department employee works in
|
job_code
|
I
|
Job classification designation
|
l_name
|
CF
|
Employee surname
|
f_name
|
CV
|
Employee given name
|
hire_date
|
DA
|
Date employee was hired
|
birth_date
|
DA
|
|
sal_amt
|
D
|
Annual compensation amount
|
Data type Representations are as follows:
Type
Description
BF BYTE
BV VARBYTE
BV VARBYTE
CF CHARACTER FIXED
CV CHARACTER VARIABLE
DA DATE
I1 BYTEINT
I2 SMALLINT
AT TIME
TS TIMESTAMP
D DECIMAL
I INTEGER
What is BTEQ in Teradata?
It is client s/w that resides on network
or channel-attached host. After starting BTEQ,you can log on to Teradata using
a TDPid (Teradata Director Program id) with your user id and password. The TDPid
identifies the instance of TD you are going to access.
Use of BTEQ (Basic Teradata Query program) is to submit SQL queries to Teradata Database. It works like a interface b/w query and TD.
Use of BTEQ (Basic Teradata Query program) is to submit SQL queries to Teradata Database. It works like a interface b/w query and TD.
Teradata SQL basic commands
Teradata basic SQL commands commonly are divided into three categories:
1.Data Definition Language
(DDL): - We can define and create database objects such as tables, macros, views, databases and users etc by using DDL commands.
SQL statement
|
Function
|
CREATE
|
To define a table, macro,view, index, trigger or stored
procedure.
|
DROP
|
To remove a table, view, macro, index, trigger or stored
procedure.
|
ALTER
|
To change table structure or protection definition.
|
2.Data Manipulation Language (DML): - Work with the data including tasks such as inserting data rows into a table and updating an existing row or performing queries on the data by using the DML commands.
SQL statement
|
Function
|
SELECT
|
To select data from one or more tables.
|
INSERT
|
To place a new row into a table.
|
UPDATE
|
To change data values in one or more existing rows.
|
DELETE
|
To remove one or more rows from a table.
|
3.Data Control Language (DCL): - Here we can perform the administrative tasks such as granting and
revoking privileges to database objects or controlling ownership of those
objects by using DCL
commands.
SQL statement
|
Function
|
GRANT
|
To give user privileges.
|
REVOKE
|
To remove user privileges.
|
GIVE
|
To transfer database ownership.
|
What are set tables and multiset tables in Teradata?
If the table is specified as SET , table do not have duplicate rows.
If the table is specified as MULTISET , table will be having duplicate
rows.
Subscribe to:
Posts (Atom)