Tuesday 12 February 2013

13. Teradata objects

Teradata Objects

A
database in the Teradata system is a collection of objects known as
tables
, views, macros, triggers and stored procedures. Databases
provide a
logical grouping for information. They are also the
foundation for space allocation and access control.

1) Tables
A table is the logical structure of data in an RDBMS. It is a
twodimensional
structure made up of columns and rows
. A user defines
a table by giving it a table name that refers to the type of data that will be
stored in the table (e.g., an Employee table stores data about employees.)

A
column represents attributes of the table. Column names are given to
each column of the table. All information in a column is of the same type.
For example, a column named Date of Birth would only hold date of birth
information. Each occurrence of an entity is stored in the table as a
row.
Entities are the people, places, things, or events that the table is
describing. Tables require Permanent Space to store rows.

2) Views
A view is a
pre-defined subset of one or more tables or other views. It
does not exist as a real table, but serves as a reference to existing tables
or views. One way to think of a view is as a virtual table. Views have
definitions in the Data Dictionary (DD) but do not contain any physical
rows. Views can be used to control access to the underlying tables.
Views can be used to hide columns from users, to insulate applications
from database changes, and to standardize or simplify access techniques.
Views do not require Permanent Space.

3) Macros
A macro is a predefined, stored set of one or more SQL commands and
report-formatting commands. Macros are used to simplify the execution of
frequently used SQL commands. Macros do not require Permanent
Space.

4) Triggers
A trigger is an event-driven procedure attached to a table. A trigger
defines events that happen when some other event, called a
triggering
event
, occurs. A trigger consists of one or more SQL statements that are
associated with a table and are executed when the trigger is fired. A
trigger is created with the CREATE TRIGGER statement.

5) Stored Procedures
A stored procedure is a pre-defined set of statements invoked through a
single SQL CALL statement. Stored procedures may contain both
Teradata SQL statements and procedural statements (in Teradata,
referred to as Stored Procedure Language, or SPL). Macros are similar to
stored procedures but do not contain SPL.

No comments:

Post a Comment