eBook - ePub
Teradata SQL
Tom Coffing, Mike Larkins
This is a test
- 1,056 pages
- English
- ePUB (mobile friendly)
- Available on iOS & Android
eBook - ePub
Teradata SQL
Tom Coffing, Mike Larkins
Book details
Book preview
Table of contents
Citations
About This Book
This book includes over 1000 examples of all aspects of SQL starting at the most basic level and going to the most advanced level with real examples that work and explain exactly what is going on. The building block approach that continues to take things a step deeper at a time makes this a perfect SQL guide for everyone.
Frequently asked questions
How do I cancel my subscription?
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
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.
Do you support text-to-speech?
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.
Is Teradata SQL an online PDF/ePUB?
Yes, you can access Teradata 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.
Information
Chapter 1 - Basic SQL Functions
“A journey of a thousand miles begins with a single step.”
- Lao-tzu
- Lao-tzu
Introduction
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
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!
SELECT Specific Columns in a Table
Column names must be separated by commas. Notice that only the columns requested come back on the report, not all columns. Also, notice that the order of the columns in the SQL is the same order on the report.
Using the Best Form for Writing SQL
SELECT | First_Name, |
Last_Name, | |
Class_Code, | |
Grade_Pt | |
FROM | Student_Table; |
SELECT | First_Name, |
,Last_Name, | |
,Class_Code, | |
,Grade_Pt | |
FROM | Student_Table; |
Can you spot the difference between these two examples?
Why is the example on the right better, even though they are functionally equivalent?
Commas in the Front or in the Back?
SELECT | First_Name, |
,Last_Name, | |
,Class_Code, | |
,Grade_Pt | |
FROM | Student_Table; |
SELECT | First_Name, |
Last_Name, | |
Class_Code, | |
Grade_Pt | |
FROM | Student_Table; |
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 will produce the same answer set and have the same performance
Place your Commas in front for better Debugging Capabilities
SELECT | First_Name |
,Last_Name | |
,Class_Code | |
,Grade_Pt | |
FROM | Student_Table; |
Successful
Having commas in front to separate column names makes it easier to debug.
Sort the Data with the ORDER BY Keyword
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
SELECT *
FROM Student_Table
ORDER BY Last_Name;
FROM Student_Table
ORDER BY Last_Name;
When you use the ORDER BY statement, it will default to ascending order. But you can ...
Table of contents
Citation styles for Teradata SQL
APA 6 Citation
Coffing, T., & Larkins, M. (2013). Teradata SQL ([edition unavailable]). Coffing Publishing. Retrieved from https://www.perlego.com/book/2919188/teradata-sql-pdf (Original work published 2013)
Chicago Citation
Coffing, Tom, and Mike Larkins. (2013) 2013. Teradata SQL. [Edition unavailable]. Coffing Publishing. https://www.perlego.com/book/2919188/teradata-sql-pdf.
Harvard Citation
Coffing, T. and Larkins, M. (2013) Teradata SQL. [edition unavailable]. Coffing Publishing. Available at: https://www.perlego.com/book/2919188/teradata-sql-pdf (Accessed: 15 October 2022).
MLA 7 Citation
Coffing, Tom, and Mike Larkins. Teradata SQL. [edition unavailable]. Coffing Publishing, 2013. Web. 15 Oct. 2022.