Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Teradata Cookbook

You're reading from   Teradata Cookbook Over 85 recipes to implement efficient data warehousing solutions

Arrow left icon
Product type Paperback
Published in Feb 2018
Publisher Packt
ISBN-13 9781787280786
Length 454 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (3):
Arrow left icon
Abhinav Khandelwal Abhinav Khandelwal
Author Profile Icon Abhinav Khandelwal
Abhinav Khandelwal
Viswanath Kasi Viswanath Kasi
Author Profile Icon Viswanath Kasi
Viswanath Kasi
Rajsekhar Bhamidipati Rajsekhar Bhamidipati
Author Profile Icon Rajsekhar Bhamidipati
Rajsekhar Bhamidipati
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. Installation 2. SQLs FREE CHAPTER 3. Advanced SQL with Backup and Restore 4. All about Indexes 5. Mixing Strategies – Joining of Tables 6. Building Loading Utility – Replication and Loading 7. Monitoring the better way 8. Collect Statistics the Better Way 9. Application and OPS DBA Insight 10. DBA Insight 11. Performance Tuning 12. Troubleshooting 13. Other Books You May Enjoy

Creating, copying, and dropping tables


Teradata Database uses tables to store data in rows. Tables consist of rows and columns in a database, and can be seen in the following figure:

In Teradata, you can create the following types of tables:

  • Permanent Table: Remains in the database until dropped manually:
    • SET
    • MULTISET 
  • Temporary Table: Session based:
    • Derive table
    • Volatile table
    • Global temporary table
    • Queue table
    • Error logging table
    • NOPI table

In this recipe, we will create, drop, and copy data from one table to another.

Getting ready

You need to connect to Teradata Database using SQLA or Studio.

How to do it...

  1. Connect to Teradata Database using SQLA or Studio.
  2. Create the following permanent table in Database using the following code; it can be seen in the screenshot of SQLA:
/*Create set table*/
CREATE volatile TABLE td_cookbook.EMP_TBL
(EMP_ID INTEGER ,
EMP_Name VARCHAR(20),
Sal INTEGER)primary index (EMP_ID)
  1. Let's insert data into the table by using the following code. Also, check the snippet from SQLA...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image