An introduction to database...

10
I nternational E dition V *. "• • fV k* •I V EIGHTH EDITIOI An Introduction to Database Systems C.J. Date

Transcript of An introduction to database...

Page 1: An introduction to database systemstailieudientu.lrc.tnu.edu.vn/Upload/Collection/brief/...databases, and object-relational databases together provide an exceptionally clear, self-contained

I n t e r n a t i o n a l E d i t i o n

V *. "• • f V k *

•I V

E I G H T H E D I T I O I

An I n t r o d u c t i o n to

Database SystemsC. J . Da t e

Page 2: An introduction to database systemstailieudientu.lrc.tnu.edu.vn/Upload/Collection/brief/...databases, and object-relational databases together provide an exceptionally clear, self-contained

• Part I (four chapters) provides a broad introduction to the concepts of database systems in general and relational systems in particular. It also introduces the standard database language, SQL.

• Part II (six chapters) consists of a detailed and very careful description of the relational model, which is not only the theoretical foundation underlying rela­tional systems but is, in fact, the theoretical foundation for the entire database field

• Part III (four chapters) discusses the general question o f database design. Three chapters are devoted to design theory, and the fourth considers semantic model­ing and the entity/relationship model.

• Part r v (two chapters) is concerned with ưansaction management (i.e., recovery and concurrency controls).

• Part V (eight chapters) shows how relational concepts are relevant to a variety of further aspects of database technology— security, distributed databases, temporal data, decision support, and so on.

• Part VI (three chapters) describes the impact o f object technology on database systems. Chapter 25 describes object systems specifically; Chapter 26 considers the possibility of a rapprochement between object and relational technologies and discusses object/relational systems; and Chapter 27 addresses the relevance to databases o f XML.

c. J . DATE is an author, lecturer, researcher, and independent

consultant specializing in relational database systems. An active

member of the database community for nearly 35 years, c. J.

Date devotes the major part of his career to exploring, expanding,

and expounding the theory and practice of relational technology.

He enjoys a reputation second to none for his ability to explain

complex technical material in a clear and understandable fashion.

Page 3: An introduction to database systemstailieudientu.lrc.tnu.edu.vn/Upload/Collection/brief/...databases, and object-relational databases together provide an exceptionally clear, self-contained

“[C. J. Date’s] book is the flag bearer of relational theory and mathematical treat­ment in general...as well as the runaway leader in discussing the SQL standards.It exercises much more respect for careful language and the importance of con­cepts and principles in gaining mastery of the field.”

— C a r l E c k b e rg , San Diego State University

“[The] 8th Edition is an excellent and comprehensive presentation of the contem­porary database field. In particular, Date’s chapters on types, relations, object databases, and object-relational databases together provide an exceptionally clear, self-contained exposition of the object-relational approach to databases.”

— M artin K. Solom on , Florida Atlantic University

“Chris Date is the computer industry’s most respected expert and thinker on data­base technology, and his book An Introduction to Database Systems continues to be the definitive work for those wanting a comprehensive and current guide to database systems.”

— C olin J . W h ite , President, Intelligent Business Strategies

‘This is the best explanation of concurrency that I have seen in literature, and it covers the ground quite thoroughly.”

— B ru c e o . L a rs e n , Stevens Institute o f Technology

“ ...both an indispensable read and an indispensable reference. No serious informa­tion systems or database practitioner should be without this book.”

— D e c la n B ra d y , M IC S, Systems Architect and Database Specialist, Fujitsu

“The author’s deep insights into the area, informal treatment of profound topics, open-ended discussions of critical issues, comprehensive and up-to-date contents, as well as rich annotations on bibliography have made the book most popular in the database area for more than two decades.”

—Q iang Zhu, The University o f Michigan, Dearborn

“[The book’s] appeal is its comprehensiveness and the fact that it is very up-to- date with research developments. The latter factor is due mainly to [Date’s] in­volvement with these developments, which gives him a unique opportunity to write about them.”

— D avid L ivingstone, University o f Northumbria at Newcastle I

Page 4: An introduction to database systemstailieudientu.lrc.tnu.edu.vn/Upload/Collection/brief/...databases, and object-relational databases together provide an exceptionally clear, self-contained

0-32

1-18

090-

