SQL Fundamentals, Third Edition / Edition 3

Paperback (Print)
Rent
Rent from BN.com
$18.01
(Save 74%)
Est. Return Date: 06/23/2014
Buy Used
Buy Used from BN.com
$41.17
(Save 41%)
Item is in good condition but packaging may have signs of shelf wear/aging or torn packaging.
Condition: Used – Good details
Used and New from Other Sellers
Used and New from Other Sellers
from $27.62
Usually ships in 1-2 business days
(Save 60%)
Other sellers (Paperback)
  • All (11) from $27.62   
  • New (6) from $37.99   
  • Used (5) from $27.62   

Overview

SQL for the Real World

Don’t just learn “generic” SQL. Learn SQL to get results with the world’s top database platforms–Oracle for the enterprise and Microsoft Access for the desktop. Based on John Patrick’s hands-on SQL course at the University of California, Berkeley Extension, this book shows exactly how to retrieve the data you want, when you need it, in any application–from ad hoc reports to the data warehouse. Thoroughly updated for the newest versions of Oracle, Access, and the SQL standard, this book contains more exercises, techniques, and solutions than ever before. You’ll learn exactly how to write SQL queries that are easy to understand, verify, modify, and extend–even if you’ve never worked with databases before.

SQL Fundamentals,Third Edition, teaches you how to

  • Build simple statements to retrieve, store, or modify data
  • Craft complex queries that draw information from multiple tables
  • Sort and summarize your data just the way you want it
  • Create and edit your own tables
  • Protect the integrity of your data
  • Create more efficient, high-performance queries
  • Work with unions, subqueries, self joins, cross joins, inner joins, and outer joins
  • Use the Oracle Data Dictionary

About the Web Site

The accompanying Web site, https://www.box.com/shared/ylbckg2fn0 , contains all the SQL code and tables from the book, including the full databases for several versions of Access and code for building the corresponding Oracle databases. It also provides solutions to many of the book’s problems and an open area for discussions with the author and other readers.

Read More Show Less

Editorial Reviews

From The Critics
This book/CD-ROM package shows how to use SQL to get information from a relational database, focusing on the most widely used SQL products Oracle and Microsoft Access. Readership includes people new to the subject of databases who are not computer programmers, as well as professional programmers looking for solutions to real-world problems. The companion CD-ROM contains all SQL code and tables from the book, Microsoft Access databases, and code for building Oracle databases. Patrick is a computer consultant and software developer specializing in relational database technology. He teaches database courses at the University of California Berkeley Extension. Annotation c. Book News, Inc., Portland, OR (booknews.com)
Booknews
Shows how to use the SQL language to get information from a relational database. The book begins with simple queries that retrieve selected data from a single table, then progresses to advanced queries that summarize the data, combine it with data from other tables, or display the data in specialized ways. The CD-ROM furnishes a library of Access databases and the code for building Oracle databases. Annotation c. Book News, Inc., Portland, OR (booknews.com)
Read More Show Less

Product Details

  • ISBN-13: 9780137126026
  • Publisher: Prentice Hall
  • Publication date: 9/19/2008
  • Series: Pearson Custom Computer Science Series
  • Edition description: Third Edition
  • Edition number: 3
  • Pages: 804
  • Sales rank: 652,816
  • Product dimensions: 6.90 (w) x 9.20 (h) x 1.30 (d)

Meet the Author

John J. Patrick is a computer consultant and software developer specializing in relational database technology. He teaches SQL Fundamentals and other database courses at the University of California, Berkeley Extension, and has more than twenty years of experience in software development at Bank of America, Chevron, Kaiser Permanente, and other leading firms.
Read More Show Less

Read an Excerpt

SQL is one of the most important computer languages. It is the language of databases. Whenever you search for the information you need in a large library of information, the code that performs the search is likely to be using SQL. Many applications in which you share information to coordinate with other people also use SQL.

It is used in more than 100 software products, and new ones are being added all the time. This book shows you how to get the most out of the databases you use. It explains how to use SQL to solve practical problems, using the most widely used SQL products, Oracle and Microsoft Access. Oracle and Access are both widely used, easily available, and run on personal computers. By learning these two products in detail, you will have all the basic skills to use any of the many products based on SQL.

How the Topics Are Presented

This book uses an informal conversational style to take you on a tour of SQL topics. Oracle and Access are placed side by side doing the same tasks, so you can see their similarities and differences. Most topics are illustrated with an example of SQL code. I have intentionally kept the tables small in these examples, which makes them easy to check and understand.

Each example of SQL code begins by setting a task. Then the SQL code is given that performs that task. Whenever possible, I wrote the SQL code so that it works in both Oracle and Access. However, sometimes I could not do that, so I wrote one version of SQL code for Oracle and a different version for Access.

To make this book easier to read, each example of SQL shows the beginning and ending data table(s). This allows you to check that you understand what the SQL is doing. I have tried to make these examples small so they are easy to check.

Each example is often followed by notes to explain any subtle points about the SQL code or the data tables.

