Thursday, 12 February 2015

Teradata Simple Views and Complex Views

A view is a part of base table or base tables. Many reasons we can use Views.

1. Views with aggregate data we can use
2. Reduce complexity, so that less SQL skill is required to use views
3. Like any other base table, we can not Alter views
4. We use REPLACE option to alter views

View can be dropped:

DROP VIEW view_name;

Before going into indepth of Views, some rules are there to create View:
  • Should NOT use ORDER BY either on a view or base table in CREATE VIEW query
  • Indexes- we shoud not
  • Always give Alias to Aggregtate/Derived column names

Simple View: A view is created from a base table without any functions or Joins

Complex View: A view is created with Aggregate functions, Joins, Derived data, DISTINCT, GROUP BY will be treated as Complex view.

No comments:

Post a Comment

5 Top Teradata DATE functions read now

  The following are the list of DATE functions. These are very frequently being used in Teradata. Current DATE The following statem...