9Free

Access!

A s a re a d e r o f th is d a ta b a s e c o n c e p ts b o o k , y o u a re e n t it le d to s ix m o n th s o f f re e a c cess to D a ta b a s e P la c e ! D a ta b a s e P la c e w i l l be a k e y re so u rc e in h e lp in g y o u s u c c e e d in y o u r d a ta b a s e c o u rs e .

T h is access a llo w s you to use all th e s tud e n t suppo rt a re a s o f D a tabase P lace , inc lud ing :

— In te rac tive tu to ria l e nv ironm en ts fo r p ractic ing d a ta ba se m ode lling , norm a liza tion prob lem s, and w ritin g S Q L queries

— A u tom a tic a lly g raded p rac tice q ues tions in the a reas o f N o rm a liza tion , S Q L, d a tabase m ode ling, and re la tiona l a lgeb ra to he lp you assess yo u r bas ic u nde rs tand ing o f the m ateria l

— A nd m ore!

To access Database Place for the first tim e:You w ill need to reg is te r o n line us ing a co m p u te r w ith an In te rne t connection and a W eb brow ser. T he p ro ce ss ta ke s ju s t a coup le o f m inu tes a nd o n ly needs to be com p le ted once.

1) Go to http://www.aw.com/databaseplace

2) Click Enter Database Place

3) Click the Register button

4) Use a coin to scratch o ff the gray coating below and reveal your student access code*.Do not use a knife o r o ther sharp object, which can dam age the code.

tisScratch Here!

5) On the registration page, enter your student access code. Do not type the dashes. You can use lowercase o r uppercase.

6) Follow the on-screen instructions. If you need help at any tim e during the online registration process, sim ply c lick the Need Help? icon.

7) Once your personal Login Name and Password are confirm ed, you can begin using Database Place!

To Log into Database Place A fte r You Register:You can access D a tabase P lace any tim e b y go ing to h ttp ://w w w .aw .co m /d a ta ba se p lac e , click ing "E nter D a tabase P lace ," and p ro v id in g y o u r Log in N am e and P as sw o rd w h en prom pted.

* Important: The A ccess Code on th is page can only be used once to establish a subscription to Database Place. This subscription is valid fo r six m onths upon activation, and is not transfe r­able. If this access code has a lready been scratched off, it may no longer be valid. If th is is the case, you can purchase a subscription by going to h ttp ://www.aw.com /databaseplace and click­ing "Enter Database P lace."

Page 5: An introduction to database systemstailieudientu.lrc.tnu.edu.vn/Upload/Collection/brief/...databases, and object-relational databases together provide an exceptionally clear, self-contained

E I G H T H E D I T I O N

An In t roduct ion to

Database SystemsC.J. Date

Đ Ạ H Ỉ Ọ C T H A 1 N G Ụ U 3

TTUING TÀM HOC L ^ U -------- - r

P E A R S O N

Boston San Francisco New York London Toronto Sydney Tokyo Singapore Madrid

Mexico City Munich Paris Cape Town Hong Kons Montreal

Page 6: An introduction to database systemstailieudientu.lrc.tnu.edu.vn/Upload/Collection/brief/...databases, and object-relational databases together provide an exceptionally clear, self-contained

Senior Acquisitions Editor: Maite Suarez-Rivas Project Editor: Katherine Harutunian Marketing Manager: Nathan Schultz Production Supervisor: Marilyn Lloyd Project Management: Elisabeth Beller Composition: Nancy Logan Technical Art: Dartmouth Publishing, Inc.Copyeditor: Daril Bentley Proofreader: Jennifer McClain Design Manager: Joyce Cosentino Wells Cover Design: Night & Day Design Cover Image: Lindy Date Prepress and Manufacturing: Caroline Fell

Access the latest information about Addison-Wesley titles from our World Wide Web site:http://www. aw. com/cs

Many of the designations used by manufacturers and sellers to distinguish theừ products are claimed as ưademarks. Where those designations appear in this book, and Addison-Wesley was aware of a trademark claim, the designations have been printed in initial caps or all caps.

The programs and applications presented in this book have been included for their instructional value. They have been tested with care but are not guaranteed for any purpose. The publisher does not offer any warranties or representations, nor does it accept any liabilities with respect to the programs or applications.