Finally, I give you a problem to solve to check your understanding of the topic. You can decide if you want to do these problems or not. Usually they are fairly easy and require only a small modification of the SQL code in the example. If you decide to do a problem, the Web site will allow you to determine if your solution is correct.

Each example of SQL code in this book is designed to be independent and stand on its own, without needing any changes performed in previous sections. This allows you to skip around in the book and read the sections in any order you want. Some people may want to read the book from beginning to end, but it is not necessary to do this.

Be sure to look at the appendices for practical tips on how to run Oracle and Access. The database files and the code for all the examples are available from the Web site. In several places throughout this book, I have expressed opinions about computer technology, something that many other technical books avoid doing. These opinions are my own and I take full responsibility for them. I also reserve the right to change my mind. If I do so, I will put my revised opinion, and the reasons that have caused me to change my thinking, on the Web site for this book.

The Companion Web Site

The companion Web site for this book is a Google group called “sqlfun.” The group Web address is:

http://groups.google.com/group/sqlfun

You can also send e-mail to me at:

sqlfun@gmail.com

This Web site contains:

  • Oracle SQL code to build all the data tables used in this book.
  • Access databases with all the data tables used in this book. Databases are available for several versions of Access.
  • Ways to check your answers to problems in the book.
  • A list of corrections, if there are any.
  • An open area for discussions, your comments, and questions you want me to answer.

I invite you to come visit the Web site!

Read More Show Less

Table of Contents

Preface xxv

Chapter 1: Storing Information in Tables 1

Introduction 3

The Parts of a Table 9

Examples of Tables 19

Key Points 30

Chapter 2: Getting Information from a Table 31

The Select Statement 33

The Select Clause 37

The Where Clause 50

The Order By Clause 71

Key Points 80

Chapter 3: Compound Conditions in the Where Clause 83

Compound Conditions in the Where Clause 85

Constant Values 95

Punctuation Matters 102

Case Sensitivity 113

Three-Valued Logic 120

Error Messages 122

Some Exercises Solved for You 124

Key Points 131

Chapter 4: Saving Your Results 133

Saving Your Results in a New Table or View 135

Modifying the Data in a Table with SQL 151

Modifying the Data in a Table with the GUI 161

Restrictions on Modifying the Data in a Table 167

Key Points 170

Chapter 5: The Data Dictionary and Other Oracle Topics 171

Commit, Rollback, and Transactions 173

Modifying Data through a View 179

The SQL Commands Page in Oracle 192

Using the Oracle Data Dictionary – Part 1 195

Key Points 207

Chapter 6: Creating Your Own Tables 209

Creating Tables 211

Changing Tables 226

Tables with Duplicate Rows 236

Key Points 243

Chapter 7: Formats, Sequences, and Indexes 245

Formats 247

Sequences 257

Indexes 262

Using the Oracle Data Dictionary – Part 2 266

An Exercise Solved for You 278

Key Points 280

Chapter 8: Data Integrity 281

Constraints on One Table 283

Referential Integrity 289

The Delete Options and Update Options of RI 303

Variations of Referential Integrity 311

How to Code Constraints in a Create Table Statement 316

Key Points 319

Chapter 9: Row Functions 321

Introduction to Row Functions 323

Numeric Functions 334

Text Functions 340

Date Functions 350

Key Points 359

Chapter 10: Using Row Functions 361

Specialized Row Functions 363

Using the Documentation of Row Functions 372

Creating Patterns of Numbers and Dates 376

Key Points 397

Chapter 11: Summarizing Data 399

Introduction to the Column Functions 401

Maximum and Minimum 404

Count 411

Sum and Average 420

Other Topics 428

Key Points 434

Chapter 12: Controlling the Level of Summarization 435

Dividing a Table into Groups of Rows 437

Eliminating Some of the Summarized Data 459

Key Points 471

Chapter 13: Inner Joins 473

Introduction to Joins 475

Inner Joins of Two Tables 479

Variations of the Join Condition 495

Applications of Joins 504

Key Points 515

Chapter 14: Outer Joins 517

Introduction to Outer Joins 519

Applications of Outer Joins 534

Key Points 553

Chapter 15: Union and Union All 555

Union Basics 557

Unconventional Unions 573

Applications of a Union 577

Set Intersection and Set Difference in Oracle 590

Key Points 595

Chapter 16: Cross Joins, Self Joins, and CrossTab Queries 597

Cross Joins 599

Self Joins 613

CrossTab Queries in Access 624

CrossTab Queries in Oracle 645

Key Points 650

Chapter 17: Combining Tables in a Production Database 653

Methods of Joining Three or More Tables 655

Losing Information 660

Caring about the Efficiency of Your Computer 663

Standardizing the Way That Tables Are Joined 666

Key Points 671

Chapter 18: If-Then-Else, Parameter Queries, and Subqueries 673

If-Then-Else Logic 675

Parameter Queries 689

Subqueries 700

Applications of Subqueries 710

Older Features of Subqueries 714

Key Points 719

Chapter 19: The Multiuser Environment 721

Database Configurations 723

