Oracle 12c SQL 3rd Edition Joan Casteel Download
Oracle 12c SQL 3rd Edition Joan Casteel Download
download
https://ebookname.com/product/oracle-12c-sql-3rd-edition-joan-
casteel/
https://ebookname.com/product/pkg-oracle-developer-pl-sql-prog-
oracle-cd-joan-casteel/
https://ebookname.com/product/pro-oracle-sql-2nd-edition-
morton-k/
https://ebookname.com/product/oracle-pl-sql-programming-third-
edition-steven-feuerstein/
https://ebookname.com/product/awwa-manual-volume-32-water-
quality-in-the-distribution-system-1st-edition-bill-lauer/
Essentials of Evidence Based Practice of
Neuroanesthesia and Neurocritical Care 1st Edition
Hemanshu Prabhakar (Editor)
https://ebookname.com/product/essentials-of-evidence-based-
practice-of-neuroanesthesia-and-neurocritical-care-1st-edition-
hemanshu-prabhakar-editor/
https://ebookname.com/product/the-issuer-s-guide-to-pipes-new-
markets-deal-structures-and-global-opportunities-for-private-
investments-in-public-equity-1st-edition-dresner/
https://ebookname.com/product/against-technology-from-the-
luddites-to-neo-luddism-1st-edition-steven-e-jones/
https://ebookname.com/product/introduction-to-ground-penetrating-
radar-inverse-scattering-and-data-processing-1st-edition-
raffaele-persico/
https://ebookname.com/product/sargon-ii-king-of-assyria-first-
edition-josette-elayi/
The Faithful Mohawks John Wolfe Lydekker
https://ebookname.com/product/the-faithful-mohawks-john-wolfe-
lydekker/
5 REASONS
to buy your textbooks
and course materials at
SAVINGS:
1 Prices up to 75% off, daily coupons, and free shipping on orders over $25
CHOICE:
2 Multiple format options including textbook, eBook and eChapter rentals
CONVENIENCE:
3 Anytime, anywhere access of eBooks or eChapters via mobile devices
4 SERVICE:
Free eBook access while your text ships, and instant access to online homework products
STUDY TOOLS:
5 Study tools* for your text, plus writing, research, career and job search resources
* availability varies
Joan Casteel
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
This is an electronic version of the print textbook. Due to electronic rights restrictions, some third party content may be suppressed. Editorial
review has deemed that any suppressed content does not materially affect the overall learning experience. The publisher reserves the right to
remove content from this title at any time if subsequent rights restrictions require it. For valuable information on pricing, previous
editions, changes to current editions, and alternate formats, please visit www.cengage.com/highered to search by
ISBN#, author, title, or keyword for materials in your areas of interest.
Important Notice: Media content referenced within the product description or the product text may not be available in the eBook version.
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
ORACLE® 12c: SQL © 2016, 2010 Cengage Learning
Joan Casteel
WCN: 02-200-203
Vice President, General Manager, Science, ALL RIGHTS RESERVED. No part of this work covered by the
Math & Quantitative Business: Balraj Kalsi copyright herein may be reproduced, transmitted, stored, or used in any
Product Director: Joe Sabatino form or by any means graphic, electronic, or mechanical, including but not
limited to photocopying, recording, scanning, digitizing, taping, Web
Product Manager: Jason Guyler
distribution, information networks, or information storage and retrieval
Content Developer: Lori Bradshaw, S4 Carlisle systems, except as permitted under Section 107 or 108 of the 1976 United
Senior Product Assistant: Brad Sullender States Copyright Act, without the prior written permission of the publisher.
Senior Marketing Manager: Eric La Scola
For product information and technology assistance, contact us at
Marketing Coordinator: William Guiliani Cengage Learning Customer & Sales Support, 1-800-354-9706
Art and Cover Direction, Production For permission to use material from this text or product,
Management, and Composition: submit all requests online at www.cengage.com/permissions
Lumina Datamatics, Inc. Further permissions questions can be emailed to
Intellectual Property permissionrequest@cengage.com
Cengage Learning
20 Channel Center Street
Boston, MA 02210
USA
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
To Scott, a true teacher—one who never stops learning
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
BRIEF CONTENTS
Preface xiv
Chapter 1 Overview of Database Concepts 1
Chapter 2 Basic SQL SELECT Statements 25
Chapter 3 Table Creation and Management 57
Chapter 4 Constraints 103
Chapter 5 Data Manipulation and Transaction Control 141
Chapter 6 Additional Database Objects 181
Chapter 7 User Creation and Management 225
Chapter 8 Restricting Rows and Sorting Data 255
Chapter 9 Joining Data from Multiple Tables 295
Chapter 10 Selected Single-Row Functions 347
Chapter 11 Group Functions 401
Chapter 12 Subqueries and MERGE Statements 449
Chapter 13 Views 495
Appendix A Tables for the JustLee Books Database 539
Appendix B SQL*Plus and SQL Developer Overview 547
Appendix C Oracle Resources 555
Appendix D SQL*Loader 557
Appendix E SQL Tuning Topics 561
Appendix F SQL in Various Databases 579
Glossary 583
Index 589
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
TABLE OF CONTENTS
Preface xiv
Chapter 1 Overview of Database Concepts 1
Introduction 2
Database Terminology 2
Database Management System 3
Database Design 4
Entity-Relationship (E-R) Model 5
Database Normalization 6
Relating Tables in the Database 10
Structured Query Language (SQL) 12
Databases Used in This Textbook 13
Basic Assumptions 13
Tables in the JustLee Books Database 14
Topic Sequence 16
Software Used in This Textbook 16
Chapter Summary 17
Review Questions 17
Multiple Choice 18
Hands-On Assignments 21
Advanced Challenge 22
Case Study: City Jail 22
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Review Questions 50
Multiple Choice 51
Hands-On Assignments 54
Advanced Challenge 55
Case Study: City Jail 55
vi Table of Contents
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Disabling and Dropping Constraints 128
Using DISABLE/ENABLE 128
Dropping Constraints 129
Chapter Summary 131
Chapter 4 Syntax Summary 131
Review Questions 133
Multiple Choice 134
Hands-On Assignments 137
Advanced Challenge 139
Case Study: City Jail 139
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Indexes 199
B-Tree Indexes 200
Bitmap Indexes 206
Function-Based Indexes 208
Index Organized Tables 209
Verifying an Index 210
Altering or Removing an Index 211
Synonyms 212
Deleting a Synonym 215
Chapter Summary 216
Chapter 6 Syntax Summary 217
Review Questions 218
Multiple Choice 219
Hands-On Assignments 222
Advanced Challenge 223
Case Study: City Jail 224
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Chapter 8 Restricting Rows and Sorting Data 255
Introduction 256
Where Clause Syntax 257
Rules for Character Strings 258
Rules for Dates 260
Comparison Operators 260
BETWEEN ... AND Operator 267
IN Operator 268
LIKE Operator 270
Logical Operators 274
Treatment of Null Values 277
ORDER by Clause Syntax 279
Secondary Sort 282
Sorting by SELECT Order 284
Chapter Summary 285
Chapter 8 Syntax Summary 286
Review Questions 288
Multiple Choice 288
Hands-On Assignments 292
Advanced Challenge 293
Case Study: City Jail 293
Table of Contents ix
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Advanced Challenge 345
Case Study: City Jail 345
x Table of Contents
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Multiple Choice 395
Hands-On Assignments 399
Advanced Challenge 399
Case Study: City Jail 400
Table of Contents xi
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
NULL Values 471
NVL in Subqueries 471
IS NULL in Subqueries 472
Correlated Subqueries 473
Nested Subqueries 475
Subquery Factoring Clause 477
DML Actions Using Subqueries 478
MERGE Statements 479
Chapter Summary 484
Chapter 12 Syntax Summary 484
Review Questions 486
Multiple Choice 486
Hands-On Assignments 492
Advanced Challenge 493
Case Study: City Jail 493
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
PUBLISHER Table 545
PROMOTION Table 546
Glossary 583
Index 589
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
PREFACE
The past few decades have seen a proliferation of organizations that rely heavily on
information technology. These organizations store their data in databases, and many
choose Oracle database management systems to access their data. The current Oracle
database version, Oracle 12c, is a database management system that enables users to
create, manipulate, and retrieve data. The purpose of this textbook is to introduce
students to basic SQL commands for interacting with Oracle 12c databases in a business
environment. In addition, concepts relating to objectives of the current Oracle
certification exams have been incorporated for students wanting to pursue certification.
The Approach
The concepts introduced in this textbook are discussed in the context of a hypothetical
real-world business: an online book retailer named JustLee Books. The company’s
business operation and the database structure are introduced and analyzed, and as
commands are introduced throughout the textbook, they’re modeled with examples using
the JustLee Books database. Using consistent examples of a hypothetical company helps
you learn the syntax of commands and how to use them in a real-world environment. In
addition, a script file that generates the database is available to give you hands-on practice
in re-creating examples and practicing variations of SQL commands to enhance your
understanding.
To explain what a database is and how it’s created, this textbook initially focuses
on creating tables and learning how to perform data manipulation operations. After
you’re familiar with the database structure, the focus then turns to querying a database.
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
In Chapters 8 through 13, you learn how to retrieve data from the database, using the
many options of a SELECT statement, including row filtering, joins, functions, and
subqueries.
To reinforce the material, each chapter includes a chapter summary and, when
appropriate, a syntax guide for the commands covered in the chapter. In addition, each
chapter includes review questions and hands-on activities that test your knowledge and
challenge you to apply that knowledge to solving business problems. A running case study
that builds throughout the textbook provides a second real-world setting—a city jail
system—as another opportunity to work with databases.
Preface xv
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
indexes to speed up data retrieval, and create synonyms to provide aliases for tables.
Chapter 7 steps you through creating user accounts and roles and shows how to grant (and
revoke) privileges to these accounts and roles. Chapter 8 explains how to restrict rows
retrieved from a table, based on a given condition. Chapter 9 shows how to link tables with
common columns by using joins. Chapter 10 describes the single-row functions supported
by Oracle 12c. Chapter 11 covers the usage of multiple-row functions to derive a single
value for a group of rows and explains how to restrict groups of rows. Chapter 12 covers
using subqueries to retrieve rows based on an unknown condition already stored in the
database. Chapter 13 explains using views to restrict access to data and reduce the
complexity of certain types of queries.
The appendixes support and reinforce chapter materials. Appendix A contains
printed versions of the initial table structure and data for the JustLee Books database used
throughout this textbook. Appendix B introduces the operation of the SQL*Plus and SQL
Developer client software tools. Appendix C lists Oracle resources for further study.
Appendix D introduces the SQL*Loader utility for importing data. Appendix E introduces
basic SQL statement tuning concepts. Appendix F identifies SQL differences in some
popular databases.
Features
To enhance your learning experience, each chapter in this textbook includes the following
elements:
• Chapter objectives: Each chapter begins with a list of the concepts to be
mastered by the chapter’s conclusion. This list gives you a quick overview of
chapter contents and serves as a useful study aid.
• Running case: A sustained example, the business operation of JustLee Books,
is the basis for introducing new commands and practicing the material
covered in each chapter.
• Methodology: As new commands are introduced in each chapter, the
command syntax is shown and then an example, using the JustLee Books
database, illustrates using the command in the context of business
operations. This methodology shows you not only how the command is used,
but also when and why it’s used. The script file used to create the database is
available so that you can work through the examples in this textbook,
engendering a hands-on environment in which you can reinforce your
knowledge of chapter material.
• Tip: This feature, designated by the Tip icon, provides practical advice and
sometimes explains how a concept applies in the workplace.
• Note: These explanations, designated by the Note icon, offer more
information on performing operations with databases.
• Database Preparation: These notes, placed at the end-of-chapter
introductions, tell you which script from the student data files you should
run in preparation for chapter examples and activities.
• Caution: This warning, designated by the Caution icon, points out database
operations that, if misused, could have devastating results.
• Chapter summaries: Each chapter’s text is followed by a summary of chapter
concepts. These summaries are a helpful recap of chapter contents.
xvi Preface
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
• Syntax summaries: Beginning with Chapter 2, a Syntax Guide table is
included after each chapter summary to recap the command syntax covered
in the chapter.
• Review questions: End-of-chapter assessment begins with review questions
that reinforce the main ideas introduced in each chapter. These questions
ensure that you have mastered the concepts and understand the information
covered in the chapter.
• Multiple-choice questions: Each chapter contains multiple-choice
questions covering the material in the chapter. Oracle certification-type
questions are included to prepare you for the type of questions you
can expect on certification exams and measure your level of
understanding.
• Hands-on assignments: Along with conceptual explanations and
examples, each chapter includes hands-on assignments related to the
chapter’s contents. The purpose of these assignments is to give you
practical experience. In most cases, the assignments are based on the
JustLee Books database and build on the examples in the chapter.
• Advanced challenge: This section poses another problem about the JustLee
Books database for you to solve and is larger in scope than the hands-on
assignments.
• Case studies: At the end of each chapter is a major case study, designed
to help you apply what you have learned to real-world situations. These
cases give you the opportunity to synthesize and evaluate information
independently, examine potential solutions, and make recommendations,
much as you would in an actual business situation. These cases uses a
database based on a city jail system.
Supplemental Materials
The following supplemental materials are available when this book is used in a classroom
setting. All teaching tools available with this book are provided to instructors on the
Cengage Learning Web site at www.cengagebrain.com.
• Electronic Instructor’s Manual: The Instructor’s Manual accompanying this
textbook includes the following items:
• Additional instructional material to assist in class preparation, including
suggestions for lecture topics
• A sample syllabus
• When applicable, information about potential problems that can occur in
networked environments
• Cengage Learning Testing Powered by Cognero is a flexible, online system
that allows you to:
• author, edit, and manage test bank content from multiple Cengage
Learning solutions
• create multiple test versions in an instant
• deliver tests from your LMS, your classroom or wherever you want
Preface xvii
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
• PowerPoint presentations: Microsoft® PowerPoint slides are included for
each chapter. Instructors can use the slides in three ways: as teaching
aids during classroom presentations, as printed handouts for classroom
distribution, or as network-accessible resources for chapter review.
Instructors can add their own slides for additional topics introduced to
the class.
• Data files: The script files needed to create the JustLee Books and City
Jail databases are available on the Cengage Learning Web site at www
.cengagebrain.com.
• Solution files: Solutions to chapter examples, end-of-chapter review
questions and multiple-choice questions, hands-on assignments, and case
studies are available on the Cengage Learning Web site at www
.cengagebrain.com. The solutions are password protected.
• Figure files: Figure files allow instructors to create their own presentations
with figures from the textbook.
Acknowledgments
I feel fortunate that Cengage Learning pursued my authorship of this textbook and
continues to support my efforts. I am one lucky person—I have two angels in heaven, my
mother and grandmother, and one angel here on earth, Scott. Without them watching
over me, I would not be able to tackle such challenges. I also want to thank my father,
who always seems more excited than me every time I finish a book project.
However, this textbook is the result of an incredible effort by many people whom
I wish I had the opportunity to thank personally. First, hats off to Lori Bradshaw and
Wendy Langerud of S4Carlisle Publishing Services for managing the content for this
project and keeping everyone on schedule. And a special thank you to Arul Joseph Raj
of Lumina Datamatics LTD for his detailed efforts in preparing, reviewing, and formatting
the content. There were many others involved in this project like product management,
editing, marketing, and art development, and every effort was critical in making this
book a reality. I truly appreciate all of these efforts.
In addition, I need to recognize the enormous contribution of colleagues and
reviewers, who provided helpful suggestions and insight into the development of this
textbook in earlier editions. And, finally, many thanks to the instructors who have
adopted this text and have dedicated their efforts to assist others to learn these most
important database skills.
xviii Preface
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
READ THIS BEFORE YOU BEGIN
TO THE USER
Data Files
To work through the examples and complete the projects in this book, you need to load
the data files created for this book. Your instructor will provide these data files, or you
can download them from the Cengage Learning Web site at www.cengagebrain.com and
then search for this book’s title. The data files are designed to supply the same data shown
in chapter examples, so you can have hands-on practice in re-creating the queries and
their output. The tables in the database can be reset if you encounter problems, such as
accidentally deleting data. Working through all examples is highly recommended to
reinforce your learning.
Starting with Chapter 2, database script instructions are given at the beginning of the
chapter, if applicable. These database script files are in the folder corresponding to the
chapter (Chapter 5, Chapter 10, and so forth) on www.cengagebrain.com and have
filenames such as JLDB_Build_#.sql (substituting the chapter number for the
# symbol). If the computer in your school lab—or your own computer—has Oracle 12c
installed, you can work through the chapter examples and complete the hands-on
assignments and case projects. Many of the coding examples in this textbook can be
completed successfully with previous versions of Oracle (Oracle 10g or Oracle 11g).
Connecting to Oracle
Most colleges will provide various options for accessing Oracle software to execute SQL
statements required in this text, typically via the internet and/or using college computer
labs. Contact your instructor first to identify the options available. If you choose to install
Oracle 12c on your own computer, visit www.oracle.com and go to the database
download area. The database software is freely available for learning purposes, however, it
is very important that you view the documentation for the software prior to downloading
and installing the software. Be sure to review the hardware and software requirements
prior to attempting the install. You will be asked to setup a free Oracle Technology
Network account before downloading. If you are new to Oracle, consult with your
instructor prior to installing Oracle database software for guidance. This text was tested
on Oracle Database 12c release 12.1.0.1.0.
When you install the Oracle software, you’re prompted to change the password for
certain default administrative user accounts. Make sure you record the accounts’ names
and passwords because you might need to log in to the database with one of these
administrative accounts in later chapters. After you install Oracle, you’re required to
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
enter a username and password to access the software. One default username created
during installation is “scott.”
Also, note that you can’t use your own computer to work through chapter examples
and complete projects unless you have the data files. You can get these files from your
instructor, or you can download them from the Cengage Learning Web site at www
.cengagebrain.com and then search for this book’s title. When you download the data
files, they should be stored in a directory separate from any other files on your hard drive.
You need to remember the path or folder containing these files because each script
filename must be prefixed with its location before you run the script.
TO INSTRUCTORS
To complete examples and activities in this textbook, your students must have access to
the data files included on the Instructor Resources GD (or downloaded from www
.cengagebrain.com).
The data files consist of the JustLee Database folder and a folder for each chapter.
Many chapters require running a script; if so, these instructions are given in a note at the
beginning of the chapter. These scripts are in folders corresponding to the chapter
(Chapter 5, Chapter 10, and so forth) and have filenames such as JLDB_Build_#.sql
(substituting the chapter number for the # symbol). The initial database creation is done
at the beginning of Chapter 2 to create the JustLee Books database. Students should run
the scripts as instructed to have a copy of the tables stored in their schemas. You should
instruct your students on how to access and copy data files to their own computers. The
chapters and projects in this book were tested with Oracle 12c Standard Edition.
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
CHAPTER 1
OVERVIEW OF DATABASE
CONCEPTS
LEARNING OBJECTIVES
After completing this chapter, you will be able to do the following:
• Define database terms
• Identify the purpose of a database management system (DBMS)
• Explain database design by using entity-relationship models and
normalization
• Explain the purpose of a Structured Query Language (SQL)
• Understand how this textbook’s topics are sequenced and how the two
sample databases are used
• Identify the software used in this textbook
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
2 INTRODUCTION
Imagine you’re starting up an online book retail company. How will customer orders
be recorded? Will customers be able to search for products by name or keywords? Will you
be able to analyze sales information to track profits, determine product success, and target
marketing efforts to customers? Analyzing thousands of orders could take days without
using a database. A database simplifies these tasks because it’s a storage structure that
provides mechanisms for recording, manipulating, and retrieving data.
The database used throughout this textbook is based on the activities of a
hypothetical business, an online bookseller named JustLee Books. The company sells
books via the Internet to customers throughout the United States. When a new customer
places an order, he or she provides data such as name, billing and shipping addresses, and
items ordered. The company also uses a database for all books in inventory.
To access the data required for operating JustLee Books, management relies on a
DBMS. A database management system (DBMS) is used to create and maintain the
structure of a database, and then to enter, manipulate, and retrieve the data it stores.
Creating an efficient database design is the key to using a database effectively to support
an organization’s business operations.
This chapter introduces basic database terminology and discusses the process of
designing a database for JustLee Books.
DATABASE TERMINOLOGY
Whenever a customer opens an account with a company, certain data must be collected.
In many cases, the customer completes an online form that asks for the customer’s name,
address, and so on, as shown in Figure 1-1.
Customer Information
Name: _________________________________
Customer B
Customer C
While collecting customer information, a series of characters is identified for each item.
A character is the basic unit of data, and it can be a letter, number, or special symbol.
Chapter 1
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Random documents with unrelated
content Scribd suggests to you:
fournir les musiciens; pour chanter Hunding, on aurait Doëry, le
fameux baryton de Vienne, auquel la chanteuse écrivit: toutes
choses enfin, s'annonçaient au mieux. Alors seulement, quand la
Belcredi vit le Duc ainsi échauffé, elle rappela à Son Altesse qu'il
fallait prévenir Christiane et Hans Ulric.
Mais dès les premières paroles, ils refusèrent l'un et l'autre, assurant
qu'ils ne consentiraient point à chanter en public.
On peut penser l'étrange vacarme, et les imprécations du duc
Charles:—Il serait donc toujours barré en ses moindres desseins! ce
petit plaisir après lequel il languissait depuis si longtemps, un caprice
d'enfant l'en voulait priver; bref, tant de furieux emportements que
Christiane enfin céda, puis Hans Ulric, la voyant pleurer, accorda ce
qu'on exigeait. A bien penser, ils n'avaient tous deux, d'autre raison
pour ce refus, que l'embarras de monter sur les planches; mais qui
sait si la distraction ne leur en serait pas profitable, et un allègement
à ces heures, qui leur marchaient à pas de plomb?
Ce fut Giulia Belcredi, qui se chargea de montrer leurs rôles à la
comtesse et à son frère. Dès le soir du lendemain, elle était chez les
jeunes gens, gaie, légère, causante, voltigeante, et qui s'extasia de
la chambre terminée, et des mille choses charmantes, curieusement
étalées partout. On avait allumé quelques bougies de cire du grand
chandelier, dont la lumière faisait distinguer jusqu'au moindre trait
des tableaux qui se trouvaient au haut des murailles, et qu'on
éteignit pour répéter. Le silence régnait partout, avec une sorte de
majesté; Giulia, devenue sérieuse, était toute droite au piano; et une
seule lampe, dans la vaste chambre. La Belcredi s'assit enfin,
promena ses doigts sur le clavier, puis, avant que de commencer,
demanda aux chanteurs s'ils se rappelaient le poème.
Ni l'un ni l'autre n'avait bien compris ce premier acte, si
brusquement interrompu, et la Belcredi, prenant la parole comme
pour entrer en matière, leur en fit le récit rapide:—Siegmund
secouru par Sieglinde, Hunding qui le reconnaît, le provoque, puis le
héros demeuré seul; il rêve, il sent sa poitrine s'enfler, Sieglinde
apparaissant alors, les aveux, le long duo, la fuite,—sans qu'un seul
mot de Giulia eût révélé de quel plus sombre crime encore, leur
adultère se noircissait. Elle frappa ensuite quelques accords, et Hans
Ulric commença.
Ils dirent le premier duo, chantèrent leur partie séparément; dans la
scène avec Hunding, qui suit. Comme deux cordes à l'unisson, dont
l'une sonne quand on touche l'autre, le cœur leur vibrait de se
répondre. Ils s'exaltaient, donnaient leur pleine voix; des élans
d'amour leur revêtaient l'âme de joie et de lumière, de toutes parts,
et quand ils entonnèrent à la fin, le chant triomphal du Printemps,
Christiane et Hans Ulric se saisirent la main. Fiévreux, enthousiastes,
haletants, ils allèrent, sans faire une faute, jusqu'à la fin de cette
admirable page.
Alors Giulia dit, comme sortant d'un rêve:
—Il se révèle à l'acte suivant, que ce sont le frère et la sœur, tous
les deux, les fils du dieu Wotan, caché sous le nom de Walse.
Ils pâlirent extraordinairement, et leurs mains s'ouvrirent, se
séparèrent; leur visage enivré s'éteignit, crispé d'un mouvement
convulsif; un silence extrême annonça de quelle horreur ils étaient
saisis. Christiane avait fermé les yeux, comme le soir où la Belcredi
leur lisait la scène de Ford; Hans Ulric, éperdu de stupeur, regardait
fixement dans l'ombre, un Rembrandt vieux, peint par lui-même, aux
yeux pénétrants et mélancoliques. Quel démon se divertissait,
connaissant le trouble de leur âme, à leur lever sans cesse ce fatal
rideau? Etaient-ils donc dépeints partout, ces cruels tourments dont
ils mouraient, et les chants des musiciens, ainsi que les vers des
poètes, n'allaient-ils plus leur faire entendre désormais, que le crime
et l'horrible désir dont ils étaient brûlés eux-mêmes? Le frère et la
sœur ne remuaient point; d'autres ardeurs s'enflammaient en eux,
que leur cœur ne leur avait pas encore expliquées; ils ne formaient
aucune idée; et parmi cette affreuse agonie, à chaque convulsion de
leur pensée mourante, ils se sentaient plus enfoncés, non dans un
mal particulier, mais dans un abîme de tous les maux.
Et Hans Ulric, le lendemain, pour la première fois depuis leur tendre
enfance, ne parut pas chez Christiane. Etendu sur un divan, à plat
ventre, l'enfant se déchirait la poitrine par des cris et des
gémissements. Il exécrait les codes, les lois, toutes les entraves des
hommes; il songeait à ces rois d'Egypte que la coutume contraignait
d'épouser leur sœur; il enviait le destin des bêtes; il eût voulu être
poussière; puis, après ces mornes méditations, éclataient non plus
des sanglots, mais des râles, mais des hurlements, qui s'éteignaient
enfin en voix confuses, en soupirs, en longs balbutiements. Il se
dressa, essuya ses yeux rougis, et il se promenait par la chambre. Sa
tête n'était plus occupée que de deux vers bizarres, en anglais, qu'il
se déclamait continuellement:
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookname.com