If you purchased this book within the United States or Canada you should be aware that it has been wrongfully imported without the approval of the Publisher or the Author.

Copyright © 2004 by Pearson Education, Inc.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or other­wise, without the prior written permission of the publisher. Printed in the United States of America.

ISBN 0-321-18956-6

P E A R S O N

6 7 8 9 10-HAM-09 08

Page 7: An introduction to database systemstailieudientu.lrc.tnu.edu.vn/Upload/Collection/brief/...databases, and object-relational databases together provide an exceptionally clear, self-contained

This book is dedicated to m y w ife Lindy and to the memory o f m y m other Rene—

also to the memory of Ted Codd, who, sadly, passed a w a y as th is book w a s going to press

Page 8: An introduction to database systemstailieudientu.lrc.tnu.edu.vn/Upload/Collection/brief/...databases, and object-relational databases together provide an exceptionally clear, self-contained

Those who cannot remember the past are condemned to repeal il

Usually quoted in the form:

Those who don’t know history are doomed to repeal it

— George Santayana

I would like to see computer science teaching set deliberately

in a historical framework. . . Students need to understand

how the present situation has come about, what was tried,

what worked and what did not, and how improvements in hardware

made progress possible. The absence o f this element in

their training causes people to approach every problem from

first principles. They are apt to propose solutions that

have been found wanting in the past.Instead o f standing

on the shoulders o f theứ precursors, they tty to go it alone.

—Maurice V Wilkes

Page 9: An introduction to database systemstailieudientu.lrc.tnu.edu.vn/Upload/Collection/brief/...databases, and object-relational databases together provide an exceptionally clear, self-contained

About the Author

c. J. Date is an independent author, lecturer, researcher, and consultant, specializing in relational database technology. He is based in Healdsburg, California.

In 1967, following several years as a mathematical programmer and programming instructor for Leo Computers Ltd. (London, England), Mr. Date moved to the IBM (UK) Development Laboratories, where he worked on the integration of database functionality into PL/I. In 1974 he transferred to the IBM Systems Development Center in California, where he was responsible for the design of a database language known as the Unified Database Language, UDL, and worked on technical planning and externals design for the IBM products SQL/DS and DB2. He left IBM in May, 1983.

Mr. Date has been active in the database field for well over 30 years. He was one of the first people anywhere to recognize the significance of Codd’s pioneering work on the relational model. He has lectured widely on technical subjects—principally on database topics, and especially on relational database—throughout North America and also in Europe, Australia, Latin America, and the Far East. In addition to the present book, he is author or coauthor of a number of other database texts, including, from Morgan Kauf- mann, Temporal Data and the Relational Model (2003) and, from Addison-Wesley, Foun­dation fo r Future Database Systems: The Third Manifesto (2nd edition, 2000), a detailed proposal for the future direction of the field; Database: A Primer (1983), which treats database systems from the nonspecialist’s point of view; a series of Relational Database Writings books (1986, 1990, 1992, 1995, 1998), which deal with various aspects of rela­tional technology in depth; and another series of books on specific systems and lan­guages— A Guide to DB2 (4th edition, 1993), A Guide to SYBASE and SQL Server ( 1992), A Guide to SQL/DS (1988), A Guide to INGRES (1987), and A Guide to the SQL Stan­dard (4th edition, 1997). His books have been translated into several languages, including Braille, Chinese, Dutch, French, German, Greek, Italian, Japanese, Korean, Polish, Portu­guese, Russian, and Spanish.

Mr. Date has also produced over 300 technical articles and research papers and has made a variety of original contributions to database theory. For several years, he was a regular columnist for the magazine Database Programming & Design. He also contrib­utes regularly to the website http://www.dbdebunk.com. His professional seminars on database technology, offered both in North America and overseas, are widely considered to be second to none for the quality of the subject matter and the clarity of the exposition.

Mr. Date holds an Honours Degree in Mathematics from Cambridge University, England (BA 1962, MA 1966) and the honorary degree of Doctor of Technology from De Montfort University, England (1994).

Page 10: An introduction to database systemstailieudientu.lrc.tnu.edu.vn/Upload/Collection/brief/...databases, and object-relational databases together provide an exceptionally clear, self-contained