Netezza SQL
eBook - ePub

Netezza SQL

  1. 683 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

About this book

This book contains nearly 700 pages of brilliant Netezza examples ranging from simple commands to advanced procedures. Netezza SQL, like all others in the Genius Series, guides readers in a clear and logical manner using pictures and real-life examples. This book is a must-have for any Netezza environment.

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere β€” even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Netezza SQL by Tom Coffing,Mike Larkins in PDF and/or ePUB format, as well as other popular books in Computer Science & Data Warehousing. We have over one million books available in our catalogue for you to explore.

Chapter 1 – Basic SQL Functions

"Kites rise highest against the wind – not with it."
Sir Winston Churchill

Introduction

image
The Student_Table above will be used
in our early SQL Examples
This is a pictorial of the Student_Table which we will use to present some basic examples of SQL and get some hands-on experience with querying this table. This book attempts to show you the table, show you the query, and show you the result set.

SELECT * (All Columns) in a Table

SELECT *
FROM Student_Table ;
image
Mostly every SQL statement will consist of a SELECT and a FROM. You SELECT the columns you want to see on your report and an Asterisk (*) means you want to see all columns in the table on the returning answer set!

Fully Qualifying a Database, Schema and Table

image
To refer to objects in other databases on the Netezza system, you must use three-level naming, which consists of the database (also referred to as catalog name), the schema (which is the name of the database owner), and the object (table, view or synonym). The last example (Sales..Dept) is a convenient way of specifying a fully qualified object name. The system supplies the schema name by internally inserting the current schema name.

SELECT Specific Columns in a Table

SELECT First_Name
,Last_Name
,Class_Code
,Grade_Pt
FROM Student_Table ;
image
Column names must be separated by commas. The next page will show perfect syntax, which will capitalize keywords and place each column on its own line.

Commas in the Front or Back?

image
Commas in the front (example 1) is Tera-Tom's recommendation to writing, but the next page is an even better example for a company standard. Both queries above produce the same answer set and have the same performance.

Using Good Form

image
SELECT First_Name,
Last_Name,
Class_Code,
Grade_Pt
FROM Student_Table ;
This is a great way to show the columns you are selecting from the Table_Name. Let me show you an even better technique!

Using the Best Form for Writing SQL

image
Why is the example on the right better even though they are functionally equivalent?

Place your Commas in front for better Debugging Capabilities

image
Having commas in front to separate column names makes it easier to debug

Sort the Data with the ORDER BY Keyword

image
Rows typically come back to the report in random order. To order the result set, you must use an ORDER BY. When you order by a column, it will order in ASCENDING order by default. This is called the Major Sort!

ORDER BY Defaults to Ascending

image
When you use the ORDER BY statement, it will default to ascending order, but you can change that if you like. I will show you how in a few pages down.

Use the Name or the Number in your ORDER BY Statement

image
The ORDER BY can use a number to represent the sort column. The numbe...

Table of contents

  1. Cover
  2. The Tera-Tom Genius Series
  3. Tera-Tom- Author of over 50 Books
  4. The Best Query Tool Works on all Systems
  5. Copyright
  6. About Tom Coffing
  7. About Michael Larkins
  8. Contents
  9. Chapter 1 – Basic SQL Functions
  10. Chapter 2 – The WHERE Clause
  11. Chapter 3 – Distinct Vs Group By
  12. Chapter 4 – Review
  13. Chapter 5 – Aggregation Function
  14. Chapter 6 – Join Functions
  15. Chapter 7 – Date Functions
  16. Chapter 8 – OLAP Functions
  17. Chapter 9 – Temporary Tables
  18. Chapter 10 – Sub-query Functions
  19. Chapter 11 - Substrings and Positioning Functions
  20. Chapter 12 – Interrogating the Data
  21. Chapter 13 – View Functions
  22. Chapter 14 – Set Operators Functions
  23. Chapter 15 – Data Manipulations
  24. Chapter 16 – Tables, DDL, and Data Types
  25. Chapter 17 – Statistical Aggregate Functions
  26. Chapter 18 – Stored Procedure Functions
  27. Chapter 19 – Nexus Query Chameleon