Getting Started with SQL.pdf

(9159 KB) Pobierz
SQL
A HANDS-ON APPROACH
FOR BEGINNERS
www.it-ebooks.info
Getting Started with
Thomas Nield
www.it-ebooks.info
A Hands-on Approach for Beginners
Getting Started with SQL
Thomas Nield
Boston
www.it-ebooks.info
Getting Started with SQL
by Thomas Nield
Copyright © 2016 Thomas Nield. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.
O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are
also available for most titles (http://safaribooksonline.com). For more information, contact our corporate/
institutional sales department: 800-998-9938 or
corporate@oreilly.com.
Editor:
Shannon Cutt
Production Editor:
Shiny Kalapurakkel
Copyeditor:
Jasmine Kwityn
Proofreader:
Rachel Head
February 2016:
First Edition
Indexer:
Ellen Troutman-Zaig
Interior Designer:
David Futato
Cover Designer:
Randy Comer
Illustrator:
Rebecca Demarest
Revision History for the First Edition
2016-02-08:
First Release
See
http://oreilly.com/catalog/errata.csp?isbn=9781491938614
for release details.
The O’Reilly logo is a registered trademark of O’Reilly Media, Inc.
Getting Started with SQL,
the cover
image, and related trade dress are trademarks of O’Reilly Media, Inc.
While the publisher and the author have used good faith efforts to ensure that the information and
instructions contained in this work are accurate, the publisher and the author disclaim all responsibility
for errors or omissions, including without limitation responsibility for damages resulting from the use of
or reliance on this work. Use of the information and instructions contained in this work is at your own
risk. If any code samples or other technology this work contains or describes is subject to open source
licenses or the intellectual property rights of others, it is your responsibility to ensure that your use
thereof complies with such licenses and/or rights.
978-1-491-93861-4
[LSI]
www.it-ebooks.info
Table of Contents
Foreword. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii
Preface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
1. Why Learn SQL?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
What Is SQL and Why Is It Marketable?
Who Is SQL For?
What Is a Database?
Exploring Relational Databases
Why Separate Tables?
Choosing a Database Solution
Lightweight Databases
Centralized Databases
1
2
3
3
4
5
5
6
2. Databases. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
3. SQLite. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
What Is SQLite?
SQLiteStudio
Importing and Navigating Databases
Retrieving Data with SQL
Expressions in SELECT Statements
Text Concatenation
Summary
9
9
10
19
23
27
28
4. SELECT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
iii
www.it-ebooks.info
Zgłoś jeśli naruszono regulamin