没有合适的资源?快使用搜索试试~ 我知道了~
首页Beginning SQL Queries From Novice to Professional.pdf
Beginning SQL Queries From Novice to Professional.pdf
需积分: 11 14 下载量 142 浏览量
更新于2023-06-16
1
收藏 9.1MB PDF 举报
Beginning SQL Queries From Novice to Professional.pdf apress的高清pdf英文原版
资源详情
资源推荐
![](https://csdnimg.cn/release/download_crawler_static/4918486/bg1.jpg)
this print for content only—size & color not accurate spine = 0.5655" 240 page count
Books for professionals By professionals
®
Beginning SQL Queries:
From Novice to Professional
Dear Reader,
Beginning SQL Queries shows you how to write database queries using the
SQL language. SQL is used for many forms of data manipulation, but key to all
forms—whether you are reporting, deleting, or updating—is the ability to target
the “right” data. It is frustrating when you know some information is in your
database but you just can’t work out how to retrieve it. It is frustrating to write a
query, only to find out too late that it returns the wrong data.
Learning about the different keywords and functions in SQL is not difficult,
but deciding which ones will help you in any particular situation can be tricky.
Writing queries with confidence is at the heart of successfully using SQL, and
this book aims to give you that confidence.
In this book, I show you different ways to approach problems so that you
will be able to find your way through the maze of SQL possibilities to create
accurate queries. I’ll explain many ways that tables can be combined, filtered,
and summarized, and the SQL statements that support these operations. Along
the way, I’ll show you alternative ways to think about each query, so that you
can overcome those inevitable moments when your mind just goes blank.
Having taught SQL for more years than I care to admit, I am still surprised by
some of the queries my students devise, which accurately address a particular
problem. My experience reinforces just how many different ways there are to
develop a query. An initial attempt that might seem obvious to me may be quite
obscure to you and vice versa.
I hope that after reading this book, you will have the confidence to tackle all
manner of queries, knowing that you’re generating accurate information from
your database.
Clare Churcher
Author of
Beginning Database Design:
From Novice to Professional
US $34.99
Shelve in
Databases/SQL
User level:
Beginner–Intermediate
Churcher
Beginning
SQL Queries
The eXperT’s Voice
®
in DaTaBases
Beginning
SQL Queries
From Novice to Professional
cyan
MaGenTa
yelloW
Black
panTone 123 c
Clare Churcher
Companion
eBook
Available
THE APRESS ROADMAP
Beginning
Database Design
Date on Database:
Writings 2000-2006
Applied Mathematics for
Database Professionals
Beginning
SQL Queries
www.apress.com
SOURCE CODE ONLINE
Companion eBook
See last page for details
on $10 eBook version
ISBN-13: 978-1-59059-943-3
ISBN-10: 1-59059-943-8
9 781590 599433
5 3 4 9 9
A thoughtful approach to learning SQL that helps you
think about the language—and about your data—so that
you can apply the right operations to the right problem to
generate the right results, every time.
![](https://csdnimg.cn/release/download_crawler_static/4918486/bg2.jpg)
Beginning SQL Queries
From Novice to Professional
■■■
Clare Churcher
Churcher_943-8FRONT.fm Page i Thursday, March 20, 2008 11:15 AM
![](https://csdnimg.cn/release/download_crawler_static/4918486/bg3.jpg)
Beginning SQL Queries: From Novice to Professional
Copyright © 2008 by Clare Churcher
All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means,
electronic or mechanical, including photocopying, recording, or by any information storage or retrieval
system, without the prior written permission of the copyright owner and the publisher.
ISBN-13 (pbk): 978-1-59059-943-3
ISBN-10 (pbk): 1-59059-943-8
ISBN-13 (electronic): 978-1-4302-0550-0
ISBN-10 (electronic): 1-4302-0550-4
Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1
Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence
of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark
owner, with no intention of infringement of the trademark.
Lead Editor: Jonathan Gennick
Technical Reviewer: Darl Kuhn
Editorial Board: Clay Andres, Steve Anglin, Ewan Buckingham, Tony Campbell, Gary Cornell,
Jonathan Gennick, Matthew Moodie, Joseph Ottinger, Jeffrey Pepper, Frank Pohlmann,
Ben Renow-Clarke, Dominic Shakeshaft, Matt Wade, Tom Welsh
Project Manager: Beth Christmas
Copy Editors: Marilyn Smith, Kim Wimpsett
Associate Production Director: Kari Brooks-Copony
Production Editor: Ellie Fountain
Compositor: Susan Glinert
Proofreaders: Linda Seifert, Liz Welch
Indexer: Broccoli Information Management
Artist: April Milne
Cover Designer: Kurt Krames
Manufacturing Director: Tom Debolski
Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor,
New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail orders-ny@springer-sbm.com, or
visit http://www.springeronline.com.
For information on translations, please contact Apress directly at 2855 Telegraph Avenue, Suite 600,
Berkeley, CA 94705. Phone 510-549-5930, fax 510-549-5939, e-mail info@apress.com, or visit http://
www.apress.com.
Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use.
eBook versions and licenses are also available for most titles. For more information, reference our Special
Bulk Sales–eBook Licensing web page at http://www.apress.com/info/bulksales.
The information in this book is distributed on an “as is” basis, without warranty. Although every precaution
has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to
any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly
by the information contained in this work.
Churcher_943-8FRONT.fm Page ii Thursday, March 20, 2008 11:15 AM
![](https://csdnimg.cn/release/download_crawler_static/4918486/bg4.jpg)
v
Contents at a Glance
About the Author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xiii
About the Technical Reviewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix
■CHAPTER 1 Relational Database Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
■CHAPTER 2 Simple Queries on One Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
■CHAPTER 3 A First Look at Joins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
■CHAPTER 4 Nested Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
■CHAPTER 5 Self Joins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
■CHAPTER 6 More Than One Relationship Between Tables . . . . . . . . . . . . . . . . . . 95
■CHAPTER 7 Set Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
■CHAPTER 8 Aggregate Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
■CHAPTER 9 Efficiency Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
■CHAPTER 10 How to Approach a Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
■CHAPTER 11 Common Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
■APPENDIX Sample Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
■INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Churcher_943-8FRONT.fm Page v Thursday, March 20, 2008 11:15 AM
![](https://csdnimg.cn/release/download_crawler_static/4918486/bg5.jpg)
vii
Contents
About the Author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xiii
About the Technical Reviewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix
■CHAPTER 1 Relational Database Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
What Is a Relational Database? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Introducing Data Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Introducing Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Inserting and Updating Rows in a Table. . . . . . . . . . . . . . . . . . . . . . . . 5
Designing Appropriate Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Maintaining Consistency Between Tables . . . . . . . . . . . . . . . . . . . . . . 9
Retrieving Information from a Database . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Relational Algebra: Specifying the Operations . . . . . . . . . . . . . . . . . 11
Relational Calculus: Specifying the Result. . . . . . . . . . . . . . . . . . . . . 13
Why Do We Need Both Algebra and Calculus? . . . . . . . . . . . . . . . . . 14
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
■CHAPTER 2 Simple Queries on One Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Retrieving a Subset of Rows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Relational Algebra for Retrieving Rows . . . . . . . . . . . . . . . . . . . . . . . 20
Relational Calculus for Retrieving Rows. . . . . . . . . . . . . . . . . . . . . . . 20
SQL for Retrieving Rows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Retrieving a Subset of Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Relational Algebra for Retrieving Columns . . . . . . . . . . . . . . . . . . . . 22
Relational Calculus for Retrieving Columns. . . . . . . . . . . . . . . . . . . . 22
SQL for Retrieving Columns. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Using Aliases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Combining Subsets of Rows and Columns . . . . . . . . . . . . . . . . . . . . . . . . 24
Saving Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Specifying Conditions for Selecting Rows . . . . . . . . . . . . . . . . . . . . . . . . . 25
Comparison Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Logical Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Contents
Churcher_943-8FRONT.fm Page vii Thursday, March 20, 2008 11:15 AM
剩余232页未读,继续阅读
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://profile-avatar.csdnimg.cn/default.jpg!1)
ediex
- 粉丝: 8
- 资源: 19
上传资源 快速赚钱
我的内容管理 收起
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![](https://csdnimg.cn/release/wenkucmsfe/public/img/voice.245cc511.png)
会员权益专享
最新资源
- 构建智慧路灯大数据平台:物联网与节能解决方案
- 智慧开发区建设:探索创新解决方案
- SQL查询实践:员工、商品与销售数据分析
- 2022智慧酒店解决方案:提升服务效率与体验
- 2022年智慧景区信息化整体解决方案:打造数字化旅游新时代
- 2022智慧景区建设:大数据驱动的5A级管理与服务升级
- 2022智慧教育综合方案:迈向2.0时代的创新路径与实施策略
- 2022智慧教育:构建区域教育云,赋能学习新时代
- 2022智慧教室解决方案:融合技术提升教学新时代
- 构建智慧机场:2022年全面信息化解决方案
- 2022智慧机场建设:大数据与物联网引领的生态转型与客户体验升级
- 智慧机场2022安防解决方案:打造高效指挥与全面监控系统
- 2022智慧化工园区一体化管理与运营解决方案
- 2022智慧河长管理系统:科技助力水环境治理
- 伪随机相位编码雷达仿真及FFT增益分析
- 2022智慧管廊建设:工业化与智能化解决方案
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![](https://img-home.csdnimg.cn/images/20220527035711.png)
![](https://img-home.csdnimg.cn/images/20220527035711.png)
![](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![](https://csdnimg.cn/release/wenkucmsfe/public/img/green-success.6a4acb44.png)