Sunday, 5 July 2015

SQL Query to Create a View in Teradata

Teradata+Jobs

Simple SQL query to create a view in Teradata:

CREATE View Employee_V AS
SELECT      Employee_No
           ,First_Name
           ,Last_Name
           ,Dept_No
FROM Employee_Table ;

- A view we create to restrict access to certain columns
-To restrict access to certain derived columns
-To restrict access to join tables
-To restrict access to certain rows

View is basically in a semantic layer. It supports to Presentation layer. Some time a view can change column names, a view can derive new columns , also aggregate columns.

Simple rules for views:

- A view should not contain Order By
-All aggregate columns must have ALIAS
-All derived column must have ALIAS



No comments:

Post a Comment