You are previewing Tera-Tom Genius Series - Oracle SQL.
O'Reilly logo
Tera-Tom Genius Series - Oracle SQL

Book Description

Oracle is one of the most popular database in the world. This incredible database is designed for on-premises systems and the cloud. Learning Oracle SQL is a great opportunity for you to access cutting edge technology. Tera-Tom Coffing and Leona Coffing have written a brilliant book that teaches readers the basics to advanced queries of Oracle SQL. This book is perfect for anyone who needs to write Oracle SQL. The book educates readers with over 600 pages of SQL examples and explanations, plus provides clever tricks and examples to provide an expert level of learning. The Authors Tera-Tom Coffing, who has written over 75 successful books on Data Warehousing and Leona Coffing, Chief Financial Officer (CFO) of Coffing Data Warehousing bring a combined 40 years of experience of data warehouse knowledge to create this must have book.

Table of Contents

  1. Cover
  2. The Tera-Tom Video Series
  3. The Tera-Tom Genius Series
  4. Tera-Tom- Author of over 50 Books
  5. The Best Query Tool Works on all Systems
  6. Trademarks and Copyrights
  7. About Tom Coffing
  8. About Leona Coffing
  9. Contents
  10. Chapter 1 – The Basics of SQL
    1. Introduction
    2. Setting Your Default SCHEMA
    3. SELECT * (All Columns) in a Table
    4. SELECT Specific Columns in a Table
    5. Commas in the Front or Back?
    6. Place your Commas in front for better Debugging Capabilities
    7. Sort the Data with the ORDER BY Keyword
    8. ORDER BY Defaults to Ascending
    9. Use the Name or the Number in your ORDER BY Statement
    10. Two Examples of ORDER BY using Different Techniques
    11. Changing the ORDER BY to Descending Order
    12. NULL Values sort First in Ascending Mode (Default)
    13. NULL Values sort First in Descending Mode (DESC)
    14. Major Sort vs. Minor Sorts
    15. Multiple Sort Keys using Names vs. Numbers
    16. Sorts are Alphabetical, NOT Logical
    17. Using A CASE Statement to Sort Logically
    18. How to ALIAS a Column Name
    19. A Missing Comma can by Mistake become an Alias
    20. Comments using Double Dashes are Single Line Comments
    21. Comments for Multi-Lines
    22. Comments for Multi-Lines as Double Dashes Per Line
    23. Formatting Number
    24. Formatting Number Examples
    25. Formatting Dates
    26. Formatting Date Example
  11. Chapter 2 – The WHERE Clause
    1. The WHERE Clause limits Returning Rows
    2. Double Quoted Aliases are for Reserved Words and Spaces
    3. Character Data needs Single Quotes in the WHERE Clause
    4. Character Data needs Single Quotes, but Numbers Don’t
    5. Comparisons against a Null Value
    6. NULL means UNKNOWN DATA so Equal (=) won’t Work
    7. Use IS NULL or IS NOT NULL when dealing with NULLs
    8. NULL is UNKNOWN DATA so NOT Equal won’t Work
    9. Use IS NULL or IS NOT NULL when dealing with NULLs
    10. Using Greater Than or Equal To (>=)
    11. AND in the WHERE Clause
    12. Troubleshooting AND
    13. OR in the WHERE Clause
    14. Troubleshooting Or
    15. Troubleshooting Character Data
    16. Using Different Columns in an AND Statement
    17. Quiz – How many rows will return?
    18. Answer to Quiz – How many rows will return?
    19. What is the Order of Precedence?
    20. Using Parentheses to change the Order of Precedence
    21. Using an IN List in place of OR
    22. The IN List is an Excellent Technique
    23. IN List vs. OR brings the same Results
    24. The IN List Can Use Character Data
    25. Using a NOT IN List
    26. Null Values in a NOT IN List Bring Back No Rows
    27. A Technique for Handling Nulls with a NOT IN List
    28. BETWEEN is Inclusive
    29. NOT BETWEEN is Also Inclusive
    30. LIKE uses Wildcards Percent ‘%’ and Underscore ‘_’
    31. LIKE command Underscore is Wildcard for one Character
    32. LIKE Command Works Differently on Char Vs Varchar
    33. LIKE Command on Character Data
    34. Quiz – What Data is Left Justified and What is Right?
    35. Numbers are Right Justified and Character Data is Left
    36. Answer – What Data is Left Justified and what is Right?
    37. An Example of Data with Left and Right Justification
    38. A Visual of CHARACTER Data vs. VARCHAR Data
    39. Use the TRIM command to remove spaces on CHAR Data
    40. Escape Character in the LIKE Command changes Wildcards
    41. Escape Characters Turn off Wildcards in the LIKE Command
    42. Quiz – Turn off that Wildcard
    43. ANSWER – To Find that Wildcard
    44. The Distinct Command
    45. Distinct vs. GROUP BY
    46. Quiz – How many rows come back from the Distinct?
    47. Answer – How many rows come back from the Distinct?
  12. Chapter 3 – Aggregation
    1. Quiz – You calculate the Answer Set in your own Mind
    2. Answer – You calculate the Answer Set in your own Mind
    3. Quiz – You calculate the Answer Set in your own Mind
    4. Answer – You calculate the Answer Set in your own Mind
    5. The 3 Rules of Aggregation
    6. There are Five Aggregates
    7. Quiz – How many rows come back?
    8. Answer – How many rows come back?
    9. Troubleshooting Aggregates
    10. GROUP BY delivers one row per Group
    11. GROUP BY Dept_No Works GROUP BY 1 Fails
    12. Limiting Rows and Improving Performance with WHERE
    13. WHERE Clause in Aggregation limits unneeded Calculations
    14. Keyword HAVING tests Aggregates after they are Totaled
    15. Keyword HAVING is like an Extra WHERE Clause for Totals
    16. Keyword HAVING tests Aggregates after they are Totaled
    17. Getting the Average Values Per Column
    18. Average Values Per Column For all Columns in a Table
  13. Chapter 4 – Join Functions
    1. A Two-Table Join Using Traditional Syntax
    2. A two-table join using Non-ANSI Syntax with Table Alias
    3. A two-table join using A Different Syntax
    4. You Can Fully Qualify All Columns
    5. A two-table join using ANSI Syntax
    6. Both Queries have the same Results and Performance
    7. Quiz – Can You Finish the Join Syntax?
    8. Answer to Quiz – Can You Finish the Join Syntax?
    9. Quiz – Can You Find the Error?
    10. Answer to Quiz – Can You Find the Error?
    11. Super Quiz – Can You Find the Difficult Error?
    12. Answer to Super Quiz – Can You Find the Difficult Error?
    13. Quiz – Which rows from both tables won’t Return?
    14. Answer to Quiz – Which rows from both tables Won’t Return?
    15. LEFT OUTER JOIN
    16. LEFT OUTER JOIN Results
    17. LEFT OUTER JOIN Using (+)
    18. RIGHT OUTER JOIN
    19. RIGHT OUTER JOIN Example and Results
    20. RIGHT OUTER JOIN Using (+)
    21. FULL OUTER JOIN
    22. FULL OUTER JOIN Results
    23. Which Tables are the Left and which Tables are Right?
    24. Answer - Which Tables are the Left and which are the Right?
    25. INNER JOIN with Additional AND Clause
    26. ANSI INNER JOIN with Additional AND Clause
    27. ANSI INNER JOIN with Additional WHERE Clause
    28. OUTER JOIN with Additional WHERE Clause
    29. OUTER JOIN with Additional AND Clause
    30. OUTER JOIN with Additional AND Clause Results
    31. Quiz – Why is this considered an INNER JOIN?
    32. Evaluation Order for Outer Queries
    33. The DREADED Product Join
    34. The DREADED Product Join Results
    35. The Horrifying Cartesian Product Join
    36. The ANSI Cartesian Join will ERROR
    37. Quiz – Do these Joins Return the Same Answer Set?
    38. Answer – Do these Joins Return the Same Answer Set?
    39. The CROSS JOIN
    40. The CROSS JOIN Answer Set
    41. The Self Join
    42. The Self Join with ANSI Syntax
    43. Quiz – Will both queries bring back the same Answer Set?
    44. Answer – Will both queries bring back the same Answer Set?
    45. Quiz – Will both queries bring back the same Answer Set?
    46. Answer – Will both queries bring back the same Answer Set?
    47. How would you Join these two tables?
    48. An Associative Table is a Bridge that Joins Two Tables
    49. Quiz – Can you write the 3-Table Join?
    50. Answer to Quiz – Can you Write the 3-Table Join?
    51. Quiz – Can you write the 3-Table Join to ANSI Syntax?
    52. Answer – Can you Write the 3-Table Join to ANSI Syntax?
    53. Quiz – Can you Place the ON Clauses at the End?
    54. Answer – Can you Place the ON Clauses at the End?
    55. The 5-Table Join – Logical Insurance Model
    56. Quiz - Write a Five Table Join Using ANSI Syntax
    57. Answer - Write a Five Table Join Using ANSI Syntax
    58. Quiz - Write a Five Table Join Using Non-ANSI Syntax
    59. Answer - Write a Five Table Join Using Non-ANSI Syntax
    60. Quiz –Re-Write this putting the ON clauses at the END
    61. Answer –Re-Write this putting the ON clauses at the END
    62. The Nexus Query Chameleon Writes the SQL for Users.
  14. Chapter 5 – Date Functions
    1. Getting the System Date
    2. Extracting the Day, Month, Year From the SYSDATE
    3. The Current_Timestamp
    4. Extracting From the Current_Timestamp
    5. The ADD_MONTHS Command
    6. Using the ADD_MONTHS Command to Add Years
    7. Using the LAST_DAY Command
    8. Calculating the Days Until the End of the Month
    9. Calculating the Months Between Two Dates
    10. NEXT_DAY Command Finds a Future Day of the Week
    11. The ROUND Command
    12. Another ROUND Example
    13. The TRUNC Command
    14. Another TRUNC Example
    15. Adding Days and Minutes
    16. How to Get the Difference in Hours
    17. Add or Subtract Days Plus Format Dates and Dollars
    18. Formatting Date Example
    19. A Summary of Math Operations on Dates
    20. The EXTRACT Command
    21. Using Intervals
    22. How a Simple Interval Handles Leap Year
    23. Troubleshooting Intervals – Invalid Dates Error
  15. Chapter 6 – OLAP Functions
    1. The Row_Number Command
    2. Quiz – How did the Row_Number Reset?
    3. Quiz – How did the Row_Number Reset?
    4. Using a Derived Table and Row_Number
    5. Ordered Analytics OVER
    6. RANK and DENSE RANK
    7. RANK Defaults to Ascending Order
    8. Getting RANK to Sort in DESC Order
    9. RANK() OVER and PARTITION BY
    10. PERCENT_RANK() OVER
    11. PERCENT_RANK() OVER with 14 rows in Calculation
    12. PERCENT_RANK OVER with 21 rows in Calculation
    13. Finding Gaps between Dates
    14. CSUM – Rows Unbounded Preceding Explained
    15. CSUM – Making Sense of the Data
    16. CSUM – Making Even More Sense of the Data
    17. CSUM – The Major and Minor Sort Key(s)
    18. The ANSI CSUM – Getting a Sequential Number
    19. Reset with a PARTITION BY Statement
    20. PARTITION BY only Resets a Single OLAP not ALL of them
    21. CURRENT ROW AND UNBOUNDED FOLLOWING
    22. Different Windowing Options
    23. Moving Sum has a Moving Window
    24. How ANSI Moving SUM Handles the Sort
    25. Quiz – How is that Total Calculated?
    26. Answer to Quiz – How is that Total Calculated?
    27. Moving SUM every 3-rows Vs a Continuous Average
    28. Partition By Resets an ANSI OLAP
    29. The Moving Window is Current Row and Preceding
    30. Moving Average
    31. Moving Average Using a CAST Statement
    32. Moving Average every 3-rows Vs a Continuous Average
    33. Partition By Resets an ANSI OLAP
    34. Moving Difference using ANSI Syntax
    35. Moving Difference using ANSI Syntax with Partition By
    36. COUNT OVER for a Sequential Number
    37. COUNT OVER Without Rows Unbounded Preceding
    38. Quiz – What caused the COUNT OVER to Reset?
    39. Answer to Quiz – What caused the COUNT OVER to Reset?
    40. The MAX OVER Command
    41. MAX OVER with PARTITION BY Reset
    42. MAX OVER Without Rows Unbounded Preceding
    43. The MIN OVER Command
    44. MIN OVER Without Rows Unbounded Preceding
    45. MIN OVER Using PARTITION BY to Reset
    46. Finding a Value of a Column in the Next Row with MIN
    47. The CSUM For Each Product_Id and the Next Start Date
    48. Quiz – Fill in the Blank
    49. Answer – Fill in the Blank
    50. How Ntile Works
    51. Ntile
    52. Ntile Continued
    53. Ntile Percentile
    54. Another Ntile Example
    55. Using Quantiles (Partitions of Four)
    56. NTILE With a Single Sort Key
    57. NTILE Using a Value of 10
    58. NTILE With a Partition
    59. Using FIRST_VALUE
    60. FIRST_VALUE
    61. FIRST_VALUE After Sorting by the Highest Value
    62. FIRST_VALUE with Partitioning
    63. FIRST_VALUE Combined with Row_Number
    64. FIRST_VALUE And Row_Number with Different Sort
    65. Using LAST_VALUE
    66. LAST_VALUE
    67. Using LAG and LEAD
    68. LEAD
    69. LEAD
    70. LEAD With Partitioning
    71. LEAD to Find the First Occurrence
    72. Using LEAD
    73. Using LEAD With an Offset of 2
    74. Using LAG
    75. Using LAG with an Offset of 2
    76. LAG
    77. LAG with Partitioning
    78. MEDIAN with Partitioning
    79. CUME_DIST
    80. CUME_DIST with a Partition
    81. SUM (SUM (n))
  16. Chapter 7 – Temporary Tables
    1. There are two types of Temporary Tables
    2. CREATING A Derived Table
    3. Creating Multiple Derived Tables in the WITH Command
    4. Creating Multiple Derived Tables in the WITH Command
    5. The Same Derived Query shown Two Different Ways
    6. Most Derived Tables Are Used To Join To Other Tables
    7. The Three Components of a Derived Table
    8. Visualize This Derived Table
    9. Our Join Example With A Different Column Aliasing Style
    10. Column Aliasing Can Default For Normal Columns
    11. Our Join Example With The WITH Syntax
    12. Quiz - Answer the Questions
    13. Answer to Quiz - Answer the Questions
    14. Clever Tricks on Aliasing Columns in a Derived Table
    15. An Example of Two Derived Tables in a Single Query
    16. Example of Two Derived Tables in a Single WITH Statement
    17. WITH RECURSIVE Derived Table Hierarchy
    18. WITH RECURSIVE Derived Table Query
    19. WITH RECURSIVE Derived Table Definition
    20. WITH RECURSIVE Derived Table Seeding
    21. WITH RECURSIVE Derived Table Looping
    22. WITH RECURSIVE Derived Table Looping in Slow Motion
    23. WITH RECURSIVE Derived Table Looping Continued
    24. WITH RECURSIVE Derived Table Looping Continued
    25. WITH RECURSIVE Derived Table Ends the Looping
    26. WITH RECURSIVE Derived Table Definition
    27. WITH RECURSIVE Final Answer Set
    28. Creating and Populating a Global Temporary Table
    29. Global Temporary Table Definitions Persist
    30. Vital Information about Global Temporary Tables
    31. ON COMMIT DELETE ROWS Example
    32. Creating and Populating a Global Temporary Table
    33. Creating a Global Temporary Table Using a CTAS
    34. Creating a Global Temporary Table Using a CTAS Join
    35. Creating a Temporary Table from Another's Space
    36. A Global Temp Table That Populates Some of the Rows
    37. A Temporary Table with Some of the Columns
  17. Chapter 8 – Sub-query Functions
    1. An IN List is much like a Subquery
    2. An IN List Never has Duplicates – Just like a Subquery
    3. The Subquery
    4. The Three Steps of How a Basic Subquery Works
    5. These are Equivalent Queries
    6. The Final Answer Set from the Subquery
    7. Quiz- Answer the Difficult Question
    8. Answer to Quiz- Answer the Difficult Question
    9. Should you use a Subquery or a Join?
    10. Quiz- Write the Subquery
    11. Answer to Quiz- Write the Subquery
    12. Quiz- Write the More Difficult Subquery
    13. Answer to Quiz- Write the More Difficult Subquery
    14. Quiz – Write the Extreme Subquery
    15. Answer to Quiz- Write the Extreme Subquery
    16. Quiz- Write the Subquery with an Aggregate
    17. Answer to Quiz- Write the Subquery with an Aggregate
    18. Quiz- Write the Correlated Subquery
    19. Answer to Quiz- Write the Correlated Subquery
    20. The Basics of a Correlated Subquery
    21. The Top Query always runs first in a Correlated Subquery
    22. Correlated Subquery Example vs. a Join with a Derived Table
    23. Quiz- A Second Chance To Write a Correlated Subquery
    24. Answer - A Second Chance to Write a Correlated Subquery
    25. Quiz- A Third Chance To Write a Correlated Subquery
    26. Answer - A Third Chance to Write a Correlated Subquery
    27. Quiz- Last Chance To Write a Correlated Subquery
    28. Answer – Last Chance to Write a Correlated Subquery
    29. Quiz – Write the Extreme Correlated Subquery
    30. Answer To Quiz – Write the Extreme Correlated Subquery
    31. Quiz- Write the NOT Subquery
    32. Answer to Quiz- Write the NOT Subquery
    33. Quiz- Write the Subquery using a WHERE Clause
    34. Answer - Write the Subquery using a WHERE Clause
    35. Quiz- Write the Subquery with Two Parameters
    36. Answer to Quiz- Write the Subquery with Two Parameters
    37. How the Double Parameter Subquery Works
    38. More on how the Double Parameter Subquery Works
    39. Quiz – Write the Triple Subquery
    40. Answer to Quiz – Write the Triple Subquery
    41. Quiz – How many rows return on a NOT IN with a NULL?
    42. Answer – How many rows return on a NOT IN with a NULL?
    43. How to handle a NOT IN with Potential NULL Values
    44. IN is equivalent to =ANY
    45. Using a Correlated Exists
    46. How a Correlated Exists matches up
    47. The Correlated NOT Exists
  18. Chapter 9 – Strings
    1. The LENGTH Command Counts Characters
    2. The LENGTH Command – Spaces can Count too
    3. The LENGTH Command and Char (20) Data
    4. The LENGTH Needs a TRIM
    5. The TRIM Command trims both Leading and Trailing Spaces
    6. A Visual of the TRIM Command Using Concatenation
    7. Trim and Trailing is Case Sensitive
    8. How to TRIM Trailing Letters
    9. The SUBSTRING Command
    10. How SUBSTRING Works with NO ENDING POSITION
    11. How SUBSTRING Works with a Starting Position of -1
    12. How SUBSTRING Works with an Ending Position of 0
    13. An Example using SUBSTRING, TRIM and CHAR Together
    14. Concatenation
    15. Concatenation and SUBSTRING
    16. Four Concatenations Together
    17. UPPER and LOWER Commands
    18. LPAD and RPAD
    19. SOUNDEX
    20. REGEXP_LIKE
    21. REGEXP_REPLACE
    22. REGEXP_INSTR
    23. REGEXP_INSTR (1 of 4)
    24. REGEXP_INSTR Options (2 of 4)
    25. REGEXP_INSTR Options (3 of 4)
    26. REGEXP_INSTR Options (4 of 4)
    27. REGEXP_INSTR Example
    28. REGEXP_INSTR Example 2
  19. Chapter 10 – Interrogating the Data
    1. Using the LOWER Command
    2. A LOWER Command Example
    3. Using the UPPER Command
    4. An UPPER Command Example
    5. Non-Letters are Unaffected by UPPER and LOWER
    6. Quiz – Fill in the Answers for the NULLIF Command
    7. Quiz – Fill in the Answers for the NULLIF Command
    8. The COALESCE Command
    9. The COALESCE Answer Set
    10. The COALESCE Command – Fill In the Answers
    11. The COALESCE Answer Set
    12. COALESCE is Equivalent to This CASE Statement
    13. The Basics of CAST (Convert And STore)
    14. Some Great CAST (Convert And Store) Examples
    15. A Rounding Example
    16. Quiz - The Basics of the CASE Statements
    17. Answer to Quiz - The Basics of the CASE Statements
    18. Using an ELSE in the Case Statement
    19. Using an ELSE as a Safety Net
    20. Rules For a Valued Case Statement
    21. Rules For a Searched Case Statement
    22. Valued Case Vs. A Searched Case
    23. Quiz - Valued Case Statement
    24. Answer - Valued Case Statement
    25. Quiz - Searched Case Statement
    26. Answer - Searched Case Statement
    27. The CASE Challenge
    28. The CASE Challenge Answer
    29. Combining Searched Case and Valued Case
    30. A Trick for getting a Horizontal Case
    31. Nested Case
    32. Put a CASE in the ORDER BY
  20. Chapter 11 – View Functions
    1. The Fundamentals of Views
    2. Creating a Simple View to Restrict Sensitive Columns
    3. You SELECT From a View
    4. Creating a Simple View to Restrict Rows
    5. A View Provides Security for Columns and Rows
    6. Basic Rules for Views
    7. How to Modify a View
    8. An Exception to the ORDER BY Rule inside a View
    9. Views Are Sometimes CREATED for Formatting
    10. Creating a View to Join Tables Together
    11. How to Alias Columns in a View CREATE
    12. The Standard Way Most Aliasing is Done
    13. What Happens When Both Aliasing Options Are Present
    14. Resolving Aliasing Problems in a View CREATE
    15. Answer to Resolving Aliasing Problems in a View CREATE
    16. Aggregates on View Aggregates
    17. Altering A Table After a View Has Been Created
    18. A View that Errors After An ALTER
  21. Chapter 12 – Set Operators Functions
    1. Rules of Set Operators
    2. INTERSECT Explained Logically
    3. INTERSECT Explained Logically
    4. UNION Explained Logically
    5. UNION Explained Logically
    6. UNION ALL Explained Logically
    7. UNION ALL Explained Logically
    8. Minus Explained Logically
    9. Minus Explained Logically
    10. An Equal Amount of Columns in both SELECT List
    11. Columns in the SELECT list should be from the same Domain
    12. The Top Query handles all Aliases
    13. The Bottom Query does the ORDER BY
    14. Great Trick: Place your Set Operator in a Derived Table
    15. UNION Vs UNION ALL
    16. A Great Example of how MINUS works
    17. USING Multiple SET Operators in a Single Request
    18. Changing the Order of Precedence with Parentheses
    19. Using UNION ALL for speed in Merging Data Sets
  22. Chapter 13 – Table Create and Data Types
    1. The Basics of Creating a Table
    2. Creating a Table With Default Values
    3. Altering a Table to Add a Column
    4. Altering a Table to Drop a Column
    5. Renaming a Table
    6. Dropping a Table
    7. Defining Primary Keys
    8. Defining a Primary Key After the Table Has Been Created
    9. Defining a Foreign Key After the Table Has Been Created
    10. Creating a Table Using a CTAS
    11. Creating a Table Using a CTAS Join
    12. Creating a Global Temporary Table Using a CTAS
    13. Creating a Global Temporary Table Using a CTAS Join
    14. Creating a Temporary Table From Another's Space
  23. Chapter 14 – Data Manipulation Language (DML)
    1. INSERT Syntax # 1
    2. INSERT example with Syntax 1
    3. INSERT Syntax # 2
    4. INSERT example with Syntax 2
    5. INSERT/SELECT Command
    6. INSERT/SELECT example using All Columns (*)
    7. INSERT/SELECT example with Less Columns
    8. Two UPDATE Examples
    9. Subquery UPDATE Command Syntax
    10. example of Subquery UPDATE Command
    11. Join UPDATE Command Syntax
    12. The DELETE Command Basic Syntax
    13. DELETE ALL Rows in a Table
    14. A DELETE Example Deleting only Some of the Rows
    15. Example of Subquery DELETE Command
    16. Example of Subquery DELETE That Gets Rid of Null Values
  24. Chapter 15 – Statistical Aggregate Functions
    1. Numeric Manipulation Functions
    2. The Stats Table
    3. The STDDEV_POP Function
    4. The STDDEV_POP Example
    5. The STDDEV_SAMP Function
    6. A STDDEV_SAMP Example
    7. The VAR_POP Function
    8. A VAR_POP Example
    9. The VAR_SAMP Function
    10. A VAR_SAMP Example
    11. The VARIANCE Function
    12. A VARIANCE Example
    13. The CORR Function
    14. A CORR Example
    15. Another CORR Example so you can Compare
    16. The COVAR_POP Function
    17. A COVAR_POP Example
    18. Another COVAR_POP Example so you can Compare
    19. The COVAR_SAMP Function
    20. A COVAR_SAMP Example
    21. Another COVAR_SAMP Example so you can Compare
    22. The REGR_INTERCEPT Function
    23. A REGR_INTERCEPT Example
    24. Another REGR_INTERCEPT Example so you can compare
    25. The REGR_SLOPE Function
    26. A REGR_SLOPE Example
    27. Another REGR_SLOPE Example so you can compare
    28. The REGR_AVGX Function
    29. A REGR_AVGX Example
    30. Another REGR_AVGX Example so you can Compare
    31. The REGR_AVGY Function
    32. A REGR_AVGY Example
    33. Another REGR_AVGY Example so you can compare
    34. The REGR_COUNT Function
    35. A REGR_COUNT Example
    36. The REGR_R2 Function
    37. A REGR_R2 Example
    38. The REGR_SXX Function
    39. A REGR_SXX Example
    40. The REGR_SXY Function
    41. A REGR_SXY Example
    42. The REGR_SYY Function
    43. A REGR_SYY Example
    44. Using GROUP BY