Tera-Tom Genius Series - DB2 SQL
eBook - ePub

Tera-Tom Genius Series - DB2 SQL

Tom Coffing, Leslie Nolander

Buch teilen
  1. 655 Seiten
  2. English
  3. ePUB (handyfreundlich)
  4. Über iOS und Android verfügbar
eBook - ePub

Tera-Tom Genius Series - DB2 SQL

Tom Coffing, Leslie Nolander

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Über dieses Buch

One of the most popular databases in the world is IBM's DB2. This book has over 600 pages of SQL examples and explanations. This book is a must have for anyone who develops or writes SQL for an IBM DB2 system. Readers will also understand how to create tables, views and indexes. The Authors Tera-Tom Coffing, who has written over 75 successful books on Data Warehousing and Leslie Nolander, Chief Operations Officer (COO) of Coffing Data Warehousing bring a combined 40 years of experience of data warehouse knowledge to create this must have book.

Häufig gestellte Fragen

Wie kann ich mein Abo kündigen?
Gehe einfach zum Kontobereich in den Einstellungen und klicke auf „Abo kündigen“ – ganz einfach. Nachdem du gekündigt hast, bleibt deine Mitgliedschaft für den verbleibenden Abozeitraum, den du bereits bezahlt hast, aktiv. Mehr Informationen hier.
(Wie) Kann ich Bücher herunterladen?
Derzeit stehen all unsere auf Mobilgeräte reagierenden ePub-Bücher zum Download über die App zur Verfügung. Die meisten unserer PDFs stehen ebenfalls zum Download bereit; wir arbeiten daran, auch die übrigen PDFs zum Download anzubieten, bei denen dies aktuell noch nicht möglich ist. Weitere Informationen hier.
Welcher Unterschied besteht bei den Preisen zwischen den Aboplänen?
Mit beiden Aboplänen erhältst du vollen Zugang zur Bibliothek und allen Funktionen von Perlego. Die einzigen Unterschiede bestehen im Preis und dem Abozeitraum: Mit dem Jahresabo sparst du auf 12 Monate gerechnet im Vergleich zum Monatsabo rund 30 %.
Was ist Perlego?
Wir sind ein Online-Abodienst für Lehrbücher, bei dem du für weniger als den Preis eines einzelnen Buches pro Monat Zugang zu einer ganzen Online-Bibliothek erhältst. Mit über 1 Million Büchern zu über 1.000 verschiedenen Themen haben wir bestimmt alles, was du brauchst! Weitere Informationen hier.
Unterstützt Perlego Text-zu-Sprache?
Achte auf das Symbol zum Vorlesen in deinem nächsten Buch, um zu sehen, ob du es dir auch anhören kannst. Bei diesem Tool wird dir Text laut vorgelesen, wobei der Text beim Vorlesen auch grafisch hervorgehoben wird. Du kannst das Vorlesen jederzeit anhalten, beschleunigen und verlangsamen. Weitere Informationen hier.
Ist Tera-Tom Genius Series - DB2 SQL als Online-PDF/ePub verfügbar?
Ja, du hast Zugang zu Tera-Tom Genius Series - DB2 SQL von Tom Coffing, Leslie Nolander im PDF- und/oder ePub-Format sowie zu anderen beliebten Büchern aus Informatik & Data-Warehousing. Aus unserem Katalog stehen dir über 1 Million Bücher zur Verfügung.

Information

Jahr
2015
ISBN
9781940540368

Chapter 1 – The Basics of SQL

“As I would not be a slave, so I would not be a master.”
- Abraham Lincoln

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, the query, and the result set.

Finding Your Current Schema

image
The example above shows you how to find your current schema.

Setting Your Default SCHEMA

image
DB2 allows you do set your default database. Above, we have set our default database to SQL_Class. If we run a query without specifying the database, then DB2 will assume the database is SQL_Class. DB2 refers to this as a schema.

SELECT * (All Columns) in a Table

image
Most 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!

SELECT Specific Columns in a Table

SELECT First_Name
,Last_Name
,Class_Code
,Grade_Pt
FROM Student_Table ;
image
This is a great way to show the columns you are selecting from the Table_Name.

Commas in the Front or Back?

image
Why is the example on the left better even though they are functionally equivalent? Errors are easier to spot and comments won’t cause errors.

Place your Commas in front for better Debugging Capabilities

image
"A life filled with love may have some thorns,
but a life empty of love will have no roses."
Anonymous
Having commas in front to separate column names makes it easier to debug. Remember our quote above. "A query filled with commas at the end just might fill you with thorns, but a query filled with commas in the front will allow you to always come up smelling like roses."

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. This is called the Major Sort!

ORDER BY Defaults to Ascending

image
Rows typically come back to the report in random order, but we decided to use the ORDER BY statement. Now, the data comes back ordered by Last_Name.

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 number 2 represents the second column on the report.

Two Examples of ORDER BY using Different Techniques

image
Notice that the answer set is sorted i...

Inhaltsverzeichnis