Application Development and Procedural Language Interface 8 Features to Support Database Operations 9 Third Party Features 10 Development o f Database Technology and M arket Structure
Trang 1Database Design, Application Development,
and Administration
Trang 3Database Design,
Application Development, and Administration
Michael V Mannino
U n ive rsity o f C olorado , D enve r
DẠI HỌC THÁI NGUYÊN
w w w m m a n n in o co m
Trang 4C o pyright © 2009 M ichael V M annino A ll rig h ts reserved N o p art o f this pu b licatio n m a y be reproduced, stored, o r distributed in any form , o r by an y m eans.
ISBN 978-061523104-4
A vailable for booksellers and libraries through I n g r a m B o o k C om pany
Trang 6Application Development and Procedural Language Interface 8
Features to Support Database Operations 9
Third Party Features 10
Development o f Database Technology and M arket Structure 10
Evolution of Database Technology 11
Current Market for Database Software 12
A rchitectures o f Database Management Systems 13
Data Independence and the Three Schema ArchitKturt 13
Parallel and Distributed Database Processing IS
Organizational Impacts o f Database Technology 18
Interacting with Databues 18
Information Resource Management 19
Closing Thoughts 20
Review Concepts 2 1
Questions 2 1
References fo r Further Study 22
Chapter 2 In tro d u ctio n to D atabase D e v e lo p m e n t 2 3
Inform ation Systems 23
Components 0Í Information Systems 23
Information Systems Development Process 24
Goals o f Database Development 26
Develop a Common Vocabulary 26
Define the Meaning 0Í Data 26
Ensure Data Quality 27
Find an Efficient Implementation 28
Database Developm ent Process 28
Phases of Database Development 28
Conceptual Data Modeling 28
Logical Database Design 30
Distributed Database Design 30
Physical Database Design Ỉ0
Splitting Conceptual Design for Large Projects 31
Cross-Checking with Application Development 31
Skills in Database D evelopm ent 32
Tools o f Database D evelopm ent 34
Definition of thí Integrity Rules 45
Application of the Integrity Rules 46
Entity Integrity Variations 46
Referential Integrity 47
Rtferentiil Integrity for Self-Referencing (Unary) Relationships 48
Graphical Rtprisenution of Referential Integrity 49
Delete and Update A ctions fo r Reference Rows 50
O perators o f Relational Algebra 52
Restrict (StlKt) and Project Operators 52
Extwdtd Cross Product Optnnr SJ Join Operator 55 Visual Formation of Join Optra Dorn 57 Outer Join Operator S7 Fun Yenui One-Sided Outer Join Operators Ỉ8 Viual Formation of Outer Join opcntmn s»
Union, Interjection, and Difftftoct Opera ton to Union Compatibility 61
Summaria Operator 6Ỉ Divide Operator M Summary of Operator! 6Ỉ Closing Thoughts 66 Questions 67 Problems 68 References f o r Further Study 70
G etting Started w ith the SELECT Statement 79 Single Table Problems 83
Joining Tables 87 Summarizing Tables with GROUP BY 2nd HAVING 89 Improving the Apptaranct of Results 92 Conceptual Evaluation Process fo r SELECT Statements 94
C ritical Q uestions fo r Q u e ry Form ulation 99 Refining Q u e ry Form ulation Skills w ith Examples 100 Joining Multiple Tables with the Cross Product Style II I Combining Joins and Grouping 108
SQL Modification Statements NO Closing Thoughts 112
Q uestions 115 Problems 117 References fo r Further Reading 124
H-N Wabomhips with AttnbutM I3S MMcfcmidq (Uury) Waoowhpj 136 toodatiw Entity Type* Representing Multy-Wajr (M-Wajr) lc b m d * s 137 Equiraltnct between l-N and H-N Relationships 139
Classification in the Entity Relationship M odel 140
Trang 7Oiiịointntu and (ompfeMca Coattnints 141
Multiple Itvtk of Generalization 142
N o ta tio n Summary and Diagram Rules 142
Notation Summary 14)
Aiprewnaoon of Business Ruin in EM) 144
Diicram Rules 145
Example of Rule VnUtKNB and Resolutions 146
AlttmiDvt Organization 01 Rules 147
Support in CASE Toots 141
References fo r Further Study 159
Chapter 6 D e v e lo p in g D ata M o d els for Business
D atabases 161
Analyzing Business Data Modeling Problems 16 1
Guidelines for Analyzing Business Information Needs 161
ldtn0fyin( Entity Types I <2
Determining Primary Keys 162
Adding Relationship! 163
Summary of Analyst Guidelines 163
Information Rtquifenwnts for the Wattr Utility Database 164
Information Requirements 144
Identifying Entity Types and Primaiy leys 165
Adding Relationships Its
Refinements to an ERD 166
Transforminj Attributes into Entity Types 167
Splitting Compound Attributes 147
Expanding Entity Types 167
Transforming a Week Entity into Ỉ Strong Entity 168
Example Design Documentation 173
Dittoing Common Despt Erron 174
Misplaced and hban{ Wioomhips 174
Incorrect Cardinaibn I7S
Overuse of Speoakml Data Modeling Construes I7S
Redundant Relationships I7S
Converting an ERD to Relational Tables 177
Bask Conversion Rules 177
Converting Optional l-M Relationships 179
Converting Gcncrabation Hierarchies 182
Converting I-I felationships IÍS
(omprehengvt Conwrcion Example I8S
Closing Thoughts 188
Review Concepts 188
Questions 188
Problems 189
References fo r Further Study 208
Ch apter 7 N o rm a liza tio n o f R elational Tab les 2 0 9
Overview o f Relational Database Design 209
Anwdant* of Nodikation Anomalies 209
Functional DipwdwciM 210
Functional Dependency Lists and Diagrams 211
Idtndfymg Fwcooiul DcpMdtflcits 211
Eliminating FD j Usn»t Sample Data 213
Firn Normal For* 214
Second Normal Fora 2IS Third Normal Fora 21A Com tuned Enmpit 01 2NF and 3MF 21«
Boyce-Codd Normal fora 217 Mioonihip btmca 3i f and BCNf 211 Simple ỉynihrás Prottdurt I l f Applying the Simple SyittiHB Proct*n 220
Anotfwr Eiamplt Uunj dv Smọk Synttaó Procedure 221
Refining M-W ay Relationships 222 Kdibomhip Indtpndcaa 223 Rtlabomhip Indeptadmct Eample 223 Nultnralwd Dtptfldendn and Fourth Normal form 225 Higher Level N orm al Forms 226
fifth Normal form 22«
Domain ley Normal Fora 227 Practical Concerns about Norm alization 227 Rote of Normilinoon M the DaabiM Dmtoprrwnt Procns 228 Analyzing the NormaiiuDOfl Object)** 221
Closing Thoughts 229 Questions 230 Problems 2 3 1 References fo r Further Study 2 4 1
Chapter 8 P hysical D atabase D e sig n 2 4 3
Overview o f Physical Database Design 243 Storage Lent of Databases 243 Objtctim and Constraints 245 Inputs Outputs, and Eirnronmnt 245 Difficulties 24«
Inputs o f Physical Database Design 247 Table Profiles 247 AppKatiofl Profit! 249 File Structures 250 Sequential flits 2S0 Hash Files 2SI Multiway Tree (Btreci) Files 253 Btrtt Cha/acttftsoa: What's in 1 Nam? 25) Node Splittt( and Conatwuoon 25S Cost of Opcrabom 2SS B+ Tr*« 2S7 Index Haktiaf 2S8 Bitmap IndciH 2S9 Summary of Fite Structure 261 Orade Soap Concepts and file Structures 262
Q uery Optim ization 263 Transbóon Tufa 243 Sjmai and Semantic Analysis 264
Query Transformation 264
Access Plan Evaluation 265 Access Plan Execution 267 Improwij OpomaDon Decraore 26Ỉ TiW* Profile Difiatnais 268
Query Coding PractKK 2*9
Index Selection 269 Problem Definition 270 Trade-oft and DtfficulMs 271 DiffkuHm of ladti Wecoon 272
Oradt SQL k a a Umor 273
Sitecoon Rules 27Ỉ Applying thí Stlecoon Rules 273
A dditional Choices in Physical Database Design 275 Denomukadon 274
topeabnj Groups 276 Generakaoon Hicrvthtts 274 (odes and Mtanmp 277 iKori formitwij 277 ParaM Processing 271 Othff Ways to Improve Pfriormana 280 Closing Thoughts 280
Trang 8Q uestions 2 8 1
Problems 283
References fo r F urther Study 289
C h apter 9 A d v a n ced Q u ery F o r m u la tio n w ith S Q L
291
O u te r Join Problems 2 9 1
SQL Support (or Outer join Problems 292
Mixing Inner and Outer Joins 295
Understanding Nested Q ueries 296
Type I Nested Queries 297
Limited SQL Formulations for Difference Problems 299
Difference Problems Cannot be Solved with Inequality Joins 300
Summary of Limited Formulations for Difference Problems 302
Using Type II Nested Queries for Difference Problems 302
More Difficult Difference Problems 304
Nested Queries in the FROM Cause 306
Formulating Division Problems 308
Review OÍ the Divide Operator 308
Simple Division Problems 309
Advanced Division Problems ỉ 11
N u ll Value C onsiderations 3 11
Effect on Simple Conditions 313
Effect on Compound Conditions 315
Effect on Aggregate Calculations and Grouping 316
Closing Thoughts 3 17
Questions 3 19
Problems 320
References fo r Further Study 324
A p p en d ix 9 A: U sa g e o f M u ltip le S ta tem en ts in
Using Views fo r Retrieval 333
Using views in SELECT Statements 334
Processing Queries with View References 335
Updating Using Views 337
Single-Table Updatable Views 337
Rules for Single-Table Updatable Views 337
View Updates with Side Effects 339
Rules for l-M Updatable Views 340
Inserting Rows in l-M Updatable Queries 341
l-N Updatable Queries with More than Two Tables 342
Using Views in Hierarchical Forms 343
What is a Hierarchical Form? 343
Relationship between Hierarchical Forms and Tables Ỉ4S
Query Formulation Skills for Hierarchical Forms 345
Using Views in Reports 349
What is a Hierarchical Report7 349
Query Formulation Skills for Hierarchical Reports 351
C h apter I I S to red P ro ced u res a n d T rig g e r s 3 6 7
Database Programming Languages and PL/SQL 368
Nodntioa for Database Programming ÌM paga ỈM
Customization 368 Batdi Processing 369 Complex Operations 369 Other Modrations 369 Deũgn Issues Ỉ70 Lin p u p Style 370 Database Connection 371 Result Processing 371 PƯSQL Suit mints 371 Basia of PƯSQL 372 Variable Declaration and Assignment Statements 372 Conditional Statements 374
Iteration Statements 376 Executing PL/SQL Statements in Anonymous Blocks 377 Stored Procedures 378
PL/SQl Procedures 379 PƯỈQL Functions 381 Using Girwrs 384 PL/SQL Packages 388 Triggers 3 9 1 Motivation and Classification of Triggers 391 Oracle Triggers 392
Introductory Triggers and Testing Code 392 BEFORE ROW Tnyer for Constraint Chtddnt 395 AFTER ROW Triggtr for Update Propapd'on 396
Combining Trigger Events to Reduct the Number of Trigpn in
Additional BEFORE ROW Trigger Example! 399 AFTER ROW Trigger for Exception Reporting 401 Triggers to Simulate Operations on a Generjliiation Hicrvdijr 402 Undemanding Trigger Execution 407
Simplified Trigger Execution Procedure 407 Trigger Execution Procedure with Ricunive Execution 401 Mutating Table Enron 409
C losing Thoughts 410
Q uestions 4 11 Problems 4 12 References fo r F u rth e r Study 4 16
A p p e n d ix 1 1 A S Q L :2 0 0 6 S y n ta x S u m m a ry 4 1 7
C h a p ter 1 2 V ie w D e s ig n a n d I n teg r a tio n 4 1 9
M otivation fo r V ie w Design and Integration 419 View Design w ith Forms 420
Form Analysis 421 Step I - Define Form Structure 422 Step 2 - Identify Entity Types 423 Step Ỉ - Attach Attributes 423 Step 4 - Add Relationships 424 Step Ỉ - Check Compltttnes and Consistency 424 Another Form Analysis Example 426 Analysis of M-Way Relationships Using Forms 428
V ie w Integration 430 Incremental and Parallel Integration Approaches 431 Determining an Integration Strategy 432 Precedence Relationships among Forms 432
Hi solving Synonyms and Homonyms 433 View integration Examples 433 Incremental tattfration Examples 4J4 ParaM Inttpaoon Example 4ỈỈ Closing Thoughts 436
Trang 9Questions 437
Problems 437
References fo r Further Study 439
C h apter 13 D atabase D ev elo p m en t for S tudent
Conceptual Data Modeling 446
EM) hr the Loan Origination Form 446
I ikthmdo I Integration after Adding the Disclosure Letter 447
InaMwatal Innpaoon after Adding (he Statement of Account 448
lixmRMOl Integration after Adding the Loin Activity Report 450
Refining the Conceptual Schema 4 5 1
Schema Convtnion <52
Nomukubon 453
Physical Database Design and Application Development 454
Applkadon and Table Profiles 45S
Index Selection 456
Derived Data and Dtnormalizatiofl Decisions 457
Otter Implementation Decisions 458
Application Development 458
Data Requirements for the Loan Origination Form 4S8
Data Requirement! far thí Loan Activity Report 459
Derived Data Hainttnanct 460
A p pendix 13.B: CR EA TE TA BLE Statem ents 4 6 5
C hapter 14 D a ta and D atabase A d m in istration 4 6 9
Organizational C o n te x t fo r Managing Databases 469
Database Support for Hinagtmcnt Decision Making 469
Information Resource Management to Knowledge Management 470
Responsibilities of Dan Administrators and Database Administrators 472
Tools o f Database A dm inistration 473
Security 473
SQL 200i Security Statements 475
Security in Oradt and Access 476
Integrity Constraints 478
SQL Domains 479
CHECH Constraints in the CREATE TABLE Statemetn 479
SQL20Q6 Assertions 480
MinjfWDMt of Trijjen and Stored Procedures 481
Data Dictionary Manipulation 483
Catalog Tables in SQL 2006 and Oracle 483
Information Resource Dictionary 484
Processes fo r Database Specialists 485
Data Planning 486
Selection and Evaluation of Database Management Systems 487
Selection and Evaluation ProCTSS 487
A p p end ix 14.A SQ L:2 0 0 6 Syntax Sum m ary 501
C h apter 15 T ransaction M anagem en t 5 0 3
Basics o f Database Transactions 503 Transaction Examples SIM SQL Statements to Define Transactions S04 Other Transaction Example SOS Transaction Properties so 4
C oncurrency C o n tro l 507 Objective of Concurrency Control sot Interference Problems SOS Lost Updatt 509 Uncommitted Dependency 509 Problems Involving IntonsBlwi Rctrievab SIO Concurrency Control Took SI I Locks Ỉ I I Locking Granularity ỈI2 Dtadtocks Ỉ I Ỉ Two-Ptacd Lockinj Protocol SI4 Optimistic Approaches SIS Recovery Management 5 15 Data Storage Drricts and Failure Types SIS Recovery Took s 14
Transaction Lof 514 Checkpoint SI7 Force Writing ỈI8 Database Backup S ll Ktcowy Process*! 51!
Dcfemd Update Ỉ20 RK0VC7 Exam pit 521 taomy Features in Oradt 11{ S2J Transaction Design Issues 523 Transaction Boundary and Hot Spots 524 Tradc-ofb in Choosing Transaction Boundaries $24 Hot Spots 524
Example Trattsacoon Boundary Desgn S2Ỉ Avoiding User Interaction Time 526 Tennis Court Reservation Cue 526 Isolation Inch S2I Timing of Inttpity Constraint Enforcement S30 Saw Points 531
W o rk flo w Management 532 Ouracttrióng Workflows 532 Enabling ĩedmoiogÌH S33 Distributed Object Management 533 Woridow Spw&aooro and Implementation 534 Customized Transaction Management 534 Closing Thoughts 535
Review Concepts 535 Questions 536 Problems 538 References fo r Further Study 545
A p p en d ix 15 A S Q L :2 0 0 6 Syntax S um m ary 4 4 6
C hapter 16 D a ta W arehouse T e c h n o lo g y and
M a nagem ent 5 4 9
Basic Concepts 549 Transaction Processing mws DraBM Support S49 OurjcttnsDa of Data Warthouxi 550 ArditKturts for Data Warehouse 5SI Data Mining 552
Appkatxxts of Daa W jn ho usis sss
Trang 10Example of a Multidimensional Data Cube 554
Relational DBMS Support fo r Data W arehouses 563
Relational Data Nodding for Multidimtmional Data 56]
Variations to the Star Schema 564
Tim« Representation in Star Schemas 566
Dimension Representation SÍ7
Extensions to the GROUP BY Clause for Multidimensional Data S70
CUBE Operator Ỉ70
ROLLUP Operator 574
GROUPING SETS Optrator 576
Variations of the CUBE ROLLUP, and GROUPING SETS Operator* Ỉ77
Other Extensions for Decision Support S78
Materialized views in Orade I Ig S78
Query Rewriting Principles Ỉ80
Query Rewriting Details S80
ROUP (Relational OLAP) S84
HOLAP (Hybrid 01AP) 585
Maintaining a Data W arehouse 585
Sources of Data S86
Workflow for Maintaining Ỉ Data Warehouse Ỉ87
Managing the Refresh Process S89
Closing Thoughts 590
Review Concepts 5 9 1
Questions 5 9 1
Problems 592
References fo r Further Study 597
C h apter 1 7 C lien t-Server P ro cessin g , Parallel
D a ta b a se P ro cessin g , and D istr ib u te d D a tab ases
5 9 9
O verview o f D istributed Processing and D istributed Data 599
Motivation for Gient-Server Processing S99
Motivation for Parallel Database Processing 601
Motivation for Distributed Data 601
Summary of Advantages and Disadvantages 602
Web Service Architecture 607
Parallel Database Processing 609
Architectures and Design Issues 609
Commercial Parallel Database Technology i l l
Oracle Real Application Ousters i l l
IBM DB2 Enterprise Server Edition with DPF Option 612
Architectures fo r D istributed Database Management Systems 613
Compontnt Architecture 6IỈ
Schema Architectures 6IS
Transparency fo r D istributed Database Processing 617
Motivating Example 617
FrapnenQdon Transparency 619
Location Trinspirency 619
local Happing Transparency 621
D istributed Database Processing 624 Dinributtd Query Processing (24 Distributed Transaction Procfisioj 424 Distributed Concurrency Control 42i Drttnbuttd Commit Pnxesunj *27 Closing Thoughts 628 Review Concepts 629
Q uestions 630 Problems 6 3 1 References fo r Further Study 633
C h a p ter 18 O b ject D a ta b a se M a n a g em en t System s
O b je ct-O rie n te d Principles 637 Encapsulation 637 Inheritance 639 Potymorphiun 641 Programming Languages versus DBMSs 642
A rchitectures fo r O bject Database Management 643 Larp Objects and External Software M3 Socialized Media Sirvtn 644 ObjKt Database Middkwar* 6<4 Objcct-llclitional Database Management Systems for Ihtr-Otfiatd Types MS Objtct-Oriinttd Database Management Spams 647
Summary of Object Database Architectures 648
O bject Database Features in SQ L2006 649 User-Delined Types 650
Table Definitions 6SI Subtablc families 6Ỉ4 Manipulating Complex Objects and Subtablc Families ÍSS
O b je ct Database Features in O racle I Ig 657 Defining User-Defined Types and Typed Tables in Oradc I I f 4Ỉ7 Using Typed Tables in Oracic llg 661
Dependcnàtỉ among Types and Typed Tablet 663 Other Object Features in Oradc I Ig 664 Type Substitution 2nd Object Views 664 Nest Tables 664
Closing Thoughts 667 Review Concepts 668
Q uestions 668 Problems 670 References fo r Further Study 674
G lo ssa ry 6 7 5
Trang 11M otivating Example
Paul Hong, the ow ner o f International Industrial Adhesives, Inc., is elated about the recent perform ance o f his business but cautious about future prospects Revenue and profit growth exceeded forecasts while expenses remained below the general level o f inflation He attributes the success to the inưoduction o f new adhesive products, increased global dem and, usage o f outsourcing to focus resources, and strategic deploym ent o f information lechnology His elation about recent perform ance is tempered by future prospects The success o f his business has attracted new com petitors focusing on his most profitable custom ers and products The credit crunch and econom ic slowdown may trim revenues w hile the rising price o f raw materials especially petroleum may squeeze profit margins The payback from costly new industry initiatives for electronic com m erce is uncertain A s a newly formed public corporation, governm ent regulations will significantly increase reporting and com pliance costs Despite the recent success o f his business, he rem ains cautious about new directions to ensure continued growth o f his business
Paul Hong needs to evaluate information technology investments to stay ahead o f com petitors and control costs o f industry and governm ent mandates To match com petitors, he needs m ore detailed and timely data about industry trends, com petitors’ actions, and distributor transactions H e wants to find a cost-effective solution to support an industry initiative for electronic com m erce To function as a public com pany, he must conduct information technology audits and fulfill other governm ent reporting requirem ents for public com panies For all o f these concerns, he is unsure about proprietary versus open technologies and standards
T hese concerns involve significant usage o f database technology as part o f a growing enterprise com puting infrastructure Transaction processing features in enterprise D BM Ss provide
a foundation to ensure reliability o f online order processing to support industry initiatives for increased electronic com merce Data warehouse features in enterprise D BM Ss provide the foundation to support large data warehouses and capture source data in a tim elier manner Parallel database technology can im prove perform ance and reliability o f both transaction processing and data w arehouse queries through incremental addition o f com puting capacity Object database features provide the ability to m anage large collections o f X M L docum ents generated by industry initiatives for electronic commerce
H ow ever, the solutions to Paul H ong’s concerns are found not ju st in technology
U tilization o f the appropriate level o f technology involves a vision for an organization’s future, a deep understanding o f technology, and traditional managem ent skills to m anage risk Paul Hong realizes that his largest challenge is to blend these skills so that effective solutions can be developed for International Industrial Adhesives, Inc
Introduction
This textbook provides a foundation to understand database technology supporting enterprise com puting concerns such as those faced by Paul Hong As a new student o f database management, you first need to understand the fundam ental concepts o f database m anagement and the relational data model Then you need to master skills in database design and database application developm ent This textbook provides tools to help you understand relational databases and acquire skills to solve basic and advanced problem s in query formulation, data modeling, norm alization, application data requirem ents, and custom ization o f database applications
A fter establishing these skills, you are ready to study the role o f database specialists and the processing environm ents in which databases are used This textbook presents the fundam ental database technologies in each processing environm ent and relates these technologies to new advances in electronic com m erce and enterprise com puting You will learn the vocabulary
Trang 12study o f individual database m anagem ent system s, electronic com m erce applications, and enterprise com puting.
W h a t’s N ew in the Fourth Edition
T h e fourth edition m akes significant revisions to the third edition w hile preserving die proven pedagogy developed in the first three editions Experience gained from m y ow n instruction o f undergraduate and graduate students along w ith feedback from adopters o f the earlier editions have led to the developm ent o f new m aterial and refinem ents to existing m aterial T h e m ost significant changes in the fourth edition are in advanced application d evelopm ent and database adm inistration: (C hapters 8, 11, 14, 15, and 17, 18): new m aterial on O racle storage concepts, expanded presentation o f access plan choices in qu ery optim ization, triggers to m aintain generalization hierarchies, database security policies, a m ini case study for transaction design, additional coverage o f O racle database links, and new co verage o f X M L database concepts In addition, refinem ents and updates to m ost chapters have im proved th e presentation and currency
o f th e m aterial The new and revised m aterial strengthens the proven approach o f the third edition that provided business rules in d a ta m odeling, g uidelines for analyzing business inform ation needs, expanded coverage o f design e ư o rs in data m odeling, expanded coverage o f functional
d ependency identification, and new coverage o f qu ery optim ization tips
For database application developm ent, the fourth edition features S Q L :2006, an evolutionary change to SQL: 1999 and SQ L :2003 T h e fourth edition ex p lain s the scope o f
SQ L:2006, the difficulty o f conform ance w ith the standard, and new elem ents o f the standard
N um erous refinem ents o f database application develo p m en t coverage extend the proven coverage
o f the first three editions: query form ulation guidelines, advanced m atching problem s, query form ulation tips for hierarchal form s and reports, and triggers for so ft constraints
For database adm inistration and processing environm ents, th e fourth edition provides expanded coverage o f new technology in S Q L :2006 and O racle 1 lg T h e m ost sig n ifican t new topics are
O racle storage concepts, triggers to support generalization hierarchies, security policies, and X M L support Significantly revised coverage is provided fo r deadlock control, database recovery checkpointing, user interaction tim e in transaction d esig n , W eb services in clien t-serv er database processing, and com m ercial acceptance o f ob ject database architectures
In addition to new m aterial and refinem ents to existing m aterial, the fourth edition extends the chapter supplem ents The fourth edition contains new en d -o f-ch ap ter q u estions and problem s N ew m aterial in the textbook’s w ebsite includes case studies, assignm ents in first and second database courses, and sam ple exam s
The fourth edition uses the sam e finer ch ap ter organization originally introduced in the third edition P art 1 covers introductory m aterial about database m anagem ent and database developm ent to provide a conceptual foundation fo r detailed know ledge and skills in subsequent chapters P art 2 covers th e essential elem ents o f the relational d ata m odel for database creation and query form ulation D atabase developm ent is split betw een data m odeling in P art 3 and logical and physical table design in Part 4 A dvanced application d evelopm ent covering advanced m atching problem s, database view s, and stored pro ced u res and triggers is co vered in P art 5 P art 6 covers advanced database developm ent w ith view integration and a com prehensive case study P art 7 covers database adm inistration and processing environm ents fo r D B M Ss
C om p etitive A dvan tage s
This textbook provides outstanding features unm atched in co m peting textbooks T h e unique features include detailed S Q L coverage for both A ccess and O racle, p ro blem -solving guid e lin es to aid acquisition o f key skills, carefully d esigned sam ple databases and ex am ples, a com prehensive case study, advanced topic coverage, and integrated lab m aterial T h ese features pro v id e a com plete package for an introductory database course Each o f these features is described in m ore
d etail in the list below w hereas T able P -l sum m arizes the com p etitiv e adv an tag es by chapter
Trang 13com peting textbooks Table P-2 sum m arizes SQL coverage by chapter Parts 2 and 5 provide a thorough coverage o f the CREA TE TA BLE, SELECT, U PD A TE, INSERT, D ELETE, CREA TE
V IEW , and C R EA TE TRIG G ER statements N um erous exam ples o f basic, interm ediate, and advanced problem s are presented The chapters in Part 7 cover statem ents useful for database adm inisưators as well as statem ents used in specific processing environm ents
A ccess a n d O racle Coverage: The chapters in Parts 2 and 5 provide detailed coverage o f
both A ccess and O racle SQL Each exam ple for the SELECT, IN SERT, U PD A TE, D ELETE, and
C R EA TE V IEW statem ents are shown for both database managem ent system s Significant coverage o f new O racle 1 lg SQL features appears in C hapters 8, 9, 11, 15, 16, and 18 In addition, the chapters in Parts 2 and 5 cover SQ L:2006 syntax to support instruction with other prom inent database m anagem ent systems
Problem-Solving Guidelines: Students need m ore than explanations o f concepts and
exam ples to solve problem s Students need guidelines to help structure their thinking process to tackle problem s in a system atic manner The guidelines provide m ental models to help students apply the concepts to solve basic and advanced problem s Table P-3 sum m arizes the unique problem -solving guidelines by chapter
Sam ple D atabases a n d Examples' T w o sam ple databases are used throughout the
chapters o f Parts 2 and 5 to provide consistency and continuity The University database is used in the chapter exam ples, w hile the O rder Entry database is used in the end-of-chapter problems
N um erous exam ples and problem s with these databases depict the fundam ental skills o f query form ulation and application data requirem ents Revised versions o f the databases provide separation betw een basic and advanced exam ples The website contains C R EA TE TA B LE statem ents, sam ple data, data m anipulation statem ents, and A ccess database files for both databases
C hapters in Parts 3 ,4 , and 7 use additional databases to broaden exposure to m ore diverse business situations Students need exposure to a variety o f business situations to acquire database design skills and understand concepts im portant to database specialists O ther databases covering
w ater utility operations, patient visits, academic paper reviews, personal financial tracking, airline reservations, placem ent office operations, autom obile insurance, store sales tracking, and real estate sales supplem ent the University and O rder Entry databases in the chapter exam ples and end- of-chapter problem s
Com prehensive Case Study The Student Loan Lim ited C ase is found at the end o f Part
6 The case description along with its solution integrates the concepts students learned in the preceding 12 chapters on application developm ent and database design The follow-up problem s at the end o f the chapter provide additional opportunities for students to apply their know ledge on a realistic case
O ptional Integrated Labs: D atabase managem ent is best taught when concepts are closely
linked to the practice o f designing and im plem enting databases using a com m ercial D BM S To help students apply the concepts described in the textbook, optional supplem entary lab m aterials are available on the te x t’s website The w ebsite contains labs for two M icrosoft A ccess versions (2003 and 2007) as w ell as practice databases and practice exercises The M icrosoft A ccess labs integrate a detailed coverage o f A ccess with the application developm ent concepts covered in Parts 2 and 5
C urrent a nd C utting-Edge Topics: This book covers some topics that are m issing from
com peting textbooks: advanced query form ulation, updatable views, developm ent and
m anagem ent o f stored procedures and triggers, data requirem ents for data entry forms and reports, view integration, m anagem ent o f the refresh process for data w arehouses, the data w arehouse maturity m odel, parallel database architectures, object database architectures, data warehouse features in S Q L :2006 and O racle lOg, object-relational features in SQL:2006 and O racle 1 lg , and transaction design principles T hese topics enable m otivated students to obtain a deeper understanding o f database m anagement
Trang 14to p u rch ase as m any a s fo u r b o o k s fo r an in tro d u cto ry datab ase course: a tex tb o o k c o v e r in g
p rinciples, la b o rato ry b ooks c o v erin g d etails o f a D B M S an d a C A S E to o l, a su p p lem en tal S Q L book, and a caseb o o k w ith realistic p ractice p ro b lem s T h is te x tb o o k an d su p p le m e n ta l m aterial
pro v id e one co m plete, integrated, and less ex p e n siv e so u rce for th e student
T a b le P - ls Sum m ary o f C o m p e titiv e A d van tages b y Ch apter
Chapter Unique Features
2 Unique chapter providing a conceptual introduction to the database development process
3 Visual representation of relational algebra operators
4 Query formulation guidelines; Oracle, Access, and SQL2006 SQL coverage
5 Emphasis on ERD notation, business rules, and diagram rules
6 Strategies for analyzing business information needs, data modeling transformations, and detection of common
design errors
7 Normalization guidelines and procedures
8 Index selection rules; SQL tuning guidelines, integrated coverage of query optimization, file structures, and
index selection
9 Query formulation guidelines; Orade llg , Access, and SQL2006 coverage; advanced topic coverage of nested
queries, division problems, and null value handling
10 Rules for updatable views, data requirement guidelines for forms and reports
II Unique chapter covering concepts and practices of database programming languages, stored procedures, and
triggers
12 Unique chapter covering concepts and practices OÍ view integration and design
13 Unique chapter providing a comprehensive case study on student loan processing
14 Guidelines for important processes used by database administrators
IS Transaction design guidelines and advanced topic coverage
16 Data warehouse maturity model for evaluating technology impact on organizations; advanced topic coverage of
relational database features for data warehouse processing and the data warehouse refresh process; extensive Orade Mg data warehouse coverage
17 Integrated coverage of dient-server processing, parallel database processing, and distributed databases
18 Advanced topic coverage of object-relational features in SQL2006 and Oracle 1 Ig
Trang 15Chapter SQL Statement Coverage
3 CREATE TABLE
4 SELECT, INSERT UPDATE DELETE
9 SELECT (nested queries, outer joins, null value handling); Access, Orade llg , and SQL2006 coverage
10 CREATE VIEW; queries and manipulation statements using views
II CREATE PROCEDURE (Oracle), CREATE TRIGGER (Orade and SQL2006)
14 GRANT REVOKE CREATE ROLE CREATE ASSERTION CHECK dause of the CREATE TABU statement, CREATE DOMAIN
IS COMMIT ROLLBACK, SET TRANSACTION, SET CONSTRAINTS, SAVEPOINT
16 CREATE MATERIALIZED VIEW (Orade) GROUP BY dame extensions (Orade and SQL2006), CREATE DIMENSION (Orade)
18 CREATE TYPE, CREATE TABLE (typed tables and subtables), SELECT (object identifier!, path expressions dereference operator); SQL2006 and Orade 1 Ig coverage
Tab le P-3: Problem Solvin g G uidelines by Chapter
Chapter Problem-Solving Guidelines
3 Visual representation of relationships and relational algebra operators
4 Conceptual evaluation process; query formulation questions
8 Index selection rules; SQL tuning guidelines
9 Difference problem formulation guidelines; nested query evaluation; count method (or division problems
10 Rules for updatable join queries; steps for analyzing data requirements in forms and reports
II Trigger execution procedure
12 form analysis steps; view integration strategies
14 Guidelines to manage stored procedures and triggers; data planning process; DBMS selection process
IS Transaction timeline; transaction design guidelines
16 Guidelines for relational database representations of multidimensional data; guidelines for time representation in dimension tables, trade-offs for refreshing a data warehouse
17 Progression OÍ transparency levels for distributed databases
18 Object database architectures; comparison between relational and object-relational representations
Trang 16T h is b o o k is in ten d ed fo r a first u n d erg rad u a te o r g ra d u a te c o u rs e in d ata b ase m a n ag em e n t Ac th e
u n d erg rad u a te le v el, stu d e n ts sh o u ld h av e a co n c en tratio n (m a jo r o r m in o r) o r ac tiv e in tere st in
in fo rm atio n system s F o r tw o -y ear in stitu tio n s, th e in stru c to r m a y w a n t to sk ip th e ad v a n ce d to p ics
an d p la ce m o re em p h asis on th e o p tio n al A ccess la b b o o k U n d erg rad u ate stu d e n ts sh o u ld h a v e a first co u rse co v e rin g g en e ra l in fo rm atio n sy ste m s co n c ep ts, s p re ad sh eets, w o rd p ro c essin g , and
p o ssib ly a b rie f in tro d u ctio n to d atab ases E x c ep t fo r C h ap te r 11, a p rev io u s co u rse in co m p u ter
p ro g ram m in g ca n b e usefu l b ac k g ro u n d b u t is n o t m a n d ato ry T h e o th e r ch a p te rs refere n ce so m e
c o m p u ter p ro g ram m in g c o n c e p ts, b u t w ritin g c o d e is n o t c o v e re d F o r a c o m p lete u n d ersta n d in g
o f C h ap ter 11, a co m p u te r p ro g ram m in g b ac k g ro u n d is essen tial H o w e v er, th e b asic c o n c e p ts in
C h ap ter 11 ca n b e co v e re d ev en if stu d en ts d o n o t h av e a co m p u te r p ro g ram m in g b ac k g ro u n d
A t th e g rad u ate lev el, this b o o k is s u ita b le in e ith e r M B A o r M aster o f S c ie n c e (in
in fo rm atio n sy stem s) p ro g ram s T h e a d v a n ced m a terial in th is b o o k sh o u ld b e esp e c ia lly su ita b le
fo r M aste r o f S cie n ce students
O rg a n iz a tio n
A s th e title su g g ests, D a ta b a se D esig n , A p p lica tio n D evelo p m e n t, a n d A d m in istra tio n e m p h a size s
th re e sets o f skills B e fo re acq u irin g th ese sk ills, s tu d en ts n eed a fo u n d atio n ab o u t b asic co n c ep ts
P art 1 p ro v id es co n cep tu al b ac k g ro u n d fo r s u b se q u en t d e tailed s tu d y o f d a ta b a se d e sig n , d a ta b ase
ap p lic atio n d ev e lo p m en t, an d d a ta b a se a d m in istra tio n T h e ch a p te rs in P a rt 1 p re s e n t th e
p rin c ip le s o f d a ta b ase m an ag e m e n t an d a co n c ep tu a l o v e rv iew o f th e d a ta b a se d e v e lo p m e n t process
P a rt 2 p ro v id e s fo u n d atio n al k n o w led g e a b o u t th e relatio n al d a ta m o d el C h a p te r 3 c o v e rs tab le d e fin itio n , in teg rity ru le s, an d o p erato rs to re trie v e u sefu l in fo rm atio n fro m relatio n al datab ases C h a p te r 4 p resen ts g u id e lin e s fo r q u ery fo rm u latio n an d n u m e ro u s e x a m p le s o f S Q L
S E L E C T statem en ts
P arts 3 a n d 4 e m p h asize p ractica l sk ills a n d d esig n g u id e lin e s fo r th e d a ta b a se
d ev e lo p m en t p ro cess S tu d en ts d esirin g a c a re e r a s a d a ta b a se s p ec ialist sh o u ld b e ab le to p erfo rm
ea ch step o f th e d ata b ase d e v e lo p m e n t p ro cess S tu d en ts sh o u ld le arn sk ills o f d a ta m o d e lin g ,
sc h em a co n v e rsio n , n o rm a liz atio n , an d p h y sica l d a ta b a se d esig n T h e P a rt 3 ch a p ters (C h ap te rs 5
an d 6) c o v e r d a ta m o d e lin g u sin g th e E n tity R e la tio n sh ip M o d e l C h a p te r 5 co v e rs th e s tru ctu re o f
en tity relatio n sh ip d ia g ram s, w h ile C h a p te r 6 p re se n ts u sa g e o f e n tity re la tio n sh ip d ia g ra m s lo
an a ly z e b u sin e ss in fo rm atio n n eed s T h e P a rt 4 ch a p te rs (C h ap ters 7 a n d 8) c o v e r ta b le d esig n
p rin c ip le s an d p ra ctice fo r lo g ical an d p h y sica l d esig n C h a p te r 7 co v e rs th e m o tiv a tio n , fu n ctio n al
d ep e n d e n cie s, n o rm al fo rm s, an d p ractica l c o n sid e ra tio n s o f d a ta n o rm a liz atio n C h a p te r 8
co n tain s b ro ad c o v e ra g e o f p h y sica l d a ta b a se d esig n in c lu d in g th e o b je ctiv e s, in p u ts, file stru ctu re
an d q u ery o p tim iz atio n b a c k g ro u n d , a n d im p o rtan t d esig n ch o ices
P art 5 p ro v id e s a fo u n d atio n fo r b u ild in g d a ta b a se a p p lic a tio n s b y h elp in g stu d e n ts
ac q u ire sk ills in ad v a n ced q u ery fo rm u latio n , s p ecific atio n o f d a ta re q u irem en ts fo r d a ta e n try
fo rm s an d rep o rts, an d c o d in g trig g ers an d sto re d p ro ce d u re s C h a p te r 9 p re se n ts ad d itio n a l
e x a m p les o f in term ed iate an d a d v a n ced S Q L , a lo n g w ith c o rre s p o n d in g q u e ry fo rm u latio n sk ills
C h ap ter 10 d escrib es th e m o tiv atio n , d e fin itio n , a n d u sag e o f relatio n al v ie w s a lo n g w ith
sp ecificatio n o f v iew d efin itio n s fo r d a ta e n try fo rm s a n d rep o rts C h a p te r 11 p re se n ts c o n c ep ts
an d c o d in g p ractices o f d a ta b a se p ro g ra m m in g la n g u ag es, sto red p ro c e d u re s, a n d trig g ers fo r
c u sto m iza tio n o f d atab ase ap p licatio n s
P art 6 co v e rs ad v a n ced to p ics o f d a ta b a se d ev e lo p m en t C h a p te r 12 d e s c rib e s v iew
d esig n an d v iew in teg ratio n , w h ich are d a ta m o d e lin g c o n c e p ts fo r la rg e d a ta b a s e d e v e lo p m e n t effo rts C h a p te r 13 p ro v id e s a c o m p reh en siv e c a se stu d y th a t en a b le s s tu d e n ts to g ain in sig h ts
ab o u t th e d ifficu lties o f ap p ly in g d a ta b a se d esig n a n d a p p lic a tio n d e v e lo p m e n t sk ills to a rea listic
b u sin ess database
Trang 17students for careers as database specialists Students need to understand the responsibilities, tools, and processes em ployed by data adm inistrators and database adm inistrators as well as the various environm ents in which databases operate.
The chapters in Part 7 em phasize the role o f database specialists and the details o f managing databases in various operating environments C hapter 14 provides a context for the other chapters through coverage o f the responsibilities, tools, and processes used by database adm inistrators and data administrators The other chapters in Part 4 provide a foundation for managing databases in im portant environments: C hapter 15 on transaction processing C hapter 16
on data warehouses, C hapter 17 on distributed processing and data, and C hapter 18 on object database management These chapters em phasize concepts, architectures, and design choices important for database specialists
Te xt A pproach and Them e
To support acquisition o f the necessary skills for learning and understanding application developm ent, database design, and managing databases, this book adheres to three guiding principles:
Combine concepts a n d practice Database management is more easily learned when concepts are
closely linked to the practice o f designing and im plem enting databases using a com mercial DBM S The textbook and the accompanying supplem ents have been designed to provide close integration between concepts and practice through the following features:
SQ L exam ples for both A ccess and Oracle as well as SQL: 2006 coverage
Em phasis o f the relationship between application developm ent and query formulation
Usage o f a data m odeling notation supported by professional C A SE tools
Supplem ental laboratory practice chapters that com bine textbook concepts w ith details o f com mercial D BM Ss
Em phasize problem -solving skills This book features problem -solving guidelines to help students
master the fundam ental skills o f data modeling, normalization, query formulation, and application development The textbook and associated supplem ents provide a wealth o f questions, problems, case studies, and laboratory practices in which students can apply their skills W ith mastery o f the fundam ental skills, students will be poised for future learning about databases and change the way they think about com puting in general
Provide introductory a n d advanced material Business students who use this book may have a
variety o f backgrounds This book provides enough depth to satisfy the m ost eager students However, the advanced parts are placed so that they can be skipped by the less inclined
Overviews provide a snapshot o r preview o f chapter contents
Key Terms are highlighted and defined in the boxed areas as they appear in the chapter Example* are clearly separated from the rest o f the chapter material for easier review and studying purposes
B anning Database Examples — University and O rder Entry w ith icons in margins to draw student attention to examples
C lo sin g T h oughts summarize chapter content in relation to the learning objectives
Trang 18o f term inology.
Q uestion* are pro v id e d to rev iew th e c h a p ter co ncepts
Problem s help stu d en ts p ractice and im p lem en t th e d etailed skills presen ted in thechapter
R eferen ces fo r F arther S tu d y p o in t stu d en ts to ad d itio n a l so u rces on ch a p ter co n ten t
C h ap ter A p p en d ix es pro v id e ad d itio n al d etails and co n v e n ien t su m m aries o f certainprinciples o r practices
Glossary: P ro v id es a co m p lete list o f te rm s an d d efin itio n s u sed th ro u g h o u t th e text
B ib liograph y: A list o f helpful industry, acad em ic, a n d o th er p rinted m aterial fo r further
research o r study
M icro so ft A cce ss Labs
L ab b ooks for both M icro so ft A ccess 2003 and 2007 are av ailab le on th e te x tb o o k ’s w ebsile T h e lab b ooks pro v id e d etailed co v erag e o f features im portant to beg in n in g d atab ase stu d en ts as w ell
as m any advanced features T h e lab ch ap ters p ro v id e a m ix tu re o f g u id ed p ractice a n d reference
m a terial organized into th e follow ing chapters:
A n Introduction to M icro so ft A ccess
D atab ase C reation L ab
E ach lab ch a p ter follow s the p ed agogy o f the te x tb o o k w ith L earn in g O b jectiv es, O verview ,
C losing T h oughts, A dditional P ractice ex ercises, and A p p en d ix e s o f helpful tips M o st lab
ch ap ters reference co n cep ts from the textb o o k fo r clo se integration w ith co rresp o n d in g tex tb o o k
chapters Each lab bo o k also in clu d es a glo ssary o f term s and an index
Trang 19A com prehensive set o f supplements for die text and lab manuals is available to adopters.
• PowerPoint slides for each chapter
• Solutions to end o f chapter problems for each chapter
• Solutions to end o f chapter questions for each chapter
• Access databases for the university and order entry textbook databases
• Oracle SQL statements to create and populate the university and order entry textbookdatabases
• Files containing SQL statements used in the textbook chapters
• Case studies along with case study solutions
• Assignments used in a first database course The assignments involve database creation, query formulation, application development with forms, data modeling, and
normalization In addition, a project assignment integrates material about database development and application development
• Assignments used in a second database course The assignments involve databasecreation, triggers, data warehouse usage, and object relational databases In addition,projects about Oracle advanced features, benchmark development, and management practices involve integrative skills for database specialists
• Sample exams for a first course in database management
• Sample exams for an advanced course in database management
• Access databases for each lab chapter
• Access databases for end o f chapter problems in each lab chapter
Teaching Paths
The textbook can be covered in several orders in a one- or a two-semester sequence The author has taught a one-sem ester course with the ordering o f relational database basics, query formulation, application development, database development, and database processing environments This ordering has the advantage o f covering the more concrete material (query formulation and application development) before the more abstract material (database
development) Lab chapters and assignments are used for practice beyond the textbook chapters
To fit into one semester, advanced topics are skipped in Chapters 8 and 11 to 18
A second ordering is to cover database development before application development For this ordering, the author recommends following the textbook chapter ordering: 1 ,2 ,5 ,6 , 3 ,7 , 4 , 9 , and 10 The material on schema conversion in Chapter 6 should be covered after Chapter 3 This ordering supports a more thorough coverage o f database development while not neglecting application development To fit into one semester, advanced topics are skipped in Chapters 8 and
11 to 18
A third possible ordering is to use the textbook in a two-course sequence The first course covers database management fundamentals from Parts 1 and 2, data modeling and normalization from Parts 3 and 4, and advanced query formulation, application development with views, and view integration from Parts 5 and 6 The second course em phasizes database administration skills with physical database design from Part 4, triggers and stored procedures from Part 5, and the processing environments from Part 7 along with additional material on managing enterprise databases A comprehensive project can be used in the second course to integrate application development, database development, and database administration
Trang 20The fourth edition is the culm ination o f m any years o f work B efore beginning the first edition, I
w rote tutorials, laboratory practices, and case studies This m aterial was first used to supplem ent other textbooks A fter encouragem ent from students, this m aterial w as used w ithout a textbook This material, revised m any tim es through student com m ents, was the foundation for the firsl edition D uring the developm ent o f the first edition, the m aterial w as classroom tested for three years with hundreds o f undergraduate and graduate students, along w ith careful review through four drafts by m any outside reviewers The second edition w as developed through classroom usage o f the first edition for three years, along w ith teaching an advanced database course for several years The third edition w as developed through three years experience w ith the second edition in basic and advanced database courses The fourth edition w as developed through three years o f instruction w ith the third edition in beginning and advanced database courses
I wish to acknow ledge the excellent support that I have received in com pleting this project I thank m y m any database students, especially those in ISM G 6080, ISM G 6480, and ISM G 4500 at the U niversity o f C olorado Denver Y our com m ents and reaction to the textbook have been invaluable to its im provement
A bou t the A uthor
M ichael V M annino has been involved in the database field since 1980 H e has taught database
m anagem ent since 1983 at several m ajor universities (U niversity o f Florida, U niversity o f Texas
at Austin, U niversity o f W ashington, and U niversity o f C olorado Denver) His audiences have included undergraduate M IS students, graduate M IS students, M B A students, and doctoral students as w ell as corporate em ployees in retraining program s H e has also been active in
database research as evidenced by publications in m ajor jo u rn als o f the IEE E (Transactions on
K now ledge a nd D ata Engineering and Transactions on Softw are Engineering), ACM
( C ommunications and C om puting Surveys), and IN FO R M S (Inform s Jo u rn a l on C om puting and Inform ation System s Research) His research includes several pop u lar survey and tutorial
articlesas well as many papers describing original research Practical results o f his research on a form -driven approach to database design are incorporated into C hapter 12
Dedication
I dedicate this book to m y daughters, Ju lia and A im ee Y our sm iles and affection inspire m e ev e iy day
Trang 21ion to D atabase M ana
Learning Objectives
This chapter provides an inưoduction to database technology and the impact o f this technology onorganizations After this chapter the student should have acquired the following knowledge andskills:
• Describe the characteristics of business databases and the features o f database management systems
• Understand the importance o f nonprocedural access for software productivity
• Appreciate the advances in database technology and the contributions o f database technology
Database technology is not only improving the daily operations o f organizations but also the quality o f decisions that affect our lives Databases contain a flood o f data about many aspects
o f our lives: consumer preferences, telecommunications usage, credit history, television viewing habits, and so on Database technology helps to summarize this mass o f data into useful information for decision making Management uses information gleaned from databases to make long-range decisions such as investing in plants and equipment, locating stores, adding new items
to inventory, and entering new businesses
This first chapter provides a starling point for your exploration o f database technology
It surveys database characteristics, database management system features, system architectures, and human roles in managing and using databases The other chapter in Part 1 (Chapter 2) provides a conceptual overview o f the database development process This chapter provides a broad picture o f database technology and shares the excitement about the journey ahead
1.1 Database Characteristics
Every day, businesses collect mountains o f facts about persons, things, and events such as credit card numbers, bank balances, and purchase amounts Databases contain these sorts o f simple facts
as well as nonconventional facts such as medical images, fingerprints, product photos, and maps
W ith the proliferation o f the Internet and the means to capture data in com puterized form, a vast amount o f data is available at the click o f a mouse button Organizing these data for ease of retrieval and maintenance is paramount Thus, managing databases has become a vital task in most organizations
Database: a c o lle c tio n o f p e rs is te n t d ata th a t can be sh ared a nd in te r re la te d
Trang 22d atab ases, as d iscu ssed in th e fo llo w in g list:
P ersisten t m eans that d ata resid e on stab le sto rag e su ch as a m ag n etic d isk F o r ex a m p le, org an izatio n s need to retain d a ta ab o u t cu sto m ers, suppliers, an d inv en to ry o n stab le sto rag e
b ec au se these d ata are re p etitiv ely used A v ariab le in a co m p u ter program is not p ersiste n l
b ec au se it resid es in m ain m em o ry and d isap p e ars a fte r th e p ro g ram term in a tes P ersisten cy
d o es not m ean th at d ata lasts forever W h en d a ta are no lo n g er relevant (su ch as a su p p lie r
go in g out o f bu sin ess), they are rem o v ed o r archived
P ersisten cy d ep en d s on relev an ce o f intended u sage F o r ex a m p le , th e m ileage y ou d riv e for
w ork is im portant to m aintain i f you are self-em p lo y ed L ik ew ise, th e a m o u n t o f y o u r
m edical ex p en ses is im p o rtan t if y ou can item ize y o u r ded u c tio n s o r y ou h av e a h ea lth sav in g s acco u n t B ecau se sto rin g and m ain tain in g d a ta is co stly , o n ly d ata lik ely to b e relev an t to decisio n s should be stored
Shared m eans that a d atab ase can h av e m u ltip le uses an d u sers A d atab a se p ro v id e s a
co m m o n m em o ry fo r m u ltip le fu n ctio n s in an o rg an izatio n F o r ex a m p le, a p erso n n el
d atab ase can support payroll calcu latio n s, p erfo rm a n ce ev alu atio n s, g o v ern m en t rep o rtin g req u irem en ts, and so on M any users can access a d atab ase a t th e sam e tim e F o r ex am p le,
m any custom ers can sim u ltan eo u sly m ak e airlin e reserv atio n s U nless tw o users are try in g to
ch an g e the sam e p art o f the datab ase at th e sam e tim e, th ey can p ro cee d w ith o u t w aitin g on each other
Interrelated m eans that d ata stored as sep arate u n its ca n be co n n e cted to p ro v id e a w hole picture F or ex am p le, a cu sto m er d atab ase relates cu sto m er d ata (n am e, ad d ress, ) lo o rd er
d ata (o rd er num ber, o rd er date, ) to facilitate o rd er p ro cessin g D ata b ases co n tain b oth
en tities and relatio n sh ip s am ong en tities A n en tity is a c lu ster o f data u su ally ab o u t a single subject that can b e ac cessed together A n en tity ca n d en o te a p erso n , p lace, th in g , o r ev en t
F o r exam ple, a p ersonnel d atab ase co n ta in s en tities su ch as em p lo y ees, d ep a rtm en ts, and
sk ills as well as relatio n sh ip s sh o w in g em p lo y ee assig n m en ts to d ep artm en ts, sk ills p o ssessed
by em ployees, and salary h isto ry o f em p lo y ees A ty p ical b u sin ess d atab ase m a y h av e hundreds o f en tities and relationships
T o d ep ict these ch aracteristics, let us co n sid er a n u m b er o f d atab ases W e begin w ith a sim p le university datab ase (F igure 1.1) since y ou h av e so m e fa m iliarity w ith th e w o rk in g s o f a univ e rsity
A sim plified university d atab ase co n tain s d ata ab o u t stu d en ts, facu lty , co u rses, co u rs e o fferin g s,
a n d en rollm ents T h e datab ase su p p o rts p ro ced u res su ch as reg isterin g fo r classe s, a ssig n in g faculty to co u rse o fferin g s, reco rd in g g rades, an d sch ed u lin g co u rse o fferin g s R elatio n sh ip s in the
u n iv ersity d atabase su p p o rt an sw ers to qu estio n s such as
W h a t o fferin g s are av ailab le fo r a co u rse in a g iv en acad em ic p erio d ?
W h o is th e in stru c to r fo r an o fferin g o f a co u rse?
W h a t students are en ro lled in an o fferin g o f a co u rse?
Trang 23of courses,
assign m en t
C ourse scheduling
University DatabaseFigure 1.1: Depiction of a Simplified University Database
Note: Words surrounding the database denote procedures that use the database.Next, let us consider a water utility database as depicted in Figure 1.2 The primary function of a water utility database is billing customers for water usage Periodically, a customer’s water consumption is measured from a meter and a bill is prepared Many aspects can influence the preparation o f a bill such as a customer’s payment history, meter characteristics, type of customer (low income, renter, homeowner, small business, large business, etc.), and billing cycle Relationships in the water utility database support answers to questions such as
What is the date of the last bill sent to a customer?
How much water usage was recorded when a customer’s meter was last read?When did a customer make his/her last payment?
P aym ent processing
S ervice s ta rt/
stop
W a t e r u t i l i t y D a ta b a s eFigure 1.2: Depiction of a Simplified Water Utility Database
Finally, let us consider a hospital database as depicted in Figure 1.3 The hospital database supports treatment o f patients by physicians Many different health providers read and contribute
to a patient’s medical record Physicians make diagnoses and prescribe ưeatments based on symptoms Nurses are responsible for monitoring symptoms and providing medication Food staff prepare meals according to a dietary plan Relationships in the database support answers to questions such as
What are the most recent symptoms of a patient?
Who prescribed a given treatment of a patient?
What diagnosis did a doctor make for a patient?
L
3
Trang 24H o s p i t a l D a t a b a s e
m o n ito rin g
P a tie n t
ca re
Figure 13: Depiction of a Simplified Hospital Database
These simplified databases lack many kinds o f data found in real databases For example, the simplified university database does not contain data about course prerequisites and classroom capacities and locations Real versions o f these databases would have many more entities, relationships, and additional uses Nevertheless, these simple databases have the essential characteristics o f business databases: persistent data, multiple users and uses, and multiple entities connected by relationships
1.2 Features of Database M anagement Systems
A database management system (DBMS) is a collection o f com ponents that supports the creation, use, and maintenance o f databases Initially, DBMSs provided efficient storage and retrieval o f data Due to marketplace demands and product innovation, DBMSs have evolved to provide a broad range o f features for data acquisition, storage, dissemination, maintenance, retrieval, and formatting The evolution o f these features has made DBMSs rather com plex It can take years
o f study and use to master a particular DBMS Because DBMSs continue to evolve, you must continually update your knowledge
D a ta b a s e M a n a g e m e n t S y s te m (D B M S ): a c o lle c tio n o f c o m p o n e n ts th a t s u p p o r t data
a c q u is itio n , d isse m in a tio n , m a in ten an ce , re trie v a l, a nd fo rm a ttin g
To provide insight about features that you will encounter in commercial DBMSs, Table 1-1 summarizes a common set o f features The rem ainder of this section presents examples o f these features Some examples are drawn from M icrosoft Access, a popular desktop DBMS Later chapters expand upon the inưoduction provided here
Table 1-1: Summary o f Com m on Features o f DBMSs
F e atu re D e s c rip tio n
Database definition Language and graphical tools to define entities, relationships, integrity constraints, and
authorization rights Nonprocedural access Language and graphical tools to access data without complicated coding Application development Graphical tools to develop menus, data entry forms, and reports; data requirements ter
forms and reports are specified using nonprocedural access.
Procedural language interface Language that combines nonprocedural access with full capabilities of a programming
language Transaction processing Control mechanisms to prevent interference from simultaneous users and recover lost
data after a failure Database tuning Tools to monitor and improve database performance
4
Trang 25T o define a database, the entities and relationships must be specified In most commercial
D BM Ss, tables store collections o f entities A table (Figure 1.4) has a heading row (first row) showing the column names and a body (other row s) showing the contents o f the table
Relationships indicate connections among tables For exam ple, the relationship connecting the student table to the enrollment table shows the course offerings taken by each student
Table: a n am ed, tw o -d im e n s io n a l a rra n g e m e n t o f data A ta b le co nsists o f a hea ding p a r t a nd a
b o d y p a rt.
S td C ity £ 4 |% d S ta te jS td Z ip |S td M a |o r |S td C U s s * i|S td G P A 1
Figure 1.4: Display of Student Table in Microsoft Access
M ost D BM Ss provide several tools to define databases The Structured Q uery Language(SQL) is an industry standard language supported by most DBMSs SQL can be used to define tables, relationships am ong tables, integrity constraints (rules that define allowable data), and authorization rights (rules that restrict access to data) Chapter 3 describes SQL statements to define tables and relationships
I S Q L an in d u s try sta n d a rd database language th a t in clu d e s s ta te m e n ts f o r database d e fin itio n ,
I database m a n ip u la tio n , a nd database c o n tr o l. _
In addition to SQL, many D BM Ss provide graphical, window-oriented tools Figures 1.5 and 1.6 depict graphical tools for defining tables and relationships U sing the Table Definition window in Figure 1.5, a user can define properties o f columns such as the data type and field size
U sing the R elationship Definition window in Figure 1.6, relationships am ong tables can be defined A fter defining the structure, a database can be populated The data in Figure 1.4 should
be added after the Table Definition window and Relationship Definition window are complete
Trang 2664 characters long, including spaces Press
F I for help on field names.
Figure 1.5: Table Definition Window in Microsoft Access
Figure 1.6: Relationship Definition Window in Microsoft Access
1.2.2 Nonprocedural Access
The most important feature o f 3 DBMS is the ability to answer queries A query is a request for data to answer a question For example, the user may want to know customers having large balances or products with strong sales in a particular region Nonprocedural access allows users
Trang 27retrieve, not implementation details o f how retrieval occurs Implementation details involve coding complex procedures with loops Nonprocedural languages do not have looping statements (for, while, and so on) because only the parts o f a database to retrieve are specified.
N o n p r o c e d u r a l D a ta b a se Language: a language such as S Q L th a t a llo w s y o u t o specify the
p a rts o f a database t o access ra th e r than t o co d e a c o m p le x p ro c e d u re N o n p ro c e d u ra l languages d o n o t in clude lo o p in g statem ents. _Nonprocedural access can reduce the number o f lines of code by a factor o f 100 as compared to procedural access Because a large part o f business software involves data access, nonprocedural access can provide a dramatic improvement in software productivity
To appreciate the significance o f nonprocedural access, consider an analogy to planning a vacation You specify your destination, ưavel budget, length o f slay, and departure date These facts indicate the “what” o f your trip To specify the “how” of your trip, you need to indicate many more details such as the best route to your destination, the most desirable hotel, ground transportation, and so on Your planning process is much easier if you have a professional to help with these additional details Like a planning professional, a DBMS performs the detailed planning process to answer queries expressed in a nonprocedural language
Most DBMSs provide more than one tool for nonprocedural access The SELECT statement o f SQL, described in Chapter 4, provides a nonprocedural way to access a database Most DBMSs also provide graphical tools to access databases Figure 1.7 depicts a graphical tool available in Microsoft Access To pose a query lo the database, a user only has to indicate the required tables, relationships, and columns Access is responsible for generating the plan to retrieve the requested data Figure 1.8 shows the result of executing the query in Figure 1.7
Trang 28BOB N0RBERĨ BOTHELL 5679 J.7
ROBERTO MORALES SEATTlf 5679 3.8
Figure 1.8: Result of Executing Query in Figure 1.7
1.2.3 Application Development and Procedural Language Interface
Most DBMSs go well beyond simply accessing data Graphical tools are provided for building complete applications using forms and reports Data enưy forms provide a convenient tool to enter and edit data, while reports enhance the appearance o f data that is displayed or printed The form in Figure 1.9 can be used to add new course assignments for a professor and to change existing assignments The report in Figure 1.10 uses indentation to show courses taught by faculty
in various departments The indentation style can be easier to view than the tabular style shown in Figure 1.8 Many forms and reports can be developed with a graphical tool without detailed coding For example, Figures 1.9 and 1.10 were developed without coding Chapter 10 describes concepts underlying form and report development
Nonprocedural access makes form and report creation possible without extensive coding
As part of creating a form or report, the user indicates the data requirements using a nonprocedural language (SQL) or graphical tool To complete a form or report definition, the user indicates formatting of data, user interaction, and other details
Trang 29F aculty W o rk Load R e po rt fo r the 2007-2008 A ca d e m ic Y ear
Figure 1.10: Microsoft Access Report of Faculty Workload
In addition to application development tools, a procedural language interface adds the full capabilities o f a com puter programming language Nonprocedural access and application developm ent tools, though convenient and powerful, are sometimes not efficient enough or do not provide the level o f conưol necessary for application development W hen these tools are not adequate, D BM Ss provide the full capabilities o f a program ming language M ost commercial
D BM Ss have a procedural language interface For example, O racle has the language PL/SQL and
M icrosoft SQL Server has the language Transact-SQL Chapter 11 describes procedural language interfaces and the PL/SQ L language
P r o c e d u r a l L an g u a g e In te rfa c e : a m e th o d CO c o m b in e a n o n p ro c e d u ra l language such as S Q L with a p ro g ra m m in g language such as Java o r V isu al B a sic
1.2.4 Features to Support Database Operations
T ransaction processing enables a DBMS to process large volumes o f repetitive work A transaction is a unit o f work that should be processed reliably without interference from olher users and w ithout loss o f data due to failures Examples o f transactions are withdrawing cash at
an ATM , m aking an airline reservation, and registering for a course A D BM S ensures that ưansactions are free o f interference from other users, parts o f a transaction are not lost due to a failure, and transactions do not make the database inconsistent Transaction processing is largely
an unseen, back-office affair The user does not know the details about transaction processing other than the assurances about reliability
T r a n s a c tio n P ro c e s s in g : re lia b le and e ffic ie n t p ro c e s s in g o f la rg e v o lu m e s o f r e p e titiv e w o r k ;
D B M S s e n s u re th a t sim u lta n e o u s u se rs d o n o t in te r fe re w it h each o th e r a nd th a t fa ilu re s d o
Trang 30large databases with many simultaneous users These DBMSs are known as enterprise DBMSs because the databases they support databases are often critical lo the functioning o f an organization Enterprise DBMSs usually run on powerful servers and have a high cost In conưast, desktop DBMSs running on personal computers and small servers support limited transaction processing features but have a much lower cost Desktop DBMSs support databases used by work teams and small businesses Embedded DBMSs are an emerging category of database software As its name im p lie s , an embedded DBMS resides in a larger system, either an application or a device such as a personal digital assistant (PDA) or a smart card Embedded DBMSs provide limited transaction processing features but have low memory, processing, and storage requirements.
1.2.5 Third-Party Features
In a d d itio n to features provided directly by vendors o f DBMSs, third-party software is also available for many DBMSs In most cases, third-party software extends the features available with the database software For example, many third-party vendors provide advanced database design tools that extend the database definition and tuning capabilities provided by DBMSs Figure 1.11 shows a database diagram (an entity relationship diagram) created with Visio Professional, a tool for database design The ERD in Figure 1.11 can be converted into the tables supported by most commercial DBMSs In some cases, third-party software competes directly with the database product For example, third-party vendors provide application development tools that can be used
in place of the ones provided with the database product
StdClass OffLocation 3 0 T e a c h e s 0 4 FacSalary
'E n r o llm e n t C ourseN o
C rsDesc EnrGrade
s. - >
Figure 1.11: Entity Relationship Diagram (ERD) for the University Database
1.3 Development of Database Technology and Market Structure
The previous section provided a quick tour of the features found in typical DBMSs The features
in today’s products are a significant improvement over just a few years ago Database management, like many other areas o f computing, has undergone tremendous technological growth To provide a context to appreciate today’s DBMSs, this section reviews past changes in technology and suggests future trends After this review, the current market for database software
is presented
Trang 31Table 1-2 depicts a brief history o f database technology through four generations' o f systems The first generation supported sequential and random searching, but the user was required to write a com puter program to obtain access For example, a program could be written to retrieve all custom er records or to just find the customer record with a specified customer number Because First-generation systems did not offer much support for relating data, they are usually regarded as file processing systems rather than DBMSs File processing systems can manage only one entity rather than many entities and relationships managed by a DBMS.
Table 1-2: Brief Evolution o f Database T echnology
Era G e n e ra tio n O rie n ta tio n M a jo r Features
1960s r generation File File structures and proprietary program interfaces 1970s 2“ generation Network navigation Networks and hierarchies of related records, standard
program interfaces 1980s 3" generation Relational Nonprocedural languages, optimization, traiuaữion processing 1990s to 4 generation Object Huhi-media, active, distributed processing, more powerful 2000s operator*, data warehouse processing, XML enabledThe second-generation products were the first true DBMSs as they could manage multiple entity types and relationships However, to obtain access to data, a computer program still had to be written Second-generation systems are referred to as “navigational” because the programmer had to write code to navigate among a network of linked records Some o f the second-generation products adhered to a standard database definition and manipulation language developed by the Committee on Data Systems Languages (CODASYL), a standards organization The CODASYL standard had only limited market acceptance partly because IBM, the dominant computer company during this time, ignored the standard IBM supported a different approach known as the hierarchical data model
Rather than focusing on the second-generation standard, research labs at IBM and academic institutions developed the foundations for a new generation o f DBMSs The most important development involved nonprocedural languages for database access Third-generation systems are known as relational DBMSs because o f the foundation based on mathematical relations and associated operators Optimization technology was developed so that access using nonprocedural languages would be efficient Because nonprocedural access provided such an improvement over navigational access, third-generation systems supplanted the second generation Since the technology was so different, most o f the new systems were founded by start-up companies rather than by vendors o f previous generation products IBM was the major exception
It was IBM ’s weight that led to the adoption o f SQL as a widely accepted standard
Fourth-generation DBMSs are extending the boundaries o f database technology to unconventional data, new kinds o f disưibuted processing, and data warehouse processing Fourth- generation systems can store and manipulate unconventional data types such as images, videos, maps, sounds, animations, and Web data Most DBMSs now feature convenient ways to publish static and dynamic Web data using the extensible Markup Language (XML) as a publishing
1 The generations o f DBMSs should not be confused with the generations o f programming languages In particular, fourth-generation language refers to programming language features, not DBMS features
Trang 32systems are sometimes called “object-relational.” Chapter 18 presents d e ta ils a bo ut o b je c t features
in DBMSs In addition to the emphasis on objects, DBMSs have developed new forms of distributed processing Chapter 17 presents details about parallel and distributed database technology to support increased performance, improved reliability, and local control o f data
A recent development in fourth-generation DBMSs is support for data warehouse processing A data warehouse is a database that supports mid-range and long-range decision making in organizations The retrieval of summarized data dominate data warehouse pro cessin g , whereas a mixture o f updating and retrieving data occur for databases that support the daily operations o f an organization Chapter 16 presents details about DBMS features to support data warehouse processing
The market for fourth generation systems is a battle between vendors o f third-generation systems who are upgrading their products against a new group o f systems developed as open- source software The existing companies seem to have the upper hand, but the open source DBMS products have gained important commercial usage
1.3.2 Current Market for Database Software
According to the International Data Corporation (IDC), sales (license and maintenance) of
enterprise relational DBMS software reached $14.6 billion in 2005, a 9.4 % increase since 2004
Enterprise DBMSs use mainframe servers running IBM ’s MVS operating system and mid-range servers running Unix (Linux, Solaris, AIX, and other variations) and Microsoft Windows Server operating systems Three products dominate the market for enterprise database software as shown
in Table 1-3 According to 2005 report by the Gartner Group, sales o f Microsoft SQL Server are growing faster than the other products
Table 1-3: 2003 Market Shares2 by Revenue o f Enterprise Database Software
P ro d u c t T o ta l M a rk e t Share C o m m e n ts
Oracle lOg, llg 44.6% Dominates the Unix environment; strong performance in the Window*
market also IBM DB2,
Informix
21.4% Dominates the MVS and AS/400 environments; acquired Informix in 2001;
25% share 0 Í the Unix market Microsoft SQL
Server
16.8% Strong position in the Windows market; no presence in other
environments Sybase 3.5% Popular among financial services firms on Unix platforms
Teradata 2.9% Usage as a data warehouse platform
Other 10.8% Indudes Progress Software, MySQL, PostgreSQL, open source Ingres,
Firebird, and others
Open source DBMS products have begun to challenge the commercial DBMS products at the low end o f the enterprise DBMS market Although source code for open source DBMS products is available without charge, most organizations purchase support contracts so the open source products are not free Still, many organizations have reported lower cost of ownership
: Market shares according to a 2005 study by the International Data Corporation
Trang 33source DBM S market A ccording to M ySQL.com in January 2008, “m ore than 100 m illion copies
o f M ySQ L's high-perform ance open source database softw are have been dow nloaded and distributed and an additional 50,000 copies are dow nloaded daily.” Besides, M ySQ L, PostgreSQL and open source Ingres are mature open source D BM S products Firebird is a new er open source product that is gaining usage
In the market for desktop database software, M icrosoft A ccess dom inates at least in part because o f the dom inance o f M icrosoft Office Desktop database softw are is prim arily sold as part
o f office productivity software W ith M icrosoft O ffice holding about 90% o f the office
productivity market, A ccess holds a com parable share o f the desktop database softw are market
O ther significant products in the desktop database softw are market are Paradox, Approach,FoxPro, and FileM aker Pro
T o provide coverage o f both enterprise and desktop database softw are, this book provides significant coverage o f Oracle and M icrosoft A ccess In addition, the em phasis on the SQL standard in Parts 2 and 5 provides database language coverage for the other m ajor products.Because o f the potential growth o f personal com puting devices, most m ajor DBMS vendors have now entered the em bedded DBMS market Em bedded DBMS softw are is sold prim arily by value-added softw are resellers as part o f an application, such as an accounting package A ccording to an IDC 2007 report, O racle is the market leader with 23.2% o f the
em bedded m arket in 2006 following by Progress Software w ith 14.1% and IBM w ith 10.2%
1.4 A rchitectures of D atabase M anagem ent System s
T o provide insight about the internal organization o f DBM Ss, this section describes tw o architectures o r organizing fram eworks The first architecture describes an organization o f database definitions to reduce the cost o f softw are m aintenance The second architecture describes
an organization o f data and software to support rem ote access These architectures prom ote a conceptual understanding rather than indicate actual DBM S im plem entation
1.4.1 Data Independence and the Three Schema Architecture
In early D B M Ss, there w as a close connection between a database and com puter program s that accessed the database Essentially, the DBM S was considered part o f a program m ing language
As a result, the database definition was part o f the com puter program s that accessed the database
In addition, the conceptual meaning o f a database was not separate from its physical
im plem entation on magnetic disk The definitions about the structure o f a database and its physical im plem entation w ere mixed inside com puter program s
The close association between a database and related program s led to problem s in softw are m aintenance Softw are maintenance encom passing requirem ent changes, corrections, and enhancem ents can consum e a large fraction o f softw are developm ent budgets In early DBM Ss,
m ost changes to the database definition caused changes to com puter program s In many cases, changes to com puter program s involved detailed inspection o f the code, a labor-intensive process This code inspection work is sim ilar to year 2000 com pliance in which date form ats were changed
to four digits Perform ance tuning o f a database was difficult because som etim es hundreds o f com puter program s had to be recom piled for every change Because database definition changes are com m on, a large fraction o f softw are maintenance resources were devoted to database changes Som e studies have estim ated the percentage as high as 50% o f softw are maintenance resources
The concept o f data independence em erged to alleviate problem s w ith program
m aintenance D ata independence means that a database should have an identity separate from the applications (com puter program s, form s, and reports) that use it The separate identity allow s the database definition to be changed w ithout affecting related applications For exam ple, if a new colum n is added to a table, applications not using the new colum n should not be affected.Likew ise if a new table is added, only applications that need the new table should be affected.This separation should be even more pronounced if a change only affects physical im plem entation
Trang 34concern about co m p u ter program changes.
D a ta In d e p e n d e n c e : a d a ta b a se s h o u ld h a v e a n id e n t it y s e p a ra te f r o m t h e a p p lic a tio n s ( c o m p u te r p ro g ra m s , f o r m s , a n d r e p o r t s ) t h a t u se it T h e s e p a ra te id e n t it y a llo w s t h e
d a ta b a se d e fin itio n t o b e c h a n g e d w i t h o u t a ffe c tin g re la te d a p p lic a tio n s
In the m id-1970s, the concept o f d ata indep en d en ce led to th e proposal o f th e Three
S chem a A rchitecture depicted in F igure 1.12 T h e w ord sch em a as applied to d atab ases m eans
d atab ase description T h e T h ree Schem a A rch itectu re in clu d es th ree levels o f d atabase
d escription T h e external level is th e u ser level Each g ro u p o f users can h av e a sep arate external view (or view for short) o f a d atabase tailored to th e g ro u p ’s sp ecific needs
T h r e e S c h e m a A r c h i t e c t u r e : an a r c h ite c tu r e f o r c o m p a r tm e n ta liz in g d a ta b a s e d e s c r ip tio n s
T h e T h r e e S ch e m a A r c h it e c t u r e w a s p r o p o s e d as a w a y t o a c h ie v e d a ta in d e p e n d e n c e
In contrast, the conceptual and internal sch em as rep resen t the en tire d atab ase The conceptual schem a defines th e en tities and relatio n sh ip s F o r a b u sin ess datab ase, the conceptual schem a can b e qu ite large, perhaps hundreds o f en tity types and relatio n sh ip s L ik e th e conceptual schem a, the internal schem a represents the en tire database H o w ever, th e internal schem a represents the storage view o f the d atabase w hereas th e co nceptual sch em a rep resen ts the lo g ic a l
m eaning o f th e d atabase T h e internal schem a d efin es files, co llectio n s o f d a ta on a sto rag e d e v ic e such as a hard disk A file can store one o r m ore en tity types d escrib ed in th e co n cep tu al sch em a
F igure 1.12: T h ree Schem a A rchitecture
T o m ake the three schem a levels clearer, T a b le 1-4 sh o w s d iffe re n ces am ong d atab ase definition at the three sch em a levels using ex am ples from the features d escrib ed in S ectio n 1.2 Even in a sim plified university d atabase, the d ifferen ces am ong th e sch em a lev els a re clear W ith
a m ore co m plex database, the differen ces w ould be even m ore p ro n o u n ced w ith m an y m o re view s
a m uch larg er conceptual schem a, and a m ore co m plex internal schem a
Trang 35Schema Level D e s c rip tio n
External HighGPAView: data required for the query in Figure 1.7
FacultyAssignmentFormView: data required for the form in figure 1.9
FacultyWorkLoadReportView: data required for the report in Figure I.IO
Conceptual Student, Enrollment, Course, Faculty, and Enrollment tables and relationships (Figure 1.6)
Internal Files needed to store the tables: extra files (indexed property in Figure I.Ỉ) to improve performance
The schem a mappings describe how a schema at a higher level is derived from a schema
at a lower level For example, the external views in Table 1-4 are derived from the tables in the conceptual schema The mapping provides the knowledge to convert a request using an external view (for example, HighGPAView) into a request using the tables in the conceptual schema The mapping between conceptual and internal levels shows how entities are stored in files
DBMSs, using schemas and mappings, ensure data independence Typically, applications access a database using a view The DBMS converts an application’s request into a request using the conceptual schem a rather than the view The DBMS then transforms the conceptual schema request into a request using the internal schema M ost changes to the conceptual or internal schema do not affect applications because applications do not use the lower schema levels The DBMS, not the user, is responsible for using the mappings to make the transformations For more details about mappings and transformations Chapter 10 describes views and transformations between the external and conceptual levels Chapter 8 describes query optimization, the process o f converting a conceptual level query into an internal level representation
The Three Schem a Architecture is an official standard o f the American National Standards Institute (ANSI) However, the specific details o f the standard were never widely adopted Rather, the standard serves as a guideline about data independence The spirit o f the Three Schem a A rchitecture is widely implemented in third- and fourth-generation DBMSs
1.4.2 Parallel and Distributed Database Processing
With the growing importance o f com puter networks and electronic commerce, distributed processing is becoming a crucial function o f DBMSs Distributed processing allows
geographically dispersed com puters to cooperate when providing data access A large part o f electronic com m erce on the W eb involves accessing and updating remote databases Many databases in retail, banking, and security trading are now available through the Web D BM Ss use available network capacity and local processing capabilities to provide efficient remote database access
Distributed processing can be applied to databases to distribute tasks among servers, divide a task am ong processing resources, and distribute data among network sites T o distribute tasks among servers, many DBMSs use the client-server architecture A client is a program that submits requests to a server A server processes requests on behalf o f a client For example, a clienl may request a server to retrieve product data The server locates the data and sends them back to the client The client may perform additional processing on the data before displaying the results to the user DBMSs may employ one or more levels o f servers to distribute different kinds
o f database processing In Figure 1.13(a), the database server and database are located on a remote com puter In Figure 1.13(b), an additional middleware server is added to efficiently process messages from a large number o f clients
Trang 36c o m p u te rs co n n e c te d b y a n e tw o rk T h e c lie n t- s e r v e r a rc h ite c tu re s u p p o rts efficient
processing of messages (requests for service) b e tw e e n c lie n ts and servers. _
a) C lie n t-s e rv e r p ro ce ssin g w ith d a ta b a s e s e rv e r
b) C lie n t-se rve r p rocessing w ith m id d le w a re an d d a ta b a s e servers
Figure 1.13: Typical Client-Server Architectures
In the last decade, parallel database technology has gained commercial acceptance for large organizations Most enterprise DBMS vendors and some open source D BM Ss support parallel database technology to meet market demand Organizations are utilizing these products to realize the benefits o f im proved performance and availability Parallel database processing can improve performance through speedup (performing a task faster) and scaleup (performing more work in the same time) Parallel database processing can increase availability because a DBMS can dynamically adjust to the level o f available resources Figure 1.14 depicts tw o common parallel database architectures that can provide im p ro v e d performance and availability In Figure1.14(a) known as the shared disk architecture, each processor has its own memory but the processors share the disks In Figure 1.14(b) known as shared nothing architecture each processor has its own memory and disks
Trang 37L e g e n d
P: processor M: memory N: high-speed network SD: shared disk SN: shared nothing
Figure 1.14: Basic Parallel Database Architectures
P a ra lle l D B M S : a D B M S capable o f u tiliz in g tig h tly -c o u p le d c o m p u tin g re s o u rc e s
(p ro c e s s o rs , d isks, a nd m e m o ry ) T ig h t c o u p lin g is achie ve d b y n e tw o r k s w ith d ata
e xcha ng e tim e c o m p a ra b le CO th e tim e o f d ie d ata e xchange w ith a disk P arallel database
te c h n o lo g y p ro m is e s p e rfo rm a n c e im p ro v e m e n ts a nd high a vailab ility. _
D istributed data provides local conữol and reduced com munication costs Distributing a database allows the location o f data to match an organization’s structure D ecisions about sharing and maintaining data can be set locally to provide control closer to the data usage D ata should be located so that 80 percent o f the requests are local Local requests incur little o r no
com m unication costs and delays com pared to remote requests Figure 1.15 depicts a distributed database with three sites in Denver, London, and Tokyo Each site can control access to its local data and cooperate to provide data sharing for tasks needing data from more than one site
D a ta b a s e D a ta b a s e
Figure Ỉ.15: Distributed Database with Three Sites
ĐẠI HỌC THÁI NGUYÊN
TRUNG TÂM HỌC LIÊU
Trang 38D is tr ib u te d database te c h n o lo g y s u p p o rts lo c a l c o n tr o l o f data , d a ta s h a rin g f o r re q u e sts
in v o lv in g d ata fr o m m o re th a n o n e site , a nd re d u c e d c o m m u n ic a tio n o v e rh e a d
Client-server architectures, parallel database processing, and distributed databases provide flexible ways for DBMSs to interact with com puter networks The distribution o f dala and processing among clients and servers and the possible choices to locate data and software are much more complex than described here You will learn more details about these architectures in Chapter 17
1.5 Organizational Impacts of Database Technology
This section completes your introduction to database technology by discussing the effects o f database technology on organizations The first section describes possible interactions that you may have with a database in an organization The second section describes information resource management, an effort to conưol the data produced and used by an organization Special attention
is given to management roles that you can play as part o f an effort to control information resources Chapter 14 provides more detail about the tools and processes used in these
management roles
1.5.1 Interacting with Databases
Because databases are pervasive, there are a variety o f ways in which you may interact with databases The classification in Figure 1.16 distinguishes between functional users who interact with databases as part o f their work and information systems professionals who participate in designing and im plementing databases Each box in the hierarchy represents a role that you may play You may simultaneously play more than one role For example, a functional user in a jo b such as a financial analyst may play all three roles in different databases In some organizations, the distinction between functional users and information system s professionals is blurred In these organizations, functional users may participate in designing and using databases
Specialization
! _ I _ 1
Functional User I Information Systems I
I Indirect I I Parametric I I Power I I DBA _ I I Analyst/Programmer I I Management I
I I Technical 11 Non Technical I' I'r^— Lr — 71Figure 1.16: Classification of RolesFunctional users can play a passive or an active role when interacting with databases Indirect usage o f a database is a passive role An indirect user is given a report or some data exưacted from a database A parametric user is more aclive than an indirect user A param etric user requests existing forms o r reports using param eters, input values that change from usage lo usage For example, a parameter may indicate a date range, sales territory, or departm ent name The pọvỵọr user is the most active Because decision-making needs can be difficult to predict ad hoc or unplanned usage o f a database is important A pow er user is skilled enough to build a form
or report when needed Power users should have a good understanding o f nonprocedural access a skill described in parts 2 and 5 o f this book
Information systems professionals interact with databases as part o f developing an information system Analyst/programmers are responsible for collecting requirem ents designing applications, and im plementing information systems They create and use external views to develop forms, reports, and other parts o f an information system M anagem ent has an oversight role in the development o f databases and information systems Information system s professionals
Trang 39application development in parts 3 to 5 o f this book.
Database administrators assist both information systems professionals and functional users Database administrators have a variety o f both technical and non-technical responsibilities (Table 1-5) Technical skills are more detail-oriented; non-technica] responsibilities are more people-oriented The primary technical responsibility is database design On the non-technical side, the database adm inisttator’s time is split among a number o f activities Database
adm inisưators can also have responsibilities in planning databases and evaluating DBMSs Chapter 14 provides more details about responsibilities and tools o f database administrators
Database A dm inistrator a s u p p o r t p o s itio n th a t specializes in m anaging in d ivid u a l databases
a nd DBMSs.
Tabic 1-5: Responsibilities o f the Database Administrator
T e ch n ica l N o n -te c h n ic a l
Designing conceptual schemas Setting databast standards
Designing internal schemas Devising training materials
Monitoring database performance Promoting benefits of databases
Selecting and evaluating database software Consulting with users
Managing security for database usage Planning new databases
Troubleshooting database problems
1.5.2 Information Resource Management
Information resource management is a response to the challenge o f effectively utilizing information technology The goal o f information resource management is to use information technology as a tool for processing, distributing, and integrating information throughout an organization M anagem ent o f information resources has many similarities with managing physical resources such as inventory Inventory management involves activities such as safeguarding inventory from theft and deterioration, storing it for efficient usage, choosing suppliers, handling waste, coordinating movement, and reducing holding costs Information resource m anagement involves similar activities: planning databases, acquiring data, protecting data from unauthorized access, ensuring reliability, coordinating flow among information systems, and eliminating duplication
As part o f controlling information resources, new management responsibilities have arisen The data adm inistrator is a management role with many o f these responsibilities; the major responsibility being planning the development o f new databases The data adm inistrator maintains
an enterprise data architecture that describes existing databases and new databases and also evaluates new information technologies and determines standards for managing databases
Data Administrator, a m a n ag em en t p o s itio n th a t p e rfo rm s p lan n in g a nd p o lic y s e ttin g f o r th e
in fo r m a tio n re s o u rc e s o f an e n tir e o rg a n iz a tio n The data adm inistrator typically has broader responsibilities than the database administrator The data administrator has primarily a planning role, while the database adm inistrator has a more technical role focused on individual databases and DBMSs The data adm inistrator also views the information resource in a broader context and considers all kinds of data, both com puterized and noncomputerized A major effort in many organizations is to com puterize nontraditional data such as video, training materials, images, and correspondence The data adm inistrator develops long-range plans for nontraditional data, while the database adm inistrator im plem ents the plans using appropriate database technology
Because o f broader responsibilities, the data adm inistrator typically is higher in an organization chart Figure 1.17 depicts two possible placements o f data adm inistrators and
Trang 40C h ap te r 1 h a s p ro v id ed a bro ad intro d u ctio n to D B M S s Y ou sh o u ld u s e th is b ac k g ro u n d as a
co n tex t fo r th e skills y ou w ill acq u ire in s u b se q u en t ch ap ters Y o u le arn e d th a t d a ta b a s e s co n tain
in te ư e la te d d a ta th a t can be sh ared ac ro ss m u ltip le p a rts o f an o rg an izatio n D B M S s su p p o rt tfa n sfo rm atio n o f d ata fo r dec isio n m ak in g T o su p p o rt th is ư a n s ỉb rm a tio n , d a ta b a s e te ch n o lo g y has ev o lv ed from sim p le file access to p o w erfu l sy stem s th a t su p p o rt d a ta b a s e d e fin itio n ,
n o n p ro ced u ral access, a p p licatio n d ev e lo p m en t, tra n sa ctio n p ro c e ssin g , an d p e rfo rm a n c e tu n in g
N o n p ro ced u ral ac cess is th e m o st vital e lem en t b ec au se it allo w s ac c e ss w ith o u t d e ta ile d co d in g
Y ou learn ed ab o u t tw o arch itectu res th at p ro v id e o rg an izin g p rin c ip le s fo r D B M S s T h e T h re e
S ch em a A rch itectu re su p p o rts d ata in d ep en d en ce , an im p o rtan t c o n c e p t fo r re d u c in g th e c o s t o f
s o ftw are m a in te n an ce C lien t-serv er arch itec tu re s, p arallel d a ta b a se p ro ce ssin g , an d d istrib u te d
d atab ases allow d atab ases to be accessed o v e r co m p u te r n etw o rk s, a fe atu re vital in to d a y s
n etw o rk ed w orld
T h e sk ills em p h asized in la ter ch a p ters sh o u ld en a b le y o u to w o rk as an a c tiv e fu n ctio n al
u ser o r an aly st B o th k in d s o f u sers need to u n d ersta n d th e sk ills ta u g h t in th e se co n d p a rt o f th is
b o ok T h e fifth p art o f th e b o o k p ro v id e s sk ills fo r a n a ly sts/p ro g ram m ers T h is b o o k a lso p ro v id e s
th e fo u n d atio n o f sk ills to o b tain a sp ecialist p o sitio n as a d a ta b a se o r d a ta a d m in is tra to r T h e
sk ills in th e th ird , fourth, six th , an d sev en th p arts o f th is b o o k are m o st usefu l fo r a p o sitio n as a
d atab ase ad m in istrato r H o w e v er, y o u w ill p ro b ab ly need to ta k e ad d itio n a l c o u rs e s , le arn d etails
o f p o p u la r D B M S s, an d ac q u ire m a n ag em e n t ex p e rien ce b efo re o b ta in in g a s p e c ia list ro le A
p o sitio n as a d atab ase sp ecialist can b e an ex c itin g an d lu c rativ e c a re e r o p p o rtu n ity th a t y ou
sh o u ld co n sid e r