Introduction to Teradata SQL
SQL – It stands for Structured Query Language. This is the language for accessing and manipulating any Relational Database Management Systems. SQL is a non-procedural and set oriented language, meaning it contains no procedural-type statements.
Teradata SQL is based on ANSI standards. ANSI stands for American National Standards Institute. Teradata SQL is fully certified at the SQL92 Entry level, with some intermediate, some full and some SQL-99 Core features also implemented. To enhance the capabilities of SQL, Teradata has added extensions that are unique to Teradata.
SQL Commands- There are three categories of SQL Commands:
Data Definition Language (DDL)
Data Manipulation Language (DML)
Data Control Language (DCL)
Categories of SQL Commands
Data Definition Language (DDL) - this is used for creating various database objects like tables, views, macros, users etc.
The following table summarizes the basic DDL Statements :
CREATE | To define a database object like new table, new macro, trigger, index, stored procedure, view. |
DROP | To remove database objects like table, index, macro, stored procedure, view. |
ALTER | Modify table, column, trigger or referential constraints or recompile stored procedure |
RENAME | Rename a table, view, trigger, stored procedure |
SET | Specifies time zones and the collation or character set for a session |
COLLECT STATISTICS | Collect Stats on column/columns or index |
Data Manipulation Language (DML) - This is used for the manipulation of data like inserting the records, deleting the records, updating the records etc.
INSERT | Inserting data into a table |
UPDATE | Modifies data in one or more rows in a table |
Delete | Removing data from table |
Comment | Insert a text comment for a table |
Checkpoint | CHECKPOINT is a function that writes records to a restart log table that you can use to restart in case of a hardware or software system failure. |
Database | Indicates a default database |
Merge | Combines both UPDATE and INSERT in a single SQL statement. |
Data Control Language(DCL):
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.
|
No comments:
Post a Comment