Netezza SQL
eBook - ePub

Netezza SQL

Tom Coffing, Mike Larkins

Condividi libro
  1. 683 pagine
  2. English
  3. ePUB (disponibile sull'app)
  4. Disponibile su iOS e Android
eBook - ePub

Netezza SQL

Tom Coffing, Mike Larkins

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Informazioni sul libro

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.

Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
Netezza SQL è disponibile online in formato PDF/ePub?
Sì, puoi accedere a Netezza SQL di Tom Coffing, Mike Larkins in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Informatik e Data-Warehousing. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

Anno
2014
ISBN
9781940540283
Argomento
Informatik

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...

Indice dei contenuti