| 000 | 07628nam a22001457a 4500 | ||
|---|---|---|---|
| 999 |
_c6589 _d6589 |
||
| 020 | _a9789332523852 | ||
| 082 |
_a005.756 _bDUB |
||
| 100 | _aDuBois, Paul | ||
| 245 | _aMySQL | ||
| 250 | _aFifth Edition | ||
| 260 |
_aUttar Pradesh, India: _bPearson India Education Services Pvt. Ltd., _c2020. |
||
| 300 |
_axx, 1153p. _bIncludes Index |
||
| 505 | _aTable of Contents Introduction 1 Why Choose MySQL? 2 What You Can Expect from This Book 4 Road Map to This Book 4 Part I: General MySQL Use 4 Part II: Using MySQL Programming Interfaces 5 Part III: MySQL Administration 5 Part IV: Appendixes 6 How to Read This Book 6 Versions of Software Covered in This Book 7 Conventions Used in This Book 9 Additional Resources 9 Part I: General MySQL Use 1 Getting Started with MySQL 11 1.1 How MySQL Can Help You 11 1.2 A Sample Database 14 1.2.1 The U.S. Historical League Project 15 1.2.2 The Grade-Keeping Project 17 1.2.3 How the Sample Database Applies to You 17 1.3 Basic Database Terminology 18 1.3.1 Structural Terminology 18 1.3.2 Query Language Terminology 20 1.3.3 MySQL Architectural Terminology 21 1.4 A MySQL Tutorial 22 1.4.1 Obtaining the Sample Database Distribution 23 1.4.2 Preliminary Requirements 23 1.4.3 Establishing and Terminating Connections to the MySQL Server 25 1.4.4 Executing SQL Statements 27 1.4.5 Creating a Database 30 1.4.6 Creating Tables 31 1.4.7 Adding New Rows 49 1.4.8 Resetting the sampdb Database to a Known State 53 1.4.9 Retrieving Information 54 1.4.10 Deleting or Updating Existing Rows 85 1.5 Tips for Interacting with mysql 87 1.5.1 Simplifying the Connection Process 87 1.5.2 Issuing Statements with Less Typing 00 1.6 Where to Now? 94 2 Using SQL to Manage Data 95 2.1 The Server SQL Mode 96 2.2 MySQL Identifier Syntax and Naming Rules 97 2.3 Case Sensitivity in SQL Statements 99 2.4 Character Set Support 101 2.4.1 Specifying Character Sets 102 2.4.2 Determining Character Set Availability and Current Settings 103 2.4.3 Unicode Support 104 2.5 Selecting, Creating, Dropping, and Altering Databases 105 2.5.1 Selecting Databases 105 2.5.2 Creating Databases 106 2.5.3 Dropping Databases 107 2.5.4 Altering Databases 107 2.6 Creating, Dropping, Indexing, and Altering Tables 107 2.6.1 Storage Engine Characteristics 108 2.6.2 Creating Tables 113 2.6.3 Dropping Tables 121 2.6.4 Indexing Tables 122 2.6.5 Altering Table Structure 127 2.7 Obtaining Database Metadata 130 2.7.1 Obtaining Metadata with SHOW 130 2.7.2 Obtaining Metadata with INFORMATION SCHEMA 132 2.7.3 Obtaining Metadata from the Command Line 135 2.8 Performing Multiple-Table Retrievals with Joins 136 2.8.1 Inner Joins 137 2.8.2 Qualifying References to Columns from Joined Tables 139 2.8.3 Left and Right (Outer) Joins 139 2.9 Performing Multiple-Table Retrievals with Subqueries 143 2.9.1 Subqueries with Relative Comparison Operators 144 2.9.2 IN and NOT IN Subqueries 145 2.9.3 ALL, ANY, and SOME Subqueries 146 2.9.4 EXISTS and NOT EXISTS Subqueries 147 2.9.5 Correlated Subqueries 148 2.9.6 Subqueries in the FROM Clause 149. 2.9.7 Rewriting Subqueries as Joins 149 2.10 Performing Multiple-Table Retrievals with UNION 151 2.11 Multiple-Table Deletes and Updates 154 2.12 Performing Transactions 156 2.12.1 Using Transactions to Ensure Safe Statement Execution 157 2.12.2 Using Transaction Savepoints 161 2.12.3 Transaction Isolation 162 2.13 Foreign Keys and Referential Integrity 164 2.14 Using FULLTEXT Searches 170 2.14.1 Natural Language FULLTEXT Searches 172 2.14.2 Boolean Mode FULLTEXT Searches 174 2.14.3 Query Expansion FULLTEXT Searches 175 2.14.4 Configuring the FULLTEXT Search Engine 176 3 Data Types 179 3.1 Data Value Categories 181 3.1.1 Numeric Values 181 3.1.2 String Values 182 3.1.3 Temporal (Date and Time) Values 191 3.1.4 Spatial Values 191 3.1.5 Boolean Values 192 3.1.6 The NULL Value 192 3.2 MySQL Data Types 192 3.2.1 Data Type Overview 193 3.2.2 Specifying Column Types in Table Definitions 194 3.2.3 Specifying Column Default Values 196 3.2.4 Numeric Data Types 196 3.2.5 String Data Types 204 3.2.6 Temporal (Date and Time) Data Types 218 3.3 How MySQL Handles Invalid Data Values 228 3.4.1 General AUTO_INCREMENT Properties 230 3.4 Working with Sequences 230 3.4.2 Storage Engine-Specific AUTO_INCREMENT Properties 232 3.4.3 Issues to Consider with AUTO_INCREMENT Columns 235 3.4.4 Tips for Working with AUTO INCREMENT Columns 235 3.4.5 Generating Sequences Without AUTO INCREMENT 237 3.5 Expression Evaluation and Type Conversion 239 3.5.1 Writing Expressions 240 3.5.2 Type Conversion 247 3.6 Choosing Data Types 255 3.6.1 What Kind of Values Will the Column Hold? 257 3.6.2 Do Your Values Lie Within Some Particular Range? 259 4 Views and Stored Programs 261 4.1 Using Views 262 4.2 Using Stored Programs 265 4.2.1 Compound Statements and Statement Delimiters 266 4.2.2 Stored Functions and Procedures 268 4.2.3 Triggers 272 4.2.4 Events 274 275 4.3 Security for Views and Stored Programs 5 Query Optimization 277 5.1 Using Indexing 277 5.1.1 Benefits of Indexing 278 5.1.2 Costs of Indexing 281 5.1.3 Choosing Indexes 281 5.2 The MySQL Query Optimizer 285 5.2.1. How the Optimizer Works 286 5.2.2 Using EXPLAIN to Check Optimizer Operation 290 5.3 Choosing Data Types for Efficient Queries 296 5.4 Choosing Table Storage Formats for Efficient Queries 299 5.5 Loading Data Efficiently 300 5.6 Scheduling, Locking, and Concurrency 303 Part II: Using MySQL Programming Interfaces 6 Introduction to MySQL Programming 6.1 Why Write Your Own MySQL Programs? 307 6.2 APIs Available for MySQL 310 307 6.2.1 The C API 311 6.2.2 The Perl DBI API 311 6.2.3 The PHP ΑΡΙ 313 6.3 Choosing an API 314 6.3.1 Execution Environment 314 6.3.2 Performance 315 6.3.3 Development Time 316 6.3.4 Portability 317 7 Writing MySQL Programs Using C 319 7.1 Compiling and Linking Client Programs 320 7.2 Connecting to the Server 323 327 7.3 Handling Errors and Processing Command Options 7.3.1 Checking for Errors 327 7.3.2 Getting Connection Parameters at Runtime 330 7.3.3 Incorporating Option Processing into a Client Program 344 7.4 Processing SQL Statements 348 7.4.1 Handling Statements That Modify Rows 350 7.4.2 Handling Statements That Return a Result Set 351 7.4.3 A General-Purpose Statement Handler 354 7.4.4 Alternative Approaches to Statement Processing 356 7.4.6 Using Result Set Metadata 359 357 7.4.5 mysql_store_result() Versus mysql_use_result() 7.4.7 Encoding Special Characters and Binary Data 364 7.5 An Interactive Statement-Execution Program 368 7.6 Writing Clients That Include SSL Support 370 7.7 Using Multiple-Statement Execution 375 7.8 Using Server-Side Prepared Statements 377 7.9 Using Prepared CALL Support 389 8 Writing MySQL Programs Using Perl DBI 395 8.1 Perl Script Characteristics 396 8.2 Perl DBI Overview 396 8.2.1 DBI Data Types 396 8.2.2 A Simple DBI Script 397 8.2.3 Handling Errors 402 8.2.4 Handling Statements That Modify Rows 406 8.2.5 Handling Statements That Return a Result Set 407 8.2.6 Quoting Special Characters in Statement Strings 416 | ||
| 942 | _cBK | ||