Book Image

Teradata Cookbook

By : Abhinav Khandelwal, Viswanath Kasi, Rajsekhar Bhamidipati
Book Image

Teradata Cookbook

By: Abhinav Khandelwal, Viswanath Kasi, Rajsekhar Bhamidipati

Overview of this book

Teradata is an enterprise software company that develops and sells its eponymous relational database management system (RDBMS), which is considered to be a leading data warehousing solutions and provides data management solutions for analytics. This book will help you get all the practical information you need for the creation and implementation of your data warehousing solution using Teradata. The book begins with recipes on quickly setting up a development environment so you can work with different types of data structuring and manipulation function. You will tackle all problems related to efficient querying, stored procedure searching, and navigation techniques. Additionally, you’ll master various administrative tasks such as user and security management, workload management, high availability, performance tuning, and monitoring. This book is designed to take you through the best practices of performing the real daily tasks of a Teradata DBA, and will help you tackle any problem you might encounter in the process.
Table of Contents (19 chapters)
Title Page
Dedication
Packt Upsell
Contributors
Preface
Index

Working with views


Views in SQL databases are the virtual tables; any view in a database always sits on top of one or more tables. By definition, VIEW contain rows and columns from a SELECT statement from the real table; it could be a combination of one or more tables:

As you can see in the figure, VIEW contains 1 column from TABLE A and two from TABLE B. Tables are joined using a join between two tables.

There are a few benefits when it comes to view creation, and they are as follows:

  • Provides a security mechanism
  • Can hide the complexity of the table in a view
  • Data in the view gets auto-updated whenever the underlying table gets changed
  • Statistics defined on the table are available to views also

As a best practice, it is recommended to create a separate database containers for views. As shown in the screenshot, we have two separate containers for tables and views:

The following is the syntax for creating a view:

/*View creating syntax*/
CREATE/REPLACE VIEW <viewname> 
AS  
<select query...