<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7106842514564860422</id><updated>2025-09-09T00:28:49.874+05:30</updated><category term="BASICS"/><category term="SQL"/><category term="Functions"/><category term="Utilities"/><category term="Teradata Architecture"/><category term="Teradata Components"/><category term="Interview Questions"/><category term="Performance Tuning"/><category term="Teradata Indexes"/><category term="components of teradata architecture"/><category term="TPT"/><category term="Teradata 14 release functions"/><category term="Teradata Columnar"/><category term="new functions in teardata"/><category term="AMP"/><category term="About Teradata"/><category term="Aggregate Join Index"/><category term="BETWEEN Operator"/><category term="BTEQ"/><category term="BYNET"/><category term="Bynet in Teradata"/><category term="CASE Function"/><category term="CASESPECIFIC"/><category term="COLLECTSTATISTICS"/><category term="CUBE Function"/><category term="Case_N Partitioning"/><category term="Certification"/><category term="Character Based Partitioning"/><category term="Cliques"/><category term="Collect Statistics on a PPI"/><category term="Collect statistics syntax"/><category term="Compressed Join Index"/><category term="Cross Joins"/><category term="DEFAULT"/><category term="Data Protection mechanism in teradata"/><category term="Data distribution using Secondary Index"/><category term="Databases"/><category term="Date Functions"/><category term="Definition of Vproc"/><category term="Derived tables"/><category term="Differences in Teradata vesrions V12"/><category term="Disk Arrays"/><category term="Disk array controllers"/><category term="Disk array definition"/><category term="Down-AMP Recovery Journal in teradata"/><category term="EXPLAIN"/><category term="EXTRACT"/><category term="Explain scalability"/><category term="FAST EXPORT"/><category term="FASTLOAD"/><category term="Fallback"/><category term="Fallback benefits"/><category term="Global temporary tables"/><category term="HASHAMP"/><category term="HASHBAKAMP"/><category term="HASHBUCKET"/><category term="HASHROW"/><category term="HELP function"/><category term="Hash Functions"/><category term="Hash Indexes"/><category term="Hashing"/><category term="Hot Standby Nodes"/><category term="How Fallback works"/><category term="How It Handles Failures"/><category term="IN Operator"/><category term="Indexes in Teradata"/><category term="Inner Joins"/><category term="Introduction to Teradata"/><category term="Join Index"/><category term="Joins"/><category term="Journals"/><category term="LIKE operator"/><category term="Learn Teradata"/><category term="Locks"/><category term="MPP"/><category term="MULTI LOAD"/><category term="Multi Column Primary Indexes"/><category term="Multi Table Join index"/><category term="NoPI Table"/><category term="Non Unique Primary Index"/><category term="Non Unique Secondary Index"/><category term="Numeric Functions"/><category term="OS"/><category term="Open architecture of teradata"/><category term="Operators"/><category term="Outer Joins"/><category term="PDE"/><category term="Parallel Database Extensions"/><category term="Parsing Engine"/><category term="Partitioned Primary Index"/><category term="Performance Tips"/><category term="Physical disks"/><category term="Primary Index"/><category term="Privacy Policy"/><category term="RAID"/><category term="RAID 0"/><category term="RAID 2"/><category term="RAID S"/><category term="RAID1"/><category term="RAID5"/><category term="RANGE_N Partitioning"/><category term="ROLLUP Function"/><category term="Ranking"/><category term="Redundant Array of Inexpensive Disks"/><category term="Regular Expression Functions"/><category term="Row Id"/><category term="SAMPLE Function"/><category term="SCSI bus"/><category term="SHOW function in teradata"/><category term="SMP"/><category term="SQL Commnads"/><category term="Scalabilty"/><category term="Secondary Index"/><category term="Self Joins"/><category term="Single Table Join Index"/><category term="Software Components"/><category term="Sparse Join Index"/><category term="Subqueries"/><category term="Symmetric Multi Processing"/><category term="TD14 new functions"/><category term="TITLE"/><category term="TPA"/><category term="TPUMP"/><category term="TRIM"/><category term="TYPE"/><category term="Tables"/><category term="Teardata Journals"/><category term="Temporary tables"/><category term="Teradata  Performance Tuning"/><category term="Teradata 14 functions"/><category term="Teradata 14 updates"/><category term="Teradata AMP"/><category term="Teradata Bynet"/><category term="Teradata Channel Driver"/><category term="Teradata EXPLAIN Plan"/><category term="Teradata Facts"/><category term="Teradata Fallback"/><category term="Teradata Gateway"/><category term="Teradata HASH Functions"/><category term="Teradata Macros"/><category term="Teradata Primary index"/><category term="Teradata RAID"/><category term="Teradata Secondary index"/><category term="Teradata Subqueries syntax"/><category term="Teradata TOP Function"/><category term="Teradata V14 Statistics Enhancements"/><category term="Teradata columnar compression"/><category term="Teradata columnar example"/><category term="Teradata disk array"/><category term="Teradata hot standby nodes"/><category term="Teradata operating system"/><category term="Teradata subqueries examples"/><category term="Teradata virtual processor"/><category term="Teradata vproc manager"/><category term="Teradata12 Certification"/><category term="Teradata14 Certification"/><category term="Teradata15 features"/><category term="Trim function syntax"/><category term="Trusted Parallel Application"/><category term="Unique Primary Index"/><category term="Unique Secondary Index"/><category term="Use of Teradata AMP"/><category term="Uses of Bynet"/><category term="V13 and V14"/><category term="VProcs"/><category term="Volatile tables"/><category term="What is Bynet"/><category term="What is Teradata AMP"/><category term="What is Vproc"/><category term="What is explain in Teradata"/><category term="What is scalability"/><category term="What is the Teradata Database"/><category term="Why Teradata"/><category term="architecture of clique"/><category term="architecture of teradata"/><category term="cliques in teradata"/><category term="components of Disk array"/><category term="difference between Symmetric Multi Processing and massive parallel processing"/><category term="disk array controller"/><category term="explain hot standby nodes"/><category term="fallback in teradata"/><category term="hot standby node in teradata"/><category term="introduction teradata database"/><category term="join in teradata syntax"/><category term="joins in teradata"/><category term="journal in Teradata"/><category term="massive parallel processing"/><category term="multi level partitioned primary index"/><category term="no primary index in teradata"/><category term="permanent journal in Teradata"/><category term="recovery journal in Teradata"/><category term="teradata architecture overview"/><category term="teradata bynet architecture"/><category term="teradata bynet definition"/><category term="teradata clique"/><category term="teradata locks"/><category term="teradata locks types"/><category term="teradata rdbms architecture"/><category term="teradata vproc"/><category term="teradata vproc definition"/><category term="teradata&#39;s open architecture"/><category term="transient journal in teradata"/><category term="types of join indexes in teradata"/><category term="types of locks in teradata"/><category term="what is hot standby node in teradata"/><title type='text'>Teradata Wiki</title><subtitle type='html'>Learn today... Lead tomorrow...</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://teradatawiki.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://teradatawiki.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Admin</name><uri>http://www.blogger.com/profile/03270946312373154797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCm0FeHTqy9tdxei5Vc3zsRwKvVPISdFMvIqK5NAbGyyTShzSA7INIQO8uEUGzBkkIDbVj7rdc7z1yqFbAQJMIryVb0gOqbYP1pgPjtpQ9v73YBxwSkukI_mgytcpbIA/s220/IMG_3457.jpg.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>61</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7106842514564860422.post-1056938656712459162</id><published>2016-06-30T09:30:00.001+05:30</published><updated>2016-06-30T09:36:25.309+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="BASICS"/><category scheme="http://www.blogger.com/atom/ns#" term="Teradata Columnar"/><title type='text'>Columnar</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;ssmainhide&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_GPwtcNYjdLsqFo_Y6GZktPdRAbRzrDDKNBxj041jnBHktCp-xahnaJ47lZ2xHmQ8u2xa9VR3ZvaHVBsXu83F5eBLrx-sduNY527b6AV8Fo57nWktbl-AONYZMKlQFZk3wECQ5J_p4BKs/s1600/Columnar.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Teradata Columnar&quot; border=&quot;0&quot; height=&quot;125&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_GPwtcNYjdLsqFo_Y6GZktPdRAbRzrDDKNBxj041jnBHktCp-xahnaJ47lZ2xHmQ8u2xa9VR3ZvaHVBsXu83F5eBLrx-sduNY527b6AV8Fo57nWktbl-AONYZMKlQFZk3wECQ5J_p4BKs/s200/Columnar.jpg&quot; title=&quot;Teradata Columnar&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
The purpose of a Columnar(NoPI) table is to spread the rows evenly across the AMPs. This is why a NoPI table is often used as a staging table.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Columnar Table Fundamentals&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Columnar Tables must be a NoPI Table so No Primary Index (NoPI).&lt;/li&gt;
&lt;li&gt;The NoPI brings even distribution to the table.&lt;/li&gt;
&lt;li&gt;Columnar Tables allow Columns to be Partitioned.&lt;/li&gt;
&lt;li&gt;An AMP still holds the entire row, but partitions vertically.&lt;/li&gt;
&lt;li&gt;Columns are placed inside their own individual Container.&lt;/li&gt;
&lt;li&gt;All Containers have the same amount of rows in the exact order.&lt;/li&gt;
&lt;li&gt;Single Columns or Multi-Columns can be placed inside containers.&lt;/li&gt;
&lt;li&gt;Each container looks like a small table for I/O purposes.&lt;/li&gt;
&lt;li&gt;Add up all the containers and you rebuild the row.&lt;/li&gt;
&lt;li&gt;Columnar Tables make sense when users query only certain columns.&lt;/li&gt;
&lt;li&gt;When a row is deleted it is NOT Physically Deleted but marked deleted&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Normal table vs columnar table&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
The two tables above contain the same Employee data, but one is a columnar table. Employee_Normal has placed 3 rows on each AMP with 5 columns. The other table Employee_Columnar has 5 Containers each with one column.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgM4nlc8J0u7tyt1wlirnSUTlU9sNNOeBMhs3wziGh7c4Mes0l5en0HGhCuh4KVh-9JGZHaPXksJIR8U566blVf_Z3XAfQ0Uc9n_MuQcUNXZ05ilI2996Kb8PgjGRfnxRXUpuFIQQGjmv6i/s1600/Columnar_amp.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Teradata Columnar containers&quot; border=&quot;0&quot; height=&quot;360&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgM4nlc8J0u7tyt1wlirnSUTlU9sNNOeBMhs3wziGh7c4Mes0l5en0HGhCuh4KVh-9JGZHaPXksJIR8U566blVf_Z3XAfQ0Uc9n_MuQcUNXZ05ilI2996Kb8PgjGRfnxRXUpuFIQQGjmv6i/s640/Columnar_amp.jpg&quot; title=&quot;Teradata Columnar containers&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Add caption&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Example&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
CREATE Table Employee&lt;br /&gt;
(&lt;br /&gt;
&amp;nbsp; Emp_Id &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Integer&lt;br /&gt;
&amp;nbsp;,Dept_Id &amp;nbsp; &amp;nbsp; &amp;nbsp; Integer&lt;br /&gt;
&amp;nbsp;,First_Name &amp;nbsp; &amp;nbsp;Varchar(20)&lt;br /&gt;
&amp;nbsp;,Last_Name &amp;nbsp; &amp;nbsp; Char(20)&lt;br /&gt;
&amp;nbsp;,Salary &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Decimal (10,2)&lt;br /&gt;
)&lt;br /&gt;
No Primary Index&lt;br /&gt;
PARTITION BY COLUMN;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Columnar table&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxuaGtpuxdlBdD73SwlXBcA9NFzhiVhbutlGtwDgRYEZxshI95TZEfkDaUlNPNe4ma6QQg2kMtuF5rzAGHy1YkiIKSQAc11qYzVLciFppmREz9_8InSjjXtnm5xoz71TvmHGQpsp6dJMsU/s1600/Columnar_amp2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Teradata Columnar AMP&quot; border=&quot;0&quot; height=&quot;235&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxuaGtpuxdlBdD73SwlXBcA9NFzhiVhbutlGtwDgRYEZxshI95TZEfkDaUlNPNe4ma6QQg2kMtuF5rzAGHy1YkiIKSQAc11qYzVLciFppmREz9_8InSjjXtnm5xoz71TvmHGQpsp6dJMsU/s640/Columnar_amp2.jpg&quot; title=&quot;Teradata Columnar AMP&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;This AMP is assigned 3 Employee Rows&lt;/li&gt;
&lt;li&gt;All AMPs hold 3 different Employee Rows also&lt;/li&gt;
&lt;li&gt;Each Row has 5 Columns&lt;/li&gt;
&lt;li&gt;This Columnar Table partitions in 5 separate containers&lt;/li&gt;
&lt;li&gt;Each container has a relative row number (1, 2, 3)&lt;/li&gt;
&lt;li&gt;Each container has the exact same number of rows&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;NoPI Table Capabilities:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Are always Multi-Set Tables&lt;/li&gt;
&lt;li&gt;Have Secondary Indexes (USI or NUSI)&lt;/li&gt;
&lt;li&gt;Have Join Indexes&lt;/li&gt;
&lt;li&gt;Be Volatile or Global Temporary Tables&lt;/li&gt;
&lt;li&gt;Can COLLECT STATISTICS&lt;/li&gt;
&lt;li&gt;Be FALLBACK Protected&lt;/li&gt;
&lt;li&gt;Have Triggers&lt;/li&gt;
&lt;li&gt;Be Large Objects (LOBs)&lt;/li&gt;
&lt;li&gt;Have Primary Key Foreign Key Constraint&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;NoPI Table Restrictions&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;No Primary Indexes allowed&lt;/li&gt;
&lt;li&gt;No SET Tables&lt;/li&gt;
&lt;li&gt;No Partition Primary Index (PPI) tables&lt;/li&gt;
&lt;li&gt;No Queue Tables&lt;/li&gt;
&lt;li&gt;No Hash Indexes&lt;/li&gt;
&lt;li&gt;No Identity Columns&lt;/li&gt;
&lt;li&gt;No Permanent Journaling&lt;/li&gt;
&lt;li&gt;Can&#39;t be the Target Table for any UPDATE, UPSERT or MERGE-INTO Statements&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Examples of Columnar tables&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: blue;&quot;&gt;Multi-Columnar&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;
CREATE Table Employee&lt;br /&gt;
(&lt;br /&gt;
&amp;nbsp; Emp_Id &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Integer&lt;br /&gt;
&amp;nbsp;,Dept_Id &amp;nbsp; &amp;nbsp; &amp;nbsp; Integer&lt;br /&gt;
&amp;nbsp;,First_Name &amp;nbsp; &amp;nbsp;Varchar(20)&lt;br /&gt;
&amp;nbsp;,Last_Name &amp;nbsp; &amp;nbsp; Char(20)&lt;br /&gt;
&amp;nbsp;,Salary &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Decimal (10,2)&lt;br /&gt;
)&lt;br /&gt;
No Primary Index&lt;br /&gt;
PARTITION BY COLUMN&lt;br /&gt;
(Emp_Id&lt;br /&gt;
,Dept_id&lt;br /&gt;
(,First_name, Last_name, Salary));&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: blue;&quot;&gt;Row Hybrid Columnar&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;
CREATE Table Employee&lt;br /&gt;
(&lt;br /&gt;
&amp;nbsp; Emp_Id &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Integer&lt;br /&gt;
&amp;nbsp;,Dept_Id &amp;nbsp; &amp;nbsp; &amp;nbsp; Integer&lt;br /&gt;
&amp;nbsp;,First_Name &amp;nbsp; &amp;nbsp;Varchar(20)&lt;br /&gt;
&amp;nbsp;,Last_Name &amp;nbsp; &amp;nbsp; Char(20)&lt;br /&gt;
&amp;nbsp;,Salary &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Decimal (10,2)&lt;br /&gt;
)&lt;br /&gt;
No Primary Index&lt;br /&gt;
PARTITION BY COLUMN&lt;br /&gt;
(Emp_Id No Auto Compress&lt;br /&gt;
,Dept_id&lt;br /&gt;
(,First_name, Last_name, Salary)&lt;br /&gt;
No Auto Compress);&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: blue;&quot;&gt;Columnar Partitions&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;
Crete Table Order_table_PPI_Col&lt;br /&gt;
(Order_no integer not null&lt;br /&gt;
,Customer_no integer&lt;br /&gt;
,Order_date date&lt;br /&gt;
,Order_total decimal(10,2)&lt;br /&gt;
)&lt;br /&gt;
NO PRIMARY INDEX&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;PARTITION BY(Column&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;,Range_N(Order_date between date &#39;2015-01-01 AND date &#39;2015-12-31&#39;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;EACH INTERVAL &#39;1&#39; Month));&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/1056938656712459162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/1056938656712459162'/><link rel='alternate' type='text/html' href='http://teradatawiki.blogspot.com/2016/06/Teradata-columnar.html' title='Columnar'/><author><name>Anil Daki</name><uri>http://www.blogger.com/profile/02752372351162508647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_GPwtcNYjdLsqFo_Y6GZktPdRAbRzrDDKNBxj041jnBHktCp-xahnaJ47lZ2xHmQ8u2xa9VR3ZvaHVBsXu83F5eBLrx-sduNY527b6AV8Fo57nWktbl-AONYZMKlQFZk3wECQ5J_p4BKs/s72-c/Columnar.jpg" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-7106842514564860422.post-7492399909823014780</id><published>2015-09-08T06:16:00.001+05:30</published><updated>2015-09-09T09:33:03.067+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="BASICS"/><category scheme="http://www.blogger.com/atom/ns#" term="Tables"/><title type='text'>Creating Tables</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;ssmainhide&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvfPuCwDsZaTk_GTLo4RVfshChlObTsFrHqkThRPGPImRXliaXsIM6N9a4_gNnfK0n40LTYRfmK6QCaS8v34MJSICFQL73GMyFj9GZ6wkeJYAyJ6fhfz_TrcNVQg2UbXG6I_gK9qjpws8/s1600/Creating_Teradata_tables.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;124&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvfPuCwDsZaTk_GTLo4RVfshChlObTsFrHqkThRPGPImRXliaXsIM6N9a4_gNnfK0n40LTYRfmK6QCaS8v34MJSICFQL73GMyFj9GZ6wkeJYAyJ6fhfz_TrcNVQg2UbXG6I_gK9qjpws8/s200/Creating_Teradata_tables.PNG&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;html&gt;&lt;br /&gt;
&lt;head&gt;&lt;br /&gt;
&lt;style&gt;
table, th, td {
    border: 1px solid black;
}
th, td {
    padding: 5px;
    text-align: left;

}
&lt;/style&gt;&lt;br /&gt;
&lt;/head&gt;&lt;br /&gt;
&lt;body&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table style=&quot;width: 100%;&quot;&gt;
&lt;tr&gt;&lt;td bgcolor=&quot;#F5DA81&quot;&gt;&lt;b&gt;Creation Type&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=&quot;#F5DA81&quot;&gt;&lt;b&gt;SQL&lt;/b&gt;&lt;/td&gt;
&lt;tr&gt;&lt;td&gt;Creating a Table with a Unique Primary Index&lt;/td&gt;  &lt;td&gt;CREATE TABLE EMP_TABLE&lt;br /&gt;
(&lt;br /&gt;
EMP_NO    INTEGER&lt;br /&gt;
,DEPT_NO    INTEGER&lt;br /&gt;
,FIRST_NAME VARCHAR(20)&lt;br /&gt;
,LAST_NAME CHAR(20)&lt;br /&gt;
,SALARY   DECIMAL(10,2)&lt;br /&gt;
,ADDRESS   VARCHAR(100)&lt;br /&gt;
) &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;UNIQUE PRIMARY INDEX&lt;/b&gt;&lt;/span&gt; (EMP_NO);&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Creating a Table with a Non-Unique Primary Index&lt;/td&gt; &lt;td&gt;CREATE TABLE EMP_TABLE&lt;br /&gt;
(&lt;br /&gt;
EMP_NO    INTEGER&lt;br /&gt;
,DEPT_NO    INTEGER&lt;br /&gt;
,FIRST_NAME VARCHAR(20)&lt;br /&gt;
,LAST_NAME CHAR(20)&lt;br /&gt;
,SALARY   DECIMAL(10,2)&lt;br /&gt;
,ADDRESS   VARCHAR(100)&lt;br /&gt;
) &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;PRIMARY INDEX&lt;/b&gt;&lt;/span&gt;(EMP_NO);&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Creating a Table without entering a Primary Index&lt;/td&gt; &lt;td&gt;CREATE TABLE EMP_TABLE &lt;br /&gt;
( &lt;br /&gt;
EMP_NO    INTEGER &lt;br /&gt;
,DEPT_NO    INTEGER &lt;br /&gt;
,FIRST_NAME VARCHAR(20) &lt;br /&gt;
,LAST_NAME CHAR(20) &lt;br /&gt;
,SALARY   DECIMAL(10,2) &lt;br /&gt;
,ADDRESS   VARCHAR(100) &lt;br /&gt;
)  &lt;br /&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;td&gt;Creating a Table with NO Primary Index&lt;/td&gt; &lt;td&gt;CREATE TABLE EMP_TABLE &lt;br /&gt;
( &lt;br /&gt;
EMP_NO    INTEGER &lt;br /&gt;
,DEPT_NO    INTEGER &lt;br /&gt;
,FIRST_NAME VARCHAR(20) &lt;br /&gt;
,LAST_NAME CHAR(20) &lt;br /&gt;
,SALARY   DECIMAL(10,2) &lt;br /&gt;
,ADDRESS   VARCHAR(100) &lt;br /&gt;
)  &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;NO  PRIMARY INDEX&lt;/b&gt;&lt;/span&gt;; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Creating a Set Table&lt;/td&gt; &lt;td&gt;CREATE &lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;SET&lt;/b&gt;&lt;/span&gt; TABLE EMP_TABLE &lt;br /&gt;
( &lt;br /&gt;
EMP_NO    INTEGER &lt;br /&gt;
,DEPT_NO    INTEGER &lt;br /&gt;
,FIRST_NAME VARCHAR(20) &lt;br /&gt;
,LAST_NAME CHAR(20) &lt;br /&gt;
,SALARY   DECIMAL(10,2) &lt;br /&gt;
,ADDRESS   VARCHAR(100) &lt;br /&gt;
)  &lt;br /&gt;
PRIMARY INDEX(EMP_NO); &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Creating a Multiset Table&lt;/td&gt; &lt;td&gt;CREATE &lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;MULTISET&lt;/b&gt;&lt;/span&gt; TABLE EMP_TABLE &lt;br /&gt;
( &lt;br /&gt;
EMP_NO    INTEGER &lt;br /&gt;
,DEPT_NO    INTEGER &lt;br /&gt;
,FIRST_NAME VARCHAR(20) &lt;br /&gt;
,LAST_NAME CHAR(20) &lt;br /&gt;
,SALARY   DECIMAL(10,2) &lt;br /&gt;
,ADDRESS   VARCHAR(100) &lt;br /&gt;
)  &lt;br /&gt;
PRIMARY INDEX(EMP_NO); &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Creating a Set Table with a Unique Primary Index&lt;/td&gt; &lt;td&gt;CREATE &lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;SET&lt;/b&gt;&lt;/span&gt; TABLE EMP_TABLE &lt;br /&gt;
( &lt;br /&gt;
EMP_NO    INTEGER &lt;br /&gt;
,DEPT_NO    INTEGER &lt;br /&gt;
,FIRST_NAME VARCHAR(20) &lt;br /&gt;
,LAST_NAME CHAR(20) &lt;br /&gt;
,SALARY   DECIMAL(10,2) &lt;br /&gt;
,ADDRESS   VARCHAR(100) &lt;br /&gt;
)  &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;UNIQUE PRIMARY INDEX&lt;/b&gt;&lt;/span&gt;(EMP_NO); &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Creating a Set Table with a Unique Secondary Index&lt;/td&gt; &lt;td&gt;CREATE &lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;SET&lt;/b&gt;&lt;/span&gt; TABLE EMP_TABLE &lt;br /&gt;
( &lt;br /&gt;
EMP_NO    INTEGER &lt;br /&gt;
,DEPT_NO    INTEGER &lt;br /&gt;
,FIRST_NAME VARCHAR(20) &lt;br /&gt;
,LAST_NAME CHAR(20) &lt;br /&gt;
,SALARY   DECIMAL(10,2) &lt;br /&gt;
,ADDRESS   VARCHAR(100) &lt;br /&gt;
)  &lt;br /&gt;
PRIMARY INDEX(EMP_NO) &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;UNIQUE INDEX&lt;/b&gt;&lt;/span&gt;(DEPT_NO); &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Creating a Table with an UPI and USI&lt;/td&gt; &lt;td&gt;CREATE SET TABLE EMP_TABLE &lt;br /&gt;
( &lt;br /&gt;
EMP_NO    INTEGER &lt;br /&gt;
,DEPT_NO    INTEGER &lt;br /&gt;
,FIRST_NAME VARCHAR(20) &lt;br /&gt;
,LAST_NAME CHAR(20) &lt;br /&gt;
,SALARY   DECIMAL(10,2) &lt;br /&gt;
,ADDRESS   VARCHAR(100) &lt;br /&gt;
)  &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;UNIQUE PRIMARY INDEX&lt;/b&gt;&lt;/span&gt;(EMP_NO) &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;UNIQUE INDEX&lt;/b&gt;&lt;/span&gt;(DEPT_NO); &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Creating a Table with a Multicolumn Primary Index&lt;/td&gt; &lt;td&gt;CREATE TABLE EMP_TABLE &lt;br /&gt;
( &lt;br /&gt;
EMP_NO    INTEGER &lt;br /&gt;
,DEPT_NO    INTEGER &lt;br /&gt;
,FIRST_NAME VARCHAR(20) &lt;br /&gt;
,LAST_NAME CHAR(20) &lt;br /&gt;
,SALARY   DECIMAL(10,2) &lt;br /&gt;
,ADDRESS   VARCHAR(100) &lt;br /&gt;
)  &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;PRIMARY INDEX(EMP_NO,DEPT_NO,SALARY)&lt;/b&gt;&lt;/span&gt;; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Creating a Unique Secondary Index (USI) after a table is created&lt;/td&gt;  &lt;td&gt;CREATE &lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;UNIQUE INDEX IDXNAME&lt;/b&gt;&lt;/span&gt;(EMP_NO) ON EMP_TABLE ; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Creating a Value-Ordered NUSI&lt;/td&gt; &lt;td&gt;CREATE &lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;INDEX(DEPT_NO) ORDER BY VALUES &lt;/b&gt;&lt;/span&gt;ON EMP_TABLE ; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Making an exact copy a Table with data&lt;/td&gt; &lt;td&gt;CREATE TABLE EMP_TABLE_BACKUP AS EMP_TABLE WITH DATA; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Making an exact copy a Table with out data&lt;/td&gt; &lt;td&gt;CREATE TABLE EMP_TABLE_BACKUP AS EMP_TABLE WITH NO DATA; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Copying a Table&lt;/td&gt; &lt;td&gt;CREATE TABLE EMP_TABLE_BACKUP AS (SELECT * FROM EMP_TABLE ) WITH  DATA; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Copying only specific columns of a table&lt;/td&gt; &lt;td&gt;CREATE TABLE EMP_TABLE_BACKUP AS  &lt;br /&gt;
(SELECT  &lt;br /&gt;
EMP_NO    &lt;br /&gt;
,DEPT_NO     &lt;br /&gt;
,SALARY  &lt;br /&gt;
FROM EMP_TABLE )  &lt;br /&gt;
WITH  DATA; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Copying aTable and Keeping the Statistics&lt;/td&gt;  &lt;td&gt;CREATE TABLE EMP_TABLE_BACKUP AS EMP_TABLE &lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;WITH DATA AND STATS&lt;/b&gt;&lt;/span&gt;; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Copying a Table without data but with  Statistics&lt;/td&gt;  &lt;td&gt;CREATE TABLE EMP_TABLE_BACKUP AS EMP_TABLE&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt; WITH NO DATA AND STATS&lt;/b&gt;&lt;/span&gt; ; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Creating a Table with Fallback&lt;/td&gt; &lt;td&gt;CREATE  TABLE EMP_TABLE, &lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;FALLBACK&lt;/b&gt;&lt;/span&gt; &lt;br /&gt;
( &lt;br /&gt;
EMP_NO    INTEGER &lt;br /&gt;
,DEPT_NO    INTEGER &lt;br /&gt;
,FIRST_NAME VARCHAR(20) &lt;br /&gt;
,LAST_NAME CHAR(20) &lt;br /&gt;
,SALARY   DECIMAL(10,2) &lt;br /&gt;
,ADDRESS   VARCHAR(100) &lt;br /&gt;
)  &lt;br /&gt;
UNIQUE PRIMARY INDEX(EMP_NO) ; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Creating a Table with No Fallback&lt;/td&gt; &lt;td&gt;CREATE  TABLE EMP_TABLE,&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt; NO FALLBACK&lt;/b&gt;&lt;/span&gt; &lt;br /&gt;
( &lt;br /&gt;
EMP_NO    INTEGER &lt;br /&gt;
,DEPT_NO    INTEGER &lt;br /&gt;
,FIRST_NAME VARCHAR(20) &lt;br /&gt;
,LAST_NAME CHAR(20) &lt;br /&gt;
,SALARY   DECIMAL(10,2) &lt;br /&gt;
,ADDRESS   VARCHAR(100) &lt;br /&gt;
)  &lt;br /&gt;
UNIQUE PRIMARY INDEX(EMP_NO) ; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Creating a Table with a Before Journal&lt;/td&gt; &lt;td&gt;CREATE  TABLE EMP_TABLE &lt;br /&gt;
,NO FALLBACK &lt;br /&gt;
,&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;BEFORE JOURNAL&lt;/b&gt;&lt;/span&gt; &lt;br /&gt;
( &lt;br /&gt;
EMP_NO    INTEGER &lt;br /&gt;
,DEPT_NO    INTEGER &lt;br /&gt;
,FIRST_NAME VARCHAR(20) &lt;br /&gt;
,LAST_NAME CHAR(20) &lt;br /&gt;
,SALARY   DECIMAL(10,2) &lt;br /&gt;
,ADDRESS   VARCHAR(100) &lt;br /&gt;
)  &lt;br /&gt;
UNIQUE PRIMARY INDEX(EMP_NO) ; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Creating a Table with a Dual Before Journal&lt;/td&gt; &lt;td&gt;CREATE  TABLE EMP_TABLE &lt;br /&gt;
,NO FALLBACK &lt;br /&gt;
,&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;DUAL JOURNAL&lt;/b&gt;&lt;/span&gt; &lt;br /&gt;
( &lt;br /&gt;
EMP_NO    INTEGER &lt;br /&gt;
,DEPT_NO    INTEGER &lt;br /&gt;
,FIRST_NAME VARCHAR(20) &lt;br /&gt;
,LAST_NAME CHAR(20) &lt;br /&gt;
,SALARY   DECIMAL(10,2) &lt;br /&gt;
,ADDRESS   VARCHAR(100) &lt;br /&gt;
)  &lt;br /&gt;
UNIQUE PRIMARY INDEX(EMP_NO) ; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Creating a Table with an After Journal&lt;/td&gt; &lt;td&gt;CREATE  TABLE EMP_TABLE &lt;br /&gt;
,NO FALLBACK &lt;br /&gt;
,&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;AFTER JOURNAL&lt;/b&gt;&lt;/span&gt; &lt;br /&gt;
( &lt;br /&gt;
EMP_NO    INTEGER &lt;br /&gt;
,DEPT_NO    INTEGER &lt;br /&gt;
,FIRST_NAME VARCHAR(20) &lt;br /&gt;
,LAST_NAME CHAR(20) &lt;br /&gt;
,SALARY   DECIMAL(10,2) &lt;br /&gt;
,ADDRESS   VARCHAR(100) &lt;br /&gt;
)  &lt;br /&gt;
UNIQUE PRIMARY INDEX(EMP_NO) ; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Creating a Table with a Dual After Journal&lt;/td&gt; &lt;td&gt;CREATE  TABLE EMP_TABLE &lt;br /&gt;
,NO FALLBACK &lt;br /&gt;
,&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;DUAL AFTER JOURNAL&lt;/b&gt;&lt;/span&gt; &lt;br /&gt;
( &lt;br /&gt;
EMP_NO    INTEGER &lt;br /&gt;
,DEPT_NO    INTEGER &lt;br /&gt;
,FIRST_NAME VARCHAR(20) &lt;br /&gt;
,LAST_NAME CHAR(20) &lt;br /&gt;
,SALARY   DECIMAL(10,2) &lt;br /&gt;
,ADDRESS   VARCHAR(100) &lt;br /&gt;
)  &lt;br /&gt;
UNIQUE PRIMARY INDEX(EMP_NO) ; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Creating a Table with a Journal Keyword Alone&lt;/td&gt; &lt;td&gt;CREATE  TABLE EMP_TABLE &lt;br /&gt;
,NO FALLBACK &lt;br /&gt;
,&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;JOURNAL&lt;/b&gt;&lt;/span&gt; &lt;br /&gt;
( &lt;br /&gt;
EMP_NO    INTEGER &lt;br /&gt;
,DEPT_NO    INTEGER &lt;br /&gt;
,FIRST_NAME VARCHAR(20) &lt;br /&gt;
,LAST_NAME CHAR(20) &lt;br /&gt;
,SALARY   DECIMAL(10,2) &lt;br /&gt;
,ADDRESS   VARCHAR(100) &lt;br /&gt;
)  &lt;br /&gt;
UNIQUE PRIMARY INDEX(EMP_NO) ; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Creating a Table with Customization of the Data Block Size&lt;/td&gt; &lt;td&gt;CREATE  TABLE EMP_TABLE &lt;br /&gt;
,FALLBACK &lt;br /&gt;
,&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;DATABLOCKSIZE= 21248 BYTES&lt;/b&gt;&lt;/span&gt; &lt;br /&gt;
( &lt;br /&gt;
EMP_NO    INTEGER &lt;br /&gt;
,DEPT_NO    INTEGER &lt;br /&gt;
,FIRST_NAME VARCHAR(20) &lt;br /&gt;
,LAST_NAME CHAR(20) &lt;br /&gt;
,SALARY   DECIMAL(10,2) &lt;br /&gt;
,ADDRESS   VARCHAR(100) &lt;br /&gt;
)  &lt;br /&gt;
UNIQUE PRIMARY INDEX(EMP_NO) ; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Creating a Table with Customization with FREESPACE Percent&lt;/td&gt; &lt;td&gt;CREATE  TABLE EMP_TABLE &lt;br /&gt;
,FALLBACK &lt;br /&gt;
,DATABLOCKSIZE= 21248 BYTES &lt;br /&gt;
,&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;FREESPACE = 20 PERCENT&lt;/b&gt;&lt;/span&gt; &lt;br /&gt;
( &lt;br /&gt;
EMP_NO    INTEGER &lt;br /&gt;
,DEPT_NO    INTEGER &lt;br /&gt;
,FIRST_NAME VARCHAR(20) &lt;br /&gt;
,LAST_NAME CHAR(20) &lt;br /&gt;
,SALARY   DECIMAL(10,2) &lt;br /&gt;
,ADDRESS   VARCHAR(100) &lt;br /&gt;
)  &lt;br /&gt;
UNIQUE PRIMARY INDEX(EMP_NO) ; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Creating a Columnar Table&lt;/td&gt; &lt;td&gt;CREATE  TABLE EMP_TABLE &lt;br /&gt;
( &lt;br /&gt;
EMP_NO    INTEGER &lt;br /&gt;
,DEPT_NO    INTEGER &lt;br /&gt;
,FIRST_NAME VARCHAR(20) &lt;br /&gt;
,LAST_NAME CHAR(20) &lt;br /&gt;
,SALARY   DECIMAL(10,2) &lt;br /&gt;
,ADDRESS   VARCHAR(100) &lt;br /&gt;
)  &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt; NO PRIMARY INDEX &lt;br /&gt;
PARTITION BY COLUMN&lt;/b&gt;&lt;/span&gt;; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Creating a Columnar Table with Multi-Column Containers&lt;/td&gt; &lt;td&gt;CREATE  TABLE EMP_TABLE &lt;br /&gt;
( &lt;br /&gt;
EMP_NO    INTEGER &lt;br /&gt;
,DEPT_NO    INTEGER &lt;br /&gt;
,FIRST_NAME VARCHAR(20) &lt;br /&gt;
,LAST_NAME CHAR(20) &lt;br /&gt;
,SALARY   DECIMAL(10,2) &lt;br /&gt;
,ADDRESS   VARCHAR(100) &lt;br /&gt;
)  &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt; NO PRIMARY INDEX &lt;br /&gt;
PARTITION BY COLUMN ( &lt;br /&gt;
EMP_NO, &lt;br /&gt;
DEPT_NO, &lt;br /&gt;
(FIRST_NAME,LAST_NAMESALARY))&lt;/b&gt;&lt;/span&gt;; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Creating a Columnar Table with a Row Hybrid&lt;/td&gt; &lt;td&gt;CREATE  TABLE EMP_TABLE &lt;br /&gt;
( &lt;br /&gt;
EMP_NO    INTEGER &lt;br /&gt;
,DEPT_NO    INTEGER &lt;br /&gt;
,FIRST_NAME VARCHAR(20) &lt;br /&gt;
,LAST_NAME CHAR(20) &lt;br /&gt;
,SALARY   DECIMAL(10,2) &lt;br /&gt;
,ADDRESS   VARCHAR(100) &lt;br /&gt;
)  &lt;br /&gt;
NO PRIMARY INDEX &lt;br /&gt;
PARTITION BY COLUMN (EMP_NO NO AUTO COMPRESS,DEPT_NO &lt;br /&gt;
,&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;ROW &lt;/b&gt;&lt;/span&gt;(FIRST_NAME,LAST_NAMESALARY)NO AUTO COMPRESS); &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Creating a Columnar Table with both Row and Column Partitions&lt;/td&gt; &lt;td&gt;CREATE  TABLE ORDER_TABLE &lt;br /&gt;
( &lt;br /&gt;
ORDER_NO    INTEGER &lt;br /&gt;
,CUSTMER_NO    INTEGER &lt;br /&gt;
,ORDER_DATE    DATE &lt;br /&gt;
,ORDER_TOTAL  DECIMAL(10,2) &lt;br /&gt;
)  &lt;br /&gt;
NO PRIMARY INDEX &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;PARTITION BY&lt;/b&gt;&lt;/span&gt; (COLUMN,  &lt;br /&gt;
RANGE_N (ORDER_DATE BETWEEN DATE &#39;2015-01-01&#39; AND &#39;2015-06-30&#39; EACH INTERVAL &#39;1&#39; MONTH)) ; &lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;/body&gt;&lt;br /&gt;
&lt;/html&gt;&lt;br /&gt;
&lt;div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjp0XMt9A88RVcHhQ0nrsf08McJQSHwOuqBVDlX8m1pBw-_IcgH36UAjVn5BLdD2JYNW00SphqO657o1Jh3yGLVqjzRWeGb4gYrvFCSVDgfhZMbckmZr05SrIUsI19UdzQTpXtzQZCrcuxm/s1600/thanks.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;50&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjp0XMt9A88RVcHhQ0nrsf08McJQSHwOuqBVDlX8m1pBw-_IcgH36UAjVn5BLdD2JYNW00SphqO657o1Jh3yGLVqjzRWeGb4gYrvFCSVDgfhZMbckmZr05SrIUsI19UdzQTpXtzQZCrcuxm/s320/thanks.gif&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/7492399909823014780'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/7492399909823014780'/><link rel='alternate' type='text/html' href='http://teradatawiki.blogspot.com/2015/09/Teradata-Creating-Tables.html' title='Creating Tables'/><author><name>Admin</name><uri>http://www.blogger.com/profile/03270946312373154797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCm0FeHTqy9tdxei5Vc3zsRwKvVPISdFMvIqK5NAbGyyTShzSA7INIQO8uEUGzBkkIDbVj7rdc7z1yqFbAQJMIryVb0gOqbYP1pgPjtpQ9v73YBxwSkukI_mgytcpbIA/s220/IMG_3457.jpg.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvfPuCwDsZaTk_GTLo4RVfshChlObTsFrHqkThRPGPImRXliaXsIM6N9a4_gNnfK0n40LTYRfmK6QCaS8v34MJSICFQL73GMyFj9GZ6wkeJYAyJ6fhfz_TrcNVQg2UbXG6I_gK9qjpws8/s72-c/Creating_Teradata_tables.PNG" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-7106842514564860422.post-1068990295291277546</id><published>2015-09-01T10:16:00.000+05:30</published><updated>2015-09-01T10:27:46.032+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="TPT"/><category scheme="http://www.blogger.com/atom/ns#" term="Utilities"/><title type='text'>TPT in deatail</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;ssmainhide&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMcZJaLpceb1nvB1XgTdbwVJyV-edKGjPT5c3abVbWSgyrgMJfn01oDM-Q3pyLRKilyHGKoy_CtvUc2IPAhEcvtccSfyCzh-aFmYxayAf_dAMZW6ZYg3rx6gx4sL5HISAgd3E8QzqBuHRR/s1600/TPT_SCRIPT.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;TPY Syntax&quot; border=&quot;0&quot; height=&quot;126&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMcZJaLpceb1nvB1XgTdbwVJyV-edKGjPT5c3abVbWSgyrgMJfn01oDM-Q3pyLRKilyHGKoy_CtvUc2IPAhEcvtccSfyCzh-aFmYxayAf_dAMZW6ZYg3rx6gx4sL5HISAgd3E8QzqBuHRR/s200/TPT_SCRIPT.PNG&quot; title=&quot;TPY Syntax&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Teradata Parallel Transporter supports the following types of SQL statements:&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Data Manipulation Language (DML): Insert, Update, Delete, Upsert, Merge, and Select&lt;/li&gt;
&lt;li&gt;Data Control Language (DCL): Give, Grant, and Revoke&lt;/li&gt;
&lt;li&gt;Data Definition Language (DDL): Create, Drop, Alter, Modify, Delete Database, Delete User, and Rename&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;div&gt;
&lt;b&gt;OS Commands&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
Use the OS Command operator to send commands to the operating system on the client system&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Delimited Data&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
Delimited data are variable-length text records with each field or column separated by one or more delimiter characters. Delimited data are also known as VARTEXT.&lt;/div&gt;
&lt;div&gt;
Use the Data Connector operator to read or write delimited data&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Large Object Data Types&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
There are two kinds of large object data type:&lt;/div&gt;
&lt;div&gt;
•&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Character large object (CLOB)&lt;/div&gt;
&lt;div&gt;
•&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Binary large object (BLOB)&lt;/div&gt;
&lt;div&gt;
•&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Three operators support the CLOB and BLOB data types.&lt;/div&gt;
&lt;div&gt;
•&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;The Inserter operator can insert CLOB and BLOB data types into a Teradata table&lt;/div&gt;
&lt;div&gt;
•&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;The Selector operator can export CLOB and BLOB data types from a Teradata table&lt;/div&gt;
&lt;div&gt;
•&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;The Data Connector operator can read/write CLOB and BLOB data types from/to a file.&lt;/div&gt;
&lt;div&gt;
Selecting the wrong operator to process the CLOB or BLOB data type terminates the job.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;TPT script Structure&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Building TPT Scripts&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
TPT uses a SQL-like scripting language for extract, basic transformation, and load functions. This easy-to-use language is based on SQL, making it familiar to most database users. All operators use the same scripting language. This represents an improvement over the individual utilities, each of which has its own unique scripting language. A single script can be used to define multiple operators and schemas to create complex extracting and loading jobs.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
There are only a few statements that are needed to build a TPT script. A quick look at the basic statements can be seen here:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;DEFINE JOB&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
Defines the overall job and packages together all following DEFINE and APPLY statements.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;DEFINE SCHEMA&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
Defines the structure of a data object in terms of columns of specific data types. A given schema definition can be used to describe multiple data objects. Also, multiple schemas can be defined in a given script.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;DEFINE OPERATOR&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
Defines a specific TPT operator to be used in this job.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;DEFINE DBMS&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
Defines an instance of a database server to be used in this job.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;APPLY&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
A processing statement used to initiate a TPT load, update, or delete operation.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
Generally TPT script has two sections&lt;/div&gt;
&lt;div&gt;
1)&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Declarative section&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
2)&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Executable section&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Declarative section—all schema and operator definitions&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Define the job name for the script&lt;/div&gt;
&lt;div&gt;
Provide the description of job&lt;/div&gt;
&lt;div&gt;
Schema Definition&lt;/div&gt;
&lt;div&gt;
Operator Definition #1&lt;/div&gt;
&lt;div&gt;
….&lt;/div&gt;
&lt;div&gt;
Operator Definition #n&lt;/div&gt;
&lt;div&gt;
Executable section - -&lt;/div&gt;
&lt;div&gt;
Specifies all sql statements processing that is extract, load, filter, delete and update done by Apply definition&lt;/div&gt;
&lt;div&gt;
It also requires a job Variable file.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
The structure of TPT script is as mentioned below&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Script example&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
DEFINE JOB FILE_LOAD&lt;/div&gt;
&lt;div&gt;
DESCRIPTION &#39;Load a Teradata table from a file&#39;&lt;/div&gt;
&lt;div&gt;
(&lt;/div&gt;
&lt;div&gt;
/* TPT declaration section/*&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
DEFINE SCHEMA Trans_n_Accts_Schema&lt;/div&gt;
&lt;div&gt;
(&lt;/div&gt;
&lt;div&gt;
Account_Number VARCHAR(50),&lt;/div&gt;
&lt;div&gt;
Trans_Number VARCHAR(50),&lt;/div&gt;
&lt;div&gt;
Trans_Date VARCHAR(50),&lt;/div&gt;
&lt;div&gt;
Trans_ID VARCHAR(50),&lt;/div&gt;
&lt;div&gt;
Trans_Amount VARCHAR(50)&lt;/div&gt;
&lt;div&gt;
);&lt;/div&gt;
&lt;div&gt;
DEFINE OPERATOR DDL_OPERATOR&lt;/div&gt;
&lt;div&gt;
TYPE DDL&lt;/div&gt;
&lt;div&gt;
ATTRIBUTES&lt;/div&gt;
&lt;div&gt;
(&lt;/div&gt;
&lt;div&gt;
VARCHAR PrivateLogName = &#39;ddl_log&#39;,&lt;/div&gt;
&lt;div&gt;
VARCHAR TdpId = @jobvar_tdpid,&lt;/div&gt;
&lt;div&gt;
VARCHAR UserName = @jobvar_username,&lt;/div&gt;
&lt;div&gt;
VARCHAR UserPassword = @jobvar_password,&lt;/div&gt;
&lt;div&gt;
VARCHAR ErrorList = &#39;3807&#39;&lt;/div&gt;
&lt;div&gt;
);&lt;/div&gt;
&lt;div&gt;
DEFINE OPERATOR FILE_READER&lt;/div&gt;
&lt;div&gt;
TYPE DATACONNECTOR PRODUCER&lt;/div&gt;
&lt;div&gt;
SCHEMA Trans_n_Accts_Schema&lt;/div&gt;
&lt;div&gt;
ATTRIBUTES&lt;/div&gt;
&lt;div&gt;
(&lt;/div&gt;
&lt;div&gt;
VARCHAR PrivateLogName = &#39;dataconnector_log&#39;,&lt;/div&gt;
&lt;div&gt;
VARCHAR DirectoryPath = @jobvar_datafiles_path,&lt;/div&gt;
&lt;div&gt;
VARCHAR FileName = &#39;accounts.txt&#39;,&lt;/div&gt;
&lt;div&gt;
VARCHAR Format = &#39;Delimited&#39;,&lt;/div&gt;
&lt;div&gt;
VARCHAR OpenMode = &#39;Read&#39;,&lt;/div&gt;
&lt;div&gt;
VARCHAR TextDelimiter = &#39;|&#39;&lt;/div&gt;
&lt;div&gt;
);&lt;/div&gt;
&lt;div&gt;
DEFINE OPERATOR LOAD_OPERATOR&lt;/div&gt;
&lt;div&gt;
TYPE LOAD&lt;/div&gt;
&lt;div&gt;
SCHEMA *&lt;/div&gt;
&lt;div&gt;
ATTRIBUTES&lt;/div&gt;
&lt;div&gt;
(&lt;/div&gt;
&lt;div&gt;
VARCHAR PrivateLogName = &#39;load_log&#39;,&lt;/div&gt;
&lt;div&gt;
VARCHAR TdpId = @jobvar_tdpid,&lt;/div&gt;
&lt;div&gt;
VARCHAR UserName = @jobvar_username,&lt;/div&gt;
&lt;div&gt;
VARCHAR UserPassword = @jobvar_password,&lt;/div&gt;
&lt;div&gt;
VARCHAR TargetTable = @jobvar_tgt_dbname || &#39;.Trans&#39;,&lt;/div&gt;
&lt;div&gt;
VARCHAR LogTable = @jobvar_wrk_dbname || &#39;.LG_Trans&#39;,&lt;/div&gt;
&lt;div&gt;
VARCHAR ErrorTable1 = @jobvar_wrk_dbname || &#39;.ET_Trans&#39;,&lt;/div&gt;
&lt;div&gt;
VARCHAR ErrorTable2 = @jobvar_wrk_dbname || &#39;.UV_Trans&#39;&lt;/div&gt;
&lt;div&gt;
);&lt;/div&gt;
&lt;div&gt;
STEP Setup_Tables&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
(&lt;/div&gt;
&lt;div&gt;
/* TPT Executation section/*&lt;/div&gt;
&lt;div&gt;
APPLY&lt;/div&gt;
&lt;div&gt;
(&#39;DROP TABLE &#39; || @jobvar_wrk_dbname || &#39;.ET_Trans;&#39;),&lt;/div&gt;
&lt;div&gt;
(&#39;DROP TABLE &#39; || @jobvar_wrk_dbname || &#39;.UV_Trans;&#39;),&lt;/div&gt;
&lt;div&gt;
(&#39;DROP TABLE &#39; || @jobvar_tgt_dbname || &#39;.Trans;&#39;),&lt;/div&gt;
&lt;div&gt;
(&#39;CREATE TABLE &#39; || @jobvar_tgt_dbname&lt;/div&gt;
&lt;div&gt;
|| &#39;.Trans (Account_Number VARCHAR(50),&lt;/div&gt;
&lt;div&gt;
Trans_Number VARCHAR(50),&lt;/div&gt;
&lt;div&gt;
Trans_Date VARCHAR(50),&lt;/div&gt;
&lt;div&gt;
Trans_ID VARCHAR(50),&lt;/div&gt;
&lt;div&gt;
Trans_Amount VARCHAR(50));&#39;)&lt;/div&gt;
&lt;div&gt;
TO OPERATOR (DDL_OPERATOR);&lt;/div&gt;
&lt;div&gt;
);&lt;/div&gt;
&lt;div&gt;
STEP Load_Trans_Table&lt;/div&gt;
&lt;div&gt;
(&lt;/div&gt;
&lt;div&gt;
APPLY&lt;/div&gt;
&lt;div&gt;
(&#39;INSERT INTO &#39; || @jobvar_tgt_dbname || &#39;.Trans(Account_Number,&lt;/div&gt;
&lt;div&gt;
Trans_Number,&lt;/div&gt;
&lt;div&gt;
Trans_Date,&lt;/div&gt;
&lt;div&gt;
Trans_ID,&lt;/div&gt;
&lt;div&gt;
Trans_Amount)&lt;/div&gt;
&lt;div&gt;
VALUES(:Account_Number,&lt;/div&gt;
&lt;div&gt;
:Trans_Number,&lt;/div&gt;
&lt;div&gt;
:Trans_Date,&lt;/div&gt;
&lt;div&gt;
:Trans_ID,&lt;/div&gt;
&lt;div&gt;
:Trans_Amount);&#39;)&lt;/div&gt;
&lt;div&gt;
TO OPERATOR (LOAD_OPERATOR[2])&lt;/div&gt;
&lt;div&gt;
SELECT * FROM OPERATOR (FILE_READER[2]);&lt;/div&gt;
&lt;div&gt;
);&lt;/div&gt;
&lt;div&gt;
);&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;b&gt;Note&lt;/b&gt;: &amp;nbsp;Example, Job Variables can be maintained in separate variables file or we can pass directly&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Job execution&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
tbuild -f &amp;lt;script file name&amp;gt; -z &amp;lt;checkpoint interval&amp;gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
The -z option sets the checkpoint interval to the number of seconds specified.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
SET CHECKPOINT INTERVAL 160 SEC&lt;/div&gt;
&lt;div&gt;
Or&lt;/div&gt;
&lt;div&gt;
SET CHECKPOINT INTERVAL 12 MINUTES&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
The checkpoint interval can be specified in a job script between the last DEFINE statement&lt;/div&gt;
&lt;div&gt;
and the APPLY statement(s).&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
tbuild&lt;/div&gt;
&lt;div&gt;
We have seen the tbuild command in many of the previous examples. This command is used to initiate a TPT job. The following key options may be used with tbuild:&lt;/div&gt;
&lt;div&gt;
-f&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Specifies the filename to be used as input.&lt;/div&gt;
&lt;div&gt;
-u&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Specifies job variable values which are to be applied.&lt;/div&gt;
&lt;div&gt;
-z&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Specifies a checkpoint interval to be used for the client side.&lt;/div&gt;
&lt;div&gt;
-s&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Specifies that job execution is to start at a specific job step.&lt;/div&gt;
&lt;div&gt;
-v&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Specifies that job attributes are to be read from an external file.&lt;/div&gt;
&lt;div&gt;
-l&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Specifies latency interval - how often to flush stale buffers.&lt;/div&gt;
&lt;div&gt;
-n &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Specifies that the job should continue, even if a step return code is greater than 4&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Note&lt;/b&gt;: If the checkpoint interval is specified both in the job script and with the tbuild -z command option, the -z option takes precedence.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Troubleshooting a Failed Job&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;Common Job Failures and Remedies&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
There are two categories of job failures. The evaluation and correction of each type of failure must be handled differently:&lt;/div&gt;
&lt;div&gt;
• Some jobs fail at launch, during execution of the tbuild statement, but before the initial job step have run.&lt;/div&gt;
&lt;div&gt;
• Some jobs launch successfully, and one or more job steps may execute successfully, but thejob fails to run to completion.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
The following sections describe common errors encountered by Teradata PT jobs.&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;When the Job Fails to Begin Running.&lt;/li&gt;
&lt;li&gt;When a job is launched but fails to begin execution, the associated errors appear in the public log. Errors are detected according to the launch sequence:&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;1. Teradata PT first processes the options specified in the tbuild command. If it detects tbuild &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; command errors, the job stops.&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Error types encountered: tbuild command errors&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2 If Teradata PT encounters no tbuild command errors, it then parses the job script and creates a &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;parallel job execution plan that will perform the operations specified in the APPLY &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;statement(s) in the job script.&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Errors types encountered:&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Pre processor errors -- Incorrect use of job variables or the INCLUDE directive.&lt;/li&gt;
&lt;li&gt;Job script compilation errors -- Syntactic and semantic errors.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; 3.Only when script compilation is successful and the execution plan has been generated does the &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Teradata PT allocate resources for and launch the various internal tasks required to execute the &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; job plan&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Errors types encountered: System resource errors&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
The following common types of tbuild errors may occur at job launch:&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;User errors&lt;/li&gt;
&lt;li&gt;executing the tbuild command&lt;/li&gt;
&lt;li&gt;Script compiler errors&lt;/li&gt;
&lt;li&gt;System resource errors&lt;/li&gt;
&lt;li&gt;semaphore errors&lt;/li&gt;
&lt;li&gt;socket errors&lt;/li&gt;
&lt;li&gt;shared memory errors&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjp0XMt9A88RVcHhQ0nrsf08McJQSHwOuqBVDlX8m1pBw-_IcgH36UAjVn5BLdD2JYNW00SphqO657o1Jh3yGLVqjzRWeGb4gYrvFCSVDgfhZMbckmZr05SrIUsI19UdzQTpXtzQZCrcuxm/s1600/thanks.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;50&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjp0XMt9A88RVcHhQ0nrsf08McJQSHwOuqBVDlX8m1pBw-_IcgH36UAjVn5BLdD2JYNW00SphqO657o1Jh3yGLVqjzRWeGb4gYrvFCSVDgfhZMbckmZr05SrIUsI19UdzQTpXtzQZCrcuxm/s320/thanks.gif&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/1068990295291277546'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/1068990295291277546'/><link rel='alternate' type='text/html' href='http://teradatawiki.blogspot.com/2015/09/tpt-example-synatx.html' title='TPT in deatail'/><author><name>Anil Daki</name><uri>http://www.blogger.com/profile/02752372351162508647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMcZJaLpceb1nvB1XgTdbwVJyV-edKGjPT5c3abVbWSgyrgMJfn01oDM-Q3pyLRKilyHGKoy_CtvUc2IPAhEcvtccSfyCzh-aFmYxayAf_dAMZW6ZYg3rx6gx4sL5HISAgd3E8QzqBuHRR/s72-c/TPT_SCRIPT.PNG" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-7106842514564860422.post-1534952446184645322</id><published>2014-12-05T07:34:00.002+05:30</published><updated>2015-10-20T02:37:17.134+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="BASICS"/><category scheme="http://www.blogger.com/atom/ns#" term="Teradata15 features"/><title type='text'>Teradata15 features</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;ssmainhide&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7ewxUT2ci_QrLReCCr0Jr6WI-noumQenJM0WooggzpT3CKw0FhXvkWLpuG3XHT-CXMoQsAHPZlwqzfswjgDCAIR5rxTWb5hDmyZGz3J99TU1jyOV6Wq6ES1hC1eOp8-LAZEJdYkTrY8o/s1600/teradata15-features.JPG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;teradata 15 features&quot; border=&quot;0&quot; height=&quot;122&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7ewxUT2ci_QrLReCCr0Jr6WI-noumQenJM0WooggzpT3CKw0FhXvkWLpuG3XHT-CXMoQsAHPZlwqzfswjgDCAIR5rxTWb5hDmyZGz3J99TU1jyOV6Wq6ES1hC1eOp8-LAZEJdYkTrY8o/s1600/teradata15-features.JPG&quot; title=&quot;teradata 15 features&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;Teradata 15.0 has come up with many new exciting features and enhanced capabilities. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;This post provides brief descriptions of the new features in this release in database level.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;&lt;b&gt;&lt;u&gt;JavaScript Object Notation: &lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;JSON (JavaScript Object Notation) is new functionality to support the storage and processing of data into Teradata database. &lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0pt; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;A JSON data type, its stores the data in JSON document or JSON records in relational format.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;JSON data can be used for all methods, functions, and procedures for processing, shredding, and publishing.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;The size of JSON documents up to 16MB&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;JSONPath support provides simple traversal and regular expressions with wildcards to filter and navigate complex JSON documents.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;&lt;b&gt;&lt;u&gt;Teradata QueryGrid:&lt;o:p&gt;&lt;/o:p&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;Teradata database now able to connect Hadoop with this QueryGrid so it’s called as Teradata Database-to-Hadoop also referred as&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;Teradata-to-Hadoop connector.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0pt; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;It provides a SQL interface for transferring data between Teradata Database and remote Hadoop hosts.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;Import Hadoop data into a temporary or permanent Teradata table.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;Export data from temporary or permanent Teradata tables into existing Hadoop tables.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;Create or drop tables in Hadoop from Teradata Database.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;Reference tables on the remote hosts in SELECT and INSERT statements.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;Select Hadoop data for use with a business tool.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;Select and join Hadoop data with data from independent data warehouses for analytical use.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;&lt;b&gt;&lt;u&gt;XML Data Type:&lt;o:p&gt;&lt;/o:p&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;Teradata also provides a new data type which stores and process the XML data.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;It supports methods, functions, stored procedures for all operations like parsing, validation, transformations and Query.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;The XML type stores values up to 2GB in size. &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;Sample Table creation&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&lt;b&gt;CREATE TABLE EMP_TABLE (&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;b&gt;  &lt;span style=&quot;font-family: Calibri;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;EMPID INTEGER,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;b&gt;  &lt;span style=&quot;font-family: Calibri;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;EMPName VARCHAR(256),&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;b&gt;  &lt;span style=&quot;font-family: Calibri;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;EMPXML XML&lt;/span&gt; )&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;b&gt;  &lt;span style=&quot;font-family: Calibri;&quot;&gt;PRIMARY INDEX (EMPID);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;b&gt;  &lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;EMPXML is an XML type column.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;&lt;b&gt;&lt;u&gt;DBQL Show Parameters&lt;o:p&gt;&lt;/o:p&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;A parameterized query used to place&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;parameters, and the parameter values are provided in a separate statement at time of execution. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;The main purpose is to&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;distinguishes between code and data. Also avoids attackers from changing the query by inserting SQL commands.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;Two new&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;Data Dictionary tables are&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;  &lt;span style=&quot;font-family: Calibri;&quot;&gt;DBC.DBQLParamTbl&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;DBC.DBQLParamTbl logs&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;&lt;b&gt;&lt;u&gt;Light-Weight Redistribution:&lt;o:p&gt;&lt;/o:p&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;The Light-Weight Redistribution(LWR) also referred to as the Single Sender Redistribution (SSR). With this feature, the Teradata Database optimizer can switch from an all-AMP row redistribution to a few AMP row redistribution. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;While executing the query, Teradata optimizer determines a query step is eligible for SSR, then the retrieved rows are redistributed by hash code to receiver AMP. In this case the number of AMPs is few. Without SSR all rows are normally redistributed across all AMPs.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0pt;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 11pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;Below chart shows the overall enhancements in Teradata 15 release.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0pt;&quot;&gt;
&lt;/div&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 11pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;-webkit-text-stroke-width: 0px; border-collapse: collapse; width: 527px;&quot;&gt;&lt;colgroup&gt;&lt;col style=&quot;mso-width-alt: 5376; mso-width-source: userset; width: 110pt;&quot; width=&quot;147&quot;&gt;&lt;/col&gt;  &lt;col style=&quot;mso-width-alt: 13897; mso-width-source: userset; width: 285pt;&quot; width=&quot;380&quot;&gt;&lt;/col&gt;  &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;   &lt;td class=&quot;xl63&quot; height=&quot;120&quot; rowspan=&quot;6&quot; style=&quot;background-color: #c5d9f1; border: 0.5pt solid windowtext; height: 90pt; width: 110pt;&quot; width=&quot;147&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #3c3638;&quot;&gt;Big Data &amp;amp; Analytics&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;   &lt;td class=&quot;xl64&quot; style=&quot;background-color: #c5d9f1; border-color: windowtext windowtext windowtext black; border-style: solid solid solid none; border-width: 0.5pt 0.5pt 0.5pt 0px; width: 285pt;&quot; width=&quot;380&quot;&gt;JSON   Integration&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;   &lt;td class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background-color: #c5d9f1; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px; height: 15pt; width: 285pt;&quot; width=&quot;380&quot;&gt;Scripting and Language Support&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;   &lt;td class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background-color: #c5d9f1; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px; height: 15pt; width: 285pt;&quot; width=&quot;380&quot;&gt;Table Operator Enhancements&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;   &lt;td class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background-color: #c5d9f1; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px; height: 15pt; width: 285pt;&quot; width=&quot;380&quot;&gt;3D Geospatial Data Type&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;   &lt;td class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background-color: #c5d9f1; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px; height: 15pt; width: 285pt;&quot; width=&quot;380&quot;&gt;Geospatial Performance Enhancements&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;   &lt;td class=&quot;xl64&quot; height=&quot;20&quot; style=&quot;background-color: #c5d9f1; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px; height: 15pt; width: 285pt;&quot; width=&quot;380&quot;&gt;SQL-H Enhancements&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;   &lt;td class=&quot;xl65&quot; height=&quot;40&quot; rowspan=&quot;2&quot; style=&quot;background-color: #f2dcdb; border-color: rgb(60, 54, 56) windowtext windowtext; border-style: none solid solid; border-width: 0px 0.5pt 0.5pt; height: 30pt; width: 110pt;&quot; width=&quot;147&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #3c3638;&quot;&gt;Performance&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;   &lt;td class=&quot;xl66&quot; style=&quot;background-color: #f2dcdb; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px; width: 285pt;&quot; width=&quot;380&quot;&gt;Light-Weight   Redistribution&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;   &lt;td class=&quot;xl66&quot; height=&quot;20&quot; style=&quot;background-color: #f2dcdb; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px; height: 15pt; width: 285pt;&quot; width=&quot;380&quot;&gt;Software Efficiency Improvements&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;   &lt;td class=&quot;xl67&quot; height=&quot;140&quot; rowspan=&quot;7&quot; style=&quot;background-color: #e4dfec; border-color: rgb(60, 54, 56) windowtext windowtext; border-style: none solid solid; border-width: 0px 0.5pt 0.5pt; height: 105pt; width: 110pt;&quot; width=&quot;147&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #3c3638;&quot;&gt;Ecosystem&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;   &lt;td class=&quot;xl68&quot; style=&quot;background-color: #e4dfec; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px; width: 285pt;&quot; width=&quot;380&quot;&gt;SQL   Interface For ShowBlocks&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;   &lt;td class=&quot;xl68&quot; height=&quot;20&quot; style=&quot;background-color: #e4dfec; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px; height: 15pt; width: 285pt;&quot; width=&quot;380&quot;&gt;TASM/TIWM - Classification by Datablock   Selectivity&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;   &lt;td class=&quot;xl68&quot; height=&quot;20&quot; style=&quot;background-color: #e4dfec; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px; height: 15pt; width: 285pt;&quot; width=&quot;380&quot;&gt;Utility Statistics Logging&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;   &lt;td class=&quot;xl68&quot; height=&quot;20&quot; style=&quot;background-color: #e4dfec; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px; height: 15pt; width: 285pt;&quot; width=&quot;380&quot;&gt;TASM - Global Weights&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;   &lt;td class=&quot;xl68&quot; height=&quot;20&quot; style=&quot;background-color: #e4dfec; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px; height: 15pt; width: 285pt;&quot; width=&quot;380&quot;&gt;Unity Callback Support&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;   &lt;td class=&quot;xl68&quot; height=&quot;20&quot; style=&quot;background-color: #e4dfec; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px; height: 15pt; width: 285pt;&quot; width=&quot;380&quot;&gt;TASM - Virtual Partitions Enhancement&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;   &lt;td class=&quot;xl68&quot; height=&quot;20&quot; style=&quot;background-color: #e4dfec; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px; height: 15pt; width: 285pt;&quot; width=&quot;380&quot;&gt;TIWM - Operating Periods For Appliance&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;   &lt;td class=&quot;xl69&quot; height=&quot;120&quot; rowspan=&quot;6&quot; style=&quot;background-color: #fcd5b4; border-color: rgb(60, 54, 56) windowtext windowtext; border-style: none solid solid; border-width: 0px 0.5pt 0.5pt; height: 90pt; width: 110pt;&quot; width=&quot;147&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #3c3638;&quot;&gt;Quality&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;   &lt;td class=&quot;xl70&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px; width: 285pt;&quot; width=&quot;380&quot;&gt;Smart   Retry During Parsing&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;   &lt;td class=&quot;xl70&quot; height=&quot;20&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px; height: 15pt; width: 285pt;&quot; width=&quot;380&quot;&gt;HSN Health&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;   &lt;td class=&quot;xl70&quot; height=&quot;20&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px; height: 15pt; width: 285pt;&quot; width=&quot;380&quot;&gt;New PI On Access Rights Table&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;   &lt;td class=&quot;xl70&quot; height=&quot;20&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px; height: 15pt; width: 285pt;&quot; width=&quot;380&quot;&gt;Unresponsive Node Isolation&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;   &lt;td class=&quot;xl70&quot; height=&quot;20&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px; height: 15pt; width: 285pt;&quot; width=&quot;380&quot;&gt;Onsite System and Dump Analysis&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;   &lt;td class=&quot;xl70&quot; height=&quot;20&quot; style=&quot;background-color: #fcd5b4; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px; height: 15pt; width: 285pt;&quot; width=&quot;380&quot;&gt;DBQL - Show Parameters&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height=&quot;40&quot; style=&quot;height: 30pt;&quot;&gt;   &lt;td class=&quot;xl71&quot; height=&quot;100&quot; rowspan=&quot;4&quot; style=&quot;background-color: #b7dee8; border-color: rgb(60, 54, 56) windowtext windowtext; border-style: none solid solid; border-width: 0px 0.5pt 0.5pt; height: 75pt; width: 110pt;&quot; width=&quot;147&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #3c3638;&quot;&gt;Industry Compatibility&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;   &lt;td class=&quot;xl72&quot; style=&quot;background-color: #b7dee8; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px; width: 285pt;&quot; width=&quot;380&quot;&gt;Sequenced   Aggregate Enhancements and Aggregate JI for Temporal&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;   &lt;td class=&quot;xl72&quot; height=&quot;20&quot; style=&quot;background-color: #b7dee8; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px; height: 15pt; width: 285pt;&quot; width=&quot;380&quot;&gt;1MB Phase 2&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;   &lt;td class=&quot;xl72&quot; height=&quot;20&quot; style=&quot;background-color: #b7dee8; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px; height: 15pt; width: 285pt;&quot; width=&quot;380&quot;&gt;ANSI Temporal Syntax Support&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15pt;&quot;&gt;   &lt;td class=&quot;xl72&quot; height=&quot;20&quot; style=&quot;background-color: #b7dee8; border-color: black windowtext windowtext black; border-style: none solid solid none; border-width: 0px 0.5pt 0.5pt 0px; height: 15pt; width: 285pt;&quot; width=&quot;380&quot;&gt;Teradata Directory Manager&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 11pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6pHuiuGCJj2dP1ppVLOyFrSdtKYgsSHM3fQgADDMa6PiuGZT2R8b6pP74CYyCgeOsg_OjjaxeIW9UDV3Vkwa8FoQV1NVu0zCngLN8HlgCbI5gBthmGmBw3JDQT666HdIRkZ9nNw6gO0o/s1600/thanks.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;62&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6pHuiuGCJj2dP1ppVLOyFrSdtKYgsSHM3fQgADDMa6PiuGZT2R8b6pP74CYyCgeOsg_OjjaxeIW9UDV3Vkwa8FoQV1NVu0zCngLN8HlgCbI5gBthmGmBw3JDQT666HdIRkZ9nNw6gO0o/s1600/thanks.gif&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/1534952446184645322'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/1534952446184645322'/><link rel='alternate' type='text/html' href='http://teradatawiki.blogspot.com/2014/12/Teradata-15-features.html' title='Teradata15 features'/><author><name>Admin</name><uri>http://www.blogger.com/profile/03270946312373154797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCm0FeHTqy9tdxei5Vc3zsRwKvVPISdFMvIqK5NAbGyyTShzSA7INIQO8uEUGzBkkIDbVj7rdc7z1yqFbAQJMIryVb0gOqbYP1pgPjtpQ9v73YBxwSkukI_mgytcpbIA/s220/IMG_3457.jpg.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7ewxUT2ci_QrLReCCr0Jr6WI-noumQenJM0WooggzpT3CKw0FhXvkWLpuG3XHT-CXMoQsAHPZlwqzfswjgDCAIR5rxTWb5hDmyZGz3J99TU1jyOV6Wq6ES1hC1eOp8-LAZEJdYkTrY8o/s72-c/teradata15-features.JPG" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-7106842514564860422.post-8286820056128560932</id><published>2014-06-07T22:21:00.000+05:30</published><updated>2014-12-04T19:45:30.864+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Date Functions"/><category scheme="http://www.blogger.com/atom/ns#" term="Functions"/><category scheme="http://www.blogger.com/atom/ns#" term="new functions in teardata"/><category scheme="http://www.blogger.com/atom/ns#" term="Teradata 14 release functions"/><title type='text'>DATE Functions</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;ssmainhide&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg66F3z-OermN2HD_Z_5RNYq5OPBUuJDzFLu3UjJImlZSx4yJ4s6fLEEWEfDRe7_b3wtv9kNp4bGK_3My__iYnrt9-xtMXhi6prEmJmsBUkXW0mt2qwnEAr-qaV4qO0SPszDIgxdN_Pr5Q/s1600/Date+Function.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Teradata Date Functions&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg66F3z-OermN2HD_Z_5RNYq5OPBUuJDzFLu3UjJImlZSx4yJ4s6fLEEWEfDRe7_b3wtv9kNp4bGK_3My__iYnrt9-xtMXhi6prEmJmsBUkXW0mt2qwnEAr-qaV4qO0SPszDIgxdN_Pr5Q/s1600/Date+Function.png&quot; height=&quot;126&quot; title=&quot;Teradata Date Functions&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
As part of Domain Specific Functions Teradata database 14 has released new DATE functions.&lt;br /&gt;
Below re list of function.&lt;/div&gt;
&lt;style type=&quot;text/css&quot;&gt;
 table.tableizer-table {
 border: 1px solid #CCC; font-family: Arial, Helvetica, sans-serif
 font-size: 12px;
} 
.tableizer-table td {
 padding: 4px;
 margin: 3px;
 border: 1px solid #ccc;
}
.tableizer-table th {
 background-color: #8C1010; 
 color: #FFF;
 font-weight: bold;
}
&lt;/style&gt;&lt;br /&gt;
&lt;table class=&quot;tableizer-table&quot;&gt;&lt;tbody&gt;
&lt;tr class=&quot;tableizer-firstrow&quot;&gt;&lt;th&gt;Function&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;LAST_DAY &lt;/td&gt;&lt;td&gt;Return date of the last day of the month that contains timestamp value&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;NEXT_DAY &lt;/td&gt;&lt;td&gt;returns first weekday named by day_value that is later than the date specified by date/timestamp value&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;NUMTODSINTERVAL &lt;/td&gt;&lt;td&gt;convert a numeric value into an INTERVAL DAY(4) TO SECOND(6) value&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;NUMTOYMINTERVAL &lt;/td&gt;&lt;td&gt;Convert a numeric value into an INTERVAL YEAR(4) TO MONTH value&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;TO_DSINTERVAL &lt;/td&gt;&lt;td&gt;Convert a string value into an INTERVAL DAY(4) TO SECOND(6) value.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;TO_YMINTERVAL &lt;/td&gt;&lt;td&gt;Convert a string value into an INTERVAL YEAR(4) TO MONTH value.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;MONTHS_BETWEEN &lt;/td&gt;&lt;td&gt;Return the number of months between two date/timestamp values.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;OADD_MONTHS &lt;/td&gt;&lt;td&gt;Add a specified date/timestamp value to a specified number of months and return the resulting date.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;TO_DATE &lt;/td&gt;&lt;td&gt;Convert a string into a DATE value via a format string.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;TO_TIMESTAMP &lt;/td&gt;&lt;td&gt;Convert a string into a TIMESTAMP value via a format string.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;TO_TIMESTAMP_TZ &lt;/td&gt;&lt;td&gt;Convert a string into a TIMESTAMP WITH TIME ZONE value via a format string.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;TRUNC &lt;/td&gt;&lt;td&gt;Returns a DATE value with the time portion truncated to the unit specified by a format string.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;ROUND &lt;/td&gt;&lt;td&gt;Returns a DATE value with the time portion rounded to the unit specified by a format string.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;iframe frameborder=&quot;0&quot; height=&quot;90&quot; src=&quot;http://www.flipkart.com/affiliate/displayWidget?affrid=WRID-141741899739188976&quot; width=&quot;728&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;SELECT LAST_DAY (DATE);&lt;/span&gt;&lt;br /&gt;
-----------------------&lt;br /&gt;
LAST_DAY(Date)&lt;br /&gt;
2014-06-30&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;SELECT NEXT_DAY(DATE &#39;2014-06-10&#39; , &#39;FRIDAY&#39;);&lt;/span&gt;&lt;br /&gt;
----------------------------------------------&lt;br /&gt;
NEXT_DAY(2014-06-10,&#39;FRIDAY&#39;)&lt;br /&gt;
2014-06-13&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;SELECT NUMTODSINTERVAL(86405,&#39;SECOND&#39;), NUMTOYMINTERVAL(100, &#39;MONTH&#39; );&lt;/span&gt;&lt;br /&gt;
----------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
NUMTODSINTERVAL(86405,&#39;SECOND&#39;)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NUMTOYMINTERVAL(100,&#39;MONTH&#39;)&lt;br /&gt;
&amp;nbsp; 1 00:00:05.000000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;8-04&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;SELECT TO_DSINTERVAL(&#39;150 08:30:00&#39;) , TO_YMINTERVAL( &#39;2-11&#39;) ;&lt;/span&gt;&lt;br /&gt;
----------------------------------------------------------------------------------------------&lt;br /&gt;
TO_DSINTERVAL(&#39;150 08:30:00&#39;)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TO_YMINTERVAL(&#39;2-11&#39;)&lt;br /&gt;
150 08:30:00.000000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; 2-11&lt;br /&gt;
The above functions can be helpful while adding to any date columns.&lt;br /&gt;
&lt;br /&gt;
samples&lt;br /&gt;
SELECT ORDER_DATE, ORDER_DATE + TO_YMINTERVAL(&#39;02-11&#39;) FROM ORDERS;&lt;br /&gt;
SELECT EMP_ID, LAST_NAME FROM EMP_TABLE&amp;nbsp; WHERE HIRE_DATE + TO_DSINTERVAL(&#39;100 00:00:00&#39;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;SELECT MONTHS_BETWEEN(DATE&#39;2014-06-01&#39;, DATE&#39;2014-02-01&#39;);&lt;/span&gt;&lt;br /&gt;
-------------------------------------------------------------&lt;br /&gt;
MONTHS_BETWEEN(2014-06-01,2014-02-01)&lt;br /&gt;
4.00&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;SELECT OADD_MONTHS (DATE &#39;2014-04-15&#39;, 2), OADD_MONTHS (DATE &#39;2008-02-29&#39;, 1);&lt;/span&gt;&lt;br /&gt;
---------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
OADD_MONTHS(2014-04-15,2)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OADD_MONTHS(2008-02-29,1)&lt;br /&gt;
2014-06-15&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2008-03-31&lt;br /&gt;
Since 29 is the last day in February, March 31 is returned since 31 is the last day in March&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;SELECT TRUNC(CAST(&#39;2014/06/05&#39; AS DATE), &#39;D&#39;) (FORMAT &#39;yyyy-mm-dd&#39;);&lt;/span&gt; &lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
TRUNC(&#39;2014/06/05&#39;,&#39;D&#39;)&lt;br /&gt;
2014-06-01&lt;br /&gt;
The date was rounded to the first day of that week.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;SELECT ROUND(CAST(&#39;2003/09/20&#39; AS DATE), &#39;RM&#39;) (FORMAT &#39;yyyy-mm-dd&#39;);&lt;/span&gt;&lt;br /&gt;
----------------------------------------------------------------------------------------------------------&lt;br /&gt;
ROUND(&#39;2003/09/20&#39;,&#39;RM&#39;)&lt;br /&gt;
2003-10-01&lt;br /&gt;
Since the day is greater than or equal to 16, the date is rounded to the beginning of the next month.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6pHuiuGCJj2dP1ppVLOyFrSdtKYgsSHM3fQgADDMa6PiuGZT2R8b6pP74CYyCgeOsg_OjjaxeIW9UDV3Vkwa8FoQV1NVu0zCngLN8HlgCbI5gBthmGmBw3JDQT666HdIRkZ9nNw6gO0o/s1600/thanks.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6pHuiuGCJj2dP1ppVLOyFrSdtKYgsSHM3fQgADDMa6PiuGZT2R8b6pP74CYyCgeOsg_OjjaxeIW9UDV3Vkwa8FoQV1NVu0zCngLN8HlgCbI5gBthmGmBw3JDQT666HdIRkZ9nNw6gO0o/s1600/thanks.gif&quot; height=&quot;62&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/8286820056128560932'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/8286820056128560932'/><link rel='alternate' type='text/html' href='http://teradatawiki.blogspot.com/2014/06/teradata-date-functions.html' title='DATE Functions'/><author><name>Admin</name><uri>http://www.blogger.com/profile/03270946312373154797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCm0FeHTqy9tdxei5Vc3zsRwKvVPISdFMvIqK5NAbGyyTShzSA7INIQO8uEUGzBkkIDbVj7rdc7z1yqFbAQJMIryVb0gOqbYP1pgPjtpQ9v73YBxwSkukI_mgytcpbIA/s220/IMG_3457.jpg.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg66F3z-OermN2HD_Z_5RNYq5OPBUuJDzFLu3UjJImlZSx4yJ4s6fLEEWEfDRe7_b3wtv9kNp4bGK_3My__iYnrt9-xtMXhi6prEmJmsBUkXW0mt2qwnEAr-qaV4qO0SPszDIgxdN_Pr5Q/s72-c/Date+Function.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-7106842514564860422.post-181050828559840753</id><published>2014-05-29T09:23:00.001+05:30</published><updated>2014-12-04T19:59:25.498+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Functions"/><category scheme="http://www.blogger.com/atom/ns#" term="new functions in teardata"/><category scheme="http://www.blogger.com/atom/ns#" term="Numeric Functions"/><category scheme="http://www.blogger.com/atom/ns#" term="Teradata 14 functions"/><title type='text'>Numeric Functions</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div class=&quot;ssmainhide&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHEZsn1b8hLTeChOrwN7k3YS8LlX61wrjmDZ7CWaYvMYTRYze4LKVasXWNpuYeSBvtkS3gV9SxqGHE6p31i5HJFY4T1QJZrNjuab2g9vE_W2p7-zG6kpMKy65yDOmxdA929gONVBrWhyk/s1600/Numeric+Functions.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Teradata Numeric Functions&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHEZsn1b8hLTeChOrwN7k3YS8LlX61wrjmDZ7CWaYvMYTRYze4LKVasXWNpuYeSBvtkS3gV9SxqGHE6p31i5HJFY4T1QJZrNjuab2g9vE_W2p7-zG6kpMKy65yDOmxdA929gONVBrWhyk/s1600/Numeric+Functions.png&quot; height=&quot;124&quot; title=&quot;Teradata Numeric Functions&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;Teradata 14 has released many Domain Specific Functions. Now we are discussing about new Numeric functions which are equivalent to Oracle.&lt;br /&gt;
The following numeric functions are available in this Teradata 14 release.&lt;br /&gt;
&lt;iframe align=&quot;right&quot; frameborder=&quot;0&quot; height=&quot;600&quot; src=&quot;http://www.flipkart.com/affiliate/displayWidget?affrid=WRID-141742846599885266&quot; width=&quot;160&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;style type=&quot;text/css&quot;&gt;
 table.tableizer-table {
 border: 1px solid #CCC; font-family: Helvetica, Arial, serif
 font-size: 
12px;
} 
.tableizer-table td {
 padding: 4px;
 margin: 3px;
 border: 1px solid #ccc;
}
.tableizer-table th {
 background-
color: #104E8B; 
 color: #000;
 font-weight: bold;
}
&lt;/style&gt;&lt;br /&gt;
&lt;table class=&quot;tableizer-table&quot;&gt;&lt;tbody&gt;
&lt;tr class=&quot;tableizer-
firstrow&quot;&gt;&lt;th&gt;Name&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;b&gt;&lt;i&gt;SIGN&lt;/i&gt;&lt;/b&gt; &lt;/td&gt;&lt;td&gt;It returns the sign of a value &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;b&gt;&lt;i&gt;TRUNC&lt;/i&gt;&lt;/b&gt; &lt;/td&gt;&lt;td&gt;It will truncate a numeric value&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;b&gt;&lt;i&gt;ROUND&lt;/i&gt;&lt;/b&gt; &lt;/td&gt;&lt;td&gt;It will round a numeric value&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;b&gt;&lt;i&gt;GREATEST&lt;/i&gt;&lt;/b&gt; &lt;/td&gt;&lt;td&gt;It  return the highest value from a list of given values&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;b&gt;&lt;i&gt;LEAST&lt;/i&gt;&lt;/b&gt; &lt;/td&gt;&lt;td&gt;It return the lowest value from a list of given values&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;b&gt;&lt;i&gt;TO_NUMBER&lt;/i&gt;&lt;/b&gt; &lt;/td&gt;&lt;td&gt;It convert a string to a number via a format string&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;b&gt;&lt;i&gt;CEILING&lt;/i&gt;&lt;/b&gt; &lt;/td&gt;&lt;td&gt;It return the smallest integer not less than the input parameter&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;b&gt;&lt;i&gt;FLOOR&lt;/i&gt;&lt;/b&gt; &lt;/td&gt;&lt;td&gt;It return the largest integer equal to or less than the input parameter&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
Example for all functions.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta;&quot;&gt;SELECT&lt;br /&gt;
&amp;nbsp; SIGN(-123)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as SIGN&lt;br /&gt;
, TRUNC (32.976) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as TRUNC&lt;br /&gt;
, ROUND(345.175) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;as ROUND&lt;br /&gt;
, GREATEST(12,56,10.1, 155.6)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as GREATEST&lt;br /&gt;
, LEAST (12,56,10.1, 155.6)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;as LEAST&lt;br /&gt;
, TO_NUMBER (&#39;4769.96&#39;, &#39;9999.99&#39;)&amp;nbsp; as TO_NUMBER&lt;br /&gt;
, CEIL( 5.4)&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;as CEIL&lt;br /&gt;
, FLOOR(3.86)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; as FLOOR &lt;br /&gt;
;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSpXRJQxG1bdtPXef7m7XbvKzfjBXMfhVt7cqsr8quhx3lqhiD-MDLqGNDIEDqZRi6TqeFB9gL4tBvlQQm7Zbryqy2w7IEl6rM1RJaVT5O0H4RZZBvgSttGKgMuZ6T9Y3pt2tbz-WKkF8/s1600/ping.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Teradata Numeric Functions&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSpXRJQxG1bdtPXef7m7XbvKzfjBXMfhVt7cqsr8quhx3lqhiD-MDLqGNDIEDqZRi6TqeFB9gL4tBvlQQm7Zbryqy2w7IEl6rM1RJaVT5O0H4RZZBvgSttGKgMuZ6T9Y3pt2tbz-WKkF8/s1600/ping.PNG&quot; height=&quot;316&quot; title=&quot;Teradata Numeric Functions&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSaC0ZJUqZZB2b3rFI1Q2jiGCnGCpKUZmW909u9C9syG2K_KffRYFPN973YxFB_Wx2h3fNIQvES3AYRkdDzfJfV5O6FCj7oyuLem3FApGIC-pCwxB48ZmWDgJHyGhKK8RgQu8_NAEBlOY/s1600/thanks.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSaC0ZJUqZZB2b3rFI1Q2jiGCnGCpKUZmW909u9C9syG2K_KffRYFPN973YxFB_Wx2h3fNIQvES3AYRkdDzfJfV5O6FCj7oyuLem3FApGIC-pCwxB48ZmWDgJHyGhKK8RgQu8_NAEBlOY/s1600/thanks.gif&quot; height=&quot;62&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/181050828559840753'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/181050828559840753'/><link rel='alternate' type='text/html' href='http://teradatawiki.blogspot.com/2014/05/Teradata14-numeric-functions.html' title='Numeric Functions'/><author><name>Admin</name><uri>http://www.blogger.com/profile/03270946312373154797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCm0FeHTqy9tdxei5Vc3zsRwKvVPISdFMvIqK5NAbGyyTShzSA7INIQO8uEUGzBkkIDbVj7rdc7z1yqFbAQJMIryVb0gOqbYP1pgPjtpQ9v73YBxwSkukI_mgytcpbIA/s220/IMG_3457.jpg.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHEZsn1b8hLTeChOrwN7k3YS8LlX61wrjmDZ7CWaYvMYTRYze4LKVasXWNpuYeSBvtkS3gV9SxqGHE6p31i5HJFY4T1QJZrNjuab2g9vE_W2p7-zG6kpMKy65yDOmxdA929gONVBrWhyk/s72-c/Numeric+Functions.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-7106842514564860422.post-89351410450630639</id><published>2014-05-22T21:23:00.004+05:30</published><updated>2014-12-04T21:25:05.488+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Functions"/><category scheme="http://www.blogger.com/atom/ns#" term="Regular Expression Functions"/><category scheme="http://www.blogger.com/atom/ns#" term="TD14 new functions"/><category scheme="http://www.blogger.com/atom/ns#" term="Teradata 14 release functions"/><title type='text'>Regular Expression Functions</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div class=&quot;ssmainhide&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTUrlC1ePaDthRqmdo87ZRYSnmQz02dHD_nfWbIhQ-HfRqNqG4MzchKB-bCQaHldMXFZqwhtfZJcCpv_iiN8HTq252al1mUQE7gL1_j0CIY9VJ8ttdikNRknw_8zrZcczPkSlmyaDS9yk/s1600/Regexp.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Regular Expression Functions&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTUrlC1ePaDthRqmdo87ZRYSnmQz02dHD_nfWbIhQ-HfRqNqG4MzchKB-bCQaHldMXFZqwhtfZJcCpv_iiN8HTq252al1mUQE7gL1_j0CIY9VJ8ttdikNRknw_8zrZcczPkSlmyaDS9yk/s1600/Regexp.png&quot; height=&quot;196&quot; title=&quot;Regular Expression Functions&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;In this Teradata 14 has released many domain specific function added NUMERIC data type, String functions and many of the functions supports regular expressions. These new functions are designed to be compatible to Oracle.&lt;br /&gt;
Here we are going to discuss about the following domain specific regular expression functions.&lt;br /&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;

&lt;li&gt;REGEXP_SUBSTR&lt;/li&gt;
&lt;li&gt;REGEXP_REPLACE&amp;nbsp;&lt;/li&gt;
&lt;li&gt;REGEXP_INSTR&amp;nbsp; &lt;/li&gt;
&lt;li&gt;REGEXP_SIMILAR&lt;/li&gt;
&lt;li&gt;REGEXP_SPLIT_TO_TABLE &lt;/li&gt;
&lt;/ol&gt;&lt;iframe align=&quot;right&quot; frameborder=&quot;0&quot; height=&quot;250&quot; src=&quot;http://www.flipkart.com/affiliate/displayWidget?affrid=WRID-141743185569038055&quot; width=&quot;300&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
Now will discuss in detail of each function below&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;u&gt;&lt;b&gt;REGEXP_SUBSTR&lt;/b&gt;&lt;/u&gt;&lt;/span&gt; &lt;br /&gt;
This function extracts a substring from a source string that matches a regular expression pattern.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;General Syntax:&lt;/i&gt;&lt;br /&gt;
REGEXP_SUBSTR (source_string, regexp_string, position_arg);&lt;br /&gt;
&lt;br /&gt;
position_arg = (occurance_org, match_arg)&lt;br /&gt;
&lt;br /&gt;
REGEXP_SUBSTR Function Example:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta;&quot;&gt;SELECT REGEXP_SUBSTR (&#39;God Bless Mummy God Bless Daddy&#39;, &#39;bless&#39;, 1, 2, &#39;i&#39;)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
In the above example &lt;br /&gt;
source_string = God Bless Mummy God Bless Daddy&lt;br /&gt;
regexp_string = Bless &lt;br /&gt;
position_arg = Find the second occurrence of the string that matches regular expression. &#39;i&#39; indicates case insensitive.&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLokZn1RTobDHTCX3M-o1MHQpC6qHchF1DivBDL57ToU4DRDD8MgQYXt4qlpgdRNiWC34P69y1t2agKGyf_taLTnEqfspWa3BJs4dONeOUDtkUQjeG0NeYmVwPp6EhJ3cQujFyJ8NGjUQ/s1600/regexp_substr.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;REGEXP_SUBSTR&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLokZn1RTobDHTCX3M-o1MHQpC6qHchF1DivBDL57ToU4DRDD8MgQYXt4qlpgdRNiWC34P69y1t2agKGyf_taLTnEqfspWa3BJs4dONeOUDtkUQjeG0NeYmVwPp6EhJ3cQujFyJ8NGjUQ/s1600/regexp_substr.JPG&quot; height=&quot;124&quot; title=&quot;REGEXP_SUBSTR&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;u&gt;&lt;b&gt;REGEXP_REPLACE &lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
This function replaces portions of the source string parameter that match a regular expression pattern with a replace string.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;General Syntax:&lt;/i&gt;&lt;br /&gt;
REGEXP_SUBSTR (source_string, regexp_string, replace_string);&lt;br /&gt;
&lt;br /&gt;
replace_string=(position_arg,occurance_org, match_arg)&lt;br /&gt;
&lt;br /&gt;
REGEXP_REPLACE Function Examples:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;b&gt;&lt;span style=&quot;color: magenta;&quot;&gt;SELECT REGEXP_REPLACE (&#39;Hello World World&#39;, &#39;world&#39;, &#39;My&#39;, 1, 1,&#39;i&#39;); &lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
In this we are replacing the 1st occurrence of &#39;World&#39; with &#39;My&#39; by ignoring case specific.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRbs49QmqzCd6tDyKY_5tZF0Tt2j8EEAzyKHSdiAucBm4jrHng4cQv-_bTbvB2wkbWM3ehfGlENZS3ADftSvK5TzOO8yCic8WAcC8_Osqw3IeBg1FIy0QC9hQqUV_7qHkki2mK3qYu6oQ/s1600/regexp_replace1.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;REGEXP_REPLACE &quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRbs49QmqzCd6tDyKY_5tZF0Tt2j8EEAzyKHSdiAucBm4jrHng4cQv-_bTbvB2wkbWM3ehfGlENZS3ADftSvK5TzOO8yCic8WAcC8_Osqw3IeBg1FIy0QC9hQqUV_7qHkki2mK3qYu6oQ/s1600/regexp_replace1.JPG&quot; height=&quot;116&quot; title=&quot;REGEXP_REPLACE &quot; width=&quot;640&quot; /&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;br /&gt;
SELECT REGEXP_REPLACE (&#39;Godís Love is so wonderful.&#39;, &#39;God&#39;s&#39;, &#39;Mother&#39;, 1, 1, &#39;c&#39;); &lt;/b&gt;&lt;/span&gt;&lt;/div&gt;In this we are replacing the 1st occurrence of &#39;God&#39;s&#39; with &#39;Mother&#39; by considering with case specific with &#39;c&#39;. &lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh53PeKTxs9uX1m0goFHeXn7enriMgR_Xsd6MKMrV0rs5roqjkQBz4vz18ScjGYWlSAMfrDxRN0NG98P98aif5FSn1DHcmMeQ_SxvZdkc1p6gZvck_WD-Q19hqdHaTXUHOB9XomCpTPKjI/s1600/regexp_replace2.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;REGEXP_REPLACE &quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh53PeKTxs9uX1m0goFHeXn7enriMgR_Xsd6MKMrV0rs5roqjkQBz4vz18ScjGYWlSAMfrDxRN0NG98P98aif5FSn1DHcmMeQ_SxvZdkc1p6gZvck_WD-Q19hqdHaTXUHOB9XomCpTPKjI/s1600/regexp_replace2.JPG&quot; height=&quot;112&quot; title=&quot;REGEXP_REPLACE &quot; width=&quot;640&quot; /&gt; &lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;b&gt;SELECT REGEXP_REPLACE(&#39;I love the buzz-buzz buzzing of the bee&#39;, &#39;buzz&#39;, &#39;BUZZ&#39;, 1, 2, &#39;c&#39;); &lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
In this we are replacing the 2nd occurrence of &#39;buzz&#39; with &#39;BUZZ&#39; by considering the case specific with &#39;c&#39;.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFzHDqSmSxGCjIW-yeWwKxRMfjqSjl5MaFkgFktWmDCJrkMPAbS2hPPh6Gts5RHfL7X704HENBfC6FHfqsRdymzaFVP3yh2d7nl5QDXgZz4U3PJg-pRoBN-RwgCPWPBRs_CJtr8OZMq4o/s1600/regexp_replace3.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;REGEXP_REPLACE &quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFzHDqSmSxGCjIW-yeWwKxRMfjqSjl5MaFkgFktWmDCJrkMPAbS2hPPh6Gts5RHfL7X704HENBfC6FHfqsRdymzaFVP3yh2d7nl5QDXgZz4U3PJg-pRoBN-RwgCPWPBRs_CJtr8OZMq4o/s1600/regexp_replace3.JPG&quot; height=&quot;90&quot; title=&quot;REGEXP_REPLACE &quot; width=&quot;640&quot; /&gt;&lt;br /&gt;
&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;br /&gt;
SELECT REGEXP_REPLACE (&#39;ABCD123-$567xy&#39;,&#39;[^0-9]*&#39;,&#39;&#39;,1,0,&#39;i&#39;)&lt;/b&gt;&lt;b&gt;;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
In this we are replacing the any character or symbols with NULL. So it results only Numeric values. &lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEia05u2mkc6ApmVTukM4anIeGLEsFzz-UE84fRWBAaQ3bkuqvV8_r2OITuAZY7PRjD-IH7E9uDWasjC7eL1VsF72N2EGlqSzcxNiOqBqpN77KFf1xABtB6vQHW0NFiPpu2yRlyVrv8taUo/s1600/regexp_replace4.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;REGEXP_REPLACE &quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEia05u2mkc6ApmVTukM4anIeGLEsFzz-UE84fRWBAaQ3bkuqvV8_r2OITuAZY7PRjD-IH7E9uDWasjC7eL1VsF72N2EGlqSzcxNiOqBqpN77KFf1xABtB6vQHW0NFiPpu2yRlyVrv8taUo/s1600/regexp_replace4.PNG&quot; height=&quot;126&quot; title=&quot;REGEXP_REPLACE &quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;u&gt;&lt;b&gt;REGEXP_INSTR &lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
This function Search the source string for a match to a regular expression pattern and return the beginning or ending position of that match.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;General Syntax:&lt;/i&gt;&lt;br /&gt;
REGEXP_SUBSTR (source_string, regexp_string, position_arg)&lt;br /&gt;
&lt;br /&gt;
position_argt = (occurance_org,return_opt, match_arg)&lt;br /&gt;
&lt;br /&gt;
return_opt&amp;nbsp; returns&amp;nbsp; 0 = function returns the beginning position of the match (default).&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 = function returns the end position &lt;br /&gt;
&lt;br /&gt;
REGEXP_INSTR Function Examples:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;b&gt;SELECT REGEXP_INSTR(&#39;Happy Birthday to you&#39;, &#39;Happy Birthday&#39;, 1, 1, 0, &#39;c&#39;);&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
It returns 1&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnG7317L2nyokBn8VSO3LgRvPoHQCB5mTA4mcW-xfGvGeTrK3trAB8TGoKbSSRQ0E4KTWDGUiiL2SE_0m5_G1hzSJoJkjsa5m_3miT33iScM6ge6Vb9tm2Z_Zfv3WQ-tQrESurq1IL7xo/s1600/regexp_instr1.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;REGEXP_INSTR &quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnG7317L2nyokBn8VSO3LgRvPoHQCB5mTA4mcW-xfGvGeTrK3trAB8TGoKbSSRQ0E4KTWDGUiiL2SE_0m5_G1hzSJoJkjsa5m_3miT33iScM6ge6Vb9tm2Z_Zfv3WQ-tQrESurq1IL7xo/s1600/regexp_instr1.PNG&quot; height=&quot;122&quot; title=&quot;REGEXP_INSTR &quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;b&gt;&lt;br /&gt;
SELECT REGEXP_INSTR(&#39;Happy Birthday to you&#39;, &#39;Happy Birthday&#39;, 1, 1, 1, &#39;c&#39;);&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
It returns 15&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEii6KxDhC5Mh50QIknsxdMjHveDW6Psg3DJASGjI9vWbg1fIecz9Qi4LQtdp61t5qNdX8Cx68gg7REPpJZr3HmtLbArYahE_Cu4g-KI_n3CGjqsjbOL47MsurTqtA8xY-2l5z5watW-9Lw/s1600/regexp_instr2.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;REGEXP_INSTR &quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEii6KxDhC5Mh50QIknsxdMjHveDW6Psg3DJASGjI9vWbg1fIecz9Qi4LQtdp61t5qNdX8Cx68gg7REPpJZr3HmtLbArYahE_Cu4g-KI_n3CGjqsjbOL47MsurTqtA8xY-2l5z5watW-9Lw/s1600/regexp_instr2.PNG&quot; height=&quot;120&quot; title=&quot;REGEXP_INSTR &quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;u&gt;&lt;b&gt;REGEXP_SIMILAR&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
This function compares a source string to a regular expression and returns an integer value.&lt;br /&gt;
&amp;nbsp;1 (true) if the entire string matches regexp_arg&lt;br /&gt;
&amp;nbsp;0 (false) if the entire string does not match regexp_arg&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;General Snytax:&lt;/i&gt;&lt;br /&gt;
REGEXP_SIMILAR(source_string, regexp_string, match_arg)&lt;br /&gt;
&lt;br /&gt;
REGEXP_INSTR Function Examples:&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;b&gt;&lt;br /&gt;
SELECT&amp;nbsp;&amp;nbsp;&amp;nbsp; Emp_Name &lt;br /&gt;
FROM&amp;nbsp;&amp;nbsp;&amp;nbsp; Emp_Table &lt;br /&gt;
WHERE&amp;nbsp;&amp;nbsp;&amp;nbsp; REGEXP_SIMILAR (emp_name, &#39;(Smith B(i|y)rd)|| (John B(i|y)rd)&#39;,&#39;c&#39;) = 1; &lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
It returns the names of employees that match&lt;br /&gt;
Smith Byrd&lt;br /&gt;
Smith Bird&lt;br /&gt;
John Bird&lt;br /&gt;
John Byrd&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGERon8oIcFEmx2DoFNojXiwyHoO74-l3NmQcOrdXprvKiL9yEnqK26VteIrUdhvO4fe4HkSvx6Z7KtMNRm-akEEBUMWFxDax7bwFPmD-QRBTtxOFemTIz_MRgTVJNqSyeomdSsdrt9PQ/s1600/regex_similar.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;REGEXP_SIMILAR&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGERon8oIcFEmx2DoFNojXiwyHoO74-l3NmQcOrdXprvKiL9yEnqK26VteIrUdhvO4fe4HkSvx6Z7KtMNRm-akEEBUMWFxDax7bwFPmD-QRBTtxOFemTIz_MRgTVJNqSyeomdSsdrt9PQ/s1600/regex_similar.PNG&quot; height=&quot;176&quot; title=&quot;REGEXP_SIMILAR&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;u&gt;&lt;b&gt;REGEXP_SPLIT_TO_TABLE &lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
This table function splits a source string into a table of strings using a regular expression as the delimiter.&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;
General Snytax:&lt;/i&gt;&lt;br /&gt;
REGEXP_SPLIT_TO_TABLE (source_string, regexp_string, match_arg)&lt;br /&gt;
&lt;br /&gt;
REGEXP_SPLIT_TO_TABLE Function Examples:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta;&quot;&gt;CREATE TABLE split_table_latin(id integer, src varchar(100) character set latin, pattern varchar(100) character set latin, match varchar(100) character set latin);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta;&quot;&gt;INSERT into split_table_latin(3, &#39;The2134quick234brown234fox987jumps8743over342the03487lazy089734red972384dog2343.&#39;, &#39;[0-9]*&#39;,&#39;c&#39;);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Then the following SELECT statement:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: magenta;&quot;&gt;SELECT * from table ( regexp_split_to_table(split_table_latin.src,split_table_latin.pattern,split_table_latin.match)returns (res varchar(100) character set latin)) as t1;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYE5eD_ppRHoo4lkuD9no1Pii61MoyKLf3UJNYLs0czGwmAp9igwnI9XLq-IwAXCkswhpA5r_t-vIqg_IImWb5kh905prR3LXk9q4-IBfVOretodBauF3Rq03a1pSPwxFUu23OlMh3CXU/s1600/regexp_split.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;REGEXP_SPLIT_TO_TABLE &quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYE5eD_ppRHoo4lkuD9no1Pii61MoyKLf3UJNYLs0czGwmAp9igwnI9XLq-IwAXCkswhpA5r_t-vIqg_IImWb5kh905prR3LXk9q4-IBfVOretodBauF3Rq03a1pSPwxFUu23OlMh3CXU/s1600/regexp_split.PNG&quot; height=&quot;156&quot; title=&quot;REGEXP_SPLIT_TO_TABLE &quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;b&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Returns a table with the following rows&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;The&lt;/li&gt;
&lt;li&gt;quick&lt;/li&gt;
&lt;li&gt;brown&lt;/li&gt;
&lt;li&gt;fox&lt;/li&gt;
&lt;li&gt;jumps&lt;/li&gt;
&lt;li&gt;over&lt;/li&gt;
&lt;li&gt;the&lt;/li&gt;
&lt;li&gt;lazy&lt;/li&gt;
&lt;li&gt;red&lt;/li&gt;
&lt;li&gt;dog&lt;/li&gt;
&lt;li&gt;.&lt;br /&gt;
&lt;br /&gt;
This all about the Regular Expression Functions. I hope you enjoyed while learning.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcD2_xOcVFb9_pVyhsqiwFVsBzO6u3_8TczDPX821DJOeutohEHxAoDTpAbcBVYc9cPBSMedLeUfK_usepOM0TkL1PKbonkKVewYVjKynVxePy90caX1SthHVbiL8J8XWQiPyJRVQxRM8/s1600/thanks.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcD2_xOcVFb9_pVyhsqiwFVsBzO6u3_8TczDPX821DJOeutohEHxAoDTpAbcBVYc9cPBSMedLeUfK_usepOM0TkL1PKbonkKVewYVjKynVxePy90caX1SthHVbiL8J8XWQiPyJRVQxRM8/s1600/thanks.gif&quot; height=&quot;62&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/89351410450630639'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/89351410450630639'/><link rel='alternate' type='text/html' href='http://teradatawiki.blogspot.com/2014/05/regular-expression-functions.html' title='Regular Expression Functions'/><author><name>Admin</name><uri>http://www.blogger.com/profile/03270946312373154797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCm0FeHTqy9tdxei5Vc3zsRwKvVPISdFMvIqK5NAbGyyTShzSA7INIQO8uEUGzBkkIDbVj7rdc7z1yqFbAQJMIryVb0gOqbYP1pgPjtpQ9v73YBxwSkukI_mgytcpbIA/s220/IMG_3457.jpg.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTUrlC1ePaDthRqmdo87ZRYSnmQz02dHD_nfWbIhQ-HfRqNqG4MzchKB-bCQaHldMXFZqwhtfZJcCpv_iiN8HTq252al1mUQE7gL1_j0CIY9VJ8ttdikNRknw_8zrZcczPkSlmyaDS9yk/s72-c/Regexp.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-7106842514564860422.post-7088668911722768391</id><published>2014-05-16T09:02:00.004+05:30</published><updated>2014-05-16T09:02:59.586+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Performance Tips"/><category scheme="http://www.blogger.com/atom/ns#" term="Performance Tuning"/><category scheme="http://www.blogger.com/atom/ns#" term="Teradata  Performance Tuning"/><title type='text'>A to Z Performance Tuning</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;ssmainhide&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCQbuRwe1KhyphenhyphenqkrZgbtYbR7XxrmuVLz9k5uZrBYYaeKSSj4o2gh_hYtclulUipBOuKpDDeZqgaXKWXPdzTPNP_NpakAnmFQozlH2x9Wjw6JUDG-DJ7QnBuSzDcD6hTG31Ru4SZzNLDIgQ/s1600/Teradata+Performance+Tuning.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Teradata Performance Tuning&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCQbuRwe1KhyphenhyphenqkrZgbtYbR7XxrmuVLz9k5uZrBYYaeKSSj4o2gh_hYtclulUipBOuKpDDeZqgaXKWXPdzTPNP_NpakAnmFQozlH2x9Wjw6JUDG-DJ7QnBuSzDcD6hTG31Ru4SZzNLDIgQ/s1600/Teradata+Performance+Tuning.png&quot; height=&quot;197&quot; title=&quot;Teradata Performance Tuning&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;i&gt;&lt;b&gt;A) Explain the EXPLAIN: &lt;/b&gt;&lt;/i&gt;Check for EXPLAIN plan to see how exactly Teradata will be executing the query. Try to understand basic keywords in Explain Plan like confidence level, join strategy used, re-distribution happening or not.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;B) Collect STATS: &lt;/b&gt;&lt;/i&gt;The stats of the columns used join conditions should updated. Secondary Indexes without proper STATS can be of little or no help. Check for STATS status of the table.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;C) Use Proper PI:&lt;/b&gt;&lt;/i&gt; If the Primary index is not properly defined in any one or all of the tables in the query. Check if the PI of target table loaded is unique.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;D) Use PPI: &lt;/b&gt;&lt;/i&gt;If there is Partition Primary Index created on a table, try to use it. If you are not using it in filter condition, it will degrade the performance.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;E) No FUNCTIONS in Conditions:&lt;/i&gt;&lt;/b&gt; Try to avoid using function in join conditions. Ex Applying COALESCE or TRIM etc causes high CPU consumption.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;F) Use PPI: &lt;/i&gt;&lt;/b&gt;If Partition Primary Index is defined in tables try to use it. If you are not using it in filter condition, it will degrade the performance. &lt;br /&gt;
&lt;i&gt;&lt;b&gt;&lt;br /&gt;
G) Same column DATA TYPES:&lt;/b&gt;&lt;/i&gt; Define same data type for the joining columns. &lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;H) Avoid IN clause in filter conditions:&lt;/b&gt;&lt;/i&gt; When there can be huge number of values in where conditions, better option can be to insert such values in a volatile table and use volatile table with INNER JOIN in the main query.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;I) Use Same PI in Source &amp;amp; Target: &lt;/b&gt;&lt;/i&gt;PI columns also can help in saving the data into disk .If the Source and Target have the same PI, data dump can happen very efficiently form source to target.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;J) Collect STATS on VOLATILE table: &lt;/b&gt;&lt;/i&gt;Collect stats on volatile tables where required can save AMPCPU. Remove stats if already present where it is not getting used.&lt;br /&gt;
If the volatile table contains UNIQUE PI, then go for sample stats rather than full stats. &lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;K) DROPPING volatile tables explicitly: &lt;/b&gt;&lt;/i&gt;Once volatile tables is no more required you can drop those. Donít wait for complete procedure to be over. This will free some spool space immediately and could prove to be very helpful in avoiding No More Spool Space error.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;L) NO LOG for volatile tables: &lt;/i&gt;&lt;/b&gt;Create volatile tables with NO LOG option. &lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;M) Check DBQL Stats: &lt;/b&gt;&lt;/i&gt;Keep your performance stats accessible. Target the most AMPCPU consuming query first.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;N) UPDATE clause: &lt;/b&gt;&lt;/i&gt;Do not write UPDATE clause with just SET condition and no WHERE condition. Even if the Target/Source has just one row, add WHERE clause for PI column. &lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;O) DELETE &amp;amp; INSERT: &lt;/b&gt;&lt;/i&gt;Sometimes replacing UPDATE with DELETE &amp;amp; INSERT can save good number of AMPCPU. Check if this holds good for your query.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;P) Query SPLITS: &lt;/i&gt;&lt;/b&gt;Split queries into several smaller queries logically and use volatile tables with proper PI. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Q) Try MSR:&lt;/i&gt;&lt;/b&gt; If same target table is loaded multiple times, try MSR for several sections. This will speed the final MERGE step into target table and you may see good CPU gain.&lt;br /&gt;
&lt;i&gt;&lt;b&gt;&lt;br /&gt;
R) Try OLAP Functions: &lt;/b&gt;&lt;/i&gt;Check if replacing co-related sub query with OLAP function may result in AMPCPU saving.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;S) Avoid DUPLICATE data: &lt;/i&gt;&lt;/b&gt;If the join columns in the tables involved in the query have duplicates. Use Distinct or Group by, load into a volatile table, collect stats and use the volatile table.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;T) Use Proper JOINS: &lt;/i&gt;&lt;/b&gt;If joins used, donít use right outer, left or full joins where inner joins is sufficient.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;U) User proper ALIAS: &lt;/i&gt;&lt;/b&gt;Check the aliases in the joins. Small mistake could lead to a product join.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;V) Avoid CAST: &lt;/i&gt;&lt;/b&gt;Avoid unnecessary casting for DATE columns. Once defined as DATE, you can compare date columns against each other even when they are in different format. Internally, DATE is stored as INTEGER. CAST is required mainly when you have to compare VARCHAR value as DATE.&lt;br /&gt;
&lt;i&gt;&lt;b&gt;&lt;br /&gt;
W) Avoid UDF: &lt;/b&gt;&lt;/i&gt;Most of the functions are available in Teradata for data manipulations. So avoid User Defined Functions&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;X) Avoid FULL TABLE SCAN:&lt;/i&gt;&lt;/b&gt; Try to avoid FTS scenarios like SI should be defined on the columns which are used as part of joins or Alternate access path. Collect stats on SI columns else there are chances where optimizer might go for FTS even when SI is defined on that particular column&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Y) Avoid using IN/NOT IN: &lt;/i&gt;&lt;/b&gt;For large list of values, avoid using IN /NOT IN in SQLs. Write large list values to a temporary table and use this table in the query&lt;br /&gt;
&lt;i&gt;&lt;b&gt;&lt;br /&gt;
Z) Use CONSTANTS: &lt;/b&gt;&lt;/i&gt;Use constants to specify index column contents whenever possible, instead of specifying the constant once, and joining the tables. This may provide a small savings on performance.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEtQsQNpfiOpl7HIhMtl1OWOKEoAp5cMkmGFWixGkHrp8pK_tteK1oCzvsISKNWLGjv7X1ESfTS2JzJeCwzwiLdasBrqTMpId8NrApKohc3uOjnILlwUqKPbmeQaLN5VMEifpB8O9whzw/s1600/thanks.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEtQsQNpfiOpl7HIhMtl1OWOKEoAp5cMkmGFWixGkHrp8pK_tteK1oCzvsISKNWLGjv7X1ESfTS2JzJeCwzwiLdasBrqTMpId8NrApKohc3uOjnILlwUqKPbmeQaLN5VMEifpB8O9whzw/s1600/thanks.gif&quot; height=&quot;62&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/7088668911722768391'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/7088668911722768391'/><link rel='alternate' type='text/html' href='http://teradatawiki.blogspot.com/2014/05/Teradata-performance-tuning.html' title='A to Z Performance Tuning'/><author><name>Admin</name><uri>http://www.blogger.com/profile/03270946312373154797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCm0FeHTqy9tdxei5Vc3zsRwKvVPISdFMvIqK5NAbGyyTShzSA7INIQO8uEUGzBkkIDbVj7rdc7z1yqFbAQJMIryVb0gOqbYP1pgPjtpQ9v73YBxwSkukI_mgytcpbIA/s220/IMG_3457.jpg.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCQbuRwe1KhyphenhyphenqkrZgbtYbR7XxrmuVLz9k5uZrBYYaeKSSj4o2gh_hYtclulUipBOuKpDDeZqgaXKWXPdzTPNP_NpakAnmFQozlH2x9Wjw6JUDG-DJ7QnBuSzDcD6hTG31Ru4SZzNLDIgQ/s72-c/Teradata+Performance+Tuning.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-7106842514564860422.post-229524053221645133</id><published>2014-04-23T08:51:00.000+05:30</published><updated>2014-04-23T09:41:22.793+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Commnads"/><title type='text'>Top SQL Commands</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;ssmainhide&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhy-sMIRvMexdEZc3_Hxmg7VCuTpcz6ZwUn94IH1TbV6qbRo0CaJxe9WM8CTD2tThi7BFIR2akrcIUl6imDKuDmNtLn6E1LtaDW4mznX9896cUJ3RQYF1kQ3FPJ9rG014MsQAGzvl6BkvA/s1600/Screen+Shot+2014-04-21+at+9.13.44+PM.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;TERADATA SQL COMMNADS&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhy-sMIRvMexdEZc3_Hxmg7VCuTpcz6ZwUn94IH1TbV6qbRo0CaJxe9WM8CTD2tThi7BFIR2akrcIUl6imDKuDmNtLn6E1LtaDW4mznX9896cUJ3RQYF1kQ3FPJ9rG014MsQAGzvl6BkvA/s1600/Screen+Shot+2014-04-21+at+9.13.44+PM.png&quot; height=&quot;123&quot; title=&quot;TERADATA SQL COMMNADS&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;i&gt;&lt;b&gt;SQL to changing the default Database&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;DATABASE EMP_DATA_BASE;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;SQL to find Information about a Database&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;HELP DATABASE EMP_DATA_BASE;&lt;/span&gt;&lt;i&gt;&lt;b&gt;&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;b&gt;&lt;br /&gt;
SQL to get Sample number of rows&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/i&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;SELECT * FROM EMP_TBL SAMPLE 10;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;SQL to get a sample Percentage of rows&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;SELECT * FROM EMP_TBL SAMPLE .50;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;SQL to find information about a Table&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;SHOW TABLE EMP_TBL;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;SQL to Use an Access Locked Table&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;LOCKING ROW FOR ACCESS SELECT * FROM EMP_TBL;&lt;/span&gt;&lt;br /&gt;
&lt;i&gt;&lt;b&gt;&lt;br /&gt;
SQL Keywords that describe you&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;SELECT DATABASE, USER, SESSION,&lt;br /&gt;
ACCOUNT,&lt;br /&gt;
PROFILE,&lt;br /&gt;
ROLE;&quot;&lt;br /&gt;
&quot;SELECT DATE,&lt;br /&gt;
CURRENT_DATE,&lt;br /&gt;
TIME,&lt;br /&gt;
CURRENT_TIME,&lt;br /&gt;
CURRENT_TIMESTAMP;&lt;/span&gt;&lt;br /&gt;
&lt;i&gt;&lt;b&gt;&lt;br /&gt;
SQL to Use Aggregates functions&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;SELECT TOP 10&amp;nbsp; STUDENT_NO, FIRST_NAME, LAST_NAME, CLASS_CODE &lt;br /&gt;
FROM STUDENT_TBL &lt;br /&gt;
ORDER BY GRADE DESC;&quot;&lt;br /&gt;
&quot;SELECT DEPT_NO&lt;br /&gt;
,MAX(SALARY) AS &quot;&quot;MAXIMUM&quot;&quot;&lt;br /&gt;
,MIN(SALARY) AS &quot;&quot;MINIMUM&quot;&quot;&lt;br /&gt;
,AVG(SALARY) AS &quot;&quot;AVERAGE&quot;&quot;&lt;br /&gt;
,SUM(SALARY) AS &quot;&quot;SUM&quot;&quot;&lt;br /&gt;
,COUNT(*) AS &quot;&quot;COUNT&quot;&quot;&lt;br /&gt;
FROM EMP_TBL&lt;br /&gt;
GROUP BY DEPT_NO&lt;br /&gt;
ORDER BY DEPT_NO;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;SQL to Select TOP Rows in a Rank Order&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;SELECT TOP 10&amp;nbsp; STUDENT_NO&lt;br /&gt;
,FIRST_NAME&lt;br /&gt;
,LAST_NAME&lt;br /&gt;
,CLASS_CODE &lt;br /&gt;
FROM STUDENT_TBL &lt;br /&gt;
ORDER BY GRADE DESC;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;SQL Using Date, Time and Timestamp&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;SELECT &lt;br /&gt;
CALENDAR_DATE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
,DAY_OF_WEEK&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
,DAY_OF_MONTH&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
,DAY_OF_YEAR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
,DAY_OF_CALENDAR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
,WEEKDAY_OF_MONTH&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
,WEEK_OF_MONTH&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
,WEEK_OF_YEAR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
,WEEK_OF_CALENDAR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
,MONTH_OF_QUARTER&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
,MONTH_OF_YEAR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
,MONTH_OF_CALENDAR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
,QUARTER_OF_YEAR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
,QUARTER_OF_CALENDAR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
,YEAR_OF_CALENDAR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
FROM SYS_CALENDAR.CALENDAR;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;SQL to Find out how much Space a USER have&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;SELECT &lt;br /&gt;
USERNAME&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
,CREATORNAME&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
,PERMSPACE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
,SPOOLSPACE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
,TEMPSPACE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
,LASTALTERNAME&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
,LASTALTERTIMESTAMP&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
FROM DBC.USERS&lt;br /&gt;
WHERE USERNAME=&#39;USER&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;i&gt;&lt;b&gt;&lt;br /&gt;
SQL to find how much Space left Per AMP in database&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;SELECT&lt;br /&gt;
VPROC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
,DATABASENAME&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
,ACCOUNTNAME&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
,MAXPERM&lt;br /&gt;
,MAXSPOOL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
,MAXTEMP&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;FROM DBC.DISKSPACE&lt;br /&gt;
WHERE DATABASENAME=&#39;EMP_DB&#39;&amp;nbsp;&amp;nbsp; ;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;SQL to finding USER Space&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;SELECT&lt;br /&gt;
&amp;nbsp;MAX(MAXPERM)&lt;br /&gt;
,MAX(MAXSPOOL)&lt;br /&gt;
,MAX(MAXTEMP)&lt;br /&gt;
&amp;nbsp;FROM DBC.DISKSPACE&lt;br /&gt;
WHERE DATABASENAME=&#39;USER&#39; ; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;SQL to find Space Skew in Tables in a Database&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;SELECT VPROC&lt;br /&gt;
,CAST(TABLENAME AS CHAR(20))&lt;br /&gt;
,CURRENTPERM&lt;br /&gt;
,PEAKPERM&lt;br /&gt;
FROM DBC.TABLESIZEV&lt;br /&gt;
WHERE DATABASENAME=&#39;USER&#39;&lt;br /&gt;
ORDER BY TABLENAME, VPROC;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;SQL to Find Table Skew&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;SELECT &lt;br /&gt;
TABLENAME, &lt;br /&gt;
SUM(CURRENTPERM) /(1024*1024) AS CURRENTPERM, &lt;br /&gt;
(100 - (AVG(CURRENTPERM)/MAX(CURRENTPERM)*100)) AS SKEWFACTOR &lt;br /&gt;
FROM &lt;br /&gt;
DBC.TABLESIZE &lt;br /&gt;
WHERE DATABASENAME=&lt;databsename&gt; &lt;br /&gt;
AND TABLENAME =&lt;tablename&gt; &lt;br /&gt;
GROUP BY 1; &lt;/tablename&gt;&lt;/databsename&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;SQL to Find AMP Skew&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;SELECT DATABASENAME&lt;br /&gt;
,TABLENAME&lt;br /&gt;
,VPROC&lt;br /&gt;
,CURRENTPERM&lt;br /&gt;
,PEAKPERM &lt;br /&gt;
FROM DBC.TABLESIZE &lt;br /&gt;
WHERE &lt;br /&gt;
DATABASENAME= &lt;dbname&gt;&lt;br /&gt;
AND &lt;br /&gt;
TABLENAME=&lt;tablename&gt; &lt;br /&gt;
ORDER BY VPROC ;&lt;/tablename&gt;&lt;/dbname&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;SQL to find number of rows per AMP for a Column&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;SELECT HASHAMP(HASHBUCKET( HASHROW(EMP_NO))) AS &quot;&quot;AMP&quot;&quot; , COUNT(*) &lt;br /&gt;
FROM EMP_TABLE&lt;br /&gt;
GROUP BY 1&lt;br /&gt;
ORDER BY 1;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;SQL to Identify&amp;nbsp; duplicate records&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;SELECT COLUMN1, COLUMN2, COLUMN3, COUNT(*)&lt;br /&gt;
FROM&lt;br /&gt;
DATABASE.TABLE&lt;br /&gt;
GROUP BY COLUMN1, COLUMN2, COLUMN3&lt;br /&gt;
HAVING COUNT(*) &amp;gt;1;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;SQL to Delete Duplicate records&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;CREATE TABLE TABLE1_BACKUP AS (SELECT * FROM TABLE1 QUALIFY ROW_NUMBER() OVER (PARTITION BY COLUMN1 ORDER BY COLUMN1 DESC )=1) WITH DATA; &lt;br /&gt;
DELETE FROM TABLE1;&lt;br /&gt;
INSERT INTO TABLE1 SELECT * FROM TABLE_BACKUP;&lt;/span&gt;&lt;br /&gt;
&lt;i&gt;&lt;b&gt;&lt;br /&gt;
SQL below to find TOP Databases by space occupied&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;SELECT &lt;br /&gt;
DatabaseName &lt;br /&gt;
,MAX(CurrentPerm) * (HASHAMP()+1)/1024/1024 AS USEDSPACE_IN_MB &lt;br /&gt;
FROM DBC.DiskSpace &lt;br /&gt;
GROUP BY DatabaseName&lt;br /&gt;
ORDER BY USEDSPACE_IN_MB DESC;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;SQL to find TOP Tables by space occupied&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;SELECT DATABASENAME&lt;br /&gt;
,TABLENAME &lt;br /&gt;
,SUM(CurrentPerm)/1024/1024 AS TABLESIZE_IN_MB &lt;br /&gt;
FROM DBC.TableSize &lt;br /&gt;
GROUP BY DATABASENAME,TABLENAME &lt;br /&gt;
ORDER BY TABLESIZE_IN_MB DESC;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;SQL to find out list of nodes&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;SELECT DISTINCT NODEID FROM DBC.RESUSAGESPMA&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;SQL to find Account Information&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;SELECT * FROM DBC.AccountInfoV ORDER BY 1;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwkbVjW1YpUIC_40iBNhJbHMIglBnLJxGbab0O_qfHQfKtAz9fvcgtcO7RaIGnJsCscAK308v3GFdhZ0G9OtpRGlgmnw_r2qK3d6ptpJcTzdpAGQk4HF6qUsR3s522_TLizzbJIRe7uM0/s1600/thanks.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwkbVjW1YpUIC_40iBNhJbHMIglBnLJxGbab0O_qfHQfKtAz9fvcgtcO7RaIGnJsCscAK308v3GFdhZ0G9OtpRGlgmnw_r2qK3d6ptpJcTzdpAGQk4HF6qUsR3s522_TLizzbJIRe7uM0/s1600/thanks.gif&quot; height=&quot;50&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/229524053221645133'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/229524053221645133'/><link rel='alternate' type='text/html' href='http://teradatawiki.blogspot.com/2014/04/Teradata-sql-commands.html' title='Top SQL Commands'/><author><name>Admin</name><uri>http://www.blogger.com/profile/03270946312373154797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCm0FeHTqy9tdxei5Vc3zsRwKvVPISdFMvIqK5NAbGyyTShzSA7INIQO8uEUGzBkkIDbVj7rdc7z1yqFbAQJMIryVb0gOqbYP1pgPjtpQ9v73YBxwSkukI_mgytcpbIA/s220/IMG_3457.jpg.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhy-sMIRvMexdEZc3_Hxmg7VCuTpcz6ZwUn94IH1TbV6qbRo0CaJxe9WM8CTD2tThi7BFIR2akrcIUl6imDKuDmNtLn6E1LtaDW4mznX9896cUJ3RQYF1kQ3FPJ9rG014MsQAGzvl6BkvA/s72-c/Screen+Shot+2014-04-21+at+9.13.44+PM.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-7106842514564860422.post-639127319298927259</id><published>2014-03-26T08:37:00.000+05:30</published><updated>2014-05-17T19:42:01.454+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="BASICS"/><category scheme="http://www.blogger.com/atom/ns#" term="Collect Statistics on a PPI"/><category scheme="http://www.blogger.com/atom/ns#" term="Collect statistics syntax"/><category scheme="http://www.blogger.com/atom/ns#" term="COLLECTSTATISTICS"/><category scheme="http://www.blogger.com/atom/ns#" term="Performance Tuning"/><category scheme="http://www.blogger.com/atom/ns#" term="Teradata V14 Statistics Enhancements"/><title type='text'>COLLECT STATISTICS </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;ssmainhide&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkqeSCgimvubpgIIaiZuv_CRkomADVq_DwAviTA0uTqtbNQQQfkbnARrCwtTP30Dwa8Ct2UjhVjvnL0LBBMksM8FcsQSpTF6xS_JnuRuBz-WXznvyo793_wGypLOqc5u8Wxui9MhGimcU/s1600/teradata_Collect_Statastics.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;teradata Collect Statistics&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkqeSCgimvubpgIIaiZuv_CRkomADVq_DwAviTA0uTqtbNQQQfkbnARrCwtTP30Dwa8Ct2UjhVjvnL0LBBMksM8FcsQSpTF6xS_JnuRuBz-WXznvyo793_wGypLOqc5u8Wxui9MhGimcU/s1600/teradata_Collect_Statastics.png&quot; height=&quot;123&quot; title=&quot;teradata Collect Statistics&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
The Purpose of&amp;nbsp; COLLECT STATISTICS is to gather and store demographic data for one or more columns or indices of a table or join index.In this process it collects data and stores the summary in the Data Dictionary (DD) inside USER DBC.&lt;br /&gt;
The optimizer uses this synopsis data to generate efficient table access and join plans.&lt;br /&gt;
&lt;br /&gt;
Below are the statistics will collect &lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;The number of rows in the table&lt;/li&gt;
&lt;li&gt;The average row size &lt;/li&gt;
&lt;li&gt;Information on all Indexes in which statistics were collected&lt;/li&gt;
&lt;li&gt;The range of values for the column(s) in which statistics were collected&lt;/li&gt;
&lt;li&gt;The number of rows per value for the column(s) in which statistics were collected&lt;/li&gt;
&lt;li&gt;The number of NULLs for the column(s) in which statistics were collected&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;u&gt;&lt;span style=&quot;color: purple;&quot;&gt;&lt;b&gt;What to COLLECT STATISTICS On?&lt;/b&gt;&lt;/span&gt;&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
Do NOT COLLECT Statistics on all columns and indexes because it takes too much space.&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Primary Index of a Join Index &lt;/li&gt;
&lt;li&gt;Secondary Indexes defined on any join index&lt;/li&gt;
&lt;li&gt;Non-indexed columns used in joins &lt;/li&gt;
&lt;li&gt;The Unique Primary Index of small tables (less than 1,000 rows per AMP)&lt;/li&gt;
&lt;li&gt;All Non-Unique Primary Indexes and All Non-Unique Secondary Indexes&lt;/li&gt;
&lt;li&gt;Join index columns that frequently appear on any additional join index columns that frequently appear in WHERE search conditions&lt;/li&gt;
&lt;li&gt;The Unique Primary Index of small tables (less than 1,000 rows per AMP)&lt;/li&gt;
&lt;li&gt;Columns that frequently appear in WHERE search conditions or in the WHERE clause of joins&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;i&gt;&lt;b&gt;Syntax for COLLECT STATISTICS&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;COLLECT STATISTICS on &lt;tablename&gt; COLUMN &lt;column name=&quot;&quot;&gt; ;&lt;br /&gt;
COLLECT STATISTICS on &lt;tablename&gt; INDEX (&lt;column name=&quot;&quot; s=&quot;&quot;&gt;);&lt;/column&gt;&lt;/tablename&gt;&lt;/column&gt;&lt;/tablename&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Examples for a better Understanding&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;COLLECT STATISTICS on Emp_Table ;&lt;br /&gt;
COLLECT STATISTICS on Emp_Table COLUMN Dept_no ;&lt;br /&gt;
COLLECT STATISTICS on Emp_Table COLUMN(Emp_no, Dept_no);&lt;br /&gt;
COLLECT STATISTICS on Emp_Table INDEX Emp_no ;&lt;br /&gt;
COLLECT STATISTICS on Emp_Table INDEX (First_name, Last_name);&lt;/span&gt;&lt;br /&gt;
&lt;u&gt;&lt;span style=&quot;color: purple;&quot;&gt;&lt;b&gt;&lt;br /&gt;
The New Teradata V14 Way to Collect Statistics&lt;/b&gt;&lt;/span&gt;&lt;/u&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;br /&gt;
COLLECT STATISTICS COLUMN(First_Name, Last_Name)&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,COLUMN(First_Name) &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,COLUMN(Dept_No) ON Employee_Table;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
With the latest approach, Only a single table scan is required instead multiple table scan like old approach.&lt;br /&gt;
&lt;br /&gt;
Teradata keeps all Collect Statistics information in DBC in the Data Dictionary tables. Those are&lt;/div&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;i&gt;DBC.Indexes (for multi-column indexes only)&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;DBC.TVFields (for all columns and single column indexes)&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;DBC.StatsTbl (Teradata V14 and beyond)&lt;/i&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;u&gt;&lt;span style=&quot;color: purple;&quot;&gt;&lt;b&gt;Collect Statistics on a PPI Table on the Partition&lt;/b&gt;&lt;/span&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;COLLECT STATISTICS on Order_Table_PPI COLUMN PARTITION&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The main reasons to collect stats on Partiton are&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;PE will give better plan for PPI tables&lt;/li&gt;
&lt;li&gt;It helps on&amp;nbsp; Partition Elimination on Range Queries.&lt;/li&gt;
&lt;li&gt;Mainly helpful when a table has a lot of empty partitions.&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;u&gt;&lt;b&gt;&lt;span style=&quot;color: purple;&quot;&gt;Teradata V14 Statistics Enhancements&lt;/span&gt;&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
1) There is a &lt;i&gt;&lt;b&gt;SUMMARY&lt;/b&gt;&lt;/i&gt; option to collect table-level statistics&lt;br /&gt;
Table-level statistics known as &quot;summary statistics&quot; are collected whenever column or index statistics are collected. &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;SHOW SUMMARY STATISTICS VALUES ON Employee_Table;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
One critical advantage is that the optimizer now uses summary stats to get the most up-to-date row count from the table in order to provide more accurate extrapolations&lt;br /&gt;
&lt;br /&gt;
2)&lt;i&gt;&lt;b&gt; SYSTEM SAMPLE &lt;/b&gt;&lt;/i&gt;option allows the system to determine the sampled system percentage.&lt;br /&gt;
SAMPLE n PERCENT allows you to specify sampling at the individual statistics collection level rather than at the system level&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;COLLECT STATISTICS&amp;nbsp;&amp;nbsp;&amp;nbsp; USING Sample 20 Percent&amp;nbsp;&amp;nbsp; COLUMN (Last_Name) ON Employee_Table;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
3) Statistics are stored in DBC.StatsTbl to reduce access contention and improve performance.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;
4) New views DBC.StatsV, DBC.ColumnStatsV, DBC.MultiColumnStatsV, and IndexStatsV.&lt;br /&gt;
&lt;br /&gt;
5) SHOW STATISTICS statement reports detailed statistics in plain text or XML formatting.&lt;br /&gt;
&lt;br /&gt;
6) &lt;i&gt;&lt;b&gt;MaxValueLength&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
Teradata only placed the first 16 bytes in the statistics before Version 14 but now the default is 25 bytes.&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;COLLECT STATISTICS USING MAXVALUELENGTH 50&amp;nbsp; COLUMN (Item_Name)&amp;nbsp; ON Shipping_Table &lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
7) &lt;i&gt;&lt;b&gt;MaxIntervals&lt;/b&gt;&lt;/i&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Whenever you collected statistics, Teradata did a full table scan on the values, sorted them, and then placed them into 200 intervals. Now, the default is 250 intervals&lt;br /&gt;
&lt;br /&gt;
8)&lt;i&gt;&lt;b&gt;Expressions&lt;/b&gt;&lt;/i&gt; can now be specified in COLLECT STATS statements&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;COLLECT STATISTICS USING SYSTEM SAMPLE COLUMN (EXTRACT(MONTH FROM Order_Date), Order_Total) AS Month_Plus_Total ON Order_Table;&lt;br /&gt;
&lt;/span&gt;Also use Substr(), MOD, CONCATENATION, Format Conversion expressions like Uppercase, Lowercase, Data type Conversions, CASE-Expressions, BEGIN and END expressions of PERIOD types.&lt;br /&gt;
&lt;br /&gt;
9)&lt;i&gt;&lt;b&gt;AutoStats&lt;/b&gt;&lt;/i&gt; feature&lt;br /&gt;
Teradata V14.10 Autostats identifies and collects missing statistics needed and detects stale statistics for refreshing. If statistics are not being used by optimizer, they will be removed.&lt;br /&gt;
A new repository of a system supplied database named &lt;i&gt;&lt;b&gt;TDSTATS&lt;/b&gt;&lt;/i&gt; stores metadata for all stats collections. This is created by a new process called &lt;i&gt;&lt;b&gt;DIPSTATS&lt;/b&gt;&lt;/i&gt;.&lt;br /&gt;
&lt;br /&gt;
10) External stored procedures (XSPs) perform the stats management process.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
These are the latest enhancements of COLLECT STATISTICS.&lt;/div&gt;
&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/639127319298927259'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/639127319298927259'/><link rel='alternate' type='text/html' href='http://teradatawiki.blogspot.com/2014/03/collect-statistics-in-teradata.html' title='COLLECT STATISTICS '/><author><name>Admin</name><uri>http://www.blogger.com/profile/03270946312373154797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCm0FeHTqy9tdxei5Vc3zsRwKvVPISdFMvIqK5NAbGyyTShzSA7INIQO8uEUGzBkkIDbVj7rdc7z1yqFbAQJMIryVb0gOqbYP1pgPjtpQ9v73YBxwSkukI_mgytcpbIA/s220/IMG_3457.jpg.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkqeSCgimvubpgIIaiZuv_CRkomADVq_DwAviTA0uTqtbNQQQfkbnARrCwtTP30Dwa8Ct2UjhVjvnL0LBBMksM8FcsQSpTF6xS_JnuRuBz-WXznvyo793_wGypLOqc5u8Wxui9MhGimcU/s72-c/teradata_Collect_Statastics.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-7106842514564860422.post-4261738798732087572</id><published>2014-03-21T21:48:00.000+05:30</published><updated>2014-03-23T10:27:40.924+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Functions"/><category scheme="http://www.blogger.com/atom/ns#" term="Hash Functions"/><category scheme="http://www.blogger.com/atom/ns#" term="HASHAMP"/><category scheme="http://www.blogger.com/atom/ns#" term="HASHBAKAMP"/><category scheme="http://www.blogger.com/atom/ns#" term="HASHBUCKET"/><category scheme="http://www.blogger.com/atom/ns#" term="HASHROW"/><category scheme="http://www.blogger.com/atom/ns#" term="Teradata HASH Functions"/><title type='text'>HASH Functions</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;ssmainhide&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjd2__bg8ZwUJLnc75tzMRfkue0pcHjlCz8Kp4Bv85twfKhIgqmMZ2YRMNwoP_iKwTpCjUmKEnlirmjMF5v4IBMErxSiKC7bx8SIZhezVNwwvRtZViJnSViwb74afiXLf4WF3oWfsNgl6s/s1600/TERADATA-HASH-FUNCTIONS.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjd2__bg8ZwUJLnc75tzMRfkue0pcHjlCz8Kp4Bv85twfKhIgqmMZ2YRMNwoP_iKwTpCjUmKEnlirmjMF5v4IBMErxSiKC7bx8SIZhezVNwwvRtZViJnSViwb74afiXLf4WF3oWfsNgl6s/s1600/TERADATA-HASH-FUNCTIONS.png&quot; height=&quot;125&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
There are four types of hashing functions are available in Teradata.&lt;br /&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;HASHROW&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;HASHAMP&lt;/li&gt;
&lt;li&gt;HASHBUCKET&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;HASHBAKAMP&lt;/li&gt;
&lt;/ol&gt;
&lt;u&gt;&lt;b&gt;HASHROW Function&lt;/b&gt;&amp;nbsp;&lt;/u&gt;&lt;br /&gt;
Basic Synatx for HASHROW is&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;HASHROW( [ &amp;lt; data-column-value &amp;gt; […, &amp;lt; data-column-value &amp;gt;…] ] )&lt;data-column-value&gt;&lt;data-column-value&gt;&lt;/data-column-value&gt;&lt;/data-column-value&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;
&lt;b&gt;Example&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;br /&gt;
SELECT&amp;nbsp;&amp;nbsp;&amp;nbsp; HASHROW (NULL)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AS NULL_HASH&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; ,HASHROW(&#39;Anil&#39;)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AS Name_HASH&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,HASHROW()&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AS NO_HASH ;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEim6dDeG2zG5FlFQpG6HRuGCoBX6A_ByAuog0FUe0E0NdGUTwNneEvtJuoeO5hmOARnyHREcFEyb7li6y2N0V-mhzvUJke7qp20UbKoKrrGLKJbzHgGCx4W-qQwbd0RhwX1e9fARkM5Giw/s1600/HASHROW.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEim6dDeG2zG5FlFQpG6HRuGCoBX6A_ByAuog0FUe0E0NdGUTwNneEvtJuoeO5hmOARnyHREcFEyb7li6y2N0V-mhzvUJke7qp20UbKoKrrGLKJbzHgGCx4W-qQwbd0RhwX1e9fARkM5Giw/s1600/HASHROW.PNG&quot; height=&quot;105&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;The Query will give same results if you ran again and again.&lt;/li&gt;
&lt;li&gt;The HASHROW function produces the 32-bit binary Row Hash that is stored as part of the data row.&lt;/li&gt;
&lt;li&gt;It returns maximum of 4,294,967,295 unique values. &lt;/li&gt;
&lt;li&gt;The values range from 0 to FFFFFFFF.&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
General example is&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;SELECT HASHROW(Emp_no) AS HASHROW_VALUE FROM Emp_table; &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;
&lt;b&gt;Result:&lt;/b&gt;&lt;br /&gt;
HASHROW_VALUE&lt;br /&gt;
------------&lt;br /&gt;
717A8724&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;b&gt;HASHBUCKET Function&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
Basic Syntax for HASHBUCKET is&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;HASHBUCKET( [ &lt;row-hash-value&gt; ] )&lt;/row-hash-value&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;SELECT HASHBUCKET(NULL) AS NULL_BUCKET&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,HASHBUCKET()&amp;nbsp;&amp;nbsp;&amp;nbsp; AS NO_BUCKET;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjyIn3y9s358gZj1ybpqdN5hP4aHrskIZZAeLbHqIE2jivDuMuBdQ6WLvzK_dxHlPc1fZUyPF7B-MGY7nYXIVHbOWaqcVE_PYjXuwgRv56kIqVsODqxaXAj98nLxC6-EoBmTRM4vBGXKc/s1600/HASHBUK.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjyIn3y9s358gZj1ybpqdN5hP4aHrskIZZAeLbHqIE2jivDuMuBdQ6WLvzK_dxHlPc1fZUyPF7B-MGY7nYXIVHbOWaqcVE_PYjXuwgRv56kIqVsODqxaXAj98nLxC6-EoBmTRM4vBGXKc/s1600/HASHBUK.PNG&quot; height=&quot;115&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span id=&quot;goog_684050156&quot;&gt;&lt;/span&gt;&lt;span id=&quot;goog_684050157&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;The HASHBUCKET function produces 16bit binary Hash Bucket&amp;nbsp; that is used with the Hash Map to determine the AMP that should store and retrieve the data row&lt;/li&gt;
&lt;li&gt;The values range from 0 to 1,048,575,not counting the NULL as a potential result.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;i&gt;General Example&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;SELECT COUNT(*) AS NBR_ROWS&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,HASHBUCKET(HASHROW (Emp_No)) AS Bucket_No&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FROM Emp_Table&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GROUP BY 2 ;&lt;/span&gt;&lt;br /&gt;
&lt;style type=&quot;text/css&quot;&gt;
 table.tableizer-table {
 border: 1px solid #CCC; font-family: Arial, Helvetica, sans-serif
 font-size: 12px;
} 
.tableizer-table td {
 padding: 4px;
 margin: 3px;
 border: 1px solid #ccc;
}
.tableizer-table th {
 background-color: #8C1010; 
 color: #FFF;
 font-weight: bold;
}
&lt;/style&gt;&lt;br /&gt;
&lt;table class=&quot;tableizer-table&quot;&gt;&lt;tbody&gt;
&lt;tr class=&quot;tableizer-firstrow&quot;&gt;&lt;th&gt;NBR_ROWS&amp;nbsp;&lt;/th&gt;&lt;th&gt;Bucket_No&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&amp;nbsp;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;388963&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;1560021&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;683238&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;53025&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;1877998&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;795490&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;410221&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;1048185&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;804626&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;317398&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;b&gt;HASHAMP Function&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
Basic Synatx for HASHAMP is&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;HASHAMP( &lt;hash-bucket&gt; )&lt;/hash-bucket&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Example&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;SELECT HASHAMP(NULL) AS NULL_BUCKET&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; ,HASHAMP ()&amp;nbsp;&amp;nbsp;&amp;nbsp; AS NO_BUCKET;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKBzL18uI1jmWwniwN-D6HxgGEZG4pcRWyMcpKu2LP8PtYXBQvj381ZOJzKcLqxOcpG96vBi634sDKqAAwfydQrriIQQMK5kiKbQVuZxSWD6wv7PZs5aBPD3kkFrIMKiMFbCmF9tSnXeg/s1600/HASHAMP.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKBzL18uI1jmWwniwN-D6HxgGEZG4pcRWyMcpKu2LP8PtYXBQvj381ZOJzKcLqxOcpG96vBi634sDKqAAwfydQrriIQQMK5kiKbQVuZxSWD6wv7PZs5aBPD3kkFrIMKiMFbCmF9tSnXeg/s1600/HASHAMP.PNG&quot; height=&quot;132&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;The HASHAMP function returns the identification number of the primary AMP for any Hash Bucket number.&lt;/li&gt;
&lt;li&gt;When no value is passed to the HASHAMP function, it returns a number that is one less than the number of AMPs in the current system configuration&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;&lt;i&gt;General Example&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;SELECT Emp_no&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,HASHBUCKET(HASHROW(Emp_no)) AS Bucket_No&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,HASHAMP(HASHBUCKET(HASHROW(Emp_no))) AS AMP_No&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM Emp_Table&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ORDER BY 1;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table class=&quot;tableizer-table&quot;&gt;&lt;tbody&gt;
&lt;tr class=&quot;tableizer-firstrow&quot;&gt;&lt;th&gt;Emp_no&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/th&gt;&lt;th&gt;Bucket_No&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/th&gt;&lt;th&gt;AMP_No&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;1777&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;973955&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;120&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;4972&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;93325&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;41&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;7524&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;540321&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;56&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;21048&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;957958&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;69&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;21048&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;957958&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;69&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;24402&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;707988&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;65&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;26346&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;9707&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;71&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;27470&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;471190&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;15&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;29157&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;613408&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;25&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;29775&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;452863&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;120&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;b&gt;HASHBAKAMP Function&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
Basic Syntax for HASHBAKAMP is&lt;span style=&quot;color: purple;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: purple;&quot;&gt;HASHBAKAMP ( &lt;hash-bucket&gt; )&lt;/hash-bucket&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;
&lt;b&gt;Example&lt;/b&gt;&lt;span style=&quot;color: magenta;&quot;&gt;SELECT HASHBAKAMP (NULL) AS NULL_BUCKET&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,HASHBAKAMP () AS NO_BUCKET;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJeq4Y36HmP_t-w00Ft2UisYsPbRvNRYrDsRLCaLSNPPkgoElp07Szm-utl4xeNxUDuHGiuTe7kmIOwYM6e03pFmKpTm5HMmMrNJyc2_-HuC5z9WT3fcxoKvBuhoW3JCv7Lfq6KW5rhRc/s1600/HASHBACKAMP.PNG&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJeq4Y36HmP_t-w00Ft2UisYsPbRvNRYrDsRLCaLSNPPkgoElp07Szm-utl4xeNxUDuHGiuTe7kmIOwYM6e03pFmKpTm5HMmMrNJyc2_-HuC5z9WT3fcxoKvBuhoW3JCv7Lfq6KW5rhRc/s1600/HASHBACKAMP.PNG&quot; height=&quot;111&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The HASHBAKAMP function returns the identification number of the Fallback AMP for any Hash Bucket number&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;General Example&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;SELECT Emp_no&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,HASHBUCKET(HASHROW(Emp_no)) AS Bucket_No&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,HASHBAKAMP(HASHAMP(HASHBUCKET(HASHROW(Emp_no)))) AS BAK_AMP_No&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM Emp_Table&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ORDER BY 1;&lt;/span&gt;&lt;br /&gt;
&lt;style type=&quot;text/css&quot;&gt;
 table.tableizer-table {
 border: 1px solid #CCC; font-family: Arial, Helvetica, sans-serif
 font-size: 12px;
} 
.tableizer-table td {
 padding: 4px;
 margin: 3px;
 border: 1px solid #ccc;
}
.tableizer-table th {
 background-color: #8C1010; 
 color: #FFF;
 font-weight: bold;
}
&lt;/style&gt;&lt;br /&gt;
&lt;table class=&quot;tableizer-table&quot;&gt;&lt;tbody&gt;
&lt;tr class=&quot;tableizer-firstrow&quot;&gt;&lt;th&gt;Emp_no&lt;/th&gt;&lt;th&gt;Bucket_No&lt;/th&gt;&lt;th&gt;BAK_AMP_No&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;2226&lt;/td&gt;&lt;td&gt;439931&lt;/td&gt;&lt;td&gt;88&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;6467&lt;/td&gt;&lt;td&gt;977645&lt;/td&gt;&lt;td&gt;94&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;24115&lt;/td&gt;&lt;td&gt;222558&lt;/td&gt;&lt;td&gt;92&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;24402&lt;/td&gt;&lt;td&gt;707988&lt;/td&gt;&lt;td&gt;94&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;25316&lt;/td&gt;&lt;td&gt;277218&lt;/td&gt;&lt;td&gt;94&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;25499&lt;/td&gt;&lt;td&gt;290771&lt;/td&gt;&lt;td&gt;95&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;29405&lt;/td&gt;&lt;td&gt;528628&lt;/td&gt;&lt;td&gt;93&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;40115&lt;/td&gt;&lt;td&gt;944038&lt;/td&gt;&lt;td&gt;95&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;40117&lt;/td&gt;&lt;td&gt;892602&lt;/td&gt;&lt;td&gt;86&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;40564&lt;/td&gt;&lt;td&gt;410014&lt;/td&gt;&lt;td&gt;85&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/4261738798732087572'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/4261738798732087572'/><link rel='alternate' type='text/html' href='http://teradatawiki.blogspot.com/2014/03/TERADATA-HASH-FUNCTIONS.html' title='HASH Functions'/><author><name>Admin</name><uri>http://www.blogger.com/profile/03270946312373154797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCm0FeHTqy9tdxei5Vc3zsRwKvVPISdFMvIqK5NAbGyyTShzSA7INIQO8uEUGzBkkIDbVj7rdc7z1yqFbAQJMIryVb0gOqbYP1pgPjtpQ9v73YBxwSkukI_mgytcpbIA/s220/IMG_3457.jpg.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjd2__bg8ZwUJLnc75tzMRfkue0pcHjlCz8Kp4Bv85twfKhIgqmMZ2YRMNwoP_iKwTpCjUmKEnlirmjMF5v4IBMErxSiKC7bx8SIZhezVNwwvRtZViJnSViwb74afiXLf4WF3oWfsNgl6s/s72-c/TERADATA-HASH-FUNCTIONS.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-7106842514564860422.post-1551626241671354359</id><published>2014-03-19T21:27:00.001+05:30</published><updated>2014-05-17T19:42:15.436+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="BASICS"/><category scheme="http://www.blogger.com/atom/ns#" term="Performance Tuning"/><category scheme="http://www.blogger.com/atom/ns#" term="Teradata EXPLAIN Plan"/><category scheme="http://www.blogger.com/atom/ns#" term="What is explain in Teradata"/><title type='text'>Explain Plan</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;ssmainhide&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLRg1DPH_YAYxTo35Xo4ejawB1g9bltfP8HdLdRD0dWPZlDhv0Uzov6SRGWmCNsjPgyGtzxLb29yuzsHEiPF5QrNi08ultDphZ41g78SizAbvpItuj2r8W08p_CUZwBd1UgdioMPuzb-o/s1600/Teradata_explain_plan.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Teradata_explain_plan&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLRg1DPH_YAYxTo35Xo4ejawB1g9bltfP8HdLdRD0dWPZlDhv0Uzov6SRGWmCNsjPgyGtzxLb29yuzsHEiPF5QrNi08ultDphZ41g78SizAbvpItuj2r8W08p_CUZwBd1UgdioMPuzb-o/s1600/Teradata_explain_plan.png&quot; height=&quot;124&quot; title=&quot;Teradata_explain_plan&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
What is EXPLAIN?&lt;br /&gt;
EXPLAIN statement is the Parsing Engines (PE’s) plan to the AMPs.A step-by-step&lt;br /&gt;
analysis of the queries being executed in the database.&lt;br /&gt;
The EXPLAIN facility provides an &quot;English&quot; translation of the plan the SQL Optimizer develops to service a request.&lt;br /&gt;
&lt;br /&gt;
The EXPLAIN is an excellent facility for the following activities:&lt;br /&gt;
• Determining Access Paths&lt;br /&gt;
• Validating the use of indexes&lt;br /&gt;
• To determine locking profiles&lt;br /&gt;
• Showing Triggers and Join Index access&lt;br /&gt;
• Estimate the query runtime&lt;br /&gt;
&lt;br /&gt;
Sample Syntax for Explain is. &lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;b&gt;EXPLAIN Select Emp_ID, Emp_Name from Emp_Table ;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
If we pass an explain command in front of a query statement or Simply Press &lt;b&gt;F6&lt;/b&gt; key, there are a several estimated confidence messages that the optimizer will relay to the user is &lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;High Confidence &lt;/b&gt;&lt;/i&gt;- Statistics available on an Index or Column.&lt;br /&gt;
&lt;i&gt;&lt;b&gt;Low Confidence &lt;/b&gt;&lt;/i&gt;- Random sampling of INDEX, or Statistics available butAND/OR condition exists.&lt;br /&gt;
&lt;i&gt;&lt;b&gt;No Confidence&lt;/b&gt;&lt;/i&gt; - Random sampling based on AMP row count. No statistics are collected.&lt;br /&gt;
&lt;br /&gt;
Understanding the EXPLAIN Terminology you should know the Keywords.&lt;br /&gt;
&lt;style type=&quot;text/css&quot;&gt;
 table.tableizer-table {
 border: 1px solid #CCC; font-family: Arial, Helvetica, sans-serif
 font-size: 11px;
} 
.tableizer-table td {
 padding: 4px;
 margin: 3px;
 border: 1px solid #ccc;
}
.tableizer-table th {
 background-color: #104F8C; 
 color: #FFF;
 font-weight: bold;
}
&lt;/style&gt;&lt;br /&gt;
&lt;table class=&quot;tableizer-table&quot;&gt;&lt;tbody&gt;
&lt;tr class=&quot;tableizer-firstrow&quot;&gt;&lt;th&gt;Keyword&lt;/th&gt;&lt;th&gt;Explanation&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Locking Pseudo Table&lt;/td&gt;&lt;td&gt;Serial lock on a symbolic table. Every table has one. Used to prevent deadlocks situations between users.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Locking table for&lt;/td&gt;&lt;td&gt;Indicates that an ACCESS, READ, WRITE, or EXCLUSIVE lock has been placed on the table&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Locking rows for &lt;type&gt;&lt;/type&gt;&lt;/td&gt;&lt;td&gt;Indicates that an ACCESS, READ, or WRITE, lock is placed on rows read or written&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Do an ABORT test&lt;/td&gt;&lt;td&gt;Guarantees a transaction is not in progress for this user&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;All AMPs retrieve&lt;/td&gt;&lt;td&gt;All AMPs are receiving the AMP steps and are involved in providing the answer set&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;By way of an all rows scan&lt;/td&gt;&lt;td&gt;Rows are read sequentially on all AMPs&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;By way of primary index&lt;/td&gt;&lt;td&gt;Rows are read using the Primary index column(s)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;By way of index number&lt;/td&gt;&lt;td&gt;Rows are read using the Secondary index – number from HELP INDEX&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;BMSMS&lt;/td&gt;&lt;td&gt;Bit Map Set Manipulation Step, alternative direct access technique when multiple NUSI columns are referenced in the WHERE clause&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Residual conditions&lt;/td&gt;&lt;td&gt;WHERE clause conditions, other than those of a join&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Eliminating duplicate rows&lt;/td&gt;&lt;td&gt;Providing unique values, normally result of DISTINCT, GROUP BY or subquery&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Where unknown comparison will be ignored&lt;/td&gt;&lt;td&gt;Indicates that NULL values will not compare to a TRUE or FALSE. Seen in a subquery using NOT IN or NOT = ALL because no rows will be returned on ignored comparison.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Nested join&lt;/td&gt;&lt;td&gt;The fastest join possible. It uses a UPI to retrieve a single row after using a UPI or a USI in the WHERE to reduce the join to a single row.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Merge join&lt;/td&gt;&lt;td&gt;Rows of one table are matched to the other table on common domain columns after being sorted into the same sequence, normally Row Hash&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Product join&lt;/td&gt;&lt;td&gt;Rows of one table are matched to all rows of another table with no concern for domain match&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;ROWID join&lt;/td&gt;&lt;td&gt;A very fast join. It uses the ROWID of a UPI to retrieve a single row after using a UPI or a USI in the WHERE to reduce the join to a single row.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Duplicated on all AMPs&lt;/td&gt;&lt;td&gt;Participating rows for the table (normally smaller table) of a join are duplicated on all AMPS&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Hash redistributed on all AMPs&lt;/td&gt;&lt;td&gt;Participating rows of a join are hashed on the join column and sent to the same AMP that stores the matching row of the table to join&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;SMS&lt;/td&gt;&lt;td&gt;Set Manipulation Step, result of an INTERSECT, UNION, EXCEPT or MINUS operation&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Last use&lt;/td&gt;&lt;td&gt;SPOOL file is no longer needed after the step and space is released&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Built locally on the AMPs&lt;/td&gt;&lt;td&gt;As rows are read, they are put into SPOOL on the same AMP&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Aggregate Intermediate Results computed locally&lt;/td&gt;&lt;td&gt;The aggregation values are all on the same AMP and therefore no need to redistribute them to work with rows on other AMPs&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Aggregate Intermediate Results computed globally&lt;/td&gt;&lt;td&gt;The aggregation values are not all on the same AMP and must be redistributed on one AMP, to accompany the same value with from the other AMPs&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
Below are the some examples&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;Example for FULL TABLE SCAN&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;EXPLAIN SELECT * FROM Emp_Table;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
1. First, we lock a distinct SQL_CLASS.&quot;pseudo table&quot; for read on a RowHash to prevent global deadlock for SQL_CLASS.Emp_Table.&lt;br /&gt;
&lt;br /&gt;
2. Next, we lock SQL_CLASS.Emp_Table for read.&lt;br /&gt;
&lt;br /&gt;
3. We do an &lt;span style=&quot;color: red;&quot;&gt;all-AMPs RETRIEVE&lt;/span&gt; step from SQL_CLASS.Emp_Table by way of an &lt;span style=&quot;color: red;&quot;&gt;all-rows scan &lt;/span&gt;with no residual conditions into Spool 1 (group_amps), which is built locally on the AMPs. The size of Spool 1 is estimated with low confidence to be 6 rows (342 bytes). The estimated time for this step is 0.03 seconds.&lt;br /&gt;
&lt;br /&gt;
4. Finally, we send out an END TRANSACTION step to all AMPs involved in processing the request.&lt;br /&gt;
-&amp;gt; The contents of Spool 1 are sent back to the user as the result of statement 1. The total estimated time is 0.03 seconds.&lt;br /&gt;
&lt;br /&gt;
If you see all-AMPs RETRIEVE by way of an all-rows scan in your plan, that means teradata is doing a Full Table Scan. So it is reading every row in the table.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&lt;br /&gt;
Explain Example – Unique Primary Index (UPI)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&lt;span style=&quot;color: magenta;&quot;&gt;EXPLAIN SELECT * FROM Emp_Table WHERE Emp_No = 123000;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&amp;nbsp;1. First, we do a &lt;span style=&quot;color: red;&quot;&gt;single-AMP RETRIEVE&lt;/span&gt; step from SQL_CLASS.Emp_Table by way of the &lt;span style=&quot;color: red;&quot;&gt;unique primary index &lt;/span&gt;&quot;SQL_CLASS.Emp_Table.Emp_No = 123000&quot; with no residual conditions. The estimated time for this step is 0.01 seconds.&lt;br /&gt;
-&amp;gt; The row is sent directly back to the user as the result of statement 1. The total estimated time is 0.01 seconds.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
In the Emp_table, Emp_no is the Unique Primary Index. So USI used in where clause. So it gives Single-AMP retrieve by way of the Unique Primary Index. This is the fastest query!&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Explain Example – Non-Unique Primary Index (NUPI)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&amp;nbsp;EXPLAIN SELECT * FROM Sales_Table WHERE Product_ID = 1000;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&lt;i&gt;1. First, we do a &lt;span style=&quot;color: red;&quot;&gt;single-AMP RETRIEVE&lt;/span&gt; step from SQL_CLASS.Sales_Table by way of the &lt;span style=&quot;color: red;&quot;&gt;primary index&lt;/span&gt; &quot;SQL_CLASS.Sales_Table.Product_ID = 1000&quot; with no residual conditions into Spool 1 (one-amp), which is built locally on that AMP. The size of Spool 1 is estimated with low confidence to be 2 rows (66 bytes). The estimated time for this step is 0.02 seconds.&lt;br /&gt;
-&amp;gt; The contents of Spool 1 are sent back to the user as the result of statement 1. The total estimated time is 0.02 seconds.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;Explain Example – Unique Seconday Index (USI)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;Explain SELECT * FROM Emp_Table WHERE&lt;br /&gt;
First_name=&quot;Sachin&quot; and &lt;br /&gt;
Last_name=&quot;&quot;tendulkar&quot;&lt;/span&gt;&lt;br /&gt;
&lt;i&gt;1. First, we do a &lt;span style=&quot;color: red;&quot;&gt;two-AMP RETRIEVE&lt;/span&gt; step from SQL_CLASS.Emp_Table by way of &lt;span style=&quot;color: red;&quot;&gt;unique index&lt;/span&gt; # 12 &quot;SQL_CLASS.Emp_Table.Last_name = &#39;tendulkar &#39; , SQL_CLASS.Emp_Table.First_name = &#39;Sachin&#39;&quot; with no residual conditions. The estimated time for this step is 0.01 seconds.&lt;br /&gt;
-&amp;gt;The row is sent directly back to the user as the result of statement 1. The total estimated time is 0.01 seconds.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Explain Example – Redistributed to All-AMPs&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&amp;nbsp; EXPLAIN SELECT Emp.*, Dept**&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM Emp_Table as Emp&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INNER JOIN&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Department_Table as Dept&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ON Emp.Dept_No = Dept.Dept_No;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&lt;i&gt;4. We do an &lt;span style=&quot;color: red;&quot;&gt;all-AMPs RETRIEVE &lt;/span&gt;step from SQL_CLASS.Emp by way of an all-rows scan with a condition of (&quot;NOT (SQL_CLASS.Emp.Dept_No IS NULL)&quot;) into Spool 2 (all_amps), which is &lt;span style=&quot;color: red;&quot;&gt;redistributed&lt;/span&gt; by the &lt;span style=&quot;color: red;&quot;&gt;hash code &lt;/span&gt;of (SQL_CLASS.Emp.&lt;span style=&quot;color: red;&quot;&gt;Dept_No&lt;/span&gt;) to all AMPs. Then we do a SORT to order Spool 2 by row hash. The size of Spool 2 is estimated with low confidence to be 6 rows (294 bytes). The estimated time for this step is 0.01 seconds.&lt;br /&gt;
&amp;nbsp;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;5 We do an all-AMPs JOIN step from SQL_CLASS.Dept by way of a RowHash match scan, which is joined to Spool 2 (Last Use) by way of a RowHash match scan. SQL_CLASS.Dept and Spool 2 are joined using a merge join, with a join condition of (&quot;Dept_No = SQL_CLASS.Dept.Dept_No&quot;).&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Hope you understood about EXPLAIN.&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/1551626241671354359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/1551626241671354359'/><link rel='alternate' type='text/html' href='http://teradatawiki.blogspot.com/2014/03/Teradata-EXPLAIN-Plan.html' title='Explain Plan'/><author><name>Admin</name><uri>http://www.blogger.com/profile/03270946312373154797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCm0FeHTqy9tdxei5Vc3zsRwKvVPISdFMvIqK5NAbGyyTShzSA7INIQO8uEUGzBkkIDbVj7rdc7z1yqFbAQJMIryVb0gOqbYP1pgPjtpQ9v73YBxwSkukI_mgytcpbIA/s220/IMG_3457.jpg.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLRg1DPH_YAYxTo35Xo4ejawB1g9bltfP8HdLdRD0dWPZlDhv0Uzov6SRGWmCNsjPgyGtzxLb29yuzsHEiPF5QrNi08ultDphZ41g78SizAbvpItuj2r8W08p_CUZwBd1UgdioMPuzb-o/s72-c/Teradata_explain_plan.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-7106842514564860422.post-9155376054268360758</id><published>2014-02-08T17:03:00.002+05:30</published><updated>2014-02-28T21:10:56.788+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="CUBE Function"/><category scheme="http://www.blogger.com/atom/ns#" term="Functions"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>CUBE Function</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;ssmainhide&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2ao4dWgB3FyDKqi2HZVUREisYovtg52RTD5RQg1BIgxjcpJ8EAf2lJjSFf3ke-pE3AqAIQCGr4Ev3pxlVlzzKAikgVO81ERZcfVq9n7M1AkpCaLNR5zbXfRl-n20Igu9ORsdyTMNBWxI/s1600/Teradata_cube-function.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Teradata Cube Function&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2ao4dWgB3FyDKqi2HZVUREisYovtg52RTD5RQg1BIgxjcpJ8EAf2lJjSFf3ke-pE3AqAIQCGr4Ev3pxlVlzzKAikgVO81ERZcfVq9n7M1AkpCaLNR5zbXfRl-n20Igu9ORsdyTMNBWxI/s1600/Teradata_cube-function.png&quot; height=&quot;131&quot; title=&quot;Teradata Cube Function&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
I hope you all familiar with &lt;a href=&quot;http://www.teradatawiki.net/2014/01/Teradata-rollup-function.html&quot;&gt;ROLLUP Function &lt;/a&gt;now. If not please read before get into CUBE Function.&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;The CUBE function can be called as Superset of RollUP function.&lt;/li&gt;
&lt;li&gt;Because It returns the same result set as ROLLUP along with provides some additional information.&lt;/li&gt;
&lt;li&gt;Instead producing a &#39;hierarchy&#39; of results, CUBE looks at all permutations of the specified dimensions.&lt;/li&gt;
&lt;/ul&gt;
Let take an example , Produce a &#39;CUBE&#39; report showing employee salaries across the dimensions of department and manager.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;SELECT DEPT_NO AS DEPTNO&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&amp;nbsp;,MGR_EMP_NO AS MANAGER&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&amp;nbsp;,SUM(SALARY_AMOUNT) AS SUMSAL&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&amp;nbsp;FROM EMPLOYEE&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&amp;nbsp;WHERE DEPT_NO &amp;lt; 402 &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;GROUP BY &lt;b&gt;&lt;span style=&quot;color: magenta;&quot;&gt;CUBE (DEPT_NO,MGR_EMP_NO)&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&amp;nbsp;ORDER BY 1,2;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;style type=&quot;text/css&quot;&gt;
 table.tableizer-table {
 border: 1px solid #CCC; font-family: Arial, Helvetica, sans-serif
 font-size: 12px;
} 
.tableizer-table td {
 padding: 4px;
 margin: 3px;
 border: 1px solid #ccc;
}
.tableizer-table th {
 background-color: #FF7849; 
 color: #FFF;
 font-weight: bold;
}
&lt;/style&gt;&lt;br /&gt;
&lt;table class=&quot;tableizer-table&quot;&gt;&lt;tbody&gt;
&lt;tr class=&quot;tableizer-firstrow&quot;&gt;&lt;th&gt;DEPTNO&lt;/th&gt;&lt;th&gt;MANAGER&lt;/th&gt;&lt;th&gt;SUMSAL&lt;/th&gt;&lt;th&gt;&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;?&lt;/td&gt;&lt;td&gt;?&lt;/td&gt;&lt;td&gt;591925&lt;/td&gt;&lt;td&gt;(all depts, all managers)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;?&lt;/td&gt;&lt;td&gt;801&lt;/td&gt;&lt;td&gt;286750&lt;/td&gt;&lt;td&gt;(all depts, one manager)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;?&lt;/td&gt;&lt;td&gt;1003&lt;/td&gt;&lt;td&gt;207725&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;?&lt;/td&gt;&lt;td&gt;1019&lt;/td&gt;&lt;td&gt;58700&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;?&lt;/td&gt;&lt;td&gt;1025&lt;/td&gt;&lt;td&gt;38750&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;100&lt;/td&gt;&lt;td&gt;?&lt;/td&gt;&lt;td&gt;100000&lt;/td&gt;&lt;td&gt;(one dept, all managers)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;100&lt;/td&gt;&lt;td&gt;801&lt;/td&gt;&lt;td&gt;100000&lt;/td&gt;&lt;td&gt;(one dept, one manager)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;201&lt;/td&gt;&lt;td&gt;?&lt;/td&gt;&lt;td&gt;73450&lt;/td&gt;&lt;td&gt;(one dept, all managers)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;201&lt;/td&gt;&lt;td&gt;801&lt;/td&gt;&lt;td&gt;34700&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;201&lt;/td&gt;&lt;td&gt;1025&lt;/td&gt;&lt;td&gt;38750&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;301&lt;/td&gt;&lt;td&gt;?&lt;/td&gt;&lt;td&gt;116400&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;301&lt;/td&gt;&lt;td&gt;801&lt;/td&gt;&lt;td&gt;57700&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;301&lt;/td&gt;&lt;td&gt;1019&lt;/td&gt;&lt;td&gt;58700&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;302&lt;/td&gt;&lt;td&gt;?&lt;/td&gt;&lt;td&gt;56500&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;302&lt;/td&gt;&lt;td&gt;801&lt;/td&gt;&lt;td&gt;56500&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;401&lt;/td&gt;&lt;td&gt;?&lt;/td&gt;&lt;td&gt;245575&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;401&lt;/td&gt;&lt;td&gt;801&lt;/td&gt;&lt;td&gt;37850&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;401&lt;/td&gt;&lt;td&gt;1003&lt;/td&gt;&lt;td&gt;207725&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
If you observe there are four additional rows (green) are included in the output.&lt;br /&gt;
These four rows represent the totals by manager.This report shows all possible permutations of the two specified dimensions.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&amp;nbsp;Reversing CUBE Parameters:&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;What happens when we flip the sequence of the CUBE parameters? Consider the following:&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;color: purple;&quot;&gt;&amp;nbsp;SELECT DEPT_NO AS DEPTNO&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&amp;nbsp;,MGR_EMP_NO AS MANAGER&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&amp;nbsp;,SUM(SALARY_AMOUNT) AS SUMSAL&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&amp;nbsp;FROM EMPLOYEE&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&amp;nbsp;WHERE DEPT_NO &amp;lt; 402 &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;GROUP BY &lt;span style=&quot;color: magenta;&quot;&gt;&lt;b&gt;CUBE (MGR_EMP_NO,DEPT_NO)&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&amp;nbsp;ORDER BY 1,2;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Yes, The output is exactly&amp;nbsp; returns same.There is no difference in output becacuse CUBE function looks at all permutations of the specified parameters, order of the arguments doesn&#39;t matter - unlike ROLLUP where it does matter.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;we can use the GROUPING and COALESCE functions to make the report more readable.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&lt;span style=&quot;color: purple;&quot;&gt;SELECT CASE GROUPING (department_number)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&amp;nbsp;WHEN 1 THEN &#39;All Depts&#39; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&amp;nbsp;ELSE (COALESCE (department_number,&#39;Null Dept&#39;) ) END AS Deptno&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&amp;nbsp;,CASE GROUPING (manager_employee_number)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&amp;nbsp;WHEN 1 THEN &#39;All Managers&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&amp;nbsp;ELSE manager_employee_number END AS Mngr&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&amp;nbsp;,SUM(salary_amount) AS SumSal&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&amp;nbsp;FROM employee&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&amp;nbsp;WHERE department_number &amp;lt; 402&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&amp;nbsp;GROUP BY&lt;span style=&quot;color: magenta;&quot;&gt;&lt;b&gt; CUBE (manager_employee_number,department_number)&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&amp;nbsp;ORDER BY 1,2; &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;style type=&quot;text/css&quot;&gt;
 table.tableizer-table {
 border: 1px solid #CCC; font-family: Arial, Helvetica, sans-serif
 font-size: 12px;
} 
.tableizer-table td {
 padding: 4px;
 margin: 3px;
 border: 1px solid #ccc;
}
.tableizer-table th {
 background-color: #FF7849; 
 color: #FFF;
 font-weight: bold;
}
&lt;/style&gt;&lt;br /&gt;
&lt;table class=&quot;tableizer-table&quot;&gt;&lt;tbody&gt;
&lt;tr class=&quot;tableizer-firstrow&quot;&gt;&lt;th&gt;Deptno&lt;/th&gt;&lt;th&gt;Mngr&lt;/th&gt;&lt;th&gt;SumSal&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;100&lt;/td&gt;&lt;td&gt;801&lt;/td&gt;&lt;td&gt;100000&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;100&lt;/td&gt;&lt;td&gt;All Managers&lt;/td&gt;&lt;td&gt;100000&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;201&lt;/td&gt;&lt;td&gt;801&lt;/td&gt;&lt;td&gt;34700&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;201&lt;/td&gt;&lt;td&gt;1025&lt;/td&gt;&lt;td&gt;38750&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;201&lt;/td&gt;&lt;td&gt;All Managers&lt;/td&gt;&lt;td&gt;73450&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;301&lt;/td&gt;&lt;td&gt;801&lt;/td&gt;&lt;td&gt;57700&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;301&lt;/td&gt;&lt;td&gt;1019&lt;/td&gt;&lt;td&gt;58700&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;301&lt;/td&gt;&lt;td&gt;All Managers&lt;/td&gt;&lt;td&gt;116400&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;302&lt;/td&gt;&lt;td&gt;801&lt;/td&gt;&lt;td&gt;56500&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;302&lt;/td&gt;&lt;td&gt;All Managers&lt;/td&gt;&lt;td&gt;56500&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;401&lt;/td&gt;&lt;td&gt;801&lt;/td&gt;&lt;td&gt;37850&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;401&lt;/td&gt;&lt;td&gt;1003&lt;/td&gt;&lt;td&gt;207725&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;401&lt;/td&gt;&lt;td&gt;All Managers&lt;/td&gt;&lt;td&gt;245575&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;All Depts&lt;/td&gt;&lt;td&gt;801&lt;/td&gt;&lt;td&gt;286750&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;All Depts&lt;/td&gt;&lt;td&gt;1003&lt;/td&gt;&lt;td&gt;207725&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;All Depts&lt;/td&gt;&lt;td&gt;1019&lt;/td&gt;&lt;td&gt;58700&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;All Depts&lt;/td&gt;&lt;td&gt;1025&lt;/td&gt;&lt;td&gt;38750&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;All Depts&lt;/td&gt;&lt;td&gt;All Managers&lt;/td&gt;&lt;td&gt;591925&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
As more dimensions are added to the cube, more permutations and thus more rows will result.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;If n is the number of dimensions in a cube, then 2**n represents the number of permutations generated:&lt;br /&gt;
&amp;nbsp;2 dimensions - 4 permutations&lt;br /&gt;
&amp;nbsp;3 dimensions - 8 permutations&lt;br /&gt;
&amp;nbsp;4 dimensions - 16 permutations&lt;br /&gt;
&amp;nbsp;etc.&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
Produce a &#39;cube&#39; report showing employee salaries across the three dimensions of department, manager and job code for department numbers less than 302.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;SELECT CASE GROUPING (department_number)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&amp;nbsp;WHEN 1 THEN &#39;All Depts&#39; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&amp;nbsp;ELSE (COALESCE (department_number,&#39;Null Dept&#39;) ) END AS Deptno&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;color: purple;&quot;&gt;,CASE GROUPING (manager_employee_number)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&amp;nbsp;WHEN 1 THEN &#39;All Managers&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&amp;nbsp;ELSE manager_employee_number END AS Mngr&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;color: purple;&quot;&gt;&amp;nbsp;,CASE GROUPING (job_code)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&amp;nbsp;WHEN 1 THEN &#39;All Job Codes&#39; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&amp;nbsp;ELSE (COALESCE (job_code,&#39;Null Job Code&#39;) ) END AS Job&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;color: purple;&quot;&gt;,SUM(salary_amount) AS SumSal&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&amp;nbsp;FROM employee&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&amp;nbsp;WHERE department_number &amp;lt; 302&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;GROUP BY &lt;span style=&quot;color: magenta;&quot;&gt;&lt;b&gt;CUBE (manager_employee_number,department_number, job_code)&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&amp;nbsp;ORDER BY 1,2;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;style type=&quot;text/css&quot;&gt;
 table.tableizer-table {
 border: 1px solid #CCC; font-family: Arial, Helvetica, sans-serif
 font-size: 12px;
} 
.tableizer-table td {
 padding: 4px;
 margin: 3px;
 border: 1px solid #ccc;
}
.tableizer-table th {
 background-color: #FF7849; 
 color: #FFF;
 font-weight: bold;
}
&lt;/style&gt;&lt;br /&gt;
&lt;table class=&quot;tableizer-table&quot;&gt;&lt;tbody&gt;
&lt;tr class=&quot;tableizer-firstrow&quot;&gt;&lt;th&gt;Deptno&lt;/th&gt;&lt;th&gt;Mngr&lt;/th&gt;&lt;th&gt;Job&lt;/th&gt;&lt;th&gt;SumSal&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;100&lt;/td&gt;&lt;td&gt;801&lt;/td&gt;&lt;td&gt;111100&lt;/td&gt;&lt;td&gt;100000&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: blue;&quot;&gt;100&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: blue;&quot;&gt;801&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: blue;&quot;&gt;All Job Codes&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: blue;&quot;&gt;100000&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;100&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;All Managers&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;All Job Codes&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;100000&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: red;&quot;&gt;100&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: red;&quot;&gt;All Managers&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: red;&quot;&gt;111100&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: red;&quot;&gt;100000&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;201&lt;/td&gt;&lt;td&gt;801&lt;/td&gt;&lt;td&gt;211100&lt;/td&gt;&lt;td&gt;34700&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: blue;&quot;&gt;201&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: blue;&quot;&gt;801&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: blue;&quot;&gt;All Job Codes&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: blue;&quot;&gt;34700&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: blue;&quot;&gt;201&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: blue;&quot;&gt;1025&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: blue;&quot;&gt;All Job Codes&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: blue;&quot;&gt;38750&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;201&lt;/td&gt;&lt;td&gt;1025&lt;/td&gt;&lt;td&gt;222101&lt;/td&gt;&lt;td&gt;38750&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: red;&quot;&gt;201&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: red;&quot;&gt;All Managers&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: red;&quot;&gt;211100&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: red;&quot;&gt;34700&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: #134f5c;&quot;&gt;201&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: #134f5c;&quot;&gt;All Managers&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: #134f5c;&quot;&gt;All Job Codes&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: #134f5c;&quot;&gt;73450&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: red;&quot;&gt;201&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: red;&quot;&gt;All Managers&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: red;&quot;&gt;222101&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: red;&quot;&gt;38750&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: blue;&quot;&gt;301&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: blue;&quot;&gt;801&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: blue;&quot;&gt;All Job Codes&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: blue;&quot;&gt;57700&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;301&lt;/td&gt;&lt;td&gt;801&lt;/td&gt;&lt;td&gt;311100&lt;/td&gt;&lt;td&gt;57700&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: blue;&quot;&gt;301&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: blue;&quot;&gt;1019&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: blue;&quot;&gt;All Job Codes&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: blue;&quot;&gt;58700&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;301&lt;/td&gt;&lt;td&gt;1019&lt;/td&gt;&lt;td&gt;312101&lt;/td&gt;&lt;td&gt;29450&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;301&lt;/td&gt;&lt;td&gt;1019&lt;/td&gt;&lt;td&gt;312102&lt;/td&gt;&lt;td&gt;29250&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: red;&quot;&gt;301&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: red;&quot;&gt;All Managers&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: red;&quot;&gt;312102&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: red;&quot;&gt;29250&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: red;&quot;&gt;301&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: red;&quot;&gt;All Managers&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: red;&quot;&gt;311100&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: red;&quot;&gt;57700&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;301&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;All Managers&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;All Job Codes&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;116400&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: red;&quot;&gt;301&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: red;&quot;&gt;All Managers&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: red;&quot;&gt;312101&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: red;&quot;&gt;29450&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: magenta;&quot;&gt;All Depts&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: magenta;&quot;&gt;801&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: magenta;&quot;&gt;All Job Codes&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: magenta;&quot;&gt;192400&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: lime;&quot;&gt;All Depts&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: lime;&quot;&gt;801&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: lime;&quot;&gt;111100&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: lime;&quot;&gt;100000&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: lime;&quot;&gt;All Depts&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: lime;&quot;&gt;801&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: lime;&quot;&gt;211100&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: lime;&quot;&gt;34700&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: lime;&quot;&gt;All Depts&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: lime;&quot;&gt;801&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: lime;&quot;&gt;311100&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: lime;&quot;&gt;57700&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: lime;&quot;&gt;All Depts&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: lime;&quot;&gt;1019&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: lime;&quot;&gt;312101&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: lime;&quot;&gt;29450&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: magenta;&quot;&gt;All Depts&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: magenta;&quot;&gt;1019&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: magenta;&quot;&gt;All Job Codes&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: magenta;&quot;&gt;58700&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: lime;&quot;&gt;All Depts&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: lime;&quot;&gt;1019&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: lime;&quot;&gt;312102&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: lime;&quot;&gt;29250&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: magenta;&quot;&gt;All Depts&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: magenta;&quot;&gt;1025&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: magenta;&quot;&gt;All Job Codes&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: magenta;&quot;&gt;38750&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: lime;&quot;&gt;All Depts&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: lime;&quot;&gt;1025&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: lime;&quot;&gt;222101&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: lime;&quot;&gt;38750&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: orange;&quot;&gt;All Depts&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: orange;&quot;&gt;All Managers&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: orange;&quot;&gt;All Job Codes&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: orange;&quot;&gt;289850&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;All Depts&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;All Managers&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;311100&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;57700&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;All Depts&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;All Managers&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;211100&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;34700&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;All Depts&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;All Managers&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;111100&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;100000&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;All Depts&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;All Managers&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;312101&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;29450&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;All Depts&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;All Managers&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;312102&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;29250&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;All Depts&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;All Managers&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;222101&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;38750&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;All Depts&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;All Managers&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;312102&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;29250&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;All Depts&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;All Managers&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;222101&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;38750&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
To help interpret the output, use the following color-coding scheme:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;(department,manager, job_code)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Each unique combo of dept/mgr/job&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;(department, manager)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Each unique combo of dept/mgr&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;(department, job_code)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                  Each unique combo of dept/job&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: lime;&quot;&gt;&lt;b&gt;(manager, job_code)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                      Each unique combo of mgr/job&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;b&gt;(department)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; All depts&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;b&gt;(manager)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; All mgrs&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;b&gt;(job_code)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; All jobs&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: orange;&quot;&gt;&lt;b&gt;( )&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;                                                  Grand Total&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/9155376054268360758'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/9155376054268360758'/><link rel='alternate' type='text/html' href='http://teradatawiki.blogspot.com/2014/02/cube-function.html' title='CUBE Function'/><author><name>Admin</name><uri>http://www.blogger.com/profile/03270946312373154797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCm0FeHTqy9tdxei5Vc3zsRwKvVPISdFMvIqK5NAbGyyTShzSA7INIQO8uEUGzBkkIDbVj7rdc7z1yqFbAQJMIryVb0gOqbYP1pgPjtpQ9v73YBxwSkukI_mgytcpbIA/s220/IMG_3457.jpg.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2ao4dWgB3FyDKqi2HZVUREisYovtg52RTD5RQg1BIgxjcpJ8EAf2lJjSFf3ke-pE3AqAIQCGr4Ev3pxlVlzzKAikgVO81ERZcfVq9n7M1AkpCaLNR5zbXfRl-n20Igu9ORsdyTMNBWxI/s72-c/Teradata_cube-function.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-7106842514564860422.post-7373890423774308701</id><published>2014-01-30T21:40:00.003+05:30</published><updated>2014-03-30T10:48:02.838+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="BASICS"/><category scheme="http://www.blogger.com/atom/ns#" term="Differences in Teradata vesrions V12"/><category scheme="http://www.blogger.com/atom/ns#" term="Teradata 14 updates"/><category scheme="http://www.blogger.com/atom/ns#" term="Teradata Facts"/><category scheme="http://www.blogger.com/atom/ns#" term="V13 and V14"/><title type='text'>Teradata Facts</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;ssmainhide&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhs4U2eX_jEuyDK6NIALaxJHm1fqPOBlmnhoDR0XDapbF788TmA2cAYuzstTTTGAQTo4FiEiJVzQVQTT1qjunmQ6QyAL_9RTWT6fClTMTG1Tw3aQ_LhuNiG2xEwFAxjHVVyK4Ywxl-60bc/s1600/Teradatawiki-+Teradata+facts.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhs4U2eX_jEuyDK6NIALaxJHm1fqPOBlmnhoDR0XDapbF788TmA2cAYuzstTTTGAQTo4FiEiJVzQVQTT1qjunmQ6QyAL_9RTWT6fClTMTG1Tw3aQ_LhuNiG2xEwFAxjHVVyK4Ywxl-60bc/s1600/Teradatawiki-+Teradata+facts.png&quot; height=&quot;124&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&lt;b&gt;Below are some of the hard facts about Teradata Database and Limitations between versions.&lt;/b&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;/ul&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Each AMP holds a portion of the rows for every table in the system.&lt;/li&gt;
&lt;li&gt;Each Table has a Primary Index that is Unique or Non-Unique&lt;/li&gt;
&lt;li&gt;The Hash Map Determines which AMP will own the Row&lt;/li&gt;
&lt;li&gt;A Unique Primary Index Spreads the Data Evenly&lt;/li&gt;
&lt;li&gt;The AMP Adds a Uniqueness Value to Create the Row-ID&lt;/li&gt;
&lt;li&gt;Each AMP Sorts Their Tables by the Row-ID&lt;/li&gt;
&lt;li&gt;A Non-Unique Primary Index Skews the Data&lt;/li&gt;
&lt;li&gt;Unique Primary Index Queries are a Single AMP Retrieve&lt;/li&gt;
&lt;li&gt;A Non-Unique Primary Index is also a Single AMP Retrieve&lt;/li&gt;
&lt;li&gt;Teradata has a No Primary Index Table called a NoPI Table&lt;/li&gt;
&lt;li&gt;There are Normal Tables and then There are Partitioned Tables&lt;/li&gt;
&lt;li&gt;Partitioning is Designed to Eliminate the Full Table Scan&lt;/li&gt;
&lt;li&gt;A Partition # and Row-ID = Row Key&lt;/li&gt;
&lt;li&gt;An AMP Stores its Rows Sorted in only Two Different Ways&lt;/li&gt;
&lt;li&gt;AMPs Moves Their Data Blocks into Memory to Read/Write&lt;/li&gt;
&lt;li&gt;Most Taxing thing for an AMP is Moving Blocks into Memory&lt;/li&gt;
&lt;li&gt;Rows are Stored in Data Blocks which are stored in Cylinders&lt;/li&gt;
&lt;li&gt;Rows for an AMP Stored Inside a Data Block in a Cylinder&lt;/li&gt;
&lt;li&gt;An AMP&#39;s Master Index is Used to Find the Right Cylinder&lt;/li&gt;
&lt;li&gt;There is One Master Index and Thousands of Cylinder Indexes&lt;/li&gt;
&lt;li&gt;The Row Reference Array is always in Row-ID order&lt;/li&gt;
&lt;li&gt;The maximum block size (before a split) was 255 sectors (127.5 K), but now it is 2047 sectors (1 MB).&lt;/li&gt;
&lt;li&gt;A Block Splits into Two Blocks at Maximum Block Size.&lt;/li&gt;
&lt;li&gt;Once the block grows to the maximum size, then Teradata will split the single block into two separate blocks. The default for the split is 2047 sectors or 1 MB.&lt;/li&gt;
&lt;li&gt;The maximum for all Teradata V14 data block splits are 2047 sectors or 1 MB, but the defaults differ based on whether or not it is an enterprise class system, or an appliance&lt;/li&gt;
&lt;li&gt;Each Table has a 48-bit TableID&lt;/li&gt;
&lt;/ul&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;/ul&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&lt;b&gt;Differences in Teradata vesrions V12, V13 and V14&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;/ul&gt;
&lt;style type=&quot;text/css&quot;&gt;
 table.tableizer-table {
 border: 1px solid #CCC; font-family: Arial, Helvetica, sans-serif
 font-size: 12px;
} 
.tableizer-table td {
 padding: 4px;
 margin: 3px;
 border: 1px solid #ccc;
}
.tableizer-table th {
 background-color: #104E8B; 
 color: #FFF;
 font-weight: bold;
}
&lt;/style&gt;&lt;br /&gt;
&lt;table class=&quot;tableizer-table&quot;&gt;&lt;tbody&gt;
&lt;tr class=&quot;tableizer-firstrow&quot;&gt;&lt;th&gt;&lt;/th&gt;&lt;th&gt;&lt;span style=&quot;color: purple;&quot;&gt;Versions&lt;/span&gt;&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;12&lt;/td&gt;&lt;td&gt;13&lt;/td&gt;&lt;td&gt;14&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;Max Vdisk Size&lt;/span&gt;&lt;/td&gt;&lt;td&gt;1.26 TB&lt;/td&gt;&lt;td&gt;1.26 TB&lt;/td&gt;&lt;td&gt;7.2 TB&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;Max Block Size (sectors)&lt;/span&gt;&lt;/td&gt;&lt;td&gt;255&lt;/td&gt;&lt;td&gt;255&lt;/td&gt;&lt;td&gt;255&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;Max Table Header Size&lt;/span&gt;&lt;/td&gt;&lt;td&gt;128 KB&lt;/td&gt;&lt;td&gt;1 MB&lt;/td&gt;&lt;td&gt;1 MB&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;Max Databases/Users&lt;/span&gt;&lt;/td&gt;&lt;td&gt;4.2 Billion&lt;/td&gt;&lt;td&gt;4.2 Billion&lt;/td&gt;&lt;td&gt;4.2 Billion&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;Max Partitions&lt;/span&gt;&lt;/td&gt;&lt;td&gt;65,535&lt;/td&gt;&lt;td&gt;65,535&lt;/td&gt;&lt;td&gt;9.2 * 10 18&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;Max Partition Levels&lt;/span&gt;&lt;/td&gt;&lt;td&gt;15&lt;/td&gt;&lt;td&gt;15&lt;/td&gt;&lt;td&gt;62&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;Max spool tables per query&lt;/span&gt;&lt;/td&gt;&lt;td&gt;2048&lt;/td&gt;&lt;td&gt;2048&lt;/td&gt;&lt;td&gt;2048&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;Max Tables in a Join&lt;/span&gt;&lt;/td&gt;&lt;td&gt;64&lt;/td&gt;&lt;td&gt;128&lt;/td&gt;&lt;td&gt;128&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;Max columns in a table&lt;/span&gt;&lt;/td&gt;&lt;td&gt;2048&lt;/td&gt;&lt;td&gt;2048&lt;/td&gt;&lt;td&gt;2048&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;Max columns in an index&lt;/span&gt;&lt;/td&gt;&lt;td&gt;64&lt;/td&gt;&lt;td&gt;64&lt;/td&gt;&lt;td&gt;64&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;Max SQL request size&lt;/span&gt;&lt;/td&gt;&lt;td&gt;1 MB&lt;/td&gt;&lt;td&gt;1 MB&lt;/td&gt;&lt;td&gt;1 MB&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;Max AMPs and PEs&lt;/span&gt;&lt;/td&gt;&lt;td&gt;16,384&lt;/td&gt;&lt;td&gt;16,384&lt;/td&gt;&lt;td&gt;32,720&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/7373890423774308701'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/7373890423774308701'/><link rel='alternate' type='text/html' href='http://teradatawiki.blogspot.com/2014/01/Teradata-hard-facts.html' title='Teradata Facts'/><author><name>Admin</name><uri>http://www.blogger.com/profile/03270946312373154797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCm0FeHTqy9tdxei5Vc3zsRwKvVPISdFMvIqK5NAbGyyTShzSA7INIQO8uEUGzBkkIDbVj7rdc7z1yqFbAQJMIryVb0gOqbYP1pgPjtpQ9v73YBxwSkukI_mgytcpbIA/s220/IMG_3457.jpg.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhs4U2eX_jEuyDK6NIALaxJHm1fqPOBlmnhoDR0XDapbF788TmA2cAYuzstTTTGAQTo4FiEiJVzQVQTT1qjunmQ6QyAL_9RTWT6fClTMTG1Tw3aQ_LhuNiG2xEwFAxjHVVyK4Ywxl-60bc/s72-c/Teradatawiki-+Teradata+facts.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-7106842514564860422.post-5011465716560319064</id><published>2014-01-06T21:51:00.003+05:30</published><updated>2014-02-06T21:49:14.694+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Functions"/><category scheme="http://www.blogger.com/atom/ns#" term="ROLLUP Function"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>ROLLUP Function</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;ssmainhide&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2XMfyEtiOVqLaxH3ARduINXpnzPZrpVFQ9hoNZrDWdhBF5UvJcrFhaVP01xfFwTe23GPeHSfeBM_vQ-_DGpVEYw6XREtyreBYMhqb2ePRc41r1jJ9pNJHYyayJfOA4gk0vQiHPXqPrFE/s1600/Teradata-rollup-function.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Teradata-rollup-function&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2XMfyEtiOVqLaxH3ARduINXpnzPZrpVFQ9hoNZrDWdhBF5UvJcrFhaVP01xfFwTe23GPeHSfeBM_vQ-_DGpVEYw6XREtyreBYMhqb2ePRc41r1jJ9pNJHYyayJfOA4gk0vQiHPXqPrFE/s1600/Teradata-rollup-function.png&quot; height=&quot;129&quot; title=&quot;Teradata-rollup-function&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
The teradata ROLLUP function is used, when ever an aggregation is required across all levels of a hierarchy within a single dimension.&lt;br /&gt;
&lt;br /&gt;
Lets take geography is a dimension. You might have 3 levels of hierarchy - city, county and state. You may wish to produce sum of revenue amounts across all three levels.&lt;br /&gt;
&lt;br /&gt;
we can produce below samples&amp;nbsp; &lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Produce a sum of revenue amounts across all three levels. &lt;/li&gt;
&lt;li&gt;Aggregate at the lowest level (city) and &#39;rollup&#39; those aggregations to the next level (county) and finally rollup to the top level (state). &lt;/li&gt;
&lt;li&gt;Provide a grand total across all three levels. &lt;/li&gt;
&lt;/ul&gt;
All of these are easily done with the ROLLUP feature.&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;b&gt;Example1:&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
Using the GROUP BY function, produce a total of salaries by department for department numbers less than 402.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;SELECT department_number &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,SUM(salary_amount) &lt;br /&gt;
FROM employee WHERE department_number &amp;lt; 402&lt;br /&gt;
GROUP BY 1&lt;br /&gt;
ORDER BY 1;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot; style=&quot;border-collapse: collapse; margin-left: 4.7pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; width: 291px;&quot;&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0;&quot;&gt;   &lt;td nowrap=&quot;&quot; style=&quot;background: #FFCC99; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 125.0pt;&quot; valign=&quot;bottom&quot; width=&quot;125&quot;&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span class=&quot;SpellE&quot;&gt;&lt;span class=&quot;GramE&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;department&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;_number&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;background: #FFCC99; border-left: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 166.0pt;&quot; valign=&quot;bottom&quot; width=&quot;166&quot;&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;Group &lt;span class=&quot;GramE&quot;&gt;Sum(&lt;/span&gt;&lt;span class=&quot;SpellE&quot;&gt;salary_amount&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 1;&quot;&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 125.0pt;&quot; valign=&quot;bottom&quot; width=&quot;125&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;100&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 166.0pt;&quot; valign=&quot;bottom&quot; width=&quot;166&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;100000&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 2;&quot;&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 125.0pt;&quot; valign=&quot;bottom&quot; width=&quot;125&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;201&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 166.0pt;&quot; valign=&quot;bottom&quot; width=&quot;166&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;73450&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 3;&quot;&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 125.0pt;&quot; valign=&quot;bottom&quot; width=&quot;125&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;301&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 166.0pt;&quot; valign=&quot;bottom&quot; width=&quot;166&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;116400&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 4;&quot;&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 125.0pt;&quot; valign=&quot;bottom&quot; width=&quot;125&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;302&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 166.0pt;&quot; valign=&quot;bottom&quot; width=&quot;166&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;56500&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 5; mso-yfti-lastrow: yes;&quot;&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 125.0pt;&quot; valign=&quot;bottom&quot; width=&quot;125&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;401&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 166.0pt;&quot; valign=&quot;bottom&quot; width=&quot;166&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;245575&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;b&gt;ROLLUP Function - One Level&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
Using the ROLLUP function, produce salary totals by department.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;SELECT department_number&lt;br /&gt;
,SUM(salary_amount)&lt;br /&gt;
FROM employee&lt;br /&gt;
WHERE department_number &amp;lt; 402&lt;br /&gt;
GROUP BY &lt;span style=&quot;color: red;&quot;&gt;ROLLUP (department_number)&lt;/span&gt;&lt;br /&gt;
ORDER BY 1;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot; style=&quot;border-collapse: collapse; border: none; margin-left: 4.7pt; mso-border-alt: solid windowtext .5pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext; mso-padding-alt: 0in 5.4pt 0in 5.4pt; width: 291px;&quot;&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0;&quot;&gt;   &lt;td nowrap=&quot;&quot; style=&quot;background: #FFCC99; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 125.0pt;&quot; valign=&quot;bottom&quot; width=&quot;125&quot;&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span class=&quot;SpellE&quot;&gt;&lt;span class=&quot;GramE&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;department&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;_number&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;background: #FFCC99; border-left: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 166.0pt;&quot; valign=&quot;bottom&quot; width=&quot;166&quot;&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;Group &lt;span class=&quot;GramE&quot;&gt;Sum(&lt;/span&gt;&lt;span class=&quot;SpellE&quot;&gt;salary_amount&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 1;&quot;&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 125.0pt;&quot; valign=&quot;bottom&quot; width=&quot;125&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt;&quot;&gt;?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 166.0pt;&quot; valign=&quot;bottom&quot; width=&quot;166&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 10.0pt;&quot;&gt;591925&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 2;&quot;&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 125.0pt;&quot; valign=&quot;bottom&quot; width=&quot;125&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;100&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 166.0pt;&quot; valign=&quot;bottom&quot; width=&quot;166&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;100000&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 3;&quot;&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 125.0pt;&quot; valign=&quot;bottom&quot; width=&quot;125&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;201&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 166.0pt;&quot; valign=&quot;bottom&quot; width=&quot;166&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;73450&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 4;&quot;&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 125.0pt;&quot; valign=&quot;bottom&quot; width=&quot;125&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;301&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 166.0pt;&quot; valign=&quot;bottom&quot; width=&quot;166&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;116400&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 5;&quot;&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 125.0pt;&quot; valign=&quot;bottom&quot; width=&quot;125&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;302&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 166.0pt;&quot; valign=&quot;bottom&quot; width=&quot;166&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;56500&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 6; mso-yfti-lastrow: yes;&quot;&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 125.0pt;&quot; valign=&quot;bottom&quot; width=&quot;125&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;401&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 166.0pt;&quot; valign=&quot;bottom&quot; width=&quot;166&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;245575&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
There is an additional row with a &#39;?&#39; department number. This row represents the rollup of all department salaries which is the top (and only) level of the hierarchy in this case. The &#39;?&#39; does not represent a null, rather it represents the &#39;total&#39; of all department salaries.&lt;br /&gt;
&lt;u&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/u&gt; &lt;u&gt;&lt;b&gt;ROLLUP Function - Two Levels&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
Produce a hierarchy of total salaries by department within manager.&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&lt;br /&gt;
SELECT manager_employee_number AS Mgr&lt;br /&gt;
,department_number AS Dept&lt;br /&gt;
,SUM(salary_amount) AS SumSal&lt;br /&gt;
FROM employee&lt;br /&gt;
WHERE department_number &amp;lt; 402 &lt;br /&gt;
GROUP BY &lt;span style=&quot;color: red;&quot;&gt;ROLLUP (manager_employee_number,department_number)&lt;/span&gt;&lt;br /&gt;
ORDER BY 1,2;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot; style=&quot;border-collapse: collapse; border: none; margin-left: 4.7pt; mso-border-alt: solid windowtext .5pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext; mso-padding-alt: 0in 5.4pt 0in 5.4pt; width: 436px;&quot;&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0;&quot;&gt;   &lt;td nowrap=&quot;&quot; style=&quot;background: #FFCC99; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 51.0pt;&quot; valign=&quot;bottom&quot; width=&quot;51&quot;&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;Mgr&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;background: #FFCC99; border-left: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 1.0in;&quot; valign=&quot;bottom&quot; width=&quot;72&quot;&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal; mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;Dept&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;background: #FFCC99; border-left: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 106.0pt;&quot; valign=&quot;bottom&quot; width=&quot;106&quot;&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal; mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;SumSal&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;background: #FFCC99; border-left: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 207.0pt;&quot; valign=&quot;bottom&quot; width=&quot;207&quot;&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 1;&quot;&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 51.0pt;&quot; valign=&quot;bottom&quot; width=&quot;51&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;color: #3366ff; font-family: Arial; font-size: 11.0pt;&quot;&gt;?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 1.0in;&quot; valign=&quot;bottom&quot; width=&quot;72&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;color: #3366ff; font-family: Arial; font-size: 11.0pt;&quot;&gt;?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 106.0pt;&quot; valign=&quot;bottom&quot; width=&quot;106&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;color: #3366ff; font-family: Arial; font-size: 11.0pt;&quot;&gt;591925&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 207.0pt;&quot; valign=&quot;bottom&quot; width=&quot;207&quot;&gt;&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;color: #3366ff; font-family: Arial; font-size: 11.0pt;&quot;&gt;&lt;span class=&quot;GramE&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #3366ff; font-family: Arial; font-size: 11.0pt;&quot;&gt;&lt;span style=&quot;color: #3366ff; font-family: Arial; font-size: 11.0pt;&quot;&gt;(&lt;span class=&quot;GramE&quot;&gt;all &lt;/span&gt;&lt;/span&gt;mgrs,all depts,all emps)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 2;&quot;&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 51.0pt;&quot; valign=&quot;bottom&quot; width=&quot;51&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;color: #dd0806; font-family: Arial; font-size: 11.0pt;&quot;&gt;801&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 1.0in;&quot; valign=&quot;bottom&quot; width=&quot;72&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;color: #dd0806; font-family: Arial; font-size: 11.0pt;&quot;&gt;?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 106.0pt;&quot; valign=&quot;bottom&quot; width=&quot;106&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;color: #dd0806; font-family: Arial; font-size: 11.0pt;&quot;&gt;286750&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 207.0pt;&quot; valign=&quot;bottom&quot; width=&quot;207&quot;&gt;&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;color: #dd0806; font-family: Arial; font-size: 11.0pt;&quot;&gt;&lt;span class=&quot;GramE&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #dd0806; font-family: Arial; font-size: 11.0pt;&quot;&gt;&lt;span style=&quot;color: #dd0806; font-family: Arial; font-size: 11.0pt;&quot;&gt;(&lt;span class=&quot;GramE&quot;&gt;mgr &lt;/span&gt;&lt;/span&gt;801,all depts, 5 emps)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 3;&quot;&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 51.0pt;&quot; valign=&quot;bottom&quot; width=&quot;51&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;801&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 1.0in;&quot; valign=&quot;bottom&quot; width=&quot;72&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;100&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 106.0pt;&quot; valign=&quot;bottom&quot; width=&quot;106&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;100000&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 207.0pt;&quot; valign=&quot;bottom&quot; width=&quot;207&quot;&gt;&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;&lt;span class=&quot;GramE&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;(&lt;span class=&quot;GramE&quot;&gt;mgr &lt;/span&gt;&lt;/span&gt;801,dept 100, 1 emp)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 4;&quot;&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 51.0pt;&quot; valign=&quot;bottom&quot; width=&quot;51&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;801&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 1.0in;&quot; valign=&quot;bottom&quot; width=&quot;72&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;201&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 106.0pt;&quot; valign=&quot;bottom&quot; width=&quot;106&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;34700&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 207.0pt;&quot; valign=&quot;bottom&quot; width=&quot;207&quot;&gt;&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;(&lt;span class=&quot;GramE&quot;&gt;mgr &lt;/span&gt;&lt;/span&gt;801,dept 201, 1 emp)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 5;&quot;&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 51.0pt;&quot; valign=&quot;bottom&quot; width=&quot;51&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;801&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 1.0in;&quot; valign=&quot;bottom&quot; width=&quot;72&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;301&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 106.0pt;&quot; valign=&quot;bottom&quot; width=&quot;106&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;57700&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 207.0pt;&quot; valign=&quot;bottom&quot; width=&quot;207&quot;&gt;&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;(&lt;span class=&quot;GramE&quot;&gt;mgr &lt;/span&gt;&lt;/span&gt;801,dept 301, 1 emp)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 6;&quot;&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 51.0pt;&quot; valign=&quot;bottom&quot; width=&quot;51&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;801&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 1.0in;&quot; valign=&quot;bottom&quot; width=&quot;72&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;302&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 106.0pt;&quot; valign=&quot;bottom&quot; width=&quot;106&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;56500&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 207.0pt;&quot; valign=&quot;bottom&quot; width=&quot;207&quot;&gt;&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;(&lt;span class=&quot;GramE&quot;&gt;mgr &lt;/span&gt;&lt;/span&gt;801,dept 302, 1 emp)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 7;&quot;&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 51.0pt;&quot; valign=&quot;bottom&quot; width=&quot;51&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;801&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 1.0in;&quot; valign=&quot;bottom&quot; width=&quot;72&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;401&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 106.0pt;&quot; valign=&quot;bottom&quot; width=&quot;106&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;37850&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 207.0pt;&quot; valign=&quot;bottom&quot; width=&quot;207&quot;&gt;&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;(&lt;span class=&quot;GramE&quot;&gt;mgr &lt;/span&gt;&lt;/span&gt;801,dept 401, 1 emp)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 8;&quot;&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 51.0pt;&quot; valign=&quot;bottom&quot; width=&quot;51&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;color: #dd0806; font-family: Arial; font-size: 11.0pt;&quot;&gt;1003&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 1.0in;&quot; valign=&quot;bottom&quot; width=&quot;72&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;color: #dd0806; font-family: Arial; font-size: 11.0pt;&quot;&gt;?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 106.0pt;&quot; valign=&quot;bottom&quot; width=&quot;106&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;color: #dd0806; font-family: Arial; font-size: 11.0pt;&quot;&gt;207725&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 207.0pt;&quot; valign=&quot;bottom&quot; width=&quot;207&quot;&gt;&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;color: #dd0806; font-family: Arial; font-size: 11.0pt;&quot;&gt;&lt;br /&gt;
(mgr 1003,all depts, 6 emps)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 9;&quot;&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 51.0pt;&quot; valign=&quot;bottom&quot; width=&quot;51&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;1003&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 1.0in;&quot; valign=&quot;bottom&quot; width=&quot;72&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;401&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 106.0pt;&quot; valign=&quot;bottom&quot; width=&quot;106&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;207725&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 207.0pt;&quot; valign=&quot;bottom&quot; width=&quot;207&quot;&gt;&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;&lt;br /&gt;
(mgr 1003,dept 401, 6 emps)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 10;&quot;&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 51.0pt;&quot; valign=&quot;bottom&quot; width=&quot;51&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;color: #dd0806; font-family: Arial; font-size: 11.0pt;&quot;&gt;1019&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 1.0in;&quot; valign=&quot;bottom&quot; width=&quot;72&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;color: #dd0806; font-family: Arial; font-size: 11.0pt;&quot;&gt;?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 106.0pt;&quot; valign=&quot;bottom&quot; width=&quot;106&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;color: #dd0806; font-family: Arial; font-size: 11.0pt;&quot;&gt;58700&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 207.0pt;&quot; valign=&quot;bottom&quot; width=&quot;207&quot;&gt;&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;color: #dd0806; font-family: Arial; font-size: 11.0pt;&quot;&gt;&lt;br /&gt;
(mgr 1019,all depts, 2 emps)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 11;&quot;&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 51.0pt;&quot; valign=&quot;bottom&quot; width=&quot;51&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;1019&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 1.0in;&quot; valign=&quot;bottom&quot; width=&quot;72&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;301&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 106.0pt;&quot; valign=&quot;bottom&quot; width=&quot;106&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;58700&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 207.0pt;&quot; valign=&quot;bottom&quot; width=&quot;207&quot;&gt;&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;&lt;br /&gt;
(mgr 1019,dept 301, 2 emps)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 12;&quot;&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 51.0pt;&quot; valign=&quot;bottom&quot; width=&quot;51&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;color: #dd0806; font-family: Arial; font-size: 11.0pt;&quot;&gt;1025&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 1.0in;&quot; valign=&quot;bottom&quot; width=&quot;72&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;color: #dd0806; font-family: Arial; font-size: 11.0pt;&quot;&gt;?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 106.0pt;&quot; valign=&quot;bottom&quot; width=&quot;106&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;color: #dd0806; font-family: Arial; font-size: 11.0pt;&quot;&gt;38750&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 207.0pt;&quot; valign=&quot;bottom&quot; width=&quot;207&quot;&gt;&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;color: #dd0806; font-family: Arial; font-size: 11.0pt;&quot;&gt;&lt;br /&gt;
(mgr 1025,all depts, 1 emp)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 13; mso-yfti-lastrow: yes;&quot;&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 51.0pt;&quot; valign=&quot;bottom&quot; width=&quot;51&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;1025&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 1.0in;&quot; valign=&quot;bottom&quot; width=&quot;72&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;201&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 106.0pt;&quot; valign=&quot;bottom&quot; width=&quot;106&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;38750&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 207.0pt;&quot; valign=&quot;bottom&quot; width=&quot;207&quot;&gt;&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;&lt;br /&gt;
(mgr 1025,dept 201, 1 emp)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
Three separate aggregations taking place in the preceding query.&lt;br /&gt;
&lt;br /&gt;
Totals for each dept/manager combo (black). &lt;br /&gt;
This is represented as the set &#39;(manager,department )&#39; and is the bottom of the hierarchy.&lt;br /&gt;
&lt;br /&gt;
Totals for each manager across all departments (red). &lt;br /&gt;
This is represented as the set &#39;(manager )&#39; which is the middle of the hierarchy.&lt;br /&gt;
&lt;br /&gt;
A total for all depts across all managers (blue). &lt;br /&gt;
This is represented as the set &#39;( )&#39; and is the top of the hierarchy.&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;b&gt;ROLLUP WITH NULL&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
As previously indicated, the row with the &#39;?&#39; represents the grand total of all salaries across all departments.&lt;br /&gt;
But what if there was a department number with a null? How would we distinguish between it and a &#39;total&#39; row?&lt;br /&gt;
&lt;br /&gt;
Add an employee with a null department and a null job code:&lt;br /&gt;
&lt;br /&gt;
INSERT INTO employee VALUES&lt;br /&gt;
(1050,801,NULL,NULL,&#39;LaCoste&#39;,&#39;Jason&#39;,780415,480816,60000.00);&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;SELECT department_number&lt;br /&gt;
,SUM(salary_amount)&lt;br /&gt;
FROM employee&lt;br /&gt;
GROUP BY &lt;span style=&quot;color: red;&quot;&gt;ROLLUP (department_number)&lt;/span&gt;&lt;br /&gt;
ORDER BY 1;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot; style=&quot;border-collapse: collapse; border: none; margin-left: -1.5pt; mso-border-alt: solid windowtext .5pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext; mso-padding-alt: 0in 5.4pt 0in 5.4pt; width: 291px;&quot;&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0;&quot;&gt;   &lt;td nowrap=&quot;&quot; style=&quot;background: #FFCC99; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 125.0pt;&quot; valign=&quot;bottom&quot; width=&quot;125&quot;&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span class=&quot;SpellE&quot;&gt;&lt;span class=&quot;GramE&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;department&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;_number&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;background: #FFCC99; border-left: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 166.0pt;&quot; valign=&quot;bottom&quot; width=&quot;166&quot;&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;Group &lt;span class=&quot;GramE&quot;&gt;Sum(&lt;/span&gt;&lt;span class=&quot;SpellE&quot;&gt;salary_amount&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 1;&quot;&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 125.0pt;&quot; valign=&quot;bottom&quot; width=&quot;125&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 166.0pt;&quot; valign=&quot;bottom&quot; width=&quot;166&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;color: black; font-family: Arial; font-size: 11.0pt;&quot;&gt;651925&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 2;&quot;&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 125.0pt;&quot; valign=&quot;bottom&quot; width=&quot;125&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 166.0pt;&quot; valign=&quot;bottom&quot; width=&quot;166&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;60000&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 3;&quot;&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 125.0pt;&quot; valign=&quot;bottom&quot; width=&quot;125&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;100&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 166.0pt;&quot; valign=&quot;bottom&quot; width=&quot;166&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;100000&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 4;&quot;&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 125.0pt;&quot; valign=&quot;bottom&quot; width=&quot;125&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;201&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 166.0pt;&quot; valign=&quot;bottom&quot; width=&quot;166&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;73450&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 5;&quot;&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 125.0pt;&quot; valign=&quot;bottom&quot; width=&quot;125&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;301&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 166.0pt;&quot; valign=&quot;bottom&quot; width=&quot;166&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;116400&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 6;&quot;&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 125.0pt;&quot; valign=&quot;bottom&quot; width=&quot;125&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;302&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 166.0pt;&quot; valign=&quot;bottom&quot; width=&quot;166&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;56500&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 7; mso-yfti-lastrow: yes;&quot;&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 125.0pt;&quot; valign=&quot;bottom&quot; width=&quot;125&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;401&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td nowrap=&quot;&quot; style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 166.0pt;&quot; valign=&quot;bottom&quot; width=&quot;166&quot;&gt;&lt;br /&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt;&quot;&gt;245575&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
While it may seem obvious that the row with the larger sum will represent the &#39;total&#39; row, &lt;br /&gt;
a function exists which permits the report to be more easily read.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/5011465716560319064'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/5011465716560319064'/><link rel='alternate' type='text/html' href='http://teradatawiki.blogspot.com/2014/01/Teradata-rollup-function.html' title='ROLLUP Function'/><author><name>Admin</name><uri>http://www.blogger.com/profile/03270946312373154797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCm0FeHTqy9tdxei5Vc3zsRwKvVPISdFMvIqK5NAbGyyTShzSA7INIQO8uEUGzBkkIDbVj7rdc7z1yqFbAQJMIryVb0gOqbYP1pgPjtpQ9v73YBxwSkukI_mgytcpbIA/s220/IMG_3457.jpg.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2XMfyEtiOVqLaxH3ARduINXpnzPZrpVFQ9hoNZrDWdhBF5UvJcrFhaVP01xfFwTe23GPeHSfeBM_vQ-_DGpVEYw6XREtyreBYMhqb2ePRc41r1jJ9pNJHYyayJfOA4gk0vQiHPXqPrFE/s72-c/Teradata-rollup-function.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-7106842514564860422.post-469893878053148327</id><published>2013-12-27T21:25:00.002+05:30</published><updated>2014-02-06T21:50:08.042+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Certification"/><category scheme="http://www.blogger.com/atom/ns#" term="Teradata12 Certification"/><category scheme="http://www.blogger.com/atom/ns#" term="Teradata14 Certification"/><title type='text'>Teradata 14 Certification Details</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;style&gt;
&lt;!--
 /* Font Definitions */
@font-face
 {font-family:Arial;
 panose-1:2 11 6 4 2 2 2 2 2 4;
 mso-font-charset:0;
 mso-generic-font-family:auto;
 mso-font-pitch:variable;
 mso-font-signature:3 0 0 0 1 0;}
@font-face
 {font-family:Cambria;
 panose-1:2 4 5 3 5 4 6 3 2 4;
 mso-font-charset:0;
 mso-generic-font-family:auto;
 mso-font-pitch:variable;
 mso-font-signature:3 0 0 0 1 0;}
 /* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
 {mso-style-parent:&quot;&quot;;
 margin-top:0in;
 margin-right:0in;
 margin-bottom:10.0pt;
 margin-left:0in;
 mso-pagination:widow-orphan;
 font-size:12.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-ascii-font-family:Cambria;
 mso-ascii-theme-font:minor-latin;
 mso-fareast-font-family:Cambria;
 mso-fareast-theme-font:minor-latin;
 mso-hansi-font-family:Cambria;
 mso-hansi-theme-font:minor-latin;
 mso-bidi-font-family:&quot;Times New Roman&quot;;
 mso-bidi-theme-font:minor-bidi;}
@page Section1
 {size:8.5in 11.0in;
 margin:1.0in 1.25in 1.0in 1.25in;
 mso-header-margin:.5in;
 mso-footer-margin:.5in;
 mso-paper-source:0;}
div.Section1
 {page:Section1;}
&lt;/style&gt;

       
&lt;br /&gt;
&lt;div class=&quot;ssmainhide&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWXaLiIMc2A9dCE_qy3Uj9eV1vaLmmCuqpT7u8Wl_RLHOM9TiUqkN9H5928Wq3lldGc8c8fxu3lgvX5YJTRBSezetVsoemYDAM1n4lHjdoM_EBaLgXer4Drj8UzhjWWhs7MQwOhScBQxs/s1600/Teradata+Certification.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWXaLiIMc2A9dCE_qy3Uj9eV1vaLmmCuqpT7u8Wl_RLHOM9TiUqkN9H5928Wq3lldGc8c8fxu3lgvX5YJTRBSezetVsoemYDAM1n4lHjdoM_EBaLgXer4Drj8UzhjWWhs7MQwOhScBQxs/s200/Teradata+Certification.png&quot; height=&quot;121&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt; mso-bidi-font-size: 12.0pt;&quot;&gt;The Teradata 14 Certification is the most current release of Teradata Certification exams offered globally through authorized Prometric Testing Centers.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;u&gt;&lt;span style=&quot;color: red; font-family: Arial; font-size: 11.0pt; mso-bidi-font-size: 12.0pt;&quot;&gt;Teradata 14 Certification Details&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot; style=&quot;border-collapse: collapse; margin-left: 4.7pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; width: 530px;&quot;&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0;&quot;&gt;   &lt;td style=&quot;background: silver; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 52.95pt;&quot; valign=&quot;bottom&quot; width=&quot;53&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;Exam&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td style=&quot;background: silver; border-left: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 391.85pt;&quot; valign=&quot;bottom&quot; width=&quot;392&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;Title&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td style=&quot;background: silver; border-left: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 85.5pt;&quot; valign=&quot;bottom&quot; width=&quot;86&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;Duration&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 1;&quot;&gt;   &lt;td style=&quot;background: white; border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 52.95pt;&quot; valign=&quot;bottom&quot; width=&quot;53&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;TE0-141&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td style=&quot;background: white; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 391.85pt;&quot; valign=&quot;bottom&quot; width=&quot;392&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;Teradata 14 Basics exam&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td style=&quot;background: white; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 85.5pt;&quot; valign=&quot;bottom&quot; width=&quot;86&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;1 hr 30 min&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 2;&quot;&gt;   &lt;td style=&quot;background: white; border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 52.95pt;&quot; valign=&quot;bottom&quot; width=&quot;53&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;TE0-142&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td style=&quot;background: white; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 391.85pt;&quot; valign=&quot;bottom&quot; width=&quot;392&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;Teradata 14 SQL exam&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td style=&quot;background: white; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 85.5pt;&quot; valign=&quot;bottom&quot; width=&quot;86&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;1 hr 45 min&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 3;&quot;&gt;   &lt;td style=&quot;background: white; border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 52.95pt;&quot; valign=&quot;bottom&quot; width=&quot;53&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;TE0-143&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td style=&quot;background: white; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 391.85pt;&quot; valign=&quot;bottom&quot; width=&quot;392&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;Teradata 14 Physical Design and Implementation &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td style=&quot;background: white; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 85.5pt;&quot; valign=&quot;bottom&quot; width=&quot;86&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;2 hrs&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 4;&quot;&gt;   &lt;td style=&quot;background: white; border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 52.95pt;&quot; valign=&quot;bottom&quot; width=&quot;53&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;TE0-14B&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td style=&quot;background: white; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 391.85pt;&quot; valign=&quot;bottom&quot; width=&quot;392&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;Teradata 14 Bridge from Teradata 12*&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td style=&quot;background: white; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 85.5pt;&quot; valign=&quot;bottom&quot; width=&quot;86&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;2 hrs 30 min&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 5;&quot;&gt;   &lt;td style=&quot;background: white; border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 52.95pt;&quot; valign=&quot;bottom&quot; width=&quot;53&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;TE0-144&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td style=&quot;background: white; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 391.85pt;&quot; valign=&quot;bottom&quot; width=&quot;392&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;Teradata 14 Database Administration exam&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td style=&quot;background: white; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 85.5pt;&quot; valign=&quot;bottom&quot; width=&quot;86&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;2 hrs 15 min&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 6;&quot;&gt;   &lt;td style=&quot;background: white; border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 52.95pt;&quot; valign=&quot;bottom&quot; width=&quot;53&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;TE0-145&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td style=&quot;background: white; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 391.85pt;&quot; valign=&quot;bottom&quot; width=&quot;392&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;Teradata 14 Solutions Development exam&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td style=&quot;background: white; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 85.5pt;&quot; valign=&quot;bottom&quot; width=&quot;86&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;2 hrs&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 7;&quot;&gt;   &lt;td style=&quot;background: white; border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 52.95pt;&quot; valign=&quot;bottom&quot; width=&quot;53&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;TE0-146&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td style=&quot;background: white; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 391.85pt;&quot; valign=&quot;bottom&quot; width=&quot;392&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;Teradata 14 Enterprise Architecture exam&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td style=&quot;background: white; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 85.5pt;&quot; valign=&quot;bottom&quot; width=&quot;86&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;1 hr 45 min&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 8; mso-yfti-lastrow: yes;&quot;&gt;   &lt;td style=&quot;background: white; border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 52.95pt;&quot; valign=&quot;bottom&quot; width=&quot;53&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;TE0-147&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td style=&quot;background: white; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 391.85pt;&quot; valign=&quot;bottom&quot; width=&quot;392&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;Teradata 14 Comprehensive Mastery exam**&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td style=&quot;background: white; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 85.5pt;&quot; valign=&quot;bottom&quot; width=&quot;86&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;3 hrs 20 min&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt; mso-bidi-font-size: 12.0pt;&quot;&gt;NEW! *Teradata 14 Bridge Exam This exam is designed to transition or “bridge” qualifying candidates from the Teradata 12 Certification track to the Teradata 14 Certification track. This eligibility based exam is available only to candidates that have achieved any of the following Teradata 12 Certifications: Certified Technical Specialist, Database Administrator, Solutions Developer or Enterprise Architect. The Teradata 14 Bridge exam replaces the need to retake the core Teradata Certification exams: Basics (TE0-141), SQL (TE0-142), and Physical Design and Implementation (TE0-143) once you have achieved the prerequisite Teradata 12 Certification(s).&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;u&gt;&lt;span style=&quot;color: red; font-family: Arial; font-size: 11.0pt; mso-bidi-font-size: 12.0pt;&quot;&gt;Teradata 12 Certification Details&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt; mso-bidi-font-size: 12.0pt;&quot;&gt;PLEASE NOTE: The following Teradata 12 Certification Exams (TE0-121 through TE0-126*) will remain in market through September 30, 2014. After that time, the exams will be discontinued but the certifications will continue to be supported. If you are new to the TCPP program, we strongly encourage you to begin with the Teradata 14 Basics exam on the Teradata 14 Certification Track. &lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;i&gt;  &lt;/i&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;i&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt; mso-bidi-font-size: 12.0pt;&quot;&gt;The Teradata 12 Qualifying Exam for V2R5 Masters (TE0-12Q*) and the Teradata 12 Comprehensive Mastery Exam (TE0-127*) will remain in market until Q1 2015.&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot; style=&quot;border-collapse: collapse; margin-left: 4.7pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; width: 530px;&quot;&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0;&quot;&gt;   &lt;td style=&quot;background: silver; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 57.05pt;&quot; valign=&quot;bottom&quot; width=&quot;57&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;Exam&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td style=&quot;background: silver; border-left: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 383.25pt;&quot; valign=&quot;bottom&quot; width=&quot;383&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;Title&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td style=&quot;background: silver; border-left: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 1.25in;&quot; valign=&quot;bottom&quot; width=&quot;90&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;Duration&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 1;&quot;&gt;   &lt;td style=&quot;background: white; border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 57.05pt;&quot; valign=&quot;bottom&quot; width=&quot;57&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;TE0-121&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td style=&quot;background: white; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 383.25pt;&quot; valign=&quot;bottom&quot; width=&quot;383&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;Teradata 12 Basics exam&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td style=&quot;background: white; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 1.25in;&quot; valign=&quot;bottom&quot; width=&quot;90&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;2 hrs&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 2;&quot;&gt;   &lt;td style=&quot;background: white; border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 57.05pt;&quot; valign=&quot;bottom&quot; width=&quot;57&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;TE0-122&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td style=&quot;background: white; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 383.25pt;&quot; valign=&quot;bottom&quot; width=&quot;383&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;Teradata 12 SQL exam&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td style=&quot;background: white; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 1.25in;&quot; valign=&quot;bottom&quot; width=&quot;90&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;2 hrs 15 min&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 3;&quot;&gt;   &lt;td style=&quot;background: white; border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 57.05pt;&quot; valign=&quot;bottom&quot; width=&quot;57&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;TE0-123&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td style=&quot;background: white; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 383.25pt;&quot; valign=&quot;bottom&quot; width=&quot;383&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;Teradata 12 Physical Design and Implementation &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td style=&quot;background: white; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 1.25in;&quot; valign=&quot;bottom&quot; width=&quot;90&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;2 hrs&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 4;&quot;&gt;   &lt;td style=&quot;background: white; border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 57.05pt;&quot; valign=&quot;bottom&quot; width=&quot;57&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;TE0-124&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td style=&quot;background: white; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 383.25pt;&quot; valign=&quot;bottom&quot; width=&quot;383&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;Teradata 12 Database Administration exam&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td style=&quot;background: white; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 1.25in;&quot; valign=&quot;bottom&quot; width=&quot;90&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;2 hrs 15 min&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 5;&quot;&gt;   &lt;td style=&quot;background: white; border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 57.05pt;&quot; valign=&quot;bottom&quot; width=&quot;57&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;TE0-125&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td style=&quot;background: white; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 383.25pt;&quot; valign=&quot;bottom&quot; width=&quot;383&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;Teradata 12 Solutions Development exam&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td style=&quot;background: white; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 1.25in;&quot; valign=&quot;bottom&quot; width=&quot;90&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;3 hrs&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 6;&quot;&gt;   &lt;td style=&quot;background: white; border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 57.05pt;&quot; valign=&quot;bottom&quot; width=&quot;57&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;TE0-126&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td style=&quot;background: white; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 383.25pt;&quot; valign=&quot;bottom&quot; width=&quot;383&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;Teradata 12 Enterprise Architecture exam&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td style=&quot;background: white; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 1.25in;&quot; valign=&quot;bottom&quot; width=&quot;90&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;2 hrs 45 min&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 7;&quot;&gt;   &lt;td style=&quot;background: white; border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 57.05pt;&quot; valign=&quot;bottom&quot; width=&quot;57&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;TE0-127&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td style=&quot;background: white; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 383.25pt;&quot; valign=&quot;bottom&quot; width=&quot;383&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;Teradata 12 Comprehensive Mastery exam*&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td style=&quot;background: white; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 1.25in;&quot; valign=&quot;bottom&quot; width=&quot;90&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;3 hrs 30 min&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;height: 13.0pt; mso-yfti-irow: 8; mso-yfti-lastrow: yes;&quot;&gt;   &lt;td style=&quot;background: white; border-top: none; border: solid windowtext 1.0pt; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 57.05pt;&quot; valign=&quot;bottom&quot; width=&quot;57&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;TE0-12Q&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td style=&quot;background: white; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 383.25pt;&quot; valign=&quot;bottom&quot; width=&quot;383&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;Teradata 12 Qualifying Exam for V2R5 Masters*&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;   &lt;td style=&quot;background: white; border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 13.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 1.25in;&quot; valign=&quot;bottom&quot; width=&quot;90&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 11.0pt;&quot;&gt;2 hrs 45 min&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt; mso-bidi-font-size: 12.0pt;&quot;&gt;How to schedule exams at Prometric:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt; mso-bidi-font-size: 12.0pt;&quot;&gt;Schedule appointments on-line: Your correct and valid e-mail address will be required each time you schedule an exam. To begin registration, go to: www.prometric.com/Teradata &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt; mso-bidi-font-size: 12.0pt;&quot;&gt;Or contact a Prometric Regional Registration Center by telephone:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt; mso-bidi-font-size: 12.0pt;&quot;&gt;Candidates in the USA &amp;amp; Canada may call Toll Free: 1-877-887-6868&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Arial; font-size: 11.0pt; mso-bidi-font-size: 12.0pt;&quot;&gt;Candidates in all other countries, go to www.prometric.com/teradata and choose “contact numbers” on the left navigation bar&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt; mso-bidi-font-size: 12.0pt;&quot;&gt;* In India only- NIIT testing sites do not accept discount/promotional codes directly at the site.&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt; mso-bidi-font-size: 12.0pt;&quot;&gt; If you plan to register onsite, please visit the &lt;a href=&quot;https://www.prometric.com/en-us/clients/teradata/Pages/landing.aspx&quot;&gt;Prometric&lt;/a&gt; website and choose “Locate a Test Center” to find an alternative testing center.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;color: red; font-family: Arial; font-size: 11.0pt; mso-bidi-font-size: 12.0pt;&quot;&gt;Additional Information about your Prometric Registration:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt; mso-bidi-font-size: 12.0pt;&quot;&gt;Exam Cost: &lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt; mso-bidi-font-size: 12.0pt;&quot;&gt;Teradata exam fees will vary based on the exam taken and your location. Exam fees will display after you choose your exam title during the on-line registration process. You may pay Prometric with a credit card or exam voucher.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt; mso-bidi-font-size: 12.0pt;&quot;&gt;Testing ID:&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt; mso-bidi-font-size: 12.0pt;&quot;&gt; Prometric assigns a unique alpha-numeric Testing ID to you during your first exam registration. Use the same Prometric testing ID each time you register for a Teradata exam. Your correct and valid e-mail address will be required each time you schedule an exam.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt; mso-bidi-font-size: 12.0pt;&quot;&gt;Official Name:&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt; mso-bidi-font-size: 12.0pt;&quot;&gt; Ensure that your entire first and last name is spelled correctly as it appears on your official Government-issued photo ID.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt; mso-bidi-font-size: 12.0pt;&quot;&gt;Cancellation:&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt; mso-bidi-font-size: 12.0pt;&quot;&gt; Prometric’s 24-hour cancellation and no-show policies will be in effect for exam appointments. &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt; mso-bidi-font-size: 12.0pt;&quot;&gt;Re-Take Policy:&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt; mso-bidi-font-size: 12.0pt;&quot;&gt; Re-take violations are considered Security violations.&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;To avoid re-take violations, please refer to the re-take policy prior to re-scheduling a failed exam.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt; mso-bidi-font-size: 12.0pt;&quot;&gt;Exam Completion and Results:&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial; font-size: 11.0pt; mso-bidi-font-size: 12.0pt;&quot;&gt; Upon completing a Teradata exam at a Prometric Testing Center, Prometric will provide a printed hard copy “Notice of Exam Completion”. Keep this document for information you will need to retrieve your “Notice of Exam Results”&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/469893878053148327'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/469893878053148327'/><link rel='alternate' type='text/html' href='http://teradatawiki.blogspot.com/2013/12/teradata-14-certification-details.html' title='Teradata 14 Certification Details'/><author><name>Admin</name><uri>http://www.blogger.com/profile/03270946312373154797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCm0FeHTqy9tdxei5Vc3zsRwKvVPISdFMvIqK5NAbGyyTShzSA7INIQO8uEUGzBkkIDbVj7rdc7z1yqFbAQJMIryVb0gOqbYP1pgPjtpQ9v73YBxwSkukI_mgytcpbIA/s220/IMG_3457.jpg.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWXaLiIMc2A9dCE_qy3Uj9eV1vaLmmCuqpT7u8Wl_RLHOM9TiUqkN9H5928Wq3lldGc8c8fxu3lgvX5YJTRBSezetVsoemYDAM1n4lHjdoM_EBaLgXer4Drj8UzhjWWhs7MQwOhScBQxs/s72-c/Teradata+Certification.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-7106842514564860422.post-3272387601226771059</id><published>2013-11-30T20:13:00.000+05:30</published><updated>2014-02-01T21:00:34.756+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="architecture of teradata"/><category scheme="http://www.blogger.com/atom/ns#" term="BASICS"/><category scheme="http://www.blogger.com/atom/ns#" term="components of teradata architecture"/><category scheme="http://www.blogger.com/atom/ns#" term="Open architecture of teradata"/><category scheme="http://www.blogger.com/atom/ns#" term="Teradata Architecture"/><category scheme="http://www.blogger.com/atom/ns#" term="Teradata Components"/><category scheme="http://www.blogger.com/atom/ns#" term="teradata rdbms architecture"/><category scheme="http://www.blogger.com/atom/ns#" term="teradata&#39;s open architecture"/><title type='text'>Architecture</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Teradata relies on three architectural components.&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://teradatawiki.blogspot.in/2013/08/Teradata-Parsing-engine.html&quot;&gt;Parsing Engine(PE) or Optimizer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://teradatawiki.blogspot.in/2013/08/Teradata-AMP.html&quot;&gt;Access Module Processors(AMPs)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://teradatawiki.blogspot.in/2013/08/Teradata-BYNET.html&quot;&gt;BYNETs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Disks&lt;/li&gt;
&lt;/ul&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTwtQkM7qGdCRD2Nt-Tx3myQZxNoNpkAZJuHE-Ujo8yKnUf2bLkBHeHxPsdbaB1QZYO1Ahfv_orNb6nIzQrd9nWhzQ-Z6xHP0To5fx9HMa3cGhB8DLHwyBl0ZtDwlyni_ePpXo3F-BOTM/s1600/Teradata+Architecture.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;TeradataWiki-Teradata Architecture&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTwtQkM7qGdCRD2Nt-Tx3myQZxNoNpkAZJuHE-Ujo8yKnUf2bLkBHeHxPsdbaB1QZYO1Ahfv_orNb6nIzQrd9nWhzQ-Z6xHP0To5fx9HMa3cGhB8DLHwyBl0ZtDwlyni_ePpXo3F-BOTM/s400/Teradata+Architecture.png&quot; height=&quot;400&quot; title=&quot;TeradataWiki-Teradata Architecture&quot; width=&quot;316&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Teradata Architecture&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;b&gt;Parsing Engine (PE)&lt;/b&gt;&lt;br /&gt;
The Parsing Engine (PE) is a component that interprets SQL requests, receives input records, and passes data. It sends the messages through the BYNET to the AMPs.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;BYNETs&lt;/b&gt;&lt;br /&gt;
The BYNET act as message-passing layer. It decides which AMP should receive a message.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Access Module Processor (AMP)&lt;/b&gt;&lt;br /&gt;
The AMP is a virtual processor (vproc) designed to managing a portion of the entire database.&lt;br /&gt;
It performs all database management functions such as sorting, aggregating, and formatting data.&lt;br /&gt;
The AMP receives data from the PE, formats rows, and distributes them to the disk storage units it controls. The AMP also retrieves the rows requested by the Parsing Engine.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Disks&lt;/b&gt;&lt;br /&gt;
Disks are disk drives associated with an AMP that store the data rows.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/3272387601226771059'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/3272387601226771059'/><link rel='alternate' type='text/html' href='http://teradatawiki.blogspot.com/2013/09/Teradata-Architecture.html' title='Architecture'/><author><name>Admin</name><uri>http://www.blogger.com/profile/03270946312373154797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCm0FeHTqy9tdxei5Vc3zsRwKvVPISdFMvIqK5NAbGyyTShzSA7INIQO8uEUGzBkkIDbVj7rdc7z1yqFbAQJMIryVb0gOqbYP1pgPjtpQ9v73YBxwSkukI_mgytcpbIA/s220/IMG_3457.jpg.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTwtQkM7qGdCRD2Nt-Tx3myQZxNoNpkAZJuHE-Ujo8yKnUf2bLkBHeHxPsdbaB1QZYO1Ahfv_orNb6nIzQrd9nWhzQ-Z6xHP0To5fx9HMa3cGhB8DLHwyBl0ZtDwlyni_ePpXo3F-BOTM/s72-c/Teradata+Architecture.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-7106842514564860422.post-3945769346621067054</id><published>2013-11-29T21:58:00.000+05:30</published><updated>2017-01-26T03:58:05.300+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="FAST EXPORT"/><category scheme="http://www.blogger.com/atom/ns#" term="Utilities"/><title type='text'>FAST EXPORT</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;ssmainhide&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFs7lHqB7ANm-v16OmftSKsG5Q7fD77iHMbxeOEgsR5nQh3ae3RWImrJpIRPMhgIch_d-ikQV4EvuM6RRoj2ilzze7j1-_C5R6LNuKUi4HTxVbntGFPvq-d_3KkZ-tkEw164PsajSDhno/s1600/Fast+Export.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;TeradataWiki- Teradata Utilities Fast export&quot; border=&quot;0&quot; height=&quot;125&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFs7lHqB7ANm-v16OmftSKsG5Q7fD77iHMbxeOEgsR5nQh3ae3RWImrJpIRPMhgIch_d-ikQV4EvuM6RRoj2ilzze7j1-_C5R6LNuKUi4HTxVbntGFPvq-d_3KkZ-tkEw164PsajSDhno/s200/Fast+Export.png&quot; title=&quot;TeradataWiki- Teradata Utilities Fast export&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
FastExport ,the name itself is spells to exports data from Teradata to a Flat file. But BTEQ also does the same thing.The main difference is BTEQ exports data in rows and FastExport exports data in 64K blocks. So if its required to load data with lightning speed Fast export is the best choice.&lt;br /&gt;
&lt;br /&gt;
FastExport is a 64K block utility it falls under the limit of 15 block utilities. That means that a system can’t have more than a combination of 15 FastLoads, MultiLoads, and FastExports.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Basic fundamentals of FastExport&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;FastExport EXPORTS data from Teradata.&lt;/li&gt;
&lt;li&gt;FastExport only supports the SELECT statement.&lt;/li&gt;
&lt;li&gt;Choose FastExport over BTEQ when Exporting Data of more than half a million+ rows&lt;/li&gt;
&lt;li&gt;FastExport supports multiple SELECT statements and multiple tables in a single run&lt;/li&gt;
&lt;li&gt;FastExport supports conditional logic, conditional expressions, arithmetic calculations, and data&lt;/li&gt;
&lt;li&gt;conversions.&lt;/li&gt;
&lt;li&gt;FastExport does NOT support error files or error limits.&lt;/li&gt;
&lt;li&gt;FastExport supports user-written routines INMODs and OUTMODs&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
Sample fast export Script&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;.LOGTABLE Empdb.Emp_Table_log;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;.LOGON TD/USERNAME,PWD;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt; &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;BEGIN EXPORT&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;SESSIONS 12;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt; &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;.EXPORT OUTFILE C:\TEMP\EMPDATA.txt&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;FORMAT BINARY;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt; &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;SELECT EMP_NUM &amp;nbsp; &amp;nbsp;(CHAR(10))&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ,EMP_NAME &amp;nbsp; (CHAR(50))&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ,SALARY &amp;nbsp; &amp;nbsp; (CHAR(10))&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ,EMP_PHONE &amp;nbsp;(CHAR(10))&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;FROM Empdb.Emp_Table;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt; &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;.END EXPORT;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;.LOGOFF;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;FastExport Modes&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
FastExport has two modes: RECORD or INDICATOR&lt;br /&gt;
RECORD mode is the default, but you can use INDICATOR mode if required.&lt;br /&gt;
The difference between the two modes is INDICATOR mode will set the indicator bits to 1 for column values containing NULLS.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;FastExport Formats&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
FastExport can export data in below formats&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;FASTLOAD&lt;/li&gt;
&lt;li&gt;BINARY&lt;/li&gt;
&lt;li&gt;TEXT&lt;/li&gt;
&lt;li&gt;UNFORMAT&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/3945769346621067054'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/3945769346621067054'/><link rel='alternate' type='text/html' href='http://teradatawiki.blogspot.com/2013/10/Teradata-utilities-fastexport.html' title='FAST EXPORT'/><author><name>Admin</name><uri>http://www.blogger.com/profile/03270946312373154797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCm0FeHTqy9tdxei5Vc3zsRwKvVPISdFMvIqK5NAbGyyTShzSA7INIQO8uEUGzBkkIDbVj7rdc7z1yqFbAQJMIryVb0gOqbYP1pgPjtpQ9v73YBxwSkukI_mgytcpbIA/s220/IMG_3457.jpg.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFs7lHqB7ANm-v16OmftSKsG5Q7fD77iHMbxeOEgsR5nQh3ae3RWImrJpIRPMhgIch_d-ikQV4EvuM6RRoj2ilzze7j1-_C5R6LNuKUi4HTxVbntGFPvq-d_3KkZ-tkEw164PsajSDhno/s72-c/Fast+Export.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-7106842514564860422.post-4007785935641710964</id><published>2013-11-29T16:22:00.000+05:30</published><updated>2013-12-19T21:39:30.594+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ranking"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>Rank Function</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;ssmainhide&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXnSplCP-Xn1BdIbUki4rKSaH0y7zA_9uMCit8-uCaZ1kSyXRadKascD80vUEAbe5QKKyaSEx-t2K-fx9oa6xmDZ2bi3viJQXUPIraO3lC-vF8HOfmx2Um4L3N7w177xTKFNEG8ELE_a8/s1600/Teradata+Rank+FUnction.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;TeradataWiki-Teradata Rank FUnction&quot; border=&quot;0&quot; height=&quot;128&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXnSplCP-Xn1BdIbUki4rKSaH0y7zA_9uMCit8-uCaZ1kSyXRadKascD80vUEAbe5QKKyaSEx-t2K-fx9oa6xmDZ2bi3viJQXUPIraO3lC-vF8HOfmx2Um4L3N7w177xTKFNEG8ELE_a8/s200/Teradata+Rank+FUnction.png&quot; title=&quot;TeradataWiki-Teradata Rank FUnction&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
The teradata RANK function permits a column to be ranked, either based on high or low order, against other rows in the answer set. You may specify the order of ranking by use of the ORDER BY clause within the RANK function. Descending order will provide traditional ranking wherein the largest value is assigned a rank of one. Ascending order will associate the largest value with the highest rank value (i.e., typically a value &amp;gt; 1).&lt;br /&gt;
&lt;br /&gt;
The syntax for the RANK function is:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;RANK( ) OVER (ORDER BY sales DESC);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Example&lt;/i&gt;&lt;br /&gt;
Show the ranking of product sales for store 1001.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;SELECT storeid&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;,prodid&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;,sales&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;,RANK( ) OVER (ORDER BY sales DESC) AS &quot;Rank&quot;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;FROM salestbl&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;WHERE storeid = 1001;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
Result&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;b&gt;Storeid &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; prodid &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sales &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Rank&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;----------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;1001 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;F &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 150000.00 &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;1001 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 100000.00 &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;1001 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;C &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;60000.00 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;1001 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;D &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;35000.00 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;Things To Notice:&lt;/u&gt;&lt;br /&gt;
WHERE clause qualifies rows to be ranked.&lt;br /&gt;
When the order of sales is DESC, the highest sales amount is rank #1&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Example&lt;/i&gt;&lt;br /&gt;
Show the lowest ranking of product sales for store 1001.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;SELECT storeid&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;,prodid&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;,sales&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;,RANK( ) OVER (ORDER BY sales ASC) AS &quot;Rank&quot;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;FROM salestbl&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;WHERE storeid = 1001;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;br class=&quot;Apple-interchange-newline&quot; /&gt;Storeid &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; prodid &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sales &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Rank&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;----------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;1001 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; D &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 35000.00 &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;1001 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; C &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 60000.00 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;1001 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 100000.00 &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;1001 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; F &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;150000.00 &amp;nbsp; &amp;nbsp; 4&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;Things To Notice:&lt;/u&gt;&lt;br /&gt;
When the order of sales is ASC, the lowest sales amount is rank #1&lt;br /&gt;
Rank #1 always appears at top of list unless overridden.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;u&gt;Rankings With Qualification&lt;/u&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The QUALIFY clause allows restriction of which rankings will be output in the final result.&lt;br /&gt;
The QUALIFY clause allows restriction of which rankings will be output in the final result.&lt;br /&gt;
&lt;br /&gt;
QUALIFY performs like the HAVING clause by requesting a specific range in the output.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Example&lt;/i&gt;&lt;br /&gt;
Get top 3 sales - any product in any store:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;SELECT storeid&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ,prodid&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ,sales&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;,RANK( ) OVER (ORDER BY sales DESC)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AS &quot;Ranking&quot;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;FROM salestbl&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;QUALIFY Ranking &amp;lt;= 3;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;Storeid &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; prodid &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sales &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Rank&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;----------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;1001 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; F &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;150000.00 &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;1001 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;100000.00 &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;1003 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; B &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 65000.00 &amp;nbsp; &amp;nbsp; &amp;nbsp; 3 &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;i&gt;&lt;u&gt;Things To Notice:&lt;/u&gt;&lt;/i&gt;&lt;br /&gt;
QUALIFY shows the ranking for the top 3 sales amounts only.&lt;br /&gt;
&lt;br /&gt;
The RANK function produces an ordered sequence. &amp;nbsp;ORDER BY can override the normal sequencing.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Example&lt;/i&gt;&lt;br /&gt;
Reverse the ranking sequence in the previous example.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;SELECT storeid&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;,prodid&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;,sales&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;,RANK( ) OVER (ORDER BY sales DESC) AS &quot;Ranking&quot;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;FROM &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;salestbl&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;QUALIFY Ranking &amp;lt;= 3&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;ORDER BY 4 DESC;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;Storeid &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; prodid &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sales &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Rank&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;----------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;1003 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;B &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 65000.00 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;1001 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 100000.00 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;1001 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;F &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 150000.00 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;i&gt;Things To Notice:&lt;/i&gt;&lt;/u&gt;&lt;br /&gt;
The ORDER BY clause in the SELECT statement may always be used to control the final order of the result set.&lt;br /&gt;
When the order of sales is DESC, the highest sales amount is always rank #1&lt;br /&gt;
After the ranking is applied, the output results are produced based on the ORDER BY sequence in the SELECT statement, if specified.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Ranking With PARTITION BY&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The PARTITION BY clause may be used in conjunction with a RANK function to change the scope of the ranking. Without a PARTITION BY clause, the scope defaults to the RANK column.&lt;br /&gt;
&lt;br /&gt;
Whereas the RANK( ) ORDER BY clause controls the default sort key, the PARTITION BY clause adds another level of sort to the output.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Example&lt;/i&gt;&lt;br /&gt;
Get the top three selling products in each store.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;SELECT &amp;nbsp; storeid&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;,prodid&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;,sales&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;,RANK( ) OVER (PARTITION BY storeid&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp;ORDER BY sales DESC) AS &quot;Ranking&quot;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;FROM &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;salestbl&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;QUALIFY Ranking &amp;lt;= 3;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;br class=&quot;Apple-interchange-newline&quot; /&gt;Storeid &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; prodid &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sales &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Rank&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;----------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;1001 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;F &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 150000.00 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;1001 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 100000.00 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;1001 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;C &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;60000.00 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;1002 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;40000.00 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;1002 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;C &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;35000.00 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;1002 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;D &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;25000.00 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;1003 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;B &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;65000.00 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;1003 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;D &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;50000.00 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;1003 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;30000.00 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;u&gt;Things To Notice:&lt;/u&gt;&lt;/i&gt;&lt;br /&gt;
PARTITION BY clause controls scope, i.e., rank sales within store.&lt;br /&gt;
Without PARTITION BY, scope would default to sales only.&lt;br /&gt;
QUALIFY the ranking for the top 3 sales amounts per store.&lt;br /&gt;
Sort sequence of output is sales descending.&lt;br /&gt;
Due to PARTITION BY, sort is by sales (DESC) within store (ASC).&lt;br /&gt;
&lt;br /&gt;
Note -- no aggregation is done in this query.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/4007785935641710964'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/4007785935641710964'/><link rel='alternate' type='text/html' href='http://teradatawiki.blogspot.com/2013/10/Teradata-Ranking.html' title='Rank Function'/><author><name>Admin</name><uri>http://www.blogger.com/profile/03270946312373154797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCm0FeHTqy9tdxei5Vc3zsRwKvVPISdFMvIqK5NAbGyyTShzSA7INIQO8uEUGzBkkIDbVj7rdc7z1yqFbAQJMIryVb0gOqbYP1pgPjtpQ9v73YBxwSkukI_mgytcpbIA/s220/IMG_3457.jpg.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXnSplCP-Xn1BdIbUki4rKSaH0y7zA_9uMCit8-uCaZ1kSyXRadKascD80vUEAbe5QKKyaSEx-t2K-fx9oa6xmDZ2bi3viJQXUPIraO3lC-vF8HOfmx2Um4L3N7w177xTKFNEG8ELE_a8/s72-c/Teradata+Rank+FUnction.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-7106842514564860422.post-8790993394020056524</id><published>2013-11-27T19:59:00.000+05:30</published><updated>2015-03-02T23:29:00.761+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Interview Questions"/><title type='text'>Interview Questions Part-1</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;div class=&quot;ssmainhide&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;ssmainhide&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSYKqp2gjiL37Nh7_egY7rRsr20_pLcoQByj_Xy9PG1ad2Lc5nHokXaqlbaeQIbwcr7XH59E40Q9wm6swt0ufaDCuPKZ-qymeMBCcJDDV6QllOGJ1J4u5oNv4-FlwpJSCI6Yt3fErj05M/s1600/Teradata_interview_questions1.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;TeradataWiki-Teradata_interview_questions&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSYKqp2gjiL37Nh7_egY7rRsr20_pLcoQByj_Xy9PG1ad2Lc5nHokXaqlbaeQIbwcr7XH59E40Q9wm6swt0ufaDCuPKZ-qymeMBCcJDDV6QllOGJ1J4u5oNv4-FlwpJSCI6Yt3fErj05M/s200/Teradata_interview_questions1.png&quot; height=&quot;123&quot; title=&quot;TeradataWiki-Teradata_interview_questions&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;What are the different &amp;nbsp;types of locks in Teradata?&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt; &lt;/b&gt;&lt;/div&gt;
Exclusive Lock:&lt;br /&gt;
Exclusive locks are only applied to databases or tables, never to rows.&lt;br /&gt;
They are the most restrictive type of lock; all other users are locked out.&lt;br /&gt;
Exclusive locks are used rarely, most often when structural changes are being made to the database.&lt;br /&gt;
&lt;br /&gt;
Read Lock:&lt;br /&gt;
Read locks are used to ensure consistency during read operations.&lt;br /&gt;
Several users may hold concurrent read locks on the same data, during which no modification of the data is permitted.&lt;br /&gt;
&lt;br /&gt;
Write Lock:Write locks enable users to modify data while locking out all other users except readers not concerned about data consistency (Access lock readers).&lt;br /&gt;
Until a Write lock is released, no new read or write locks are allowed.&lt;br /&gt;
&lt;br /&gt;
Access Lock:Access locks can be specified by users who are not concerned about data consistency.&lt;br /&gt;
The use of an access lock allows for reading data while modifications are in process. Access locks are designed for decision support on large tables that are updated only by small single row changes. Access locks are sometimes called stale read locks, i.e. you may get stale data that hasnot been updated&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Lock types are automatically applied based on the SQL command:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; SELECT --&amp;gt;applies a Read lock&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; UPDATE --&amp;gt; applies a Write lock&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; CREATE TABLE --&amp;gt; applies an Exclusive lock&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
=========================================================================&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;What is multiple statement processing?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Multiple statement processing increases the performance when loading into large tables. All statements are sent to parser simultaneously and all statements are executed parallel.&lt;br /&gt;
In sql Assistance, once you place all queries and press F5. All will be executed parallel. Make sure each sql statement ends semicolon(;).&lt;br /&gt;
&lt;span style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;text-align: center;&quot;&gt;=========================================================================&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;What is TENACITY and SLEEP ?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
TENACITY to specify the number of hours FastLoad will try to establish a connection. The default is no tenacity. The statement must be placed before LOGON.&lt;br /&gt;
&lt;br /&gt;
SLEEP to specify the number of minutes FastLoad waits before retrying a logon.The default is 6 minutes. The statement must be placed before LOGON.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
=========================================================================&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;What is soft &amp;nbsp;Referential Integrity and Batch &amp;nbsp;Referential Integrity?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Soft &amp;nbsp;Referential Integrity:&lt;br /&gt;
It provides a mechanism to allow user-specified Referential Integrity (RI) constraints that are not&lt;br /&gt;
enforced by the database.&lt;br /&gt;
Enables optimization techniques such as Join Elimination.&lt;br /&gt;
&lt;br /&gt;
Batch &amp;nbsp;Referential Integrity:&lt;br /&gt;
Tests an entire insert, delete, or update batch operation for referential integrity. If insertion, deletion, or update of any row in the batch violates referential integrity, then parsing engine software rolls back the entire batch and returns an abort message.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;text-align: center;&quot;&gt;=========================================================================&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;What Teradata statistics ?&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Statistics collection is essential for the optimal performance of the Teradata query optimizer.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
The query optimizer relies on statistics to help it determine the best way to access data.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Statistics also help the optimizer ascertain how many rows exist in tables being queried and predict how many rows will qualify for given conditions.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Lack of statistics, or out-dated statistics, might result in the optimizer choosing a less-than-optimal method for accessing data tables.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;Points:&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
1: &lt;i&gt;Once a collect stats is done on the table(on index or column) where is this information stored so that the optimizer can refer this?&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Ans: Collected statistics are stored in DBC.TVFields or DBC.Indexes. However, you cannot query these two tables.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
2: &lt;i&gt;How often collect stats has to be made for a table that is frequently updated?&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Answer: You need to refresh stats when 5 to 10% of table&#39;s rows have changed. Collect stats could be pretty resource consuming for large tables. So it is always advisable to schedule the job at off peak period and normally after approximately 10% of data changes.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
3: &lt;i&gt;Once a collect stats has been done on the table how can i be sure that the optimizer is considering this before execution ? i.e; until the next collect stats has been done will the optimizer refer this?&lt;/i&gt;&lt;/div&gt;
&lt;span style=&quot;text-align: center;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Ans: Yes, optimizer will use stats data for query execution plan if available. That&#39;s why stale stats is dangerous as that may mislead the optimizer.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;text-align: center;&quot;&gt;=========================================================================&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;What is a HOT AMP?&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
When the workload is not distributed across all the AMPs, only a few AMPs end up overburdened with the work. This is a hot AMP condition.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
This typically occurs when the volume of data you are dealing with is high and&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
(a). You are trying to retrieve the data in a TERADATA table which is not well distributed across the AMPs on the system (bad Primary Index)&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
OR&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
(b). When you are trying to join on column with highly non unique values&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
OR&lt;/div&gt;
&lt;span style=&quot;text-align: center;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
(c). When you apply the DISTINCT operator on a column with highly non unique values&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;text-align: center;&quot;&gt;=========================================================================&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;What are different &amp;nbsp;SPACES available in Teradata?&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;There are mainly 3 types of spaces available.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;Perm Space&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;Temp Space&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;Spool space&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Perm Space :All databases have a defined upper limit of permanent space. Permanent space is used for storing the data rows of tables. Perm space is not pre-allocated. It &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;represents a maximum limit.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Spool Space :All databases also have an upper limit of spool space. If there is no limit defined for a particular database or user, limits are inherited from parents.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Theoretically, a user could use all unallocated pace in the system for their query. Spool space is temporary space used to hold intermediate query results or formatted answer sets to queries. Once the query is complete, the spool space is released.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Example: You have a database with total disk space of 100GB. You have 10GB of user data and an additional 10GB of overhead. What is the maximum amount of spool space available for queries?&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Answer: 80GB. All of the remaining space in the system is available for spool&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;text-align: center;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Temp Space :The third type of space is temporary space. Temp space is used for Global and Volatile temporary tables, and these results remain available to the user until the session is terminated. Tables created in temp space will survive a restart.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;text-align: center;&quot;&gt;=========================================================================&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;How Does Teradata Store Rows?&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Teradata uses hash partitioning and distribution to randomly and evenly distribute data across all AMPs.&lt;/li&gt;
&lt;li&gt;The rows of every table are distributed among all AMPs - and ideally will be evenly distributed among all AMPs.&lt;/li&gt;
&lt;li&gt;Each AMP is responsible for a subset of the rows of each table.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Evenly distributed tables result in evenly distributed workloads.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;span style=&quot;text-align: center;&quot;&gt;=========================================================================&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Which one will take care when an AMP goes down?&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;text-align: center;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;text-align: center;&quot;&gt;Down amp recovery journal will start when AMP goes down to restore the data for the down amp.&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;text-align: center;&quot;&gt; &lt;/span&gt; &lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;text-align: center;&quot;&gt;Fall back is like it has redundant data,if one amp goes down in the cluster also it wont affect your queries.the query will use data from fall back rows.the down amp wont be updated use the data from fall back.&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;text-align: center;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;text-align: center;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;text-align: center;&quot;&gt;=========================================================================&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Which one will take care when a NODE goes down?&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
In the event of node failure, all virtual processors can migrate to another available node in the clique.&amp;nbsp;&lt;/div&gt;
&lt;span style=&quot;text-align: center;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
All nodes in the clique must have access to the same disk arrays&lt;/div&gt;
&lt;/div&gt;
&lt;span style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;text-align: center;&quot;&gt;=========================================================================&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;What is the use of EXPLIN plan?&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
The EXPLAIN facility allows you to preview how Teradata will execute a requested query. It returns a summary of the steps the Teradata RDBMS would perform to execute the request.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
EXPLAIN also discloses the strategy and access method to be used, how many rows will be involved, and its cost in minutes and seconds. Use EXPLAIN to evaluate a query performance&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
and to develop an alternative processing strategy that may be more efficient. EXPLAIN works on any SQL request. The request is fully parsed and optimized, but not run. The complete plan is returned &amp;nbsp;to the user in readable English statements.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;text-align: center;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
EXPLAIN provides information about locking, sorting, row selection criteria, join strategy and conditions, access method, and parallel step processing. &amp;nbsp;EXPLAIN is useful for performance tuning, debugging, pre-validation of requests, and for technical training.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;text-align: center;&quot;&gt;=========================================================================&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;What COALESCE function?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The newer ANSI standard COALESCE can also convert a NULL to a zero. However, it can convert a NULL value to any data value as well.&lt;br /&gt;
The COALESCE searches a value list, ranging from one to many values, and returns the first Non-NULL value it finds.&lt;br /&gt;
At the same time, it returns a NULL if all values in the list are NULL.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
To use the COALESCE, the SQL must pass the name of a column to the function. The data in the column is then compared for a NULL. Although one column name is all that is required, normally more than one column is &amp;nbsp; normally passed to it. Additionally, a literal value, which is never NULL, can be returned to provide a default value if &amp;nbsp; all of the previous column values are NULL&lt;br /&gt;
&lt;br /&gt;
The syntax for the COALESCE follows:&lt;br /&gt;
&lt;br /&gt;
SELECT &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;COALESCE (&lt;column-list&gt; [,&lt;literal&gt; ] )&lt;/literal&gt;&lt;/column-list&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ,&lt;aggregate&gt;( COALESCE(&lt;column-list&gt;[,&lt;literal&gt;] ) )&lt;/literal&gt;&lt;/column-list&gt;&lt;/aggregate&gt;&lt;br /&gt;
FROM &lt;table-name&gt;&lt;/table-name&gt;GROUP BY 1 ;&lt;br /&gt;
&lt;span style=&quot;text-align: center;&quot;&gt;=========================================================================&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;When will you create PPI and when will you create secondary indexes?&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Partitioned Primary Indexes are Created so as to divide the table onto partitions based on Range or Values as Required. This is effective for Larger Tables partitioned on the Date and integer columns. There is no extra Overhead on the System (no Spl Tables Created ect )&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Secondary Indexes are created on the table for an alternate way to access data. This is the second fastest method to retrieve data from a table next to the primary index. Sub tables are created.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;text-align: center;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
PPI and secondary indexes do not perform full table scans but they access only a defined st of data in the AMP&#39;s.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
=========================================================================&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;When you chose primary index and when will you choose secondary index?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Primary index will be chosen at the time of table creation. This will help us in data distribution, data retrieval and join operations.&lt;br /&gt;
Secondary indexes can be created and dropped at any time. They are used as an alternate path to access data other than the primary index.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Related Posts:&lt;/b&gt;&lt;br /&gt;
&lt;a href=&quot;http://teradatawiki.blogspot.in/2013/11/TeradataInterviewQuestionsPart2.html&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Interview Questions Part-2&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;a href=&quot;http://teradatawiki.blogspot.in/2013/11/TeradataInterviewQuestionsPart3.html&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt; Interview Questions Part-3&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/8790993394020056524'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/8790993394020056524'/><link rel='alternate' type='text/html' href='http://teradatawiki.blogspot.com/2013/11/Teradata-Interview-Questions-part1.html' title='Interview Questions Part-1'/><author><name>Admin</name><uri>http://www.blogger.com/profile/03270946312373154797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCm0FeHTqy9tdxei5Vc3zsRwKvVPISdFMvIqK5NAbGyyTShzSA7INIQO8uEUGzBkkIDbVj7rdc7z1yqFbAQJMIryVb0gOqbYP1pgPjtpQ9v73YBxwSkukI_mgytcpbIA/s220/IMG_3457.jpg.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSYKqp2gjiL37Nh7_egY7rRsr20_pLcoQByj_Xy9PG1ad2Lc5nHokXaqlbaeQIbwcr7XH59E40Q9wm6swt0ufaDCuPKZ-qymeMBCcJDDV6QllOGJ1J4u5oNv4-FlwpJSCI6Yt3fErj05M/s72-c/Teradata_interview_questions1.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-7106842514564860422.post-6990527070302092126</id><published>2013-11-26T20:33:00.000+05:30</published><updated>2015-03-02T23:29:28.211+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Interview Questions"/><title type='text'>Interview Questions Part-2</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;ssmainhide&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-5jOTBm7zTLLFUGGXWwv3L6fpuhW1NCv3jkMAnZq-mTdaf3MUqZk4jPx32PC9AzTYdge1HinQxF7jgBPYbrYdTTGx5b0hZL3KRZJ5NKcnURpdPFTaAOSxgyoA3rhrczA80Z3wsAc9UoU/s1600/Teradata_interview_questions1.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;TeradataWiki-Teradata_interview_questions2&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-5jOTBm7zTLLFUGGXWwv3L6fpuhW1NCv3jkMAnZq-mTdaf3MUqZk4jPx32PC9AzTYdge1HinQxF7jgBPYbrYdTTGx5b0hZL3KRZJ5NKcnURpdPFTaAOSxgyoA3rhrczA80Z3wsAc9UoU/s200/Teradata_interview_questions1.png&quot; height=&quot;123&quot; title=&quot;TeradataWiki-Teradata_interview_questions2&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Diff between database and user?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Both may own objects such as tables, views, macros, procedures, and functions. Both users and databases may hold privileges.&lt;br /&gt;
However, only users may log on, establish a session with the Teradata Database, and submit requests.&lt;br /&gt;
&lt;br /&gt;
A user performs actions where as a database is passive. Users have passwords and startup strings; databases do not. Users can log on to the Teradata Database, establish sessions, and submit SQL statements; databases cannot.&lt;br /&gt;
&lt;br /&gt;
Creator privileges are associated only with a user because only a user can log on and submit a CREATE statement. Implicit privileges are associated with either a database or a user because each can hold an object and an object is owned by the named space in which it resides&lt;br /&gt;
&lt;br /&gt;
=========================================================================&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;When a PI is not mentioned on a table, how will Teradata consider the PI for that table?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
If you don&#39;t specify a PI at table create time then Teradata must chose one. For instance, if the DDL is ported from another database that uses a Primary Key instead of a Primary Index, the CREATE TABLE contains a PRIMARY KEY (PK) constraint. Teradata is smart enough to know that Primary Keys must be unique and cannot be null. So, the first level of default is to use the PRIMARY KEY column(s) as a UPI.&lt;br /&gt;
If the DDL defines no PRIMARY KEY, Teradata looks for a column defined as UNIQUE. As a second level default, Teradata uses the first column defined with a UNIQUE constraint as a UPI.&lt;br /&gt;
If none of the above attributes are found, Teradata uses the first column defined in the table as a NON-UNIQUE PRIMARY INDEX (NUPI).&lt;br /&gt;
&lt;br /&gt;
=========================================================================&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;What is covered query in Teradata?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
If a SELECT query covers all the columns that are defined in the JOIN INDEX as join columns, such type of queries are called as COVERED query.&lt;br /&gt;
Multi-Column NUSI Columns used as a Covered Query&lt;br /&gt;
=========================================================================&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;What is the use of &amp;nbsp;WITH CHECK OPTION in Teradata?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
In Teradata, the additional key phase: WITH CHECK OPTION, indicates that the WHERE clause conditions should be applied during the execution of an UPDATE or DELETE against the view. This is not a concern if views are not used for maintenance activity due to restricted privileges.&lt;br /&gt;
&lt;br /&gt;
=========================================================================&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;What is identity column?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Teradata has a concept of identity columns on their tables beginning around V2R6.x. These columns differ from Oracle&#39;s sequence concept in that the number assigned is not guaranteed to be sequential. The identity column in Teradata is simply used to guaranteed row-uniqueness.&lt;br /&gt;
Example:&lt;br /&gt;
CREATE MULTISET TABLE MyTable&lt;br /&gt;
&amp;nbsp; (&lt;br /&gt;
&amp;nbsp; &amp;nbsp;ColA INTEGER GENERATED BY DEFAULT AS IDENTITY&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(START WITH 1&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; INCREMENT BY 20)&lt;br /&gt;
&amp;nbsp; &amp;nbsp;ColB VARCHAR(20) NOT NULL&lt;br /&gt;
&amp;nbsp; )&lt;br /&gt;
UNIQUE PRIMARY INDEX pidx (ColA);&lt;br /&gt;
Granted, ColA may not be the best primary index for data access or joins with other tables in the data model. It just shows that you could use it as the PI on the table.&lt;br /&gt;
&lt;br /&gt;
=========================================================================&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;How to implement UPSERT logic in Teradata using SQL?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
We have MERGE-INTO option available in Teradata data which works as an UPSERT logic in teradata. If the condition matches then update else insert.&lt;br /&gt;
&lt;br /&gt;
Example: MERGE into dept_table1 as Taregt&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; USING (SELECT dept_no, dept_name, budget&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FROM dept_table where dept_no = 20) Source&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ON (Target.dept_no = 20)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; WHEN MATCHED then&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; UPDATE set dept_name = ëBeing Renamedí&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; WHEN NOT MATCHED then&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; INSERT (dept_no, dept_name, budget)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; VALUES (source.dept_no, source.dept_name, source.budget);&lt;br /&gt;
&lt;br /&gt;
=========================================================================&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;What is value ordered NUSI?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
When we define a value ordered NUSI on a column the rows in the secondary subtable get &amp;nbsp;sorted based on the secondary index value. The columns should be of integer or date type.&lt;br /&gt;
This is used for range queries and to avoid full table scans on large tables.&lt;br /&gt;
&lt;br /&gt;
=========================================================================&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;What are the DBQL tables.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Database Query Log tables are the tables present in DBC database which store the history of all the operations performed on the tables present in the databases.&lt;br /&gt;
The history could get very large so these tables should be purged when the data is no longer needed.&lt;br /&gt;
&lt;br /&gt;
=========================================================================&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;What is the difference between sample and top?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The Sampling function (SAMPLE) permits a SELECT to randomly return rows from a Teradata database table.&lt;br /&gt;
It allows the request to specify either an absolute number of rows or a percentage of rows to return. Additionally, it provides an ability to return rows from multiple samples.&lt;br /&gt;
&lt;br /&gt;
SELECT * FROM student_course_table SAMPLE 5;&lt;br /&gt;
&lt;br /&gt;
The TOP clause is used to specify the number of records to return. The TOP clause can be very useful on large tables with thousands of records. Returning a large number of records can impact on performance.&lt;br /&gt;
&lt;br /&gt;
SELECT TOP 2 * FROM EMP.&lt;br /&gt;
&lt;br /&gt;
=========================================================================&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;What is difference between ZEROIFNULL and NULLIFZERO ?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
The &amp;nbsp;ZEROIFNULL function: will pass zero when data coming as null&lt;br /&gt;
The &amp;nbsp;NULLIFZERO function: will pass null when data coming as zero.&lt;br /&gt;
&lt;br /&gt;
=========================================================================&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;What is Range_N?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Range_N is defined on a partition primary index to specify the range of values of a column that should be assigned to a partition.&lt;br /&gt;
The number of partitions = the number of ranges specified + no case + unknown&lt;br /&gt;
no case ñ&amp;gt; if the value does not belong to any range&lt;br /&gt;
unknown -&amp;gt; for the values like nulls, spaces etc&lt;br /&gt;
&lt;br /&gt;
=========================================================================&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;What is Casting in Teradata ?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
It will convert the data type&lt;br /&gt;
The casting is similar to DDL:&lt;br /&gt;
CAST(&#39;02/03/2009-01:25:11&#39; AS TIMESTAMP FORMAT &#39;MM/DD/YYYY-HH:MI:SS&#39;)&lt;br /&gt;
=========================================================================&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Can we do collect stats on a table when the table is being updated?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
No.We never collect stats on a table when the table is being updated. It will go for dead lock.&lt;br /&gt;
&lt;br /&gt;
=========================================================================&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;When will you go for hash index?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
A hash index organizes the search keys with their associated pointers into a hash file structure.&lt;br /&gt;
We apply a hash function on a search key to identify a bucket, and store the key and its associated pointers in the bucket (or in overflow buckets).&lt;br /&gt;
Strictly speaking, hash indices are only secondary index structures, since if a file itself is organized using hashing, there is no need for a separate hash index structure on it.&lt;br /&gt;
&lt;br /&gt;
=========================================================================&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Difference between Global and Volatile Temporary Table? Where they can be used and how they can be used?&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt; &lt;b&gt;Global Temporary Tables&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Materialize in users temporary space&lt;/li&gt;
&lt;li&gt;Base definitions are permanent in Data Dictionary tables&lt;/li&gt;
&lt;li&gt;Definitions can be materialized by any user with the necessary DML privileges&lt;/li&gt;
&lt;li&gt;Can be defined for COLLECT STATISTICS&lt;/li&gt;
&lt;li&gt;Can survive a Teradata Database restart&lt;/li&gt;
&lt;li&gt;Up to 2000 materialized tables per session&lt;/li&gt;
&lt;li&gt;Materialized instance is local to a session&lt;/li&gt;
&lt;li&gt;If not dropped manually, instance is dropped automatically at session end&lt;/li&gt;
&lt;li&gt;An instance an be dropped manually any time during a session with DROP TEMPORARY TABLE&lt;/li&gt;
&lt;li&gt;Materialized contents are not shareable with other sessions&lt;/li&gt;
&lt;li&gt;A very large number of global tables can prolong logoff, because materialized global tables are dropped automatically at session end.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;b&gt;Volatile Tables&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Occupy space in users SPOOL allocation&lt;/li&gt;
&lt;li&gt;Definitions are kept in cache and go away at session end or during a Teradata Database restart&lt;/li&gt;
&lt;li&gt;Private to the session in which they are created&lt;/li&gt;
&lt;li&gt;Can be defined for COLLECT STATISTICS(TD14 feature)&lt;/li&gt;
&lt;li&gt;Do not survive a Teradata Database reset&lt;/li&gt;
&lt;li&gt;Up to 1000 tables per session&lt;/li&gt;
&lt;li&gt;Local to a session&lt;/li&gt;
&lt;li&gt;If not dropped manually, dropped automatically at session end&lt;/li&gt;
&lt;li&gt;Can be dropped manually any time during a session with DROP TABLE&lt;/li&gt;
&lt;li&gt;Contents are not sharable with other sessions&lt;/li&gt;
&lt;li&gt;A very large number of volatile tables can prolong logoff, because volatile tables are dropped automatically at session end.&lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;Related Posts:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;a href=&quot;http://teradatawiki.blogspot.in/2013/11/Teradata-InterviewQuestionspart1.html&quot;&gt;Interview Questions Part-1&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://teradatawiki.blogspot.in/2013/11/TeradataInterviewQuestionsPart3.html&quot;&gt;&amp;nbsp;Interview Questions Part-3&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/6990527070302092126'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/6990527070302092126'/><link rel='alternate' type='text/html' href='http://teradatawiki.blogspot.com/2013/11/Teradata-Interview-Questions-Part2.html' title='Interview Questions Part-2'/><author><name>Admin</name><uri>http://www.blogger.com/profile/03270946312373154797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCm0FeHTqy9tdxei5Vc3zsRwKvVPISdFMvIqK5NAbGyyTShzSA7INIQO8uEUGzBkkIDbVj7rdc7z1yqFbAQJMIryVb0gOqbYP1pgPjtpQ9v73YBxwSkukI_mgytcpbIA/s220/IMG_3457.jpg.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-5jOTBm7zTLLFUGGXWwv3L6fpuhW1NCv3jkMAnZq-mTdaf3MUqZk4jPx32PC9AzTYdge1HinQxF7jgBPYbrYdTTGx5b0hZL3KRZJ5NKcnURpdPFTaAOSxgyoA3rhrczA80Z3wsAc9UoU/s72-c/Teradata_interview_questions1.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-7106842514564860422.post-3544309689084714173</id><published>2013-11-25T20:37:00.000+05:30</published><updated>2015-03-02T23:29:56.187+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Interview Questions"/><title type='text'>Interview Questions Part-3</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;ssmainhide&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqs0HHPljtgiUk7456VjLMi48FyAbWj-Oscngtv_pFfQPI9jzKku45VWGXnXciA6Yb2fFsS7PJQnPelnlQXwo4txXENcXmlXaq6M12sERNZq8kzsb0ssiL7BuK9M0Pfw9IP6NSdDpEulw/s1600/Teradata_interview_questions1.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;TeradataWiki-Teradata_interview_questions&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqs0HHPljtgiUk7456VjLMi48FyAbWj-Oscngtv_pFfQPI9jzKku45VWGXnXciA6Yb2fFsS7PJQnPelnlQXwo4txXENcXmlXaq6M12sERNZq8kzsb0ssiL7BuK9M0Pfw9IP6NSdDpEulw/s200/Teradata_interview_questions1.png&quot; height=&quot;123&quot; title=&quot;TeradataWiki-Teradata_interview_questions&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;What are the advantages of partitioned tables:&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
1)They provide efficient searches by using partition elimination at the various levels or combination of levels.&lt;br /&gt;
2)They reduce the I/O for range constraint queries&lt;br /&gt;
3)They take advantage of dynamic partition elimination&lt;br /&gt;
4)They provide multiple access paths to the data, and an MLPPI provides even more partition elimination and more partitioning expression choices,&lt;br /&gt;
&amp;nbsp;(i.e., you can use last name or some other value that is more readily available to query on.)&lt;br /&gt;
5)The Primary Index may be either a UPI or a NUPI; a NUPI allows local joins to other similar entities&lt;br /&gt;
6)Row hash locks are used for SELECT with equality conditions on the PI columns.&lt;br /&gt;
7)Partitioned tables allow for fast deletes of data in a partition.&lt;br /&gt;
8)They allow for range queries without having to use a secondary index.&lt;br /&gt;
9)Specific partitions maybe archived or deleted.&lt;br /&gt;
10)May be created on Volatile tables; global temp tables, base tables, and non-compressed join indexes.&lt;br /&gt;
11)May replace a Value Ordered NUSI for access.&lt;br /&gt;
&lt;br /&gt;
=========================================================================&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;What are the Partitioning Rules:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
1)A table can have up to 65,535 Partitions.&lt;br /&gt;
2)Partitioning never determines which AMP gets row.&lt;br /&gt;
3)Partitioning determines how an AMP will sort the row on its own.&lt;br /&gt;
4)Table can have up to 15 levels of partitions.&lt;br /&gt;
5)A table cannot have an UPI as the Primary Index if the Partition table does not include PI.&lt;br /&gt;
6)Total 3 forms of Partitioning Simple, RANGE and CASE.&lt;br /&gt;
&lt;br /&gt;
=========================================================================&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;What are the Disadvantages of partitioned tables&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
1)Rows in a partitioned table are 2 bytes longer.&lt;br /&gt;
2)Access via the Primary Index may take longer.&lt;br /&gt;
3)Full table joins to a NPPI table with the same PI may take longer. &lt;br /&gt;
=========================================================================&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Difference between Set and Multiset Table?&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
The SET table does not allow duplicate rows while the multiset table allow duplicate rows. For a SET table, to enhance the performance and to enforce uniqueness, a UPI or a USI can be created on a particular column. For a multiset table, a NUPI or NUSI can be created on a particular column to enhance performance.&lt;br /&gt;
&lt;br /&gt;
Characteristics of SET tables:&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Logically correct Implementation&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Automatic duplicate row elimination&lt;br /&gt;
&lt;br /&gt;
Characteristics of MULTISET tables:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;No duplicate row check overhead&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Data integrity becomes a user responsibility&lt;br /&gt;
&lt;br /&gt;
=========================================================================&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;What are the Advantages and Disadvantages of multi-column PI?&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
As many as 64 columns may be included in an index. Multi-column Primary Indexes may provide better distribution.&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;Advantage&lt;/u&gt;&lt;br /&gt;
*More columns = more uniqueness&lt;br /&gt;
*Distinct value increases.&lt;br /&gt;
*Rows per value decreases.&lt;br /&gt;
*Selectivity increases.&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;Disadvantage&lt;/u&gt;&lt;br /&gt;
*More columns = less usability&lt;br /&gt;
*PI can only be used when values for all PI columns are provided in SQL statement.&lt;br /&gt;
*Partial values do not generate a useful hash result.&lt;br /&gt;
=========================================================================&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;What is Value List Compression? how would you implement compression ?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
The Value list compression cannot compress an existing column but it can be used to add a compressed column to a table.&lt;br /&gt;
Use the ALTER TABLE statement to compress columns and reduce the number of I/O operations. Consider the following:&lt;br /&gt;
*Set the column default value to most frequent value.&lt;br /&gt;
*Compress to the default value.&lt;br /&gt;
*This is especially useful for sparsely populated columns.&lt;br /&gt;
*Overhead is not high.&lt;br /&gt;
*The I/O savings correlates to the percentage of data compressed out of a row.&lt;br /&gt;
&lt;br /&gt;
Value List Compression (VLC) provides the Teradata database with the capacity to support multiple value compression for fixed width columns. When you specify a values or values, the system suppresses any data matching the compress value from a row. This saves disk space. Smaller physical row size results in less data blocks and fewer I/Os and improved overall performance.&lt;br /&gt;
&lt;br /&gt;
Because VLC allows you to specify a list of compress values for a column, the system suppresses data when one of the specified values exists in the column. Up to 255 distinct values (plus NULL) may be compressed per fixed-width column.&lt;br /&gt;
&lt;br /&gt;
VLC improves performance as follows:&lt;br /&gt;
*Reduces the I/O required for scanning tables when the tables have compressible values in their columns.&lt;br /&gt;
*Reduces disk space because rows are smaller.&lt;br /&gt;
*Permits joins to look up the tables to be eliminated.&lt;br /&gt;
*Improves data loading because more rows may fit into one data block after compression is applied.&lt;br /&gt;
&lt;br /&gt;
=========================================================================&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;What have you done to resolve the running out of spool problem?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
To resolve running out of spool problem,&lt;br /&gt;
1) The column involved in the where clause/joining column is an index column or not, should be checked .&lt;br /&gt;
2) Also whether statistics have been collected on the index column. If no statistics have been collected then collect stats on it.&lt;br /&gt;
3) Check maxspool and peak spool from dbc.diskspace per amp basis and check for data skew.&lt;br /&gt;
4) Also check for improper join condition or join condition missing.&lt;br /&gt;
4) Despite of the steps taken, the running out of spool problem comes then explicitly increase the spool space. &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;br /&gt;
=========================================================================&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;What are the limitations of Fast load?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
1) No Secondary Indexes are allowed on the Target Table: Usually UPI and NUPI are used in Teradata to distribute the rows evenly across the AMPs.Secondary indexes are stored in a subtable block and many times on a different AMP from the data row.&lt;br /&gt;
&lt;br /&gt;
2)No Referential Integrity is allowed: The Referential Integrity defined on a table would take more system checking to prevent referential constraints.&lt;br /&gt;
&lt;br /&gt;
3)No Triggers are allowed at load time: Fast load focused on data load with high speed. So triggers not allowed.&lt;br /&gt;
&lt;br /&gt;
4)Duplicate Rows (in Multi-Set Tables) are not supported: Multiset tables are allowed duplicate data. Fastload can load the data into multiset tables but duplicate rows are discarded.&lt;br /&gt;
&lt;br /&gt;
5)No AMPs may go down (i.e., go offline) while FastLoad is processing: The down AMP must be repaired before the load process can be restarted&lt;br /&gt;
&lt;br /&gt;
6)No more than one data type conversion is allowed per column: Data type conversion cause high resource utilization on the system&lt;br /&gt;
&lt;br /&gt;
=========================================================================&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;What are the limitations of Multi load?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
1)Unique Secondary Indexes are not supported on a Target Table:Like FastLoad, MultiLoad does not support Unique Secondary Indexes (USIs). But unlike FastLoad, it does support the use of Non-Unique Secondary Indexes (NUSIs) because the index subtable row is on the same AMP as the data row.&lt;br /&gt;
&lt;br /&gt;
2)Referential Integrity is not supported: The Referential Integrity defined on a table would take more system checking to prevent referential constraints.&lt;br /&gt;
&lt;br /&gt;
3)Triggers are not supported at load time: Disable all the Triggers prior to using it.&lt;br /&gt;
&lt;br /&gt;
4)No concatenation of input files is allowed: It could impact are restart if the files were concatenated in a different sequence or data was deleted between runs.&lt;br /&gt;
&lt;br /&gt;
5)No Join Indexes: All the join indexes must be dropped before running a MultiLoad and then recreate them after the load is completed&lt;br /&gt;
&lt;br /&gt;
6)Will not process aggregates, arithmetic functions or exponentiation:If you need data conversions or math, you might be better off using an INMOD to prepare the data prior to loading it&lt;br /&gt;
=========================================================================&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Explain the phases in Multiload?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
MultiLoad Has Five IMPORT Phases:&lt;br /&gt;
Phase 1: Preliminary Phase : Ita Basic setup phase.Its used for several preliminary set-up activities for a successful data load.&lt;br /&gt;
Phase 2: DML Transaction Phase: All the SQL Data Manipulation Language (DML) statements are sent &amp;nbsp;to Teradata database as Multilaod supports multiple DML functions.&lt;br /&gt;
Phase 3: Acquisition Phase: Once the setup completes the PE&#39;s plan stored on each AMP.Then Locks the table headers and the actual input data will also be stored in the worktable.&lt;br /&gt;
Phase 4: Application Phase: In this phase all DML opreations are applied on target tables.&lt;br /&gt;
Phase 5: Cleanup Phase: Table locks will be released and all the intermediate work tables will be dropped.&lt;br /&gt;
=========================================================================&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;What are the limitations of Tpump?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;No concatenation of input data files is allowed.&lt;/li&gt;
&lt;li&gt;TPump will not process aggregates, arithmetic functions or exponentiation.&lt;/li&gt;
&lt;li&gt;The use of the SELECT function is not allowed.&lt;/li&gt;
&lt;li&gt;No more than four IMPORT commands may be used in a single load task.&lt;/li&gt;
&lt;li&gt;Dates before 1900 or after 1999 must be represented by the yyyy format for the year portion of the date, not the default format of yy.&lt;/li&gt;
&lt;li&gt;On some network attached systems, the maximum file size when using TPump is 2GB.&lt;/li&gt;
&lt;li&gt;TPump performance will be diminished if Access Logging is used.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
=========================================================================&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;How many types of error tables in Fast Load?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Each FastLoad requires two error tables. These are automatically created during run. These will populated only errors occurred during the load.&lt;br /&gt;
&lt;br /&gt;
The first error table is for any translation errors or constraint violations&lt;br /&gt;
For example, if a column is defined as integer but the data from source the data is coming in CHAR format.i.e wrong data.&lt;br /&gt;
&lt;br /&gt;
The second error table is for errors caused by duplicate values for Unique Primary Indexes.&lt;br /&gt;
=========================================================================&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;What is Quantiles?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Quantiles are used to divide a number of rows into a number of partitions of roughly equal size. The most common quantile is the percentile which is based on a value of 100. It is also not uncommon to have quartiles (based on 4), tertiles (based on 3) or deciles (based on 10). Notice that by default, both the quantile column and the quantile value itself will be output in ascending sequence.&lt;br /&gt;
&lt;br /&gt;
Aggregations may not be combined with OLAP functions, thus a derived or temporary table is sometimes necessary to produce the aggregation before the function is applied. The standard form of the quantile function is:&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;QUANTILE (quantile_constant,sortlist)&lt;br /&gt;
&lt;br /&gt;
SELECT employee_number, salary_amount,&lt;br /&gt;
QUANTILE (100, employee_number,salary_amount )&lt;br /&gt;
FROM employee &lt;br /&gt;
QUALIFY QUANTILE (100, employee_number) &amp;lt; 25; &lt;br /&gt;
&lt;br /&gt;
=========================================================================&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;What is WIDTH_BUCKET ?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The WIDTH_BUCKET function assigns partition numbers to values associated with a column or expression, based on a specified range and based on the number of partitions desired.&lt;br /&gt;
Like many OLAP and aggregate functions, WIDTH_BUCKET is used to extract statistical information from sample populations.&lt;br /&gt;
The format of the function is as follows:&lt;br /&gt;
WIDTH_BUCKET (column_expr,lower_bound, upper_bound ,partition_count)&lt;br /&gt;
&lt;br /&gt;
=========================================================================&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;What is Random function?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The RANDOM function may be used to generate a random number between a specified range.&lt;br /&gt;
RANDOM (Lower limit, Upper limit) returns a random number between the lower and upper limits inclusive. Both limits must be specified, otherwise a random number between 0 and approximately 4 billion is generated.&lt;br /&gt;
&lt;br /&gt;
SEL DEPARTMENT_NUMBER,RANDOM(1,9) FROM EMPLOYEE;&lt;br /&gt;
&lt;br /&gt;
limitations:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; RANDOM is non-ANSI standard&lt;br /&gt;
&amp;nbsp; &amp;nbsp; RANDOM may be used in a SELECT list or a WHERE clause, but not both&lt;br /&gt;
&amp;nbsp; &amp;nbsp; RANDOM may be used in Updating, Inserting or Deleting rows&lt;br /&gt;
&amp;nbsp; &amp;nbsp; RANDOM may not be used with aggregate or OLAP functions&lt;br /&gt;
&amp;nbsp; &amp;nbsp; RANDOM cannot be referenced by numeric position in a GROUP BY or ORDER BY clause&lt;br /&gt;
=========================================================================&lt;br /&gt;
&lt;b&gt;Related Posts:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;a href=&quot;http://teradatawiki.blogspot.in/2013/11/Teradata-InterviewQuestionspart1.html&quot;&gt;Interview Questions Part-1&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://teradatawiki.blogspot.in/2013/11/TeradataInterviewQuestionsPart2.html&quot;&gt;Interview Questions Part-2&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/3544309689084714173'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/3544309689084714173'/><link rel='alternate' type='text/html' href='http://teradatawiki.blogspot.com/2013/11/Teradata-Interview-Questions-Part3.html' title='Interview Questions Part-3'/><author><name>Admin</name><uri>http://www.blogger.com/profile/03270946312373154797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCm0FeHTqy9tdxei5Vc3zsRwKvVPISdFMvIqK5NAbGyyTShzSA7INIQO8uEUGzBkkIDbVj7rdc7z1yqFbAQJMIryVb0gOqbYP1pgPjtpQ9v73YBxwSkukI_mgytcpbIA/s220/IMG_3457.jpg.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqs0HHPljtgiUk7456VjLMi48FyAbWj-Oscngtv_pFfQPI9jzKku45VWGXnXciA6Yb2fFsS7PJQnPelnlQXwo4txXENcXmlXaq6M12sERNZq8kzsb0ssiL7BuK9M0Pfw9IP6NSdDpEulw/s72-c/Teradata_interview_questions1.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-7106842514564860422.post-6522440477444631393</id><published>2013-10-25T00:06:00.002+05:30</published><updated>2013-12-19T21:37:58.436+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="TPT"/><category scheme="http://www.blogger.com/atom/ns#" term="Utilities"/><title type='text'>TPT</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;ssmainhide&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgm6IwFAbb6RrgK0hxI9wBCvRq3ffb-jMsg6CfcbLMegw-TafaYpFpgQvnvTPaM-qKFEVyWgrJf-5q1AUERh2V8TMK1s_MstfNxo_PstHq73ZqKpN5oadSN1UfPvKP7QSPsnGAwvIcAAgI/s1600/TPT.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;TeradataWiki-Teradata Utilities TPT&quot; border=&quot;0&quot; height=&quot;128&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgm6IwFAbb6RrgK0hxI9wBCvRq3ffb-jMsg6CfcbLMegw-TafaYpFpgQvnvTPaM-qKFEVyWgrJf-5q1AUERh2V8TMK1s_MstfNxo_PstHq73ZqKpN5oadSN1UfPvKP7QSPsnGAwvIcAAgI/s200/TPT.png&quot; title=&quot;TeradataWiki-Teradata Utilities TPT&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
The Teradata Parallel Transport (TPT) utility is combination of BTEQ, FastLoad, MultiLoad, Tpump, and FastExport utilities. So TPT can perform&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Insert data to tables&lt;/li&gt;
&lt;li&gt;Export data from tables&lt;/li&gt;
&lt;li&gt;Update tables&lt;/li&gt;
&lt;/ul&gt;
TPT works around the concept of Operators and Data Streams.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUHtO0ndXQX7NmMDOYJ2ROK9Hl_QxlYtYhqxJd_80EMLhRe_ucvQBIEPXM3OedgawH-cmc7UROIyJn1qi530H9eH8WkeKqJP2aceApBUA_xt9T-wPq3I8Liccrgn_U4bbUvlv8n92KH9o/s1600/TPT1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;TERADATA TPT&quot; border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUHtO0ndXQX7NmMDOYJ2ROK9Hl_QxlYtYhqxJd_80EMLhRe_ucvQBIEPXM3OedgawH-cmc7UROIyJn1qi530H9eH8WkeKqJP2aceApBUA_xt9T-wPq3I8Liccrgn_U4bbUvlv8n92KH9o/s320/TPT1.png&quot; title=&quot;TERADATA TPT&quot; width=&quot;213&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;TPT&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
In the following diagram showing you mainly three components.&lt;br /&gt;
&lt;br /&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;b&gt;Producer or READ Operator&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Filter Operator or TRANSFORM Operator&amp;nbsp;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Consumer Operator or WRITE Operator&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt;
The Producer Operator performs read the Queues, Files, Relational Databases, and Non-Relational Sources.&lt;br /&gt;
The Filter Operators Transforms data from INMODs, WHERE Clauses, APPLY Filters, and User-Defined functions.&lt;br /&gt;
The Consumer Operator performs INSERTS (Load), Updates, SQL Inserts, and Tpump like Streams.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQJ6DpmlCyaDDhYoxrIOSEnxi0HNrkVg_WLvc_wZUm624dON6BJLTPZDiA8yk-OPt3wCUE-tziA11ZPmCfL19oFzjX9NqCeKoddjh7DiBX0DY24o0sAd6qRoXWgpCjQA4EGNvc4X3U6hY/s1600/TPT2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;TERADATA TPT&quot; border=&quot;0&quot; height=&quot;295&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQJ6DpmlCyaDDhYoxrIOSEnxi0HNrkVg_WLvc_wZUm624dON6BJLTPZDiA8yk-OPt3wCUE-tziA11ZPmCfL19oFzjX9NqCeKoddjh7DiBX0DY24o0sAd6qRoXWgpCjQA4EGNvc4X3U6hY/s320/TPT2.png&quot; title=&quot;TERADATA TPT&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;How to Run a TPT Script&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The easiest way to run a TPT script is to use the TBuild utility. You first create your script and then run TBuild, passing&lt;br /&gt;
TBuild the script name to run.&lt;br /&gt;
&lt;br /&gt;
In the below example just create a sample script called Scriptname.txt(this is not complete script)&lt;br /&gt;
Then run by using TBuild –f command.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;1) Create a script&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;DEFINE JOB CREATE_SOURCE_EMP_TABLE&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;DEFINE OPERATOR DDL OPERATOR&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;DESCRIPTION &#39;TPT DDL OPERATOR&#39;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TYPE DDL&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ATTRIBUTES&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;VARCHAR TDPID = &#39;LOCALTD&#39;,&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;VARCHAR USERNAME =&#39;DBC&#39;,&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;VARCHAR PASSWORD =&#39;DBC&#39;,&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;);&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;2) Using the command prompt run TBuild command&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;TBuild -f C:\Temp\Scriptname.txt&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/6522440477444631393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/6522440477444631393'/><link rel='alternate' type='text/html' href='http://teradatawiki.blogspot.com/2013/10/TERADATA-UTILITIES-TPT.html' title='TPT'/><author><name>Admin</name><uri>http://www.blogger.com/profile/03270946312373154797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCm0FeHTqy9tdxei5Vc3zsRwKvVPISdFMvIqK5NAbGyyTShzSA7INIQO8uEUGzBkkIDbVj7rdc7z1yqFbAQJMIryVb0gOqbYP1pgPjtpQ9v73YBxwSkukI_mgytcpbIA/s220/IMG_3457.jpg.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgm6IwFAbb6RrgK0hxI9wBCvRq3ffb-jMsg6CfcbLMegw-TafaYpFpgQvnvTPaM-qKFEVyWgrJf-5q1AUERh2V8TMK1s_MstfNxo_PstHq73ZqKpN5oadSN1UfPvKP7QSPsnGAwvIcAAgI/s72-c/TPT.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-7106842514564860422.post-2333185792334885150</id><published>2013-10-23T21:22:00.004+05:30</published><updated>2017-01-26T03:54:38.682+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="TPUMP"/><category scheme="http://www.blogger.com/atom/ns#" term="Utilities"/><title type='text'>TPUMP</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;ssmainhide&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqIYl8ZDPIYmMtUAmdKAM4Cwg0C-D4vRPJ_Z5jGozk-z8yic9gU8hFDA5-7CdqgsXFPtpoJgim0jXdYzVGv6wwW_S0nKSa3Z_nXhWYDotBKCYpBUlLB8ahfZ_IiOmtoyW8T7nVF3vl4AM/s1600/Teradata_tpump.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;TeradataWiki-Teradata Utilities Tpump&quot; border=&quot;0&quot; height=&quot;126&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqIYl8ZDPIYmMtUAmdKAM4Cwg0C-D4vRPJ_Z5jGozk-z8yic9gU8hFDA5-7CdqgsXFPtpoJgim0jXdYzVGv6wwW_S0nKSa3Z_nXhWYDotBKCYpBUlLB8ahfZ_IiOmtoyW8T7nVF3vl4AM/s200/Teradata_tpump.png&quot; title=&quot;TeradataWiki-Teradata Utilities Tpump&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
TPump is shortened name for Teradata Parallel Data Pump . As learned Fastload and Multiload are loads huge volume of data. But TPump loads data one row at a time, using row hash locks..&lt;br /&gt;
Because it locks at this level,and not at the table level like MultiLoad,TPump can make many simultaneous, or concurrent, updates on a table.&lt;br /&gt;
&lt;br /&gt;
TPump performs Inserts,Upadtes,Deletes and Upserts from Flat filed to populated Teradata tables at ROW LEVEL.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;TPump supports&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Secondary Indexes&lt;/li&gt;
&lt;li&gt;Referential Integrity&lt;/li&gt;
&lt;li&gt;Triggers&lt;/li&gt;
&lt;li&gt;Join indexes&lt;/li&gt;
&lt;li&gt;Pumpdata in at varying rates.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
Tpump also have limitations.&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;No concatenation of input data files is allowed.&lt;/li&gt;
&lt;li&gt;TPump will not process aggregates, arithmetic functions or exponentiation.&lt;/li&gt;
&lt;li&gt;The use of the SELECT function is not allowed.&lt;/li&gt;
&lt;li&gt;No more than four IMPORT commands may be used in a single load task.&lt;/li&gt;
&lt;li&gt;Dates before 1900 or after 1999 must be represented by the yyyy format for the year portion of the date, not the default format of yy.&lt;/li&gt;
&lt;li&gt;On some network attached systems, the maximum file size when using TPump is 2GB.&lt;/li&gt;
&lt;li&gt;TPump performance will be diminished if Access Logging is used.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
Tpump supports One Error Table.The error table does the following:&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Identifies errors&lt;/li&gt;
&lt;li&gt;Provides some detail about the errors&lt;/li&gt;
&lt;li&gt;Stores a portion the actual offending row for debugging&lt;/li&gt;
&lt;/ul&gt;
Like the other utilities, a TPump script is fully restartable as long as the log table and error tables are not dropped&lt;br /&gt;
&lt;br /&gt;
A Sample TPump Script&lt;br /&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;The script on the following page follows these steps:&lt;/li&gt;
&lt;li&gt;Setting up a Logtable&lt;/li&gt;
&lt;li&gt;Logging onto Teradata&lt;/li&gt;
&lt;li&gt;Identifying the Target, Work and Error tables&lt;/li&gt;
&lt;li&gt;Defining the INPUT flat file&lt;/li&gt;
&lt;li&gt;Defining the DML activities to occur&lt;/li&gt;
&lt;li&gt;Naming the IMPORT file&lt;/li&gt;
&lt;li&gt;Telling TPump to use a particular LAYOUT&lt;/li&gt;
&lt;li&gt;Telling the system to start loading&lt;/li&gt;
&lt;li&gt;Finishing and log off of Teradata&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;LOGTABLE &amp;nbsp;EMPDB.EMP_TPUMP_LOG;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt; &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;LOGON TDDB/USERNAME,PWD;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt; &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;BEGIN LOAD&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;PACK 5&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;RATE 10&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;ERROR TABLE EMPDB.TPUMP ERROR;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt; &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;.LAYOUT RECLAYOUT;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt; &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;.FIELD &amp;nbsp; &amp;nbsp;EMP_NUM &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * INTEGER;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;.FIELD &amp;nbsp; &amp;nbsp;DEPT_NUM &amp;nbsp; &amp;nbsp; &amp;nbsp; * SMALLINT;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;.FIELD &amp;nbsp; &amp;nbsp;FIRST_NAME &amp;nbsp; &amp;nbsp;* CHAR(20);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;.FIELD &amp;nbsp; &amp;nbsp;LAST_NAME &amp;nbsp; &amp;nbsp; * VARCHAR(20);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;.FIELD &amp;nbsp; &amp;nbsp;SALARY &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;* DECIMAL(8,2);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt; &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;.DML LABEL EMP_INS;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;INSERT INTO EMPDB.EMP_TABLE&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;(EMP_NUM, DEPT_NUM, FIRST_NAME, LAST_NAME, SALARY)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;VALUES&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;(:EMP_NUM, :DEPT_NUM, :FIRST_NAME, :LAST_NAME, :SALARY);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt; &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;.IMPORT INFILE C:\TEMP\TPUMP_FLAT_FILE.txt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt; &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;LAYOUT RECLAYOUT&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;APPLY EMP_INS&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt; &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;.END LOAD;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;.LOGOFF;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/2333185792334885150'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/2333185792334885150'/><link rel='alternate' type='text/html' href='http://teradatawiki.blogspot.com/2013/10/Teradatautilities-tpump.html' title='TPUMP'/><author><name>Admin</name><uri>http://www.blogger.com/profile/03270946312373154797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCm0FeHTqy9tdxei5Vc3zsRwKvVPISdFMvIqK5NAbGyyTShzSA7INIQO8uEUGzBkkIDbVj7rdc7z1yqFbAQJMIryVb0gOqbYP1pgPjtpQ9v73YBxwSkukI_mgytcpbIA/s220/IMG_3457.jpg.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqIYl8ZDPIYmMtUAmdKAM4Cwg0C-D4vRPJ_Z5jGozk-z8yic9gU8hFDA5-7CdqgsXFPtpoJgim0jXdYzVGv6wwW_S0nKSa3Z_nXhWYDotBKCYpBUlLB8ahfZ_IiOmtoyW8T7nVF3vl4AM/s72-c/Teradata_tpump.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-7106842514564860422.post-9195182910005802755</id><published>2013-10-23T21:19:00.004+05:30</published><updated>2013-12-19T21:37:09.472+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="MULTI LOAD"/><category scheme="http://www.blogger.com/atom/ns#" term="Utilities"/><title type='text'>MULTI LOAD</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;ssmainhide&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgf0w60NZO0k0lexZmRWXBKsqxVCExJRqdJCxC8BxN5xbD1AzqdYOXxutlbSlTcmj48m819GxBe2RUx-_GGfJo5yLmjIzjRMOB_fht9hyphenhyphenQIGSUtRYL4BRAXplneHuG-lWLc-XZmR4sbSo/s1600/Teradata+Multiload.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;TeradataWiki-Teradata Utilities Multiload&quot; border=&quot;0&quot; height=&quot;128&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgf0w60NZO0k0lexZmRWXBKsqxVCExJRqdJCxC8BxN5xbD1AzqdYOXxutlbSlTcmj48m819GxBe2RUx-_GGfJo5yLmjIzjRMOB_fht9hyphenhyphenQIGSUtRYL4BRAXplneHuG-lWLc-XZmR4sbSo/s200/Teradata+Multiload.png&quot; title=&quot;TeradataWiki-Teradata Utilities Multiload&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
MultiLoad has the capability to load multiple tables at one time from either a LAN or Channel environment. That why its names as MULTI LOAD.&lt;br /&gt;
&lt;br /&gt;
The data load can perform multiple types of DML operations, including INSERT, UPDATE, DELETE and UPSERT on up to five (5) empty or populated target tables at a time.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Limitations of Multiload&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;color: red;&quot;&gt;Unique Secondary Indexes are not supported on a Target Table&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;:Like FastLoad, MultiLoad does not support Unique Secondary Indexes (USIs). But unlike FastLoad, it does support the use of Non-Unique Secondary Indexes (NUSIs) because the index subtable row is on the same AMP as the data row.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;color: red;&quot;&gt;Referential Integrity is not supported:&lt;/span&gt;&lt;/i&gt;&lt;/b&gt; The Referential Integrity defined on a table would take more system checking to prevent referential constraints.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;color: red;&quot;&gt;Triggers are not supported at load time:&lt;/span&gt;&lt;/i&gt;&lt;/b&gt; Disable all the Triggers prior to using it.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;color: red;&quot;&gt;No concatenation of input files is allowed:&lt;/span&gt;&lt;/i&gt;&lt;/b&gt; It could impact are restart if the files were concatenated in a different sequence or data was deleted between runs.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;&lt;i&gt;No Join Indexes:&lt;/i&gt;&lt;/b&gt;&lt;/span&gt; All the join indexes must be dropped before running a MultiLoad and then recreate them after the load is completed&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;color: red;&quot;&gt;Will not process aggregates, arithmetic functions or exponentiation:&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;If you need data conversions or math, you might be better off using an INMOD to prepare the data prior to loading it.&lt;br /&gt;
&lt;br /&gt;
Multiload requires mainly &lt;b&gt;&lt;i&gt;Four components&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Log Table&lt;/i&gt;&lt;/b&gt;:Log table stores the processing record information during load.This table contains one row for every Multiload running on the system.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Work Table(s):&lt;/i&gt;&lt;/b&gt; MultiLoad will automatically create one worktable for each target table. Usually in IMPORT mode multiload could have one or more work tables and in DELETE moode you have ony one. The Purpose of work tables are 1) to perform DM tasks 2) APPLYing the input data to the AMPs.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Error Tables: &lt;/i&gt;&lt;/b&gt;Like Fastload, Multiload also two error tables&lt;br /&gt;
The first Error Table (ET). It contains all translation and constraint errors that may occur while the data is being acquired from the source(s)&lt;br /&gt;
The second Uniqueness Violation (UV) table that stores rows with duplicate values for Unique Primary Indexes (UPI).&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Target table: &lt;/i&gt;&lt;/b&gt;Target tables can have data. Multiload can load the data where target table alredy loaded.&lt;br /&gt;
&lt;br /&gt;
MultiLoad Has &lt;b&gt;&lt;u&gt;Five&lt;/u&gt;&lt;/b&gt; IMPORT Phases:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Phase 1:&lt;/i&gt;&lt;/b&gt; Preliminary Phase : Ita Basic setup phase.Its used for several preliminary set-up activities for a successful data load.&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Phase 2:&lt;/i&gt;&lt;/b&gt; DML Transaction Phase: All the SQL Data Manipulation Language (DML) statements are sent &amp;nbsp;to Teradata database as Multilaod supports multiple DML functions.&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Phase 3:&lt;/i&gt;&lt;/b&gt; Acquisition Phase: Once the setup completes the PE&#39;s plan stored on each AMP.Then Locks the table headers and the actual input data will also be stored in the worktable.&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Phase 4:&lt;/i&gt;&lt;/b&gt; Application Phase: In this phase all DML opreations are applied on target tables.&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Phase 5:&lt;/i&gt;&lt;/b&gt; Cleanup Phase: Table locks will be released and all the intermediate work tables will be dropped.&lt;br /&gt;
&lt;br /&gt;
MultiLoad has full RESTART capability in all of its five phases of operation.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Sample Multiload Script:&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The script on the following page follows these steps:&lt;br /&gt;
&lt;br /&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Setting up a Logtable&lt;/li&gt;
&lt;li&gt;Logging onto Teradata&lt;/li&gt;
&lt;li&gt;Identifying the Target, Work and Error tables&lt;/li&gt;
&lt;li&gt;Defining the INPUT flat file&lt;/li&gt;
&lt;li&gt;Defining the DML activities to occur&lt;/li&gt;
&lt;li&gt;Naming the IMPORT file&lt;/li&gt;
&lt;li&gt;Telling MultiLoad to use a particular LAYOUT&lt;/li&gt;
&lt;li&gt;Telling the system to start loading&lt;/li&gt;
&lt;li&gt;Finishing loading and logging off of Teradata&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;LOGTABLE &amp;nbsp;EMPDB.EMP_TABLE_LOG;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt; &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;LOGON TDDB/USERNAME,PWD;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt; &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;.BEGIN IMPORT MLOAD&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;TABLES EMPDB.EMP_TABLE&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;WORK TABLES EMPDB.EMP_WT&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;ERROR TABLE EMPDB.EMP_ET&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; EMPDB.EMP_UV;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt; &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;LAYOUT FILECOLDESC1;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt; &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;.FIELD EMP_NUM &amp;nbsp;* INTEGER ;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;.FIELD SALARY &amp;nbsp; * DECIMAL(8,2);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt; &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;.DML LABLE EMP_UPD;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;UPDATE EMPDB.EMP_TABLE&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;SET SALARY=:SALARY&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;WHERE EMP_NUM=:EMP_NUM;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt; &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;.IMPORT INFILE C:\TEMP\MLOAD_FLAT_FILE.txt&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;LAYOUT FILECOLDESC1&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;APPLY EMP_UPD;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt; &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;.END MLOAD;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;.LOGOFF;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/9195182910005802755'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7106842514564860422/posts/default/9195182910005802755'/><link rel='alternate' type='text/html' href='http://teradatawiki.blogspot.com/2013/10/Teradata-utilities-multiload.html' title='MULTI LOAD'/><author><name>Admin</name><uri>http://www.blogger.com/profile/03270946312373154797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCm0FeHTqy9tdxei5Vc3zsRwKvVPISdFMvIqK5NAbGyyTShzSA7INIQO8uEUGzBkkIDbVj7rdc7z1yqFbAQJMIryVb0gOqbYP1pgPjtpQ9v73YBxwSkukI_mgytcpbIA/s220/IMG_3457.jpg.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgf0w60NZO0k0lexZmRWXBKsqxVCExJRqdJCxC8BxN5xbD1AzqdYOXxutlbSlTcmj48m819GxBe2RUx-_GGfJo5yLmjIzjRMOB_fht9hyphenhyphenQIGSUtRYL4BRAXplneHuG-lWLc-XZmR4sbSo/s72-c/Teradata+Multiload.png" height="72" width="72"/></entry></feed>