Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Peers Technol ogi es Pvt. Ltd. Course Brochure TERADATA __________________________________________________________________ IT TRAINING & SERVICES Regd. Office # 207, II floor, HUDA Maithrivanam, Ameerpet, Hyderabad 500 038. Ph # +91 40 40310000 E-mail: [email protected] URL: www.peerstech.com Page 2 TERADATA COURSE CONTENTS TERADATA ARCHITECTURE TERADATA? Teradata – A Brief History Teradata’s Competitive Advantages Teradata Manageability Architecture Teradata Retrieval Architecture Multiple Tables On Multiple Amps Teradata Objects TABLES Views Macros Triggers Stored Procedures The Data Dictionary Directory (DD/D) Structure Query Language (SQL) Data Definition Language (DDL) Data Manipulation Language (DML) Data Control Language (DCL) User Assistance3-16 Create Table – Example of DDL Views Single-Table View Multi-Table Views Select – Example of DML The Select Statement The Join Operation Macros – Teradata SQL Extension HELP COMMANDS – TERADATA SQL EXTENSION Example Of Help Database Show Command – Teradata Sql Extension Explain Facility – Teradata Sql Extension Teradata Features Review SYSTEMS Teradata Functional Overview Channel-Attached Client Software Overview Network-Attached Client Software Overview The Parsing Engine MESSAGE PASSING LAYER The Access Module Processor (Amp) Teradata Parallelism TERADATA DATABASE VERSION 2 ARCHITECTURE Teradata Database Version 2 Single Node (Smp) Vnet (Older Component) MULTI-NODE MPP SYSTEM Example of 4 Node Teradata Database System Teradata Cliques Bynet (For MPP) BYNET COMMUNICATION PROTOCOLS Vproc Inter-Process Communication Examples Of Teradata Database Version 2 Systems What Makes Ncr’s Mpp Platforms Special? Ncr Rack-Based Cabinets DATABASE Tables Views Macros Triggers Teradata User Database – User Comparison The Hierarchy Of Databases And Users Example Of A System Hierarchy Permanent Space Spool Space Temporary Space System Variables And Keywords Creating Tables Data Types Access Rights And Privileges Page 3 TERADATA COURSE CONTENTS INDEXING CREATING A PRIMARY INDEX Primary Index Values Accessing Via A Unique Primary Index Accessing Via A Non-Unique Primary Index Primary Keys And Primary Indexes Duplicate Rows Row Distribution Using A Unique Primary Index (Upi) – Case 1 Row Distribution Using A Non-Unique Primary Index (Nupi) – Case 2 Row Distribution Using A Highly Non-Unique Primary Index (Nupi) Hashing Down To The Amps A Hashing Example The Hash Map Identifying Rows The Row Id Storing Rows Locating A Row On An Amp Using A Pi Secondary Indexes Choosing A Secondary Index Unique Secondary Index (Usi) Access Non-Unique Secondary Index (Nusi) Access Comparison Of Primary And Secondary Indexes Full Table Scans Partitioned Primary Index DATABASE RECOVERY FEATURES CLIQUES Teradata Vproc Migration Locks Locking Modifier Access Nowait Rules Of Locking Access Locks Fallback Fallback Clusters Fallback Vs Non-Fallback Tables Summary Clusters And Cliques Recovery Journal For Down Amps Transient Journal Permanent Archiving And Recovering Data The Stages Of Database Development Physical Database Design Concepts Data Model Terminology Logical Data Model Review Customer Service Model – Er Diagram Customer Service Logical Model Relational Terms Review Domains Domain Values Relational Terms Review (Cont) Domains, Primary And Foreign Key Relationships Entities Sub-Entities Normal Forms Normalization Constraints Transactions And Parallel Processing Page 4 TERADATA COURSE CONTENTS STRUCTURED QUERY LANGUAGE ANSI VS TERADATA SQL Commands A Table with Rows and Columns Table Relationships A Simple SQL SELECT SELECT All Columns and All Rows WHERE Clause ORDER BY Clause Multiple ORDER BY Columns DISTINCT Option Naming Requirements and Qualifications Naming Rules—Teradata Extensions Recommended Coding Conventions Default Database Changing the Default Database Customer Service Database Module 2 Simple BTEQ BTEQ: Basic Teradata Query BTEQ Request Flow Session Parameters SESSION TRANSACTION Modes SQL FLAG Example SHOW CONTROL BTEQ Script Example Using BTEQ Interactively Identifying Syntax Errors HELP FUNCTIONS HELP Commands HELP Commands: Database Objects HELP DATABASE HELP TABLE HELP Commands: Session Characteristics HELP Commands: SQL and RBDMS Utility Syntax SHOW Command SHOW TABLE SHOW VIEW SHOW MACRO EXPLAIN LOGICAL AND CONDITIONAL EXPRESSIONS Logical Expressions: Operators Between AND Range Test Operator—Numeric BETWEEN AND Range Test Operator— Character Set Operator—IN Set Operator—NOT IN What is NULL? Arithmetic and Comparison Operation on NULL Using NULL in a SELECT Partial String Operator—LIKE LIKE—Case-Blind Compare LIKE Using Quantifiers LIKE—ESCAPE Character Conditional Expressions: Logical Operators Logical Operator—AND Logical Operator—OR Multiple AND OR Logical Operator—NOT DATA CONVERSIONS AND COMPUTATIONS Data Types—Character Data Data Types—Byte Data Data Types—Numeric Data Date/Time Data Types Interval Data Types Numeric Data—Teradata Extensions Data Types—Graphic Data Arithmetic Operators Arithmetic Functions Computed Values Built-in Functions Literal, Constant, and Calculator DATE Handling DATE Arithmetic Date Functions—EXTRACT Date Functions—ADD_MONTHS Using DATE in an SQL SELECT Data Conversions Using CAST Data Conversions—Teradata Extension Page 5 TERADATA COURSE CONTENTS SUBQUERIES IN Revisited SELECT Subquery SELECT Subquery with AND SELECT Subquery with Quantifier ANY SELECT Subquery—Multiple Match EXISTS with Subquery Rules for Subqueries SHOW Command SHOW TABLE SHOW VIEW SHOW MACRO EXPLAIN ATTRIBUTE FUNCTIONS Attributes and Functions Naming a Column or Expression—AS TITLE Attribute CHARACTERS Function TRIM Function TRIM—ANSI vs BTET Mode FORMAT Phrase FORMAT Characters DATE FORMATs FORMAT DATE in an SQL SELECT Extracting Portions of DATEs Truncating CHARACTER Columns— ANSI vs BTET Mode Attribute Functions INNER JOIN Join Types of Joins Inner Join Example—Problem Inner Join Example—Solution Defining and Using Alias Names Cross Joins Cartesian Products Useful Cartesian Products Inner Joins On Multiple Tables Accidental Cartesian Products Self Joins Determining Whether to Use Sub query or Join Subquery vs Join Syntax Use EXPLAIN to Understand a Join Use EXPLAIN to Understand a Subquery OUTER JOINS Inner Join Outer Joins SELECT Statement Join Syntax LEFT Outer Join Example RIGHT Outer Join Example Outer Joins of More Than Two Tables ON Clause Placement Module 10 Data Definition Data Definition Language CREATE TABLE Elements Create Table Options Column Definitions Column Data Type Choices Column Data Type Attributes Column Storage Attributes Column-level Constraints Table-level Constraints Table-level Constraints—Example Primary Key vs Primary Index INDEX DEFINITIONS Create Table—Summary Help Constraint Drop Table Alter Table Changing Constraints Create A Secondary Index Help Index Drop Index DATA MANIPULATION INSERT INSERT SELECT UPDATE UPDATE Using Subqueries or Joins DELETE DELETE Using Subqueries or JOINs Transaction Semantics—BTET Mode Transaction Semantics—ANSI Mode Transaction Semantics: ANSI vs BTET Mode DDL and Transactions Module 12 Macros Page 6 TERADATA COURSE CONTENTS Macros CREATE, EXECUTE, DROP Macro Changing a Macro Simple Parameterized Macros Parameterized Macro to INSERT Data EXECUTE the INSERT Macro (With Positional Parameter Values) EXECUTE the INSERT Macro—Using Parameter Names Using Macros to Preserve Integrity USING Constraints to Preserve Integrity AGGREGATING GROUPS Aggregate Operators The Benefits of Aggregates—Problem The Solution: GROUP BY Group BY and the WHERE Clause GROUP BY and ORDER BY GROUP BY on Multiple Columns GROUP BY and HAVING Condition Aggregating Groups Summary TOTALS AND SUBTOTALS Using WITH BY for Subtotals Creating a Report Using WITH BY WITH BY Multiple Aggregates WITH BY Multiple Subtotal Levels Creating Final Totals Using WITH DISTINCT Modifier WITH BY, WITH and ORDER BY Creating Final Totals Using WITH and GROUP BY WITH BY and WITH Summary CORRELATED SUBQUERIES AND DERIVED TABLES Correlated Subqueries More Correlated Subqueries Correlated Subqueries Using EXISTS Correlated Subqueries and Joins Using Interim Tables Using Derived Tables Using Derived Tables with Groups SET OPERATIONS Set Operations UNION Operator INTERSECT Operator EXCEPT Operator Set operators—Additional Rules CASE EXPRESSION CASE Expression Valued CASE Statement Searched CASE Statement Searched CASE Example NULLIF Expression NULLIF for Division COALESCE Expression COALESCE and NULLIF with Aggregates VIEWS What is a View? CREATING and Using Views Join View Using Views to Rename Columns Changing a View Using Views to FORMAT and TITLE An Aggregate View An Aggregate View using HAVING Joins on Views with Aggregates (1 of 2) Joins on Views with Aggregates (2 of 2) Restrictions on Views Summary of Views STRING FUNCTIONS String Expressions SUBSTRING Function Using SUBSTRING in a List Using SUBSTRING with INTEGERs Using SUBSTRING in a WHERE Clause String Concatenation String Concatenation with SUBSTRING and TRIM POSITION—Character String Position Using SUBSTRING and POSITION Page 7 TERADATA COURSE CONTENTS ADVANCED SQL Using the System Calendar Why a System Calendar? Calendar Table Layout One Row in the Calendar Using the Calendar Using Today’s View Query Relative to Today Group Results By Week of Month Comparing Relative Weeks Aggregates Based on Day of Week Comparing Weeks Using a Day-of-Week Table BASIC ON-LINE ANALYTICAL PROCESSING On-Line Analytical Functions Cumulative Sums Cumulative Sums With Reset Moving Averages Moving Sums Moving Differences Sales Table Simple and Qualified Rankings Ranking With Qualification and GROUP BY Variations on a Ranking Ranking With Aggregations Low Order Ranking Ranking and ORDER BY ADVANCED ON-LINE ANALYTICAL PROCESSING On-Line Analytical Functions Using Quantiles Varying Quantiles Ordering Quantiles Aggregates and Quantiles Forecasting Using Linear Regression Forecasting by Date Sampling Sampling Distinct Values Using Sample-Id TRIGGERS What is a Trigger? Triggered and Triggering Statements Defining a Trigger Trigger Options Conditional Triggers Cascading Triggers Statement Triggers Referencing Rules Enabling Triggers Triggers and Transactions Multiple Triggers and Transactions Triggers, Transactions and ORDER Triggers and Referential Integrity Trigger Usage Guidelines GLOBAL AND VOLATILE TEMP TABLES Why Temporary Tables? Accessing A Temporary Table Temporary Table Choices Derived Tables Revisited Volatile Temporary Tables Volatile Table Restrictions Using Volatile Tables (1 of 2) Using Volatile Tables (2 of 2) Getting Help on Volatile Tables Limitations on Volatile Tables Global Temporary Tables Creating Global Temp Tables Space Allocations Getting Help on Global Tables Using Global Temporary Tables Global Temp Tables and DDL (1 of 2) Global Temp Tables and DDL (2 of 2) Creating Secondary Indexes Dropping Secondary Indexes Collecting Statistics Dropping Statistics Page 8 TERADATA COURSE CONTENTS ANSI TIME AND DATES Default Date Formatting Setting Date Defaults Interval Data Types (Year-Month) Interval Literals in Date Arithmetic Date Literals Date Subtraction Yields Days Date Subtraction Yields Years and Months Year-Month Interval Castings and Calculations Extracting From Date ANSI Time Simple Day-Time Intervals Complex Day-Time Intervals Interval Literals in Time Arithmetic Time Literals Time Subtraction Day-Time Interval Castings Day-Time Interval Castings and Calculations Extracting From Time ANSI TIMESTAMPS AND TIME ZONES ANSI Timestamp Timestamp Literals Timestamp Subtraction Timestamp Casting Time Zones Data Types With Time Zones Setting Time Zones iv Working With Zones (1 of 4) Working With Zones (2 of 4) Working With Zones (3 of 4) Working With Zones (4 of 4) Extracting From Timestamp With Zone Extracting From Timestamp Overlap Function Overlap Options SPECIAL FEATURES OF TERADATA V2R3 Inserting Default Values Defaulting Methods Creating Teradata Mode Tables Creating ANSI Mode Tables The LOWER Function(1 of 2) The LOWER Function(2 of 2) The POSITION Function POSITION and Case Sensitivity Renaming Columns Summary of V2R3 User Features USING THE RANDOM FUNCTION The RANDOM Function Duplicate RANDOM Values RANDOM Sampling Complex RANDOM Sampling Sample Sizing Issues Limitations On Use Of RANDOM Module 29 Table Creation from Existing Tables Creating Empty Tables Using Existing Definitions Copied Attributes Overriding Copied Attributes Creating Tables Using Subqueries RENAMING COLUMNS Changing Column Attributes Creating Populated Tables Using Existing Definitions Using Joins In A Subquery Using Calculations And Expressions Overriding Data Types Setting Default Titles Renaming Columns Using AS Clause Adding UNIQUE and PRIMARY KEY Constraints Volatile And Temporary Tables Using Default Values Populating NOT NULL Columns Populating Default Columns Page 9 TERADATA COURSE CONTENTS USING THE COUNT WINDOW FUNCTION COUNT Window Function Using WITHBY For Group Counts Using COUNT Window Function For Group Counts Using WITH For Final Counts Using COUNT Window Function For Final Count Combining COUNT Window With RANK RANK Ascending Sequence Using COUNT Window And RANK For Percentiles Using RANK And COUNT Window To Produce Ratings Using COUNT Window Instead Of Derived Table Aggregation Using COUNT Window With Derived Tables COUNT Window And QUANTILE USING THE SUM WINDOW FUNCTION SUM Window Function Using WITHBY For Group Totals Using SUM Window Function For Group Totals Using WITH For Final Totals Using SUM Window Function For Final Totals Combining SUM Window With RANK SUM Window Used In Calculations Summary ANSI EQUIVALENT OLAP FUNCTIONS RANK Function RANK Function With Groupings CSUM Function MSUM Function MAVG Function AGGREGATE JOIN INDEXES JOIN INDEX Review Why an Aggregate Index Aggregate Index Properties Without an Aggregate Index EXPLAINing Without an Aggregate Index Creating an Aggregate Index EXPLAINing the use of an Aggregate Index SHOWing an Aggregate Index Covering the Query - Example 1 Covering the Query - Example 2 GSUM, GCOUNT, WITH, WITHBY Functions STORED PROCEDURE BASICS Stored Procedure Properties Stored Procedure Advantages Parameterized Stored Procedures Calling Stored Procedures SET Statements CALL Argument Options CASTing CALL Argument Using Host Variables as Arguments Procedures CALLing Procedures Procedures CALLing Procedures with Differing Numbers of Parameter Other Considerations For CALL Statements Stored Procedures Containing SQL CALL Examples Stored Procedure Rights and Permissions Using the LOOP Statement DECLARING CURSORS CURSOR Example Viewing PRINT Output Using ACTIVITY_COUNT Compiling Stored Procedures Compiling and Permissions Compiling Procedures in ODBC and JDBC SELECT INTO - Returning a Single Row Exceptions Cause Procedure Exit Getting HELP On Procedure Definitions Page 10 TERADATA COURSE CONTENTS STORED PROCEDURES - PART 2 Updateable Cursors With Positioned UPDATEs Updateable Cursors With Positioned DELETEs Other Facts About Updateable Cursors Condition Handlers Executing an EXIT Condition Handler Executing a CONTINUE Condition Handler Multiple Handlers Stored Procedures and ANSI Mode Transactions ANSI Mode Transaction Examples Stored Procedures and Teradata Mode Transactions Teradata Mode Transaction Examples Condition Handler Exceptions (ANSI-mode) Condition Handler Exceptions (Teradata-mode) Transactions With Stored Procedures (ANSImode) Transactions With Stored Procedures (Teradatamode) ADVANCED AGGREGATE FUNCTIONS Aggregate Functions Standard Deviation Functions Variance Functions Distribution Functions Correlation And Covariance Functions BTEQ AND TERADATA UTILITIES BTEQ Using Bteq Conditional Logic Bteq Error Handling Bteq Export 4 Types Of Bteq Export Field Mode (Report) Record Mode (Data) Data Interchange Format (Dif) Bteq Export Script Bteq Data Modes FASTLOAD Fastload Characteristics Fastload Phase Fastload Phase A Sample Fastload FASTEXPORT Begin And End Export Sessions Max Min Export A Fast export Script WORK TABLES MULTILOAD Multiload Limitations How Multiload Works Advantages Of Multiload Basic Multiload Statements Sample Multiload Import Task Import Task 5 Phases Of Import Task Phase 1: Preliminary Phase 2: Dml Transaction Phase 3: Acquisition Phase 3: Acquisition - A Closer Look Phase 4: Application Phase 4: Application - A Closer Look Phase 5: Cleanup Execute End Mload Processing As An Explicit Transaction Mload Session Logoff Sample Multiload Delete Tasks Delete Task Differences From Import Task A Closer Look At Delete Task Application Phase Multiload Locks Utility Locks Restarting Multiload Release Mload Statement Invoking Multiload Application Utility Checklist