Operating in a Multiuser Environment 727

Security and Privileges 732

The Oracle Data Dictionary and the Multiuser Environment 736

Key Points 738

Chapter 20: The Design of SQL 739

Original SQL Design Objectives 741

Newer Interfaces 743

Typical Applications 748

Key Points 749

Appendix A: Oracle Is Free: How to Get Your Copy 751

Getting Current Information 752

Which Version of Oracle Should You Get? 752

System Requirements 753

Downloading Oracle from the Internet 753

Installing Oracle 754

Setup to Run the Examples in This Book 754

How to Stop Running Oracle 763

What to Do if Oracle Slows Down Your Computer 763

Appendix B: Quick Start with Oracle 765

Log in to Your Computer 766

Go to the Database Home Page 766

Log in to the Oracle Database 768

Go to the SQL Commands Page 768

Enter and Run an SQL Query 769

Optional: Print Your Query and the Results 770

Appendix C: Quick Start with Access 771

You May Use Access 2007, 2003, 2002, or 2000 772

How to Start Access 772

Entering an SQL Query 774

Dealing with Errors in Access 776

Printing from Access 777

Using the Access Trust Center 778

Appendix D: Diagram of the Lunches Database 783

Join Conditions 784

Data Validation Rules 785

Index 787

Read More Show Less

Preface

SQL is one of the most important computer languages. It is the language of databases. Whenever you search for the information you need in a large library of information, the code that performs the search is likely to be using SQL. Many applications in which you share information to coordinate with other people also use SQL.

It is used in more than 100 software products, and new ones are being added all the time. This book shows you how to get the most out of the databases you use. It explains how to use SQL to solve practical problems, using the most widely used SQL products, Oracle and Microsoft Access. Oracle and Access are both widely used, easily available, and run on personal computers. By learning these two products in detail, you will have all the basic skills to use any of the many products based on SQL.

How the Topics Are Presented

This book uses an informal conversational style to take you on a tour of SQL topics. Oracle and Access are placed side by side doing the same tasks, so you can see their similarities and differences. Most topics are illustrated with an example of SQL code. I have intentionally kept the tables small in these examples, which makes them easy to check and understand.

Each example of SQL code begins by setting a task. Then the SQL code is given that performs that task. Whenever possible, I wrote the SQL code so that it works in both Oracle and Access. However, sometimes I could not do that, so I wrote one version of SQL code for Oracle and a different version for Access.

To make this book easier to read, each example of SQL shows the beginning and ending data table(s). This allows you to check that you understand what the SQL is doing. I have tried to make these examples small so they are easy to check.

Each example is often followed by notes to explain any subtle points about the SQL code or the data tables.

Finally, I give you a problem to solve to check your understanding of the topic. You can decide if you want to do these problems or not. Usually they are fairly easy and require only a small modification of the SQL code in the example. If you decide to do a problem, the Web site will allow you to determine if your solution is correct.

Each example of SQL code in this book is designed to be independent and stand on its own, without needing any changes performed in previous sections. This allows you to skip around in the book and read the sections in any order you want. Some people may want to read the book from beginning to end, but it is not necessary to do this.

Be sure to look at the appendices for practical tips on how to run Oracle and Access. The database files and the code for all the examples are available from the Web site. In several places throughout this book, I have expressed opinions about computer technology, something that many other technical books avoid doing. These opinions are my own and I take full responsibility for them. I also reserve the right to change my mind. If I do so, I will put my revised opinion, and the reasons that have caused me to change my thinking, on the Web site for this book.

The Companion Web Site

The companion Web site for this book is a Google group called “sqlfun.” The group Web address is:

http://groups.google.com/group/sqlfun

You can also send e-mail to me at:

sqlfun@gmail.com

This Web site contains:

  • Oracle SQL code to build all the data tables used in this book.
  • Access databases with all the data tables used in this book. Databases are available for several versions of Access.
  • Ways to check your answers to problems in the book.
  • A list of corrections, if there are any.
  • An open area for discussions, your comments, and questions you want me to answer.

I invite you to come visit the Web site!

Read More Show Less

Introduction

Preface

SQL is now one of the most important computer languages. It is used in over 100 software products, and new ones are being added all the time. This book shows you how to get the most out of your database. It explains how to use SQL to solve practical problems, using the most widely used SQL products Oracle and Microsoft Access. Oracle and Access are both widely used, easily available and run on personal computers. By learning these two products in detail, you will have all the basic skills to use any of the many products based on SQL.

Every concept in this book is illustrated with an example of SQL code. In most cases, a task is set, then the SQL code is given to complete that task. The beginning and result tables of data are also shown. There are more than 200 of these examples. Each part stands on its own. You can read this book sequentially or skip around to find the parts that you need.

Be sure to look at the appendices for practical tips on how to run Oracle and Access. The CD-ROM contains the database files and the code for all the examples.

In several places throughout this book, I have expressed opinions about computer technology, something that many other technical books avoid doing. These opinions are my own and I take full responsibility for them. I also reserve the right to change my mind.

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)