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.


1 comment: