Teradata tips

by Irina 14. March 2009 18:01
    
A database may contain :

Tables – contain data
Views – are previously defined “windows” to the data 
Macros – are stored SQL statements
Triggers – are SQL statements associated with a table
Join indexes – are user defined pre-joins or pre-aggregations
Stored-procedures – are pre-written SQL scripts with defined procedural processing using Stored procedures control statements

 
Definition of  default database:

.logon irena
Password: abc123
The normal default database for this logon is irena until:
    * User logs off
    * A new database control is used
 
The database command used to change default database

You can easily verify you current default database:

Select database
Other build-in function:

Current_date
Current_time
Current_timestamp
Date
Profile
Role
Time
 
Bteq – is a front end tool for submitting SQL queries. Bteq stands for basic Teradata Query programs
There are many tools available to provide help for the Teradata Sql user or programmer

    *         Help command
Provides information on a specified database object.
There are many objects for which help may be requested.

Databases and users

HELP DATABASE
HELP USER


Database Objects

HELP TABLE – shows the name, data type and comment of all columns
HELP VIEW
HELP MACRO
HELP COLUMN
HELP INDEX
HELP STATISTICS
HELP CONSTRAINT
HELP VOLATILE TABLE
HELP JOIN INDEX
HELP HESH INDEX
HELP TRIGGER
HELP PROCEDURE
HELP FUNCTION


    *            Show command
 
SHOW TABLE – shows the most current definition of the table
SHOW VIEW
SHOW JOINT INDEX
SHOW PROCEDURE

Shoes how an object was created, intended as a convenience to the developer

    *         Explain feature

 Shoes how a query will execute in Teradata
It’s recommended to use Explain modifier before the SQL request – to see the plan execution of SQL. Explain function returns the plan how the optimizer will execute the SQL.
For example if you see that you request cause Full-table scan on a big table or cause Cartesian product join without intention – it’s preferable to rewrite request and write more efficient joint.

Explain provides:

    *          Translation of AMP steps
    *          A row count and time estimation for comparison only
    *          Which indexes if any will be used
    *          Whether individual steps will be used in parallel

    Related posts

    Comments

    11/5/2009 11:30:38 AM

    The detailsare given in the most appropriate form and they are pleasant to read.

    impotence treatments

    9/16/2010 9:42:55 PM

    Actually very good web site, wherever did you arrive up using the expertise on this piece of composing? I am delighted I discovered it although, sick be checking again quickly to determine what other articles or blog posts you may have. I'm hoping the very same greatest perform from you inside the long term as very well.

    ugg knightsbridge

    11/20/2010 1:43:37 AM

    Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with more information? It is extremely helpful for me.

    nike shox

    12/2/2010 2:14:44 AM

    Have you ever ever thought about adding just a little bit more than simply your ideas? I mean, what you say is important and everything. But its acquired no punch, no pop!

    Windows 7 Enterprise Activation Key

    12/21/2010 1:49:50 AM

    Interesting blog. It would be great if you can provide more details about it. Thanks you.

    deliver flowers in mombasa, kenya

    11/29/2011 10:50:53 AM


    SEO (SEO Company London) has now become a popular way for success of each online business. The SEO procedure is helpful for taking a website in the top position in major search engines such as google, bing and yahoo. Individuals from all over the globe prefer SEO India as India companies offer high quality and cost effective services.


    SEO (SEO Company London) has now become a popular way for success of each online business. The SEO procedure is helpful for taking a website in the top position in major search engines such as google, bing and yahoo. Individuals from all over the globe prefer SEO India as India companies offer high quality and cost effective services.

    http://www.seosoftwareservices.com

    SEO Company India

    Add comment


    (will show your Gravatar icon)  





    Live preview

    2/5/2012 8:35:07 PM

     

    About the author

    Irina Spivak Irina Spivak
    Team Leader at G-Stat. More...


    Send mail Email

    Blogroll

      Disclaimer

      The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

      © Copyright 2012

      Sign in

      eXTReMe Tracker