SQL Statement Syntax - Advanced SQL Engine - Teradata Database

Database Introduction

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
qia1556235689628.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1091
lifecycle
previous
Product Category
Teradata Vantage™

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