Tài liệu Oracle SQL Jumpstart with Examples- P1 docx

50 369 0
Tài liệu Oracle SQL Jumpstart with Examples- P1 docx

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Oracle SQL Jumpstart with Examples Powell_title.fm Page 1 Friday, July 30, 2004 10:10 AM Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. This page intentionally left blank Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Oracle SQL Jumpstart with Examples Gavin Powell Carol McCullough-Dieter AMSTERDAM • BOSTON • HEIDELBERG • LONDON NEW YORK • OXFORD • PARIS • SAN DIEGO• SAN FRANCISCO • SINGAPORE • SYDNEY • TOKYO Powell_title.fm Page 3 Friday, July 30, 2004 10:10 AM Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Elsevier Digital Press 200 Wheeler Road, Burlington, MA 01803, USA Linacre House, Jordan Hill, Oxford OX2 8DP, UK Copyright © 2005, Elsevier 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 otherwise, without the prior written permission of the publisher. Permissions may be sought directly from Elsevier’s Science & Technology Rights Department in Oxford, UK: phone: (+44) 1865 843830, fax: (+44) 1865 853333, e-mail: permissions@elsevier.com.uk. You may also complete your request on-line via the Elsevier homepage (http://elsevier.com), by selecting “Customer Support” and then “Obtaining Permissions.” Recognizing the importance of preserving what has been written, Elsevier prints its books on acid-free paper whenever possible. Library of Congress Cataloging-in-Publication Data Application submitted. ISBN: 1-55558-323-7 British Library Cataloguing-in-Publication Data A catalogue record for this book is available from the British Library. For information on all Digital Press publications visit our Web site at www.digitalpress.com and www.bh.com/digitalpress 04 05 06 07 08 09 10 9 8 7 6 5 4 3 2 1 Printed in the United States of America Powell_title.fm Page 4 Friday, July 30, 2004 10:10 AM Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. v Contents at a Glance Foreword xix Preface xxi Acknowledgements xxix 1 Introduction to Oracle SQL 1 2 New Features of Oracle SQL 39 3 Oracle Database Architecture 51 4 The SELECT Statement 73 5 Filtering Rows 97 6 Sorting Rows 109 7 Operators, Conditions, and Pseudocolumns 123 8 Using SQL*Plus 137 9 Single-Row Functions 175 10 Joining Tables 205 11 Grouping and Summarizing Data 235 12 Subqueries 267 13 Unusual Query Types 285 14 Expressions 301 15 Data Manipulation Language (DML) 315 16 Datatypes and Collections 339 powellTOC2.fm Page v Thursday, July 29, 2004 9:56 PM Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. vi Contents at a Glance 17 XML in Oracle 357 18 Tables 383 19 Views 425 20 Constraints 447 21 Indexes and Clusters 471 22 Sequences and Synonyms 489 23 Security 503 24 Basic PL/SQL 531 Appendix A 569 Appendix B 623 Appendix C 625 Index 627 powellTOC2.fm Page vi Thursday, July 29, 2004 9:56 PM Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. vii Table of Contents Foreword xix Preface xxi Acknowledgements xxix 1 Introduction to Oracle SQL 1 1.1 A Little History 1 1.1.1 The Evolution of Database Modeling 1 1.1.2 The History of Relational Databases 5 1.1.3 The Evolution of Oracle Database 6 1.2 The Basics of Relational Data Modeling 8 1.2.1 Normalization 8 1.2.1.1 Referential Integrity 10 1.2.2 Denormalization 11 1.2.3 Different Forms of the Relational Data Model 13 1.3 Structured Query Language (SQL) 14 1.3.1 The Humble Origins of SQL 14 1.3.2 What Is Oracle SQL? 15 1.3.2.1 ANSI Standards and Oracle 15 1.4 Software Useful for Reading this Book 16 1.5 Syntax Conventions Used in This Book 17 1.6 SQL Tools 19 1.6.1 SQL*Plus in Command-Line Mode 19 1.6.2 SQL*Plus in Windows Mode 24 1.6.3 SQL*Plus Worksheet 28 1.6.4 iSQL*Plus 31 1.7 The MUSIC Schema 34 1.7.1 The MUSIC Schema Sales Data Warehouse 36 powellTOC.fm Page vii Thursday, July 29, 2004 9:57 PM Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. viii Table of Contents 2 New Features of Oracle SQL 39 2.1 New Features in Oracle Database 10g 39 2.1.1 Oracle SQL Improvements in Oracle Database 10g 39 2.1.2 PL/SQL Improvements in Oracle Database 10g 44 2.1.2.1 Java Improvements in Oracle Database 10g 45 2.1.3 XML Improvements in Oracle Database 10g 45 2.1.4 Some Utility Improvements in Oracle Database 10g 45 2.1.5 Database Object Improvements in Oracle 10g 46 2.2 New Features in Oracle Database 9i 46 2.2.1 Oracle SQL Improvements in Oracle Database 9i 47 2.2.2 New PL/SQL Features in Oracle Database 9i 48 3 Oracle Database Architecture 51 3.1 The Basic Concepts 51 3.2 The Oracle Instance 58 3.3 Oracle Database Physical Architecture 60 3.3.1 Datafiles, Tablespaces, and Objects 60 3.3.2 Controlfiles, Logging, and Archiving 61 3.3.3 Rollback and Undo 62 3.3.4 Temporary Sort Space 64 3.4 Database Startup and Shutdown 65 3.5 Enhancing the Physical Architecture 67 3.5.1 Oracle Managed Files 67 3.5.2 Partitioning 67 3.5.3 Replication 68 3.5.4 Standby Databases 69 3.5.5 Clustering and Oracle RAC 70 4 The SELECT Statement 73 4.1 The Basic SELECT Statement 73 4.1.1 Uses of the SELECT Statement 73 4.1.2 Syntax Conventions 74 4.1.3 Some Simple Example SELECT Statements 76 4.2 Types of SELECT Queries 81 4.2.1 Simple Query 82 4.2.2 Filtered Query 82 4.2.3 Sorted Query 83 4.2.4 Grouping or Aggregated Query 83 powellTOC.fm Page viii Thursday, July 29, 2004 9:57 PM Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Table of Contents ix Contents 4.2.5 Join Query 84 4.2.6 Subquery 85 4.2.7 Table or View Creation Query 85 4.2.8 Hierarchical Query 86 4.2.9 Composite Queries 88 4.3 Other Aspects of the SELECT Statement 88 4.3.1 The DUAL Table 89 4.3.2 Using Functions 90 4.3.3 Arithmetic Operations 91 4.3.4 Using DISTINCT 92 4.3.5 Null Values 93 4.3.6 Using Pseudocolumns 94 5 Filtering Rows 97 5.1 WHERE Clause Syntax 97 5.1.1 Some Simple WHERE Clause Examples 98 5.2 WHERE Clause Expression Conditions 101 5.3 Logical Operators in the WHERE Clause 105 5.4 Top-N Queries 105 6 Sorting Rows 109 6.1 ORDER BY Clause Syntax 109 6.1.1 Some Simple ORDER BY Clause Examples 111 6.2 Sorting and Null Values 113 6.3 Sorting Methods 117 6.3.1 Sorting by Position 117 6.3.2 Sorting by Expression 119 7 Operators, Conditions, and Pseudocolumns 123 7.1 Precedence 124 7.2 Operators 124 7.2.1 Arithmetic Operators 125 7.2.2 Logical Operators 126 7.2.3 The Concatenation Operator 128 7.2.4 Hierarchical Query Operators 128 7.2.5 Set Operators 129 7.2.6 Multiset Operators 129 7.2.7 User-Defined Operators 131 7.3 Conditions 131 7.4 Pseudocolumns 134 powellTOC.fm Page ix Thursday, July 29, 2004 9:57 PM Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. [...]... Preface Welcome to Oracle SQL Jumpstart with Examples! The title of this book was originally Oracle SQL Reference, but during the writing process, we set our hearts on the new title Oracle SQL Jumpstart with Examples Why with Examples”? This book is still an Oracle SQL reference manual simply by the nature of its structure and content However, it is a reference manual with much added usefulness The... the nature of Oracle SQL residing and executing from within an Oracle database, there should be no operating system differences or dependencies Note: Different operating systems and platforms may require different Oracle database releases, but it is still unlikely that there will be any differences with respect to Oracle SQL This book is also written to include Oracle SQL contained in both Oracle Database... covering Oracle SQL as applied to XML in Oracle, some PL /SQL basics, Oracle Partitioning, plus both Oracle Expression Filter and Regular Expressions All of the scripts written to create the MUSIC database that is used throughout this book are found in Appendix A In addition, you can find the scripts listed on a simple menu on my website at the following URL: 1 www.oracledbaexpert.com /oracle/ OracleSQLJumpstartWithExamples/index.html... Features of Oracle SQL This chapter covers new Oracle SQL and PL /SQL features for both Oracle Database 10g and Oracle Database 9i Chapter 3 Oracle Database Architecture This chapter examines the basic architecture of Oracle Database, including the Oracle Instance, datafile physical architecture, database startup and shutdown, followed by brief descriptions of some advanced feature options such as Oracle. .. and easy to understand examples Frankly, I have not come across any other book on SQL that is as good a compilation of SQL concepts in a single source Oracle SQL Jumpstart with Examples will be a very useful reference and should be a hit for anyone who may be using Oracle SQL This book should become very popular not only with Developers and DBAs but also Database Managers, Designers and System Managers... specifically Oracle SQL users, would benefit from reading this book This book contains something for everyone from entry level to more senior experienced Oracle DBAs and programmer/developers, across a whole range of Oracle SQL tools and methods What Is in This Book? Chapter 1 Introduction to Oracle SQL This chapter discusses relational data modeling history, Normalization, Denormalization, and the origins of SQL. .. reference pointers and collections Oracle SQL collection functions are also included in this chapter Preface Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark xxvi Preface Chapter 17 XML in Oracle Oracle SQL allows for generation and manipulation of XML documents in Oracle Database This chapter introduces various aspects of using XML in Oracle SQL Chapter 18.Tables Tables are... MUSIC schema are covered with explanation and entity relationship diagrams (ERDs) in Chapter 1 and schema creation scripts in Appendix A Scripts are available from a simple menu on my Web site at www.oracledbaexpert.com /oracle/ OracleSQLJumpstartWithExamples/ index.html Let’s get started Endnotes 1 Universal Resource Locator (Web page address in a browser such as Internet Explorer) 2 Oracle Performance Tuning... proofed on Oracle Database 10g Why is this book needed? This book is needed because many Oracle SQL texts simply present facts without adequate example proof A book containing a thorough analysis of Oracle SQL, plus some of its toys and tricks, is missing from bookshelves and the warehouses of online book retailers This book fills the void Who would benefit from reading this book? Anyone using Oracle software,... Oracle Database 10g and Oracle Database 9i Whenever you see that xxi Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark xxii Preface indicates an Oracle Database 10g update or enhancement The differences between Oracle Database 10g and Oracle Database 9i are easy to see in this book Many Oracle installed sites still run Oracle Database 9i, and perhaps even Oracle Database 8i and . Features of Oracle SQL 39 2.1 New Features in Oracle Database 10g 39 2.1.1 Oracle SQL Improvements in Oracle Database 10g 39 2.1.2 PL /SQL Improvements in Oracle. Improvements in Oracle 10g 46 2.2 New Features in Oracle Database 9i 46 2.2.1 Oracle SQL Improvements in Oracle Database 9i 47 2.2.2 New PL /SQL Features in Oracle

Ngày đăng: 24/12/2013, 12:17

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan