Disclaimer: Authors have full rights over their works. Reproduction of any part of the content is prohibited without prior authorization.
SUMMARY
Items Found: 429
- INTRODUCTION. 1
- About This Book. 1
- Foolish Assumptions. 2
- Icons Used in This Book. 2
- Beyond the Book. 3
- Where to Go from Here. 3
- PART 1: GETTING STARTED WITH SQL. 5
- CHAPTER 1: Relational Database Fundamentals. 7
- Keeping Track of Things. 8
- What Is a Database?. 9
- Database Size and Complexity 10
- What Is a Database Management System?. 10
- Flat Files 12
- Database Models. 13
- Relational model. 13
- Components of a relational database 14
- Dealing with your relations 14
- Enjoy the view 16
- Schemas, domains, and constraints. 18
- The object model challenged the relational model. 19
- The object-relational model. 20
- Database Design Considerations 20
- CHAPTER 2: SQL Fundamentals. 23
- What SQL Is and Isn’t 23
- A (Very) Little History. 25
- SQL Statements. 26
- Reserved Words. 28
- Data Types. 28
- Exact numerics. 29
- Approximate numerics. 31
- Character strings. 33
- Binary strings. 35
- Booleans. 36
- Datetimes. 36
- Intervals 38
- XML type. 38
- ROW types 41
- Collection types. 42
- vi SQL For Dummies
- REF types. 44
- User-defined types 44
- Data type summary. 48
- Null Values. 49
- Constraints. 50
- Using SQL in a Client/Server System 50
- The server. 51
- The client. 52
- Using SQL on the Internet or an Intranet 52
- CHAPTER 3: The Components of SQL. 55
- Data Definition Language. 56
- When “Just do it!” is not good advice 56
- Creating tables. 57
- A room with a view. 59
- Collecting tables into schemas 64
- Ordering by catalog. 65
- Getting familiar with DDL statements 66
- Data Manipulation Language. 68
- Value expressions. 68
- Predicates. 72
- Logical connectives. 73
- Set functions. 73
- Subqueries. 76
- Data Control Language. 76
- Transactions. 76
- Users and privileges. 77
- Referential integrity constraints can jeopardize your data. 80
- Delegating responsibility for security. 82
- PART 2: USING SQL TO BUILD DATABASES. 83
- CHAPTER 4: Building and Maintaining a Simple
- Database Structure. 85
- Using a RAD Tool to Build a Simple Database. 86
- Deciding what to track 86
- Creating a database table 87
- Altering the table structure. 93
- Creating an index. 95
- Deleting a table. 97
- Building POWER with SQL’s DDL. 98
- Using SQL with Microsoft Access 99
- Creating a table. 101
- Creating an index. 105
- Altering the table structure. 105
- Deleting a table. 106
- Deleting an index. 106
- Portability Considerations. 107
- CHAPTER 5: Building a Multi-table Relational Database. 109
- Designing a Database. 110
- Step 1: Defining objects 110
- Step 2: Identifying tables and columns 110
- Step 3: Defining tables 111
- Domains, character sets, collations, and translations. 115
- Getting into your database fast with keys. 116
- Working with Indexes. 119
- What’s an index, anyway?. 119
- Why you should want an index. 121
- Maintaining an index 121
- Maintaining Data Integrity. 122
- Entity integrity 122
- Domain integrity. 124
- Referential integrity. 124
- Just when you thought it was safe 127
- Potential problem areas. 128
- Constraints. 130
- Normalizing the Database. 134
- Modification anomalies and normal forms. 134
- First normal form. 136
- Second normal form. 137
- Third normal form. 138
- Domain-key normal form (DK/NF) 139
- Abnormal form 140
- PART 3: STORING AND RETRIEVING DATA 141
- CHAPTER 6: Manipulating Database Data. 143
- Retrieving Data 144
- Creating Views. 145
- From tables. 146
- With a selection condition. 147
- With a modified attribute. 148
- Updating Views 149
- Adding New Data. 150
- Adding data one row at a time 151
- Adding data only to selected columns. 152
- Adding a block of rows to a table. 152
- Updating Existing Data. 155
- Transferring Data 158
- Deleting Obsolete Data. 161
- CHAPTER 7: Handling Temporal Data. 163
- Understanding Times and Periods. 164
- Working with Application-Time Period Tables 165
- Designating primary keys in application-time period tables. 168
- Applying referential integrity constraints to
- application-time period tables. 169
- Querying application-time period tables. 170
- Working with System-Versioned Tables. 171
- Designating primary keys in system-versioned tables. 173
- Applying referential integrity constraints to
- system-versioned tables. 174
- Querying system-versioned tables. 174
- Tracking Even More Time Data with Bitemporal Tables. 175
- Formatting and Parsing Dates and Times. 176
- CHAPTER 8: Specifying Values. 179
- Values. 179
- Row values. 180
- Literal values 180
- Variables. 182
- Special variables 184
- Column references. 185
- Value Expressions. 186
- String value expressions. 186
- Numeric value expressions. 187
- Datetime value expressions. 187
- Interval value expressions. 188
- Conditional value expressions. 189
- Functions 189
- Set functions. 189
- Value functions 193
- Table functions 208
- CHAPTER 9: Using Advanced SQL Value Expressions. 209
- CASE Conditional Expressions. 210
- Using CASE with search conditions. 211
- Using CASE with values. 212
- A special CASE — NULLIF. 215
- Another special CASE — COALESCE. 216
- CAST Data-Type Conversions. 217
- Using CAST within SQL. 219
- Using CAST between SQL and the host language. 220
- Row Value Expressions. 221
- CHAPTER 10: Zeroing In on the Data You Want. 223
- Modifying Clauses. 224
- FROM Clauses 225
- WHERE Clauses 226
- Comparison predicates 227
- BETWEEN 228
- IN and NOT IN 229
- LIKE and NOT LIKE. 231
- SIMILAR. 232
- NULL. 232
- ALL, SOME, ANY. 234
- EXISTS. 236
- UNIQUE. 237
- DISTINCT. 238
- OVERLAPS. 238
- MATCH 239
- Referential integrity rules and the MATCH predicate 240
- Logical Connectives. 243
- AND. 243
- OR 244
- NOT. 244
- GROUP BY Clauses 245
- HAVING Clauses. 247
- ORDER BY Clauses. 248
- Limited FETCH. 250
- Peering through a Window to Create a Result Set. 251
- Partitioning a window into buckets with NTILE. 252
- Navigating within a window. 253
- Nesting window functions. 255
- Evaluating groups of rows. 256
- Row pattern recognition. 257
- CHAPTER 11: Using Relational Operators. 259
- UNION. 259
- The UNION ALL operation. 261
- The CORRESPONDING operation. 262
- INTERSECT 262
- EXCEPT 264
- x SQL For Dummies
- Join Operators. 265
- Basic join. 265
- Equi-join 267
- Cross join 269
- Natural join. 270
- Condition join. 270
- Column-name join. 271
- Inner join. 272
- Outer join. 272
- Union join. 276
- ON versus WHERE. 282
- CHAPTER 12: Delving Deep with Nested Queries. 283
- What Subqueries Do. 285
- Nested queries that return sets of rows 285
- Nested queries that return a single value. 289
- The ALL, SOME, and ANY quantifiers. 292
- Nested queries that are an existence test. 293
- Other correlated subqueries. 295
- UPDATE, DELETE, and INSERT. 299
- Retrieving changes with pipelined DML. 301
- CHAPTER 13: Recursive Queries. 303
- What Is Recursion? 303
- Houston, we have a problem. 305
- Failure is not an option. 305
- What Is a Recursive Query?. 306
- Where Might You Use a Recursive Query?. 306
- Querying the hard way. 308
- Saving time with a recursive query. 309
- Where Else Might You Use a Recursive Query?. 311
- PART 4: CONTROLLING OPERATIONS. 313
- CHAPTER 14: Providing Database Security 315
- The SQL Data Control Language. 316
- User Access Levels. 316
- The database administrator. 317
- Database object owners. 317
- The public. 318
- Granting Privileges to Users. 318
- Roles 320
- Inserting data. 320
- Looking at data 321
- Modifying table data. 321
- Deleting obsolete rows from a table 322
- Referencing related tables. 322
- Using domains. 323
- Causing SQL statements to be executed. 325
- Granting Privileges across Levels. 325
- Granting the Power to Grant Privileges. 327
- Taking Privileges Away. 328
- Using GRANT and REVOKE Together to Save Time and Effort 329
- CHAPTER 15: Protecting Data. 331
- Threats to Data Integrity 332
- Platform instability 332
- Equipment failure. 332
- Concurrent access. 333
- Reducing Vulnerability to Data Corruption. 336
- Using SQL transactions. 336
- The default transaction. 338
- Isolation levels. 338
- The implicit transaction-starting statement 341
- SET TRANSACTION. 341
- COMMIT 342
- ROLLBACK. 342
- Locking database objects. 343
- Backing up your data 343
- Savepoints and subtransactions. 344
- Constraints Within Transactions. 345
- Avoiding SQL Injection Attacks 350
- CHAPTER 16: Using SQL within Applications. 351
- SQL in an Application. 352
- Keeping an eye out for the asterisk 352
- SQL strengths and weaknesses. 353
- Procedural languages’ strengths and weaknesses. 353
- Problems in combining SQL with a procedural language. 353
- Hooking SQL into Procedural Languages 354
- Embedded SQL 355
- Module language. 358
- Object-oriented RAD tools. 360
- Using SQL with Microsoft Access 361
- PART 5: TAKING SQL TO THE REAL WORLD. 365
- CHAPTER 17: Accessing Data with ODBC and JDBC. 367
- ODBC. 368
- The ODBC interface. 368
- Components of ODBC. 369
- ODBC in a Client/Server Environment. 370
- ODBC and the Internet. 370
- Server extensions 371
- Client extensions. 372
- ODBC and an Intranet. 373
- JDBC. 373
- CHAPTER 18: Operating on XML Data with SQL. 377
- How XML Relates to SQL 377
- The XML Data Type. 378
- When to use the XML type. 379
- When not to use the XML type 380
- Mapping SQL to XML and XML to SQL. 380
- Mapping character sets 381
- Mapping identifiers. 381
- Mapping data types. 382
- Mapping tables 382
- Handling null values. 383
- Generating the XML Schema. 384
- SQL Functions That Operate on XML Data 385
- XMLDOCUMENT. 385
- XMLELEMENT. 385
- XMLFOREST 386
- XMLCONCAT. 386
- XMLAGG 387
- XMLCOMMENT. 388
- XMLPARSE. 388
- XMLPI. 388
- XMLQUERY. 389
- XMLCAST. 389
- Predicates. 390
- DOCUMENT. 390
- CONTENT 390
- XMLEXISTS 390
- VALID. 391
- Transforming XML Data into SQL Tables. 392
- Mapping Non-Predefined Data Types to XML. 393
- Domain. 393
- Distinct UDT. 394
- Row. 395
- Array 396
- Multiset. 397
- The Marriage of SQL and XML. 398
- CHAPTER 19: SQL and JSON. 399
- Using JSON with SQL. 400
- Ingesting and storing JSON data into a relational database. 400
- Generating JSON data from relational data. 400
- Querying JSON data stored in relational tables 400
- The SQL/JSON Data Model. 401
- SQL/JSON items. 401
- SQL/JSON sequences 402
- Parsing JSON. 402
- Serializing JSON. 402
- SQL/JSON Functions. 403
- JSON API common syntax. 403
- Query functions. 404
- Constructor functions. 408
- IS JSON predicate. 411
- JSON nulls and SQL nulls 411
- SQL/JSON Path Language. 411
- There’s More 412
- PART 6: ADVANCED TOPICS. 413
- CHAPTER 20: Stepping through a Dataset with Cursors. 415
- Declaring a Cursor. 416
- Query expression 417
- ORDER BY clause. 417
- Updatability clause. 419
- Sensitivity. 419
- Scrollability. 420
- Opening a Cursor 421
- Fetching Data from a Single Row 422
- Syntax. 423
- Orientation of a scrollable cursor. 424
- Positioned DELETE and UPDATE statements. 424
- Closing a Cursor. 425
- xiv SQL For Dummies
- CHAPTER 21: Adding Procedural Capabilities with
- Persistent Stored Modules. 427
- Compound Statements 428
- Atomicity. 429
- Variables. 430
- Cursors. 430
- Conditions. 431
- Handling conditions 431
- Conditions that aren’t handled. 434
- Assignment. 434
- Flow of Control Statements. 435
- IF. THEN. ELSE. END IF. 435
- CASE. END CASE. 435
- LOOP. ENDLOOP 437
- LEAVE. 437
- WHILE. DO. END WHILE 438
- REPEAT. UNTIL. END REPEAT. 438
- FOR. DO. END FOR. 439
- ITERATE. 439
- Stored Procedures. 440
- Stored Functions. 442
- Privileges. 442
- Stored Modules. 443
- CHAPTER 22: Handling Errors. 445
- SQLSTATE. 445
- WHENEVER Clause. 447
- Diagnostics Areas 448
- Diagnostics header area. 449
- Diagnostics detail area. 450
- Constraint violation example. 452
- Adding constraints to an existing table. 453
- Interpreting the information returned by SQLSTATE. 454
- Handling Exceptions. 455
- CHAPTER 23: Triggers. 457
- Examining Some Applications of Triggers. 457
- Creating a Trigger 458
- Statement and row triggers. 459
- When a trigger fires. 459
- The triggered SQL statement. 459
- An example trigger definition 460
- Firing a Succession of Triggers 460
- Referencing Old Values and New Values. 461
- Firing Multiple Triggers on a Single Table 462
- PART 7: THE PARTS OF TENS. 463
- CHAPTER 24: Ten Common Mistakes. 465
- Assuming That Your Clients Know What They Need 465
- Ignoring Project Scope. 466
- Considering Only Technical Factors. 466
- Not Asking for Client Feedback. 466
- Always Using Your Favorite Development Environment. 467
- Using Your Favorite System Architecture Exclusively. 467
- Designing Database Tables in Isolation. 467
- Neglecting Design Reviews 468
- Skipping Beta Testing. 468
- Not Documenting Your Process 468
- CHAPTER 25: Ten Retrieval Tips. 469
- Verify the Database Structure. 470
- Try Queries on a Test Database 470
- Double-Check Queries That Include Joins. 470
- Triple-Check Queries with Subselects 470
- Summarize Data with GROUP BY. 471
- Watch GROUP BY Clause Restrictions 471
- Use Parentheses with AND, OR, and NOT. 471
- Control Retrieval Privileges 472
- Back Up Your Databases Regularly. 472
- Handle Error Conditions Gracefully. 472
- APPENDIX: ISO/IEC SQL: 2016 RESERVED WORDS 473
- INDEX 479