The practical SQL handbook : using SQL variants / Judith S. Bowman ... [et al.]
By: Bowman, Judith S
.
Contributor(s): Emerson, Sandra L
| Darnovsky, Marcy
.
Material type:
BookPublisher: Boston : Addison-Wesley, 2001Edition: 4th ed.Description: xxxvi, 469 p. : ill. ; 24 cm. + 1 computer optical disc (4 3/4 in.).ISBN: 0201703092.Subject(s): SQL (Computer program language)| Item type | Current library | Call number | Copy number | Status | Barcode | |
|---|---|---|---|---|---|---|
| General lending | MTU Bishopstown Library Lending | 005.756 (Browse shelf(Opens below)) | 1 | Available | 00078544 | |
| General lending | MTU Bishopstown Library CD | 005.756 (Browse shelf(Opens below)) | 1 | Available | 00095466 |
Browsing MTU Bishopstown Library shelves, Shelving location: CD Close shelf browser (Hides shelf browser)
Enhanced descriptions from Syndetics:
This latest edition of the best-selling implementation guide to the Structured Query Language teaches SQL fundamentals while providing practical solutions for critical business applications. The Practical SQL Handbook, Fourth Edition now includes expanded platform SQL coverage and extensive real-world examples based on feedback from actual SQL users.
The Practical SQL Handbook begins with a step-by-step introduction to SQL basics and examines the issues involved in designing SQL-based database applications. It fully explores SQL#146;s most popular implementations from industry leaders, Oracle, Microsoft, Sybase, and Informix.
Highlights include:
Detailed coverage of SQL commands for creating databases, tables, and indexes, and for adding, changing, and deleting data Using the SELECT command to retrieve specific data Handling NULL values (missing information) in a relational database Joining tables, including self joins and outer joins (ANSI and WHERE-clause syntax) Working with nested queries (subqueries) to get data from multiple tables Creating views (virtual tables) to provide customized access to data Using SQL functionsA bonus CD-ROM contains a time-limited, full-feature version of the Sybase® Adaptive Server Anywhere(tm) software as well as the sample database, scripts, and examples included in the book.
The Practical SQL Handbook is the most complete reference available for day-to-day SQL implementations.
0201703092B05222001
CD-ROM available at desk.
Includes bibliographical references and index.
SQL and Relational Database Management -- Designing Databases -- Creating and Filling a Database -- Selecting Data from the Database -- Sorting Data and Other Selection Techniques -- Grouping Data and Reporting from It -- Joining tables for Comprehensive Data Analysis -- Structuring Queries with Subqueries -- Creating and using views -- Security, Transactions, Performance and Integrity -- Solving Business Problems.
Table of contents provided by Syndetics
- List of Figures (p. xix)
- Foreword to the Fourth Edition (p. xxi)
- Preface (p. xxiii)
- Why New Editions? (p. xxiii)
- Changes for Recent Editions (p. xxiv)
- Include More Real-World Examples (p. xxiv)
- Emphasize SQL-92 (p. xxiv)
- Provide Software for Hands-On Practice (p. xxv)
- The Fourth Edition (p. xxv)
- Test on More Systems (p. xxv)
- Show Examples of Vendor-Specific Differences (p. xxvi)
- Acknowledgments (p. xxvi)
- Introduction (p. xxvii)
- The Beginnings of SQL (p. xxvii)
- The Commercialization of SQL (p. xxviii)
- Who Should Use This Book (p. xxix)
- The Focus of This Book (p. xxix)
- How to Learn SQL with This Book (p. xxxi)
- The Structure of This Book (p. xxxii)
- How to Use This Book (p. xxxiii)
- An Overview of the Book (p. xxxiv)
- Chapter 1 SQL and Relational Database Management (p. 1)
- In This Chapter (p. 1)
- Relational Database Management (p. 1)
- The Relational Model: It's All Tables (p. 3)
- Independence Forever (p. 4)
- A High-Level Language (p. 5)
- Data Manipulation (p. 6)
- Data Definition (p. 7)
- Data Administration (p. 8)
- Relational Operations (p. 8)
- Projection (p. 9)
- Selection (p. 10)
- Join (p. 10)
- Alternatives for Viewing Data (p. 13)
- NULLs (p. 15)
- Security (p. 15)
- Integrity (p. 16)
- SQL Functions (p. 17)
- Summary (p. 18)
- Chapter 2 Designing Databases (p. 21)
- In This Chapter (p. 21)
- Design Considerations (p. 21)
- Do You Need an Expert? (p. 22)
- Data Definition and Customization (p. 23)
- How to Approach Database Design (p. 23)
- Introducing the Sample Database (p. 27)
- Data Entities and Relationships (p. 29)
- Entities: Things with an Independent Existence (p. 29)
- One-to-Many Relationships (p. 33)
- Many-to-Many Relationships (p. 36)
- One-to-One Relationships (p. 37)
- The Entity-Relationship Approach Summarized (p. 38)
- The Normalization Guidelines (p. 39)
- First Normal Form (p. 40)
- Second Normal Form (p. 41)
- Third Normal Form (p. 43)
- Fourth Normal Form (p. 45)
- Reviewing the Database Design (p. 46)
- Summarizing the bookbiz Database (p. 48)
- Testing Your Database Design (p. 49)
- Other Database Definition Considerations (p. 50)
- Summary (p. 50)
- Chapter 3 Creating and Filling a Database (p. 51)
- In This Chapter (p. 51)
- From Theory to Practice: Installing bookbiz (p. 51)
- Distinguishing SQL Examples and Syntax (p. 52)
- Coping with Failure (p. 55)
- Working with Databases (p. 56)
- Getting Started (p. 56)
- Recognizing Roles (p. 57)
- Reserving Space for Database Objects (p. 57)
- Choosing Databases (p. 58)
- Creating Simple Tables (p. 58)
- Choosing Datatypes (p. 61)
- Assigning NULL and NOT NULL (p. 64)
- Planning Tables (p. 66)
- Defining the Tables in bookbiz (p. 66)
- Creating Indexes (p. 68)
- The CREATE INDEX Statement (p. 69)
- How, What, and Why to Index (p. 71)
- Creating Tables with SQL-92 Constraints (p. 72)
- Sketching Constraints (p. 73)
- Implementing Constraints on Individual Columns (p. 75)
- Implementing Multicolumn Constraints (p. 77)
- Changing and Deleting Databases and Objects (p. 79)
- Changing Databases (p. 79)
- Changing Table Definitions (p. 79)
- Removing Databases (p. 81)
- Removing Tables (p. 82)
- Removing Indexes (p. 82)
- Adding, Changing, and Removing Data (p. 83)
- Adding New Rows: INSERT (p. 84)
- Changing Existing Data: UPDATE (p. 89)
- Removing Data: DELETE (p. 93)
- Summary (p. 94)
- Chapter 4 Selecting Data from the Database (p. 95)
- In This Chapter (p. 95)
- SELECT Overview and Syntax (p. 95)
- Basic SELECT Syntax (p. 96)
- Full SELECT Syntax (p. 99)
- Choosing Columns: The SELECT Clause (p. 100)
- Choosing All Columns: SELECT (p. 101)
- Choosing Specific Columns (p. 102)
- More Than Column Names (p. 103)
- Specifying Tables: The FROM Clause Table List (p. 114)
- Using Table Aliases (p. 114)
- Skipping FROM (p. 115)
- Selecting Rows: The WHERE Clause (p. 116)
- Comparison Operators (p. 117)
- Connecting Conditions with Logical Operators (p. 120)
- Ranges (BETWEEN and NOT BETWEEN) (p. 127)
- Lists (IN and NOT IN) (p. 130)
- Selecting Null Values (p. 131)
- Matching Character Strings: LIKE (p. 134)
- Like, Is IN LIKE Equals...? (p. 139)
- Summary (p. 142)
- Chapter 5 Sorting Data and Other Selection Techniques (p. 143)
- In This Chapter (p. 143)
- A New Batch of SELECT Statement Clauses (p. 143)
- Sorting Query Results: ORDER BY (p. 144)
- ORDER BY Syntax (p. 144)
- Character Sets and Sort Orders (p. 146)
- Sorts Within Sorts (p. 148)
- Sort Up, Sort Down (p. 149)
- What About More Complex Expressions? (p. 150)
- How Do You Sort Nulls? (p. 154)
- Eliminating Duplicate Rows: DISTINCT and ALL (p. 155)
- DISTINCT Syntax (p. 157)
- DISTINCT with Multiple SELECT List Items (p. 158)
- Aggregate Functions (p. 162)
- Aggregate Syntax (p. 164)
- Summary (p. 173)
- Chapter 6 Grouping Data and Reporting from It (p. 175)
- In This Chapter (p. 175)
- Grouping and Aggregates (p. 175)
- The GROUP BY Clause (p. 175)
- GROUP BY Syntax (p. 176)
- Cautions and Restrictions (p. 178)
- NULLs and Groups (p. 182)
- GROUP BY: Aggregate Interactions (p. 186)
- GROUP BY with WHERE (p. 189)
- GROUP BY and ORDER BY (p. 191)
- The HAVING Clause (p. 192)
- Garden-Variety HAVING (p. 193)
- Where, Group by, Having, Order by (p. 197)
- All About NULLs (p. 197)
- NULLs and Database Design (p. 198)
- Comparisons Involving NULLs (p. 198)
- NULLs and Computations (p. 199)
- Defaults as Alternatives to NULLs (p. 201)
- Functions That Work with NULLs (p. 201)
- NULL Functions and "What-If" Calculations (p. 203)
- Summary (p. 203)
- Chapter 7 Joining Tables for Comprehensive Data Analysis (p. 205)
- In This Chapter (p. 205)
- Defining Joins (p. 205)
- Why Joins Are Necessary (p. 206)
- Associating Data from Separate Tables (p. 206)
- Providing Flexibility (p. 207)
- Getting a Good Join (p. 208)
- From/Where Join Syntax (p. 209)
- SQL-92 Join Syntax (p. 210)
- Analyzing a Join (p. 212)
- Improving the Readability of Join Results (p. 213)
- Avoiding Duplication (p. 213)
- Limiting the Width of the Display (p. 214)
- Using Aliases in the From Clause Table/View List (p. 216)
- Specifying Join Conditions (p. 218)
- Joins Based on Equality (p. 218)
- Joins Not Based on Equality (p. 220)
- Joining More Than Two Tables (p. 221)
- Exploring Exotic Joins (p. 222)
- Joining a Table with Itself: The Self-Join (p. 222)
- Showing the Background: Outer Joins (p. 225)
- Avoiding a Common Source of Errors (p. 230)
- Understanding the Cartesian Product (p. 230)
- Using the Cartesian Product (p. 232)
- Constraining the Cartesian Product (p. 233)
- Going Beyond Joins: Union, Intersect, Minus (p. 233)
- Union (p. 234)
- Intersect and Minus (p. 239)
- Summary (p. 241)
- Chapter 8 Structuring Queries with Subqueries (p. 243)
- In This Chapter (p. 243)
- What Is a Subquery? (p. 243)
- Simplified Subquery Syntax (p. 244)
- How Do Subqueries Work? (p. 244)
- Simple Subquery Processing (p. 245)
- Correlated Subquery Processing (p. 247)
- Simple-Correlated Performance Issues (p. 249)
- Joins or Subqueries? (p. 249)
- Subqueries! (p. 249)
- Joins! (p. 251)
- Subqueries vs. Self-Joins? (p. 251)
- Which Is Better? (p. 252)
- Subquery Rules (p. 252)
- Subqueries Returning Zero or More Values (p. 253)
- Subqueries Introduced with In (p. 254)
- Subqueries Introduced with not in (p. 256)
- Correlated Subqueries Introduced with in (p. 257)
- Subqueries Introduced with Comparison Operators and Any or All (p. 259)
- Subqueries Returning a Single Value (p. 266)
- Aggregate Functions Guarantee a Single Value (p. 267)
- Group By and Having Must Return a Single Value (p. 268)
- Correlated Subqueries with Comparison Operators (p. 269)
- Subqueries Testing Existence (p. 270)
- Not Exists Seeks the Empty Set (p. 273)
- Using Exists to Find Intersection and Difference (p. 274)
- Exists Alternatives (p. 275)
- Subqueries in Multiple Levels of Nesting (p. 276)
- Subqueries in Update, Delete, and Insert Statements (p. 277)
- Subqueries in from and Select Clauses (p. 278)
- Subqueries in the from Clause (p. 278)
- Subqueries in the Select Clause (p. 280)
- Summary (p. 282)
- Chapter 9 Creating and Using Views (p. 283)
- In This Chapter (p. 283)
- With a View Toward Flexibility (p. 283)
- View Commands (p. 284)
- Creating Views (p. 284)
- Displaying Data Through Views (p. 285)
- Dropping Views (p. 287)
- Advantages of Views (p. 287)
- Focus, Simplification, and Customization (p. 292)
- Security (p. 292)
- Independence (p. 292)
- How Views Work (p. 294)
- Naming View Columns (p. 296)
- Creating Views with Multiple Underlying Objects (p. 298)
- Resolving Views (p. 300)
- Data Modification Through Views (p. 306)
- The Rules According to ANSI (p. 306)
- Creating Copies of Data (p. 310)
- Summary (p. 312)
- Chapter 10 Security, Transactions, Performance, and Integrity (p. 315)
- In This Chapter (p. 315)
- Database Management in the Real World (p. 315)
- Data Security (p. 316)
- User Identification and Special Users (p. 317)
- The Grant and Revoke Commands (p. 320)
- Views as Security Mechanisms (p. 324)
- Transactions (p. 326)
- Transactions and Concurrency (p. 326)
- Transactions and Recovery (p. 327)
- User-Defined Transactions (p. 327)
- Performance (p. 330)
- Benchmarking (p. 331)
- Design and Indexing (p. 332)
- Optimizing Queries (p. 333)
- Other Tools for Monitoring and Boosting Performance (p. 336)
- Data Integrity (p. 338)
- Domain Constraints (p. 339)
- Entity Integrity (p. 341)
- Referential Integrity (p. 341)
- Stored Procedures and Triggers (p. 342)
- Summary (p. 343)
- Chapter 11 Solving Business Problems (p. 345)
- In This Chapter (p. 345)
- Using SQL on the Job (p. 345)
- Thinking Conditionally (p. 346)
- Case/Decode (p. 346)
- Changing Null Displays (p. 351)
- Formatting and Displaying Data (p. 353)
- Displaying One Column as Two (p. 353)
- Displaying Two Columns as One (p. 356)
- Converting from One Datatype to Another (p. 358)
- Playing with Patterns (p. 361)
- Matching Uppercase and Lowercase Letters (p. 361)
- Finding Data Within a Range When You Don't Know the Values (p. 363)
- Locating Date Data (p. 365)
- Displaying Data by Time Units (p. 369)
- Avoiding Mistakes (p. 370)
- Distinguishing Distincts (p. 371)
- Removing Duplicates (p. 375)
- Finding the "First" Entry (p. 377)
- Summary (p. 378)
- Appendix A Syntax Summary for the SQL Used in This Book (p. 379)
- In This Appendix (p. 379)
- Formatting (p. 379)
- Syntax Conventions (p. 380)
- Statement List (p. 380)
- Appendix B Industry SQL Equivalents (p. 381)
- In This Appendix (p. 381)
- Comparisons (p. 381)
- Naming Convention Comparison (p. 381)
- Datatype Comparison (p. 382)
- Function Comparison (p. 384)
- Character Functions (p. 384)
- Conditional Functions (p. 385)
- Date and Time Functions (p. 385)
- Appendix C Glossary (p. 387)
- Appendix D The bookbiz Sample Database (p. 403)
- In This Appendix (p. 403)
- Database Details (p. 403)
- Table Charts (p. 403)
- publishers Table (p. 403)
- authors Table (p. 404)
- titles Table (p. 405)
- titleauthors Table (p. 408)
- sales Table (p. 409)
- salesdetails Table (p. 410)
- editors Table (p. 411)
- titleditors Table (p. 412)
- roysched Table (p. 413)
- Create Statements for the bookbiz Database (p. 414)
- Adaptive Server Anywhere Creates (p. 415)
- Transact-SQL Creates (p. 418)
- Oracle Creates (p. 422)
- Informix Creates (p. 424)
- Insert Statements (p. 427)
- Create View Statements (p. 446)
- Appendix E Resources (p. 451)
- In This Appendix (p. 451)
- Books (p. 451)
- General (p. 451)
- Informix (p. 452)
- Microsoft SQL Server (p. 452)
- mSQL/MySQL (p. 452)
- Oracle (p. 453)
- Sybase (p. 453)
- Transact-SQL (p. 453)
- Web Sites (p. 454)
- Vendor Sites (p. 454)
- Other Links (p. 454)
- Newsgroups (p. 454)
- Index (p. 455)
Excerpt provided by Syndetics
Author notes provided by Syndetics
Judith S. Bowman has been a database professional since the early 1980s. She is currently an independent consultant specializing in SQL and relational database issues and is the author of Practical SQL: The Sequel (Addison-Wesley, 2001). Sandra L. Emerson is an independent consultant and former Vice President of Publishing Programs for Sybase. Marcy Darnovsky , teaches at colleges throughout the San Francisco Bay area. She was formerly at Sybase.
0201703092AB04062001