15.00 - 15.10 - SQL Statement Syntax - Teradata Database

Teradata Database Introduction to Teradata

Product
Teradata Database
Release Number
15.00
15.10
Content Type
User Guide
Publication ID
B035-1091-151K
Language
English (United States)
Last Update
2018-09-25

A typical SQL request consists of the following:

  • A statement keyword
  • One or more column names
  • A database name
  • A table name
  • One or more optional clauses introduced by keywords
  • For example, in the following single-statement request, the statement keyword is SELECT:

       SELECT deptno, name, salary
       FROM personnel.employee
       WHERE deptno IN(100, 500)
       ORDER BY deptno, name
       ;

    The select list and FROM clause for this statement is made up of the following names:

  • Deptno, name, and salary (the column names)
  • Personnel (the database name)
  • Employee (the table name)
  • The search condition, or WHERE clause, is introduced by the keyword WHERE, as in:

       WHERE deptno IN(100, 500)

    The sort ordering, or ORDER BY clause, is introduced by the keywords ORDER BY, as in:

       ORDER BY deptno, name