SQL Statement Syntax - Teradata Database

Database Introduction

Product
Teradata Database
Release Number
15.00
Language
English (United States)
Last Update
2018-09-25
dita:id
B035-1091
lifecycle
previous
Product Category
Teradata® Database

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