Data in Memory is fast as Lightning
The Problem with Row-Based Data
Columnar Data Can Store Each Column in Their Own Block
Row Based Blocks vs. Columnar Based Blocks
Visualize the Data – Rows vs. Columns
Vertica has Linear Scalability
Chapter 2 – Vertica Data Distribution
Distribution Strategy 1 - Segmented By Hash
Distribution Strategy 2 - Unsegmented
Sorting the Data in a Table CREATE Statement
Uneven Distribution Where the Data is Non-Unique
Matching Distribution Keys for Co-Location of Joins
Fact and Dimension Table Distribution Key Designs
Why a Sort Key Improves Performance
Sort Keys Help Group By, Order By and Window Functions
Chapter 3 – Clever Features of Vertica
The Five Advantages of Projections
Read-Optimized Store (ROS)/Write-Optimized Store (WOS)
Write-Optimized Store (WOS) is Memory Resident
Updates are collected in Time-Based Buckets called Epochs
Vertica Does Not Support In-Place Updates
Import/Export between Multiple Vertica Systems
Block Based Dictionary Encoding for Character Data
Nexus is Available on the Cloud
Nexus Queries Every Major System
Why is Nexus Special? Visualization and Automatic SQL
Why is Nexus Special? Cross-System Joins
Why is Nexus Special? The Amazing Hub System
Why is Nexus Special? Save Answer Sets as Tables
Why is Nexus Special? Automated Data Movement
Why is Nexus Special? Nexus makes the Servers Talk Directly
What Makes Nexus Special? The Garden of Analysis
The Garden of Analysis Grouping Sets Tab
The Garden of Analysis - Grouping Sets Answer Sets
The Garden of Analysis – Join Tab (1 of 4)
The Garden of Analysis – Join Tab (2 of 4)
The Garden of Analysis – Join Tab (3 of 4)
The Garden of Analysis – Join Tab (4 of 4)
The Garden of Analysis – Charts/Graphs Tab (1 of 4)
The Garden of Analysis – Charts/Graphs Tab (2 of 4)
The Garden of Analysis – Charts/Graphs Tab (3 of 4)
The Garden of Analysis – Charts/Graphs Tab (4 of 4)
The Garden of Analysis – Dynamic Charts Tab (1 of 4)
The Garden of Analysis – Dynamic Charts Tab (2 of 4)
The Garden of Analysis – Dynamic Charts Tab (3 of 4)
The Garden of Analysis – Dynamic Charts Tab (4 of 4)
The Garden of Analysis – Dashboard Tab (1 of 5)
The Garden of Analysis – Dynamic Charts Tab (2 of 5)
The Garden of Analysis – Dynamic Charts Tab (3 of 5)
The Garden of Analysis – Dynamic Charts Tab (4 of 5)
The Garden of Analysis – Dynamic Charts Tab (5 of 5)
Getting to the Super Join Builder
The Super Join Builder is the First Entry in the Menu
The Super Join Builder Shows Tables Visually
What to Do When No Tables are Joinable?
Drag a Joinable Object into the Super Join Builder
You will see the Add Custom Join Window
Your Tables Will Appear Together
Select the Columns You Want on the Report
Check out the SQL Tab to See the SQL that has been built
Hit Execute to get the Report inside the Super Join Builder
The Report is delivered inside the Super Join Builder
Let's Join Two Tables Again (1 of 6)
Let's Join Two Tables Again (2 of 6)
Let's Join Two Tables Again (3 of 6)
Let's Join Two Tables Again (4 of 6)
Let's Join Two Tables Again (5 of 6)
Let's Join Two Tables Again (6 of 6)
The Tabs of the Super Join Builder Philosophy – One Query
The Tabs of the Super Join Builder – Objects Tab
The Tabs of the Super Join Builder – Columns Tab)
The Tabs of the Super Join Builder – Sorting Tab
The Tabs of the Super Join Builder – Joins Tab
The Tabs of the Super Join Builder – SQL Tab
The Tabs of the Super Join Builder – Metadata Tab
The Tabs of the Super Join Builder – Analytics Tab
The Tabs of the SJB – Analytics Tab – OLAP Screen
Getting a Simple CSUM in the Analytics Tab – OLAP
Getting a Simple CSUM – The SQL Automatically Generated
Getting all of the OLAP functions in the Analytics Tab
A Five Table Join Using the Menu
The First Table is placed in the Super Join Builder
Using the Add Join Cascading Menu
All Five Tables Are In the Super Join Builder
A Five Table Join Two Steps (Cube)
Choose Cube with Columns from the Left Top of the Table
All Tables are Cubed (Joined Together Instantly)
Choose Cube and then Choose Your Columns
Create Cube - Tables Are Joined Without Columns Selected
Create Cube – Select the Columns You Want on the Report
How to join Vertica, Oracle and SQL Server Tables
The Vertica Table is now in the Super Join Builder
Drag the Joining Oracle Table to the Super Join Builder
Choose the Columns You Want on Your Report
Let's Add a SQL Server Table to our Vertica and Oracle Join
All Three Tables are now in the Super Join Builder
Change the Hub and Run the Join on Oracle
Change the Hub and Run the Join on SQL Server
Simply Amazing - Change the Hub to the Garden of Analysis
Have the Answer Set Saved Automatically to Any System
Saving the Answer Set to an Oracle or SQL Server System
Saving the Answer Set to a Vertica System
Saving the Answer Set to a Teradata System
SELECT * (All Columns) in a Table
Fully Qualifying a Database, Schema and Table
SELECT Specific Columns in a Table
Place your Commas in front for better Debugging Capabilities
Sort the Data with the ORDER BY Keyword
ORDER BY Defaults to Ascending
Use the Name or the Number in your ORDER BY Statement
Two Examples of ORDER BY using Different Techniques
Changing the ORDER BY to Descending Order
NULL Values sort First in Ascending Mode (Default)
NULL Values sort Last in Descending Mode (DESC)
Multiple Sort Keys using Names vs. Numbers
Sorts are Alphabetical, NOT Logical
Using A CASE Statement to Sort Logically
A Missing Comma can by Mistake become an Alias
Aliasing a Column Name with Spaces or Reserved Words
Comments using Double Dashes are Single Line Comments
Comments for Multi-Lines as Double Dashes per Line
The WHERE Clause limits Returning Rows
Double Quoted Aliases are for Reserved Words and Spaces
Character Data needs Single Quotes in the WHERE Clause
Character Data needs Single Quotes, but Numbers Don’t
Comparisons against a Null Value
NULL means UNKNOWN DATA so Equal (=) won’t Work
Use IS NULL or IS NOT NULL when dealing with NULLs
NULL is UNKNOWN DATA so NOT Equal won’t Work
Use IS NULL or IS NOT NULL when dealing with NULLs
Using Greater Than or Equal To (>=)
Troubleshooting Character Data
Using Different Columns in an AND Statement
Quiz – How many rows will return?
Answer to Quiz – How many rows will return?
What is the Order of Precedence?
Using Parentheses to change the Order of Precedence
Using an IN List in place of OR
The IN List is an Excellent Technique
IN List vs. OR brings the same Results
The IN List Can Use Character Data
Null Values in a NOT IN List Bring Back No Rows
A Technique for Handling Nulls with a NOT IN List
LIKE uses Wildcards Percent ‘%’ and Underscore ‘_’
LIKE command Underscore is Wildcard for one Character
LIKE Command Works Differently on Char Vs Varchar
LIKE Command on Character Data Auto Trims
Quiz – What Data is Left Justified and what is Right?
Numbers are Right Justified and Character Data is Left
Answer – What Data is Left Justified and what is Right?
An Example of Data with Left and Right Justification
A Visual of CHARACTER Data vs. VARCHAR Data
Use the TRIM command to remove spaces on CHAR Data
Escape Character in the LIKE Command changes Wildcards
Escape Characters Turn off Wildcards in the LIKE Command
ANSWER – To Find that Wildcard
Quiz – How many rows come back from the Distinct?
Answer – How many rows come back from the Distinct?
Quiz – You calculate the Answer Set in your own Mind
Answer – You calculate the Answer Set in your own Mind
Quiz – You calculate the Answer Set in your own Mind
Answer – You calculate the Answer Set in your own Mind
Quiz – How many rows come back?
Answer – How many rows come back?
GROUP BY when Aggregates and Normal Columns Mix
GROUP BY delivers one row per Group
GROUP BY Dept_No or GROUP BY 1 the same thing
Limiting Rows and Improving Performance with WHERE
WHERE Clause in Aggregation limits unneeded Calculations
Keyword HAVING tests Aggregates after they are totaled
Keyword HAVING is like an Extra WHERE Clause for totals
Keyword HAVING tests Aggregates after they are totaled
Getting the Average Values per Column
A Two-Table Join Using Traditional Syntax
A two-table join using Non-ANSI Syntax with Table Alias
You Can Fully Qualify All Columns
A two-table join using ANSI Syntax
Both Queries have the same Results and Performance
Quiz – Can You Finish the Join Syntax?
Answer to Quiz – Can You Finish the Join Syntax?
Quiz – Can You Find the Error?
Answer to Quiz – Can You Find the Error?
Super Quiz – Can You Find the Difficult Error?
Answer to Super Quiz – Can You Find the Difficult Error?
Quiz – Which rows from both tables won’t return?
Answer to Quiz – Which rows from both tables Won’t Return?
RIGHT OUTER JOIN Example and Results
Which Tables are the Left and which Tables are Right?
Answer - Which Tables are the Left and which are the Right?
INNER JOIN with Additional AND Clause
ANSI INNER JOIN with Additional AND Clause
ANSI INNER JOIN with Additional WHERE Clause
OUTER JOIN with Additional WHERE Clause
OUTER JOIN with Additional AND Clause
OUTER JOIN with Additional AND Clause Results
Quiz – Why is this considered an INNER JOIN?
Evaluation Order for Outer Queries
The DREADED Product Join Results
The Horrifying Cartesian Product Join
The ANSI Cartesian Join will ERROR
Quiz – Do these Joins Return the Same Answer Set?
Answer – Do these Joins Return the Same Answer Set?
The Self Join with ANSI Syntax
Quiz – Will both queries bring back the same Answer Set?
Answer – Will both queries bring back the same Answer Set?
Quiz – Will both queries bring back the same Answer Set?
Answer – Will both queries bring back the same Answer Set?
How would you join these two tables?
An Associative Table is a Bridge that Joins Two Tables
Quiz – Can you write the 3-Table Join?
Answer to quiz – Can you Write the 3-Table Join?
Quiz – Can you write the 3-Table Join to ANSI Syntax?
Answer – Can you write the 3-Table Join to ANSI Syntax?
Quiz – Can you Place the ON Clauses at the End?
Answer – Can you Place the ON Clauses at the End?
The 5-Table Join – Logical Insurance Model
Quiz - Write a Five Table Join Using ANSI Syntax
Answer - Write a Five Table Join Using ANSI Syntax
Quiz - Write a Five Table Join Using Non-ANSI Syntax
Answer - Write a Five Table Join Using Non-ANSI Syntax
Quiz –Re-Write this putting the ON clauses at the END
Answer –Re-Write this putting the ON clauses at the END
Current_Date, Current_Time and Current_Timestamp
Add or Subtract Days from a date
A Summary of Math Operations on Dates
Using the ADD_MONTHS Command to Add 1 Year
Using the ADD_MONTHS Command to Add 1 Year
Using the ADD_MONTHS Command to Add 5 Years
YEAR, MONTH, and DAY Functions
A Better Technique for YEAR, MONTH, and DAY Functions
Another Version of the EXTRACT Command
EXTRACT with DATE and TIME Literals
EXTRACT of the Month on Aggregate Queries
Intervals for Date, Time and Timestamp
Interval Data Types and the Bytes to Store Them
How a Simple Interval Handles Leap Year
A DATE Interval Example Going Back in Time
A Complex Time Interval Example using CAST
A Complex Time Interval Example using CAST
An OVERLAPS Example that Returns No Rows
The OVERLAPS Command using TIME
Quiz – How did the Row_Number Reset?
Quiz – How did the Row_Number Reset?
Using a Derived Table and Row_Number
Finding the First Occurrence using a WITH Derived Table
Finding the Last Occurrence using a WITH Derived Table
RANK Defaults to Ascending Order
Getting RANK to Sort in DESC Order
PERCENT_RANK OVER with 14 rows in Calculation
PERCENT_RANK OVER with 21 rows in Calculation
Quiz – What Causes the Product_ID to Reset?
Answer to Quiz – What Cause the Product_ID to Reset?
CSUM – Rows Unbounded Preceding Explained
CSUM – Making Sense of the Data
CSUM – Making Even More Sense of the Data
CSUM – The Major and Minor Sort Key(s)
The ANSI CSUM – Getting a Sequential Number
Troubleshooting the ANSI OLAP on a GROUP BY
Reset with a PARTITION BY Statement
PARTITION BY only Resets a Single OLAP not ALL of them
CURRENT ROW AND UNBOUNDED FOLLOWING
Moving Sum has a Moving Window
How ANSI Moving SUM Handles the Sort
Quiz – How is that Total Calculated?
Answer to Quiz – How is that Total Calculated?
Moving SUM every 3-rows Vs a Continuous Average
PARTITION BY Resets an ANSI OLAP
The Moving Window is Current Row and Preceding
How Moving Average Handles the Sort
Quiz – How is that Total Calculated?
Answer to Quiz – How is that Total Calculated?
Quiz – How is that 4th Row Calculated?
Answer to Quiz – How is that 4th Row Calculated?
Moving Average every 3-rows vs a Continuous Average
PARTITION BY Resets an ANSI OLAP
Moving Difference using ANSI Syntax
Moving Difference using ANSI Syntax with Partition By
COUNT OVER for a Sequential Number
COUNT OVER without Rows Unbounded Preceding
Quiz – What caused the COUNT OVER to Reset?
Answer to Quiz – What caused the COUNT OVER to Reset?
MAX OVER with PARTITION BY Reset
MAX OVER without Rows Unbounded Preceding
MIN OVER without Rows Unbounded Preceding
Finding a Value of a Column in the Next Row with MIN
The CSUM for Each Product_Id and the Next Start Date
Using Tertiles (Partitions of Four)
FIRST_VALUE after Sorting by the Highest Value
Using LEAD With and Offset of 2
There are three types of Temporary Tables
Aliasing the Column Names in The Derived Table
Multiple Ways to Alias the Columns in a Derived Table
CREATING a Derived Table using the WITH Command
The Same Derived Query shown Three Different Ways
Most Derived Tables Are Used To Join To Other Tables
The Three Components of a Derived Table
Our Join Example with a Different Column Aliasing Style
Column Aliasing Can Default for Normal Columns
A Derived example Using the WITH Syntax
Answer to Quiz - Answer the Questions
Clever Tricks on Aliasing Columns in a Derived Table
A Derived Table lives only for the lifetime of a single query
An Example of Two Derived Tables in a Single Query
Example of Two Derived Tables in a Single WITH Statement
Finding the First Occurrence of a Row using WITH
Finding the Last Occurrence of a Row using WITH
Creating and Populating a Local Temporary Table
Creating and Populating a Global Temporary Table
Creating and Populating a Global Temporary Table
Some Great Examples of Creating a Temporary Table Quickly
Creating a Temporary Table That is sorted
A Temp Table That Populates some of the Rows
A Temporary Table with Some of the Columns
Chapter 12 – Sub-query Functions
An IN List is much like a Subquery
An IN List Never has Duplicates – Just like a Subquery
The Three Steps of How a Basic Subquery Works
The Final Answer Set from the Subquery
Quiz- Answer the Difficult Question
Answer to Quiz- Answer the Difficult Question
Should you use a Subquery or a Join?
Answer to Quiz- Write the Subquery
Quiz- Write the More Difficult Subquery
Answer to Quiz- Write the More Difficult Subquery
Quiz – Write the Extreme Subquery
Answer to Quiz- Write the Extreme Subquery
Quiz- Write the Subquery with an Aggregate
Answer to Quiz- Write the Subquery with an Aggregate
Quiz- Write the Correlated Subquery
Answer to Quiz- Write the Correlated Subquery
The Basics of a Correlated Subquery
The Top Query always runs first in a Correlated Subquery
Correlated Subquery Example vs. a Join with a Derived Table
Quiz- A Second Chance to Write a Correlated Subquery
Answer - A Second Chance to Write a Correlated Subquery
Quiz- A Third Chance to Write a Correlated Subquery
Answer - A Third Chance to Write a Correlated Subquery
Quiz- Last Chance to Write a Correlated Subquery
Answer – Last Chance to Write a Correlated Subquery
Quiz – Write the Extreme Correlated Subquery
Answer To Quiz – Write the Extreme Correlated Subquery
Answer to Quiz- Write the NOT Subquery
Quiz- Write the Subquery using a WHERE Clause
Answer - Write the Subquery using a WHERE Clause
Quiz- Write the Subquery with Two Parameters
Answer to Quiz- Write the Subquery with Two Parameters
How the Double Parameter Subquery Works
More on how the Double Parameter Subquery Works
Quiz – Write the Triple Subquery
Answer to Quiz – Write the Triple Subquery
Quiz – How many rows return on a NOT IN with a NULL?
Answer – How many rows return on a NOT IN with a NULL?
How to handle a NOT IN with Potential NULL Values
How a Correlated Exists matches up
The Correlated NOT Exists Answer Set
Quiz – How many rows come back from this NOT Exists?
Answer – How many rows come back from this NOT Exists?
The LENGTH Command Counts Characters
The LENGTH Command – Spaces can Count too
The LENGTH Command and Character Data
LENGTH and CHARACTER_LENGTH Are Equivalent
Non-Letters are Unaffected by UPPER and LOWER
The TRIM Command trims both Leading and Trailing Spaces
Trim Combined with the CHARACTERS Command
How to TRIM only the Trailing Spaces
A Visual of the TRIM Command Using Concatenation
Trim and Trailing is Case Sensitive
SUBSTRING and SUBSTR are equal, but use different syntax
How SUBSTRING Works with NO ENDING POSITION
Using SUBSTRING to move backwards
How SUBSTRING Works with a Starting Position of -1
How SUBSTRING Works with an Ending Position of 0
An Example using SUBSTRING, TRIM and CHAR Together
The POSITION Command finds a Letters Position
Quiz – Find that SUBSTRING Starting Position
Answer to Quiz – Find that SUBSTRING Starting Position
Using the SUBSTRING to Find the Second Word On
Quiz – Why did only one Row Return
Answer to Quiz – Why Did only one Row Return
Chapter 14 – Interrogating the Data
Numeric Manipulation Functions
Ceiling Gets the Smallest Integer Not Smaller Than X
Floor Finds the Largest Integer Not Greater Than X
The Round Function and Precision
Quiz – What would the Answer be?
Answer to Quiz – What would the Answer be?
Quiz – Fill in the Blank Values in the Answer Set
Answer to Quiz – Fill in the Blank Values in the Answer Set
Quiz – Fill in the Answers for the NULLIF Command
Answer – Fill in the Answers for the NULLIF Command
Answer to the ZEROIFNULL Question
The COALESCE Command – Fill In the Answers
COALESCE is Equivalent to This CASE Statement
Some Great CAST (Convert and Store) Examples
Some Great CAST (Convert and Store) Examples
Some Great CAST (Convert and Store) Examples
Quiz - The Basics of the CASE Statements
Answer to Quiz - The Basics of the CASE Statements
Using an ELSE in the Case Statement
Rules for a Valued Case Statement
Rules for a Searched Case Statement
The Basics of the CASE Statements
The Basics of the CASE Statement
Valued Case vs. a Searched Case
Answer - Valued Case Statement
Quiz - Searched Case Statement
Answer - Searched Case Statement
Quiz - When NO ELSE is present in CASE Statement
Answer - When NO ELSE is present in CASE Statement
When an ELSE is present in CASE Statement
Answer - When an ELSE is present in CASE Statement
Combining Searched Case and Valued Case
A Trick for getting a Horizontal Case
Creating a Simple View to Restrict Sensitive Columns
Creating a Simple View to Restrict Rows
A View Provides Security for Columns and Rows
An Exception to the ORDER BY Rule inside a View
Views Are Sometimes CREATED for Formatting
Creating a View to Join Tables Together
How to Alias Columns in a View CREATE
The Standard Way Most Aliasing is done
What Happens When Both Aliasing Options Are Present
Resolving Aliasing Problems in a View CREATE
Answer to Resolving Aliasing Problems in a View CREATE
Altering A Table After a View Has Been Created
A View that Errors after An ALTER
Chapter 16 – Set Operators Functions
Answer - Testing Your Knowledge
Answer - Testing Your Knowledge
An Equal Amount of Columns in both SELECT List
Columns in the SELECT list should be from the same Domain
The Top Query handles all Aliases
The Bottom Query does the ORDER BY (a Number)
Great Trick: Place your Set Operator in a Derived Table
A Great Example of how EXCEPT works
USING Multiple SET Operators in a Single Request
Changing the Order of Precedence with Parentheses
Using UNION ALL for speed in Merging Data Sets
Chapter 17 – Table Create and Data Types
Distribution Strategy 1 - Segmented By Hash
Distribution Strategy 2 - Unsegmented
Sorting the Data in a Table CREATE Statement
Uneven Distribution Where the Data is Non-Unique
Matching Distribution Keys for Co-Location of Joins
Fact and Dimension Table Distribution Key Designs
Why a Sort Key Improves Performance
Sort Keys Help GROUP BY, ORDER BY and Window Functions
Creating and Populating a Local Temporary Table
Creating and Populating a Global Temporary Table
Creating and Populating a Global Temporary Table
Some Great Examples of Creating a Temporary Table Quickly
Creating a Temporary Table That is sorted
A Temp Table That Populates Some of the Rows
A Temporary Table with Some of the Columns
Chapter 18 – Data Manipulation Language (DML)
INSERT/SELECT example using All Columns (*)
INSERT/SELECT example with Less Columns
Subquery UPDATE Command Syntax
Example of Subquery UPDATE Command
Example of an UPDATE Join Command
Example of Subquery DELETE Command
Chapter 19 – Statistical Aggregate Functions
Another CORR Example so you can compare
Another COVAR_POP Example so you can compare
Another COVAR_SAMP Example so you can compare
Another REGR_INTERCEPT Example so you can compare
Another REGR_SLOPE Example so you can compare
Another REGR_AVGX Example so you can compare