{"product_id":"9780768690392","title":"Sams Teach Yourself SQL in One Hour a Day","description":"\u003cp\u003eThe Fifth Edition of \u003ci\u003eSams Teach Yourself SQL in 21 Days\u003c\/i\u003e \u003c\/p\u003e\u003cp\u003eMore than 48,000 sold!\u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003eIn just one hour a day, you’ll have all the skills you need to begin creating effective SQL queries, reports, and database applications. With this complete tutorial, you’ll quickly master the basics and then move on to more advanced features and concepts:\u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e \u003c\/p\u003e\u003cul\u003e \u003cli\u003eQuickly apply essential SQL techniques in useful, real-world queries \u003c\/li\u003e\n\u003cli\u003eDesign trustworthy, high-performance databases \u003c\/li\u003e\n\u003cli\u003eManipulate your data with views and transactions \u003c\/li\u003e\n\u003cli\u003eLeverage powerful features including stored procedures, triggers, and cursors \u003c\/li\u003e\n\u003cli\u003eWork with new objects introduced with the latest SQL standards \u003c\/li\u003e\n\u003cli\u003eGet practical, expert tips on implementing SQL in your business environment\u003c\/li\u003e \u003c\/ul\u003e \u003cp\u003e\u003c\/p\u003e\u003cp\u003eLearn on your own time, at your own pace \u003c\/p\u003e\u003cp\u003e \u003c\/p\u003e\u003cul\u003e \u003cli\u003eNo previous SQL or database experience required \u003c\/li\u003e\n\u003cli\u003eLearn techniques that work with any current version of SQL \u003c\/li\u003e\n\u003cli\u003eDiscover how to write faster, more efficient queries \u003c\/li\u003e\n\u003cli\u003eSecure your data using best practices from experienced database administrators \u003c\/li\u003e\n\u003cli\u003eBuild more powerful databases with features exclusive to Oracle SQL*Plus, Oracle PL\/SQL, and Microsoft Transact-SQL \u003c\/li\u003e\n\u003cli\u003eWrite queries for the free, open source MySQL database \u003c\/li\u003e\n\u003cli\u003eEmbed your SQL code in other applications\u003c\/li\u003e \u003c\/ul\u003e \u003cp\u003e\u003c\/p\u003e\u003cp\u003eRyan Stephens and Ron Plew are President and VP of Perpetual Technologies, Inc. (PTI) in Indianapolis, IN, providing managed services and consulting for top database implementations running Oracle, SQL Server, and other leading technologies. They taught for 5+ years as adjunct professors at Indiana University-Purdue University. Their books include \u003ci\u003eSams Teach Yourself SQL in 24 Hours\u003c\/i\u003e, First through Fourth Editions, \u003ci\u003eSams Teach Yourself SQL in 21 Days\u003c\/i\u003e, Second through Fourth Editions, and \u003ci\u003eDatabase Design\u003c\/i\u003e. \u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003eTable of Contents \u003c\/b\u003e \u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003eIntroduction 1\u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003ePART I: Introducing SQL \u003c\/b\u003e \u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003eLESSON 1: Getting Started with SQL 5\u003c\/b\u003e \u003c\/p\u003e\u003cp\u003eA Brief History of SQL 5\u003c\/p\u003e\u003cp\u003eA Brief History of Databases 6\u003c\/p\u003e\u003cp\u003eToday’s Database Landscape 11\u003c\/p\u003e\u003cp\u003eA Cross-Product Language 12\u003c\/p\u003e\u003cp\u003eEarly Implementations 12\u003c\/p\u003e\u003cp\u003eSQL and Client\/Server Application Development 13\u003c\/p\u003e\u003cp\u003eAn Overview of SQL 13\u003c\/p\u003e\u003cp\u003ePopular SQL Implementations 14\u003c\/p\u003e\u003cp\u003eMySQL 14\u003c\/p\u003e\u003cp\u003eOracle 14\u003c\/p\u003e\u003cp\u003eMicrosoft SQL Server and Sybase 15\u003c\/p\u003e\u003cp\u003eIBM DB2 16\u003c\/p\u003e\u003cp\u003eOpen Database Connectivity 16\u003c\/p\u003e\u003cp\u003eEmbedding SQL in Application Programming 17\u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003eLESSON 2: Introducing the Query 21\u003c\/b\u003e \u003c\/p\u003e\u003cp\u003eExploring SQL’s Background 21\u003c\/p\u003e\u003cp\u003eLearning Basic Query Syntax 22\u003c\/p\u003e\u003cp\u003eThe Building Blocks of Data Retrieval: SELECT and FROM 23\u003c\/p\u003e\u003cp\u003eApplying Query Concepts 25\u003c\/p\u003e\u003cp\u003eWriting Your First Query 26\u003c\/p\u003e\u003cp\u003eTerminating a SQL Statement 28\u003c\/p\u003e\u003cp\u003eSelecting Individual Columns 28\u003c\/p\u003e\u003cp\u003eChanging the Order of the Columns 29\u003c\/p\u003e\u003cp\u003eSelecting Different Tables 31\u003c\/p\u003e\u003cp\u003eSelecting Distinct Values 31\u003c\/p\u003e\u003cp\u003eExercises 37\u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003eLESSON 3: Expressions, Conditions, and Operators 39\u003c\/b\u003e \u003c\/p\u003e\u003cp\u003eWorking with Query Expressions 40\u003c\/p\u003e\u003cp\u003ePlacing Conditions on Queries 40\u003c\/p\u003e\u003cp\u003eLearning How to Use Operators 42\u003c\/p\u003e\u003cp\u003eArithmetic Operators 42\u003c\/p\u003e\u003cp\u003eComparison Operators 55\u003c\/p\u003e\u003cp\u003eCharacter Operators 63\u003c\/p\u003e\u003cp\u003eLogical Operators 70\u003c\/p\u003e\u003cp\u003eSet Operators 75\u003c\/p\u003e\u003cp\u003eMiscellaneous Operators: IN and BETWEEN 78\u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003eLESSON 4: Clauses in SQL Queries 85\u003c\/b\u003e \u003c\/p\u003e\u003cp\u003eSpecifying Criteria with the WHERE Clause 87\u003c\/p\u003e\u003cp\u003eOrder from Chaos: The ORDER BY Clause 89\u003c\/p\u003e\u003cp\u003eThe GROUP BY Clause 98\u003c\/p\u003e\u003cp\u003eThe HAVING Clause 105\u003c\/p\u003e\u003cp\u003eCombining Clauses 112\u003c\/p\u003e\u003cp\u003eExample 4.1 112\u003c\/p\u003e\u003cp\u003eExample 4.2 113\u003c\/p\u003e\u003cp\u003eExample 4.3 113\u003c\/p\u003e\u003cp\u003eExample 4.4 115\u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003eLESSON 5: Joining Tables 121\u003c\/b\u003e \u003c\/p\u003e\u003cp\u003eJoining Multiple Tables in a Single SELECT Statement 121\u003c\/p\u003e\u003cp\u003eCross Joining Tables 123\u003c\/p\u003e\u003cp\u003eFinding the Correct Column 128\u003c\/p\u003e\u003cp\u003eJoining Tables Based on Equality 129\u003c\/p\u003e\u003cp\u003eJoining Tables Based on Nonequality 137\u003c\/p\u003e\u003cp\u003eOUTER JOINs Versus INNER JOINs 139\u003c\/p\u003e\u003cp\u003eJoining a Table to Itself: The Self Join 143\u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003eLESSON 6: Embedding Subqueries into Queries 151\u003c\/b\u003e \u003c\/p\u003e\u003cp\u003eBuilding a Subquery 153\u003c\/p\u003e\u003cp\u003eUsing Aggregate Functions with Subqueries 160\u003c\/p\u003e\u003cp\u003eNesting Subqueries 162\u003c\/p\u003e\u003cp\u003eReferencing Outside with Correlated Subqueries 166\u003c\/p\u003e\u003cp\u003eUsing EXISTS, ANY, and ALL 169\u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003eLESSON 7: Molding Data with Built-in Functions 179\u003c\/b\u003e \u003c\/p\u003e\u003cp\u003eUsing Aggregate Functions to Summarize Data 180\u003c\/p\u003e\u003cp\u003eCOUNT 180\u003c\/p\u003e\u003cp\u003eSUM 181\u003c\/p\u003e\u003cp\u003eAVG 182\u003c\/p\u003e\u003cp\u003eMAX 184\u003c\/p\u003e\u003cp\u003eMIN 185\u003c\/p\u003e\u003cp\u003eVARIANCE 186\u003c\/p\u003e\u003cp\u003eSTDDEV 186\u003c\/p\u003e\u003cp\u003eUsing Functions to Format Date and Time Values 187\u003c\/p\u003e\u003cp\u003eADD_MONTHS\/ADD_DATE 188\u003c\/p\u003e\u003cp\u003eLAST_DAY 190\u003c\/p\u003e\u003cp\u003eMONTHS_BETWEEN 191\u003c\/p\u003e\u003cp\u003eNEXT_DAY 193\u003c\/p\u003e\u003cp\u003eSYSDATE 193\u003c\/p\u003e\u003cp\u003eUsing Functions for Arithmetic Operations 195\u003c\/p\u003e\u003cp\u003eABS 195 \u003c\/p\u003e\u003cp\u003eCEIL and FLOOR 196\u003c\/p\u003e\u003cp\u003eEXP 196 \u003c\/p\u003e\u003cp\u003eLN and LOG 197\u003c\/p\u003e\u003cp\u003eMOD 198 \u003c\/p\u003e\u003cp\u003ePOWER 199\u003c\/p\u003e\u003cp\u003eSIGN 199 \u003c\/p\u003e\u003cp\u003eSQRT 200\u003c\/p\u003e\u003cp\u003eUsing Functions to Modify the Appearance of Character Values 201\u003c\/p\u003e\u003cp\u003eCHR 201 \u003c\/p\u003e\u003cp\u003eCONCAT 202\u003c\/p\u003e\u003cp\u003eINITCAP 203\u003c\/p\u003e\u003cp\u003eLOWER and UPPER 203\u003c\/p\u003e\u003cp\u003eLPAD and RPAD 205\u003c\/p\u003e\u003cp\u003eLTRIM and RTRIM 206\u003c\/p\u003e\u003cp\u003eREPLACE 207\u003c\/p\u003e\u003cp\u003eSUBSTR 209\u003c\/p\u003e\u003cp\u003eTRANSLATE 213\u003c\/p\u003e\u003cp\u003eINSTR 214\u003c\/p\u003e\u003cp\u003eLENGTH 214\u003c\/p\u003e\u003cp\u003eConversion Functions 215\u003c\/p\u003e\u003cp\u003eTO_CHAR 215\u003c\/p\u003e\u003cp\u003eTO_NUMBER 217\u003c\/p\u003e\u003cp\u003eMiscellaneous Functions 217\u003c\/p\u003e\u003cp\u003eGREATEST and LEAST 217\u003c\/p\u003e\u003cp\u003eUSER 218\u003c\/p\u003e\u003cp\u003eSupplemental Examples of MySQL Character Functions 219\u003c\/p\u003e\u003cp\u003eLENGTH 219\u003c\/p\u003e\u003cp\u003eLOCATE 219\u003c\/p\u003e\u003cp\u003eINSTR 220\u003c\/p\u003e\u003cp\u003eLPAD 220\u003c\/p\u003e\u003cp\u003eRPAD 220\u003c\/p\u003e\u003cp\u003eLEFT 220\u003c\/p\u003e\u003cp\u003eRIGHT 221\u003c\/p\u003e\u003cp\u003eSUBSTRING 221\u003c\/p\u003e\u003cp\u003eLTRIM 221\u003c\/p\u003e\u003cp\u003eRTRIM 222\u003c\/p\u003e\u003cp\u003eTRIM 222\u003c\/p\u003e\u003cp\u003eSupplemental Examples of MySQL Date Functions 222\u003c\/p\u003e\u003cp\u003eDATE_FORMAT 223\u003c\/p\u003e\u003cp\u003eTIME_FORMAT 224\u003c\/p\u003e\u003cp\u003eCURDATE 224\u003c\/p\u003e\u003cp\u003eCURTIME 225\u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003ePART II: Database Design \u003c\/b\u003e \u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003eLESSON 8: Database Normalization 229\u003c\/b\u003e \u003c\/p\u003e\u003cp\u003eNormalizing a Database 229\u003c\/p\u003e\u003cp\u003eThe Raw Database 229\u003c\/p\u003e\u003cp\u003eLogical Database Design 230\u003c\/p\u003e\u003cp\u003eThe Needs of the End User 230\u003c\/p\u003e\u003cp\u003eData Redundancy 231\u003c\/p\u003e\u003cp\u003eUnderstanding the Normal Forms 231\u003c\/p\u003e\u003cp\u003eThe First Normal Form 232\u003c\/p\u003e\u003cp\u003eThe Second Normal Form 233\u003c\/p\u003e\u003cp\u003eThe Third Normal Form 234\u003c\/p\u003e\u003cp\u003eMaking Normalization Work 235\u003c\/p\u003e\u003cp\u003eReferential Integrity 235\u003c\/p\u003e\u003cp\u003eBenefits of Normalization 236\u003c\/p\u003e\u003cp\u003eDrawbacks of Normalization 237\u003c\/p\u003e\u003cp\u003eDenormalizing a Database 237\u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003eLESSON 9: Creating and Maintaining Tables 241\u003c\/b\u003e \u003c\/p\u003e\u003cp\u003eBeginning with the CREATE DATABASE Statement 242\u003c\/p\u003e\u003cp\u003eCREATE DATABASE Options 243\u003c\/p\u003e\u003cp\u003eDatabase Design 244\u003c\/p\u003e\u003cp\u003eCreating a Data Dictionary (System Catalog) 244\u003c\/p\u003e\u003cp\u003eCreating Key Fields 246\u003c\/p\u003e\u003cp\u003eDefining Tables with the CREATE TABLE Statement 247\u003c\/p\u003e\u003cp\u003eThe Table Name 248\u003c\/p\u003e\u003cp\u003eThe Field Name 249\u003c\/p\u003e\u003cp\u003eThe Field’s Data Type 249\u003c\/p\u003e\u003cp\u003eTable Storage and Sizing 254\u003c\/p\u003e\u003cp\u003eCreating a Table from an Existing Table 255\u003c\/p\u003e\u003cp\u003eModifying Table Structures with the ALTER TABLE Statement 257\u003c\/p\u003e\u003cp\u003eThe DROP TABLE Statement 261\u003c\/p\u003e\u003cp\u003eThe DROP DATABASE Statement 262\u003c\/p\u003e\u003cp\u003eWorking with DROP TABLE and DROP DATABASE 262\u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003eLESSON 10: Controlling Data Integrity 267\u003c\/b\u003e \u003c\/p\u003e\u003cp\u003eIntroducing Constraints 267\u003c\/p\u003e\u003cp\u003eData Integrity 267\u003c\/p\u003e\u003cp\u003eWhy Use Constraints? 268\u003c\/p\u003e\u003cp\u003eExploring Types of Constraints 269\u003c\/p\u003e\u003cp\u003eNOT NULL Constraints 269\u003c\/p\u003e\u003cp\u003ePrimary Key Constraints 271\u003c\/p\u003e\u003cp\u003eUnique Constraints 273\u003c\/p\u003e\u003cp\u003eForeign Key Constraints 274\u003c\/p\u003e\u003cp\u003eCheck Constraints 276\u003c\/p\u003e\u003cp\u003eManaging Constraints 277\u003c\/p\u003e\u003cp\u003eUsing the Right Order 278\u003c\/p\u003e\u003cp\u003eDifferent Approaches to Creating Constraints 279\u003c\/p\u003e\u003cp\u003eExample Oracle Referential Integrity Reports 279\u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003ePART III: Data Manipulation \u003c\/b\u003e \u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003eLESSON 11: Manipulating Data 285\u003c\/b\u003e \u003c\/p\u003e\u003cp\u003eIntroducing Data-Manipulation Statements 285\u003c\/p\u003e\u003cp\u003eEntering Data with the INSERT Statement 286\u003c\/p\u003e\u003cp\u003eEntering One Record with the INSERT...VALUES Statement 286\u003c\/p\u003e\u003cp\u003eInserting NULL Values 289\u003c\/p\u003e\u003cp\u003eInserting Unique Values 291\u003c\/p\u003e\u003cp\u003eEntering Multiple Records with the INSERT...SELECT Statement 292\u003c\/p\u003e\u003cp\u003eModifying Existing Data with the UPDATE Statement 295\u003c\/p\u003e\u003cp\u003eRemoving Information with the DELETE Statement 298\u003c\/p\u003e\u003cp\u003eImporting and Exporting Data from Foreign Sources 303\u003c\/p\u003e\u003cp\u003eMicrosoft Access 303\u003c\/p\u003e\u003cp\u003eMicrosoft SQL Server 304\u003c\/p\u003e\u003cp\u003eOracle 305\u003c\/p\u003e\u003cp\u003eMySQL 305\u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003eLESSON 12: Dates and Time in SQL 309\u003c\/b\u003e \u003c\/p\u003e\u003cp\u003eHow Are Date and Time Values Stored? 310\u003c\/p\u003e\u003cp\u003eANSI Standard Data Types for Date and Time 310\u003c\/p\u003e\u003cp\u003eDATETIME Elements 311\u003c\/p\u003e\u003cp\u003eImplementation of Specific Data Types 311\u003c\/p\u003e\u003cp\u003eApplying Date Functions to the Query 312\u003c\/p\u003e\u003cp\u003eThe Current Date 312\u003c\/p\u003e\u003cp\u003eTime Zones 314\u003c\/p\u003e\u003cp\u003eAdding Time to Dates 315\u003c\/p\u003e\u003cp\u003eSubtracting Dates 318\u003c\/p\u003e\u003cp\u003eComparing Dates and Time Periods 320\u003c\/p\u003e\u003cp\u003eOther Miscellaneous Date Functions 320\u003c\/p\u003e\u003cp\u003eConverting Date Formats 321\u003c\/p\u003e\u003cp\u003eDate Pictures 322\u003c\/p\u003e\u003cp\u003eConverting Dates to Character Strings 324\u003c\/p\u003e\u003cp\u003eConverting Character Strings to Dates 325\u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003eLESSON 13: Creating Views 331\u003c\/b\u003e \u003c\/p\u003e\u003cp\u003eIntroducing Views 331\u003c\/p\u003e\u003cp\u003eUsing Views 332\u003c\/p\u003e\u003cp\u003eExploring a Simple View 335\u003c\/p\u003e\u003cp\u003eRenaming Columns 337\u003c\/p\u003e\u003cp\u003eExamining SQL View Processing 338\u003c\/p\u003e\u003cp\u003eRestrictions on Using SELECT 343\u003c\/p\u003e\u003cp\u003eModifying Data in a View 343\u003c\/p\u003e\u003cp\u003eProblems with Modifying Data Using Views 345\u003c\/p\u003e\u003cp\u003eCommon Applications of Views 346\u003c\/p\u003e\u003cp\u003eRemoving Views with the DROP VIEW Statement 350\u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003eLESSON 14: Controlling Transactions 353\u003c\/b\u003e \u003c\/p\u003e\u003cp\u003eTransaction Management 354\u003c\/p\u003e\u003cp\u003eThe Banking Application 354\u003c\/p\u003e\u003cp\u003eBeginning a Transaction 356\u003c\/p\u003e\u003cp\u003eFinishing a Transaction 358\u003c\/p\u003e\u003cp\u003eCanceling the Transaction 361\u003c\/p\u003e\u003cp\u003eUsing Transaction Savepoints 363\u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003ePART IV: Database Administration \u003c\/b\u003e \u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003eLESSON 15: Creating Indexes on Tables to Improve Performance 369\u003c\/b\u003e \u003c\/p\u003e\u003cp\u003eWhat Are Indexes? 370\u003c\/p\u003e\u003cp\u003eIndexing Tips 378\u003c\/p\u003e\u003cp\u003eIndexing on More Than One Field 379\u003c\/p\u003e\u003cp\u003eUsing the UNIQUE Keyword with CREATE INDEX 381\u003c\/p\u003e\u003cp\u003eIndexes and Joins 382\u003c\/p\u003e\u003cp\u003eUsing Clustered Indexes 384\u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003eLESSON 16: Streamlining SQL Statements for Improved Performance 389\u003c\/b\u003e \u003c\/p\u003e\u003cp\u003eMaking Your SQL Statements Readable 390\u003c\/p\u003e\u003cp\u003eAvoiding the Full-Table Scan 391\u003c\/p\u003e\u003cp\u003eAdding a New Index 393\u003c\/p\u003e\u003cp\u003eArranging Elements in a Query 393\u003c\/p\u003e\u003cp\u003eProcedures 395\u003c\/p\u003e\u003cp\u003eAvoiding OR 396\u003c\/p\u003e\u003cp\u003eOLAP Versus OLTP 397\u003c\/p\u003e\u003cp\u003eTuning an OLTP System 397\u003c\/p\u003e\u003cp\u003eTuning an OLAP System 398\u003c\/p\u003e\u003cp\u003eBatch Loads Versus Transactional Processing 398\u003c\/p\u003e\u003cp\u003eOptimizing Data Loads by Dropping Indexes 400\u003c\/p\u003e\u003cp\u003eCOMMIT Statement 401\u003c\/p\u003e\u003cp\u003eRebuilding Tables and Indexes in a Dynamic Environment 402\u003c\/p\u003e\u003cp\u003eTuning the Database 405\u003c\/p\u003e\u003cp\u003eIdentifying Performance Obstacles 407\u003c\/p\u003e\u003cp\u003eUsing Built-in Tuning Tools 409\u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003eLESSON 17: Database Security 413\u003c\/b\u003e \u003c\/p\u003e\u003cp\u003eSecurity’s Role in Database Administration 413\u003c\/p\u003e\u003cp\u003ePopular Database Products and Security 414\u003c\/p\u003e\u003cp\u003eOracle Express and MySQL Security 416\u003c\/p\u003e\u003cp\u003eCreating Users 416\u003c\/p\u003e\u003cp\u003eCreating Roles 419\u003c\/p\u003e\u003cp\u003eUser Privileges 421\u003c\/p\u003e\u003cp\u003eUsing Views for Security Purposes 429\u003c\/p\u003e\u003cp\u003eUsing Synonyms in Place of Views 430\u003c\/p\u003e\u003cp\u003eUsing Views to Solve Security Problems 431\u003c\/p\u003e\u003cp\u003eUsing the WITH GRANT OPTION Clause 433\u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003eLESSON 18: Exploring the Data Dictionary (System Catalog) 437\u003c\/b\u003e \u003c\/p\u003e\u003cp\u003eAn Introduction to the Data Dictionary 437\u003c\/p\u003e\u003cp\u003eIdentifying Data Dictionary Users 438\u003c\/p\u003e\u003cp\u003eExploring the Contents of the Data Dictionary 439\u003c\/p\u003e\u003cp\u003eOracle’s Data Dictionary 439\u003c\/p\u003e\u003cp\u003eMySQL Data Dictionary 440\u003c\/p\u003e\u003cp\u003eA Look Inside Oracle’s Data Dictionary 440\u003c\/p\u003e\u003cp\u003eUser Views 440\u003c\/p\u003e\u003cp\u003eSystem DBA Views 449\u003c\/p\u003e\u003cp\u003eDynamic Performance Views 458\u003c\/p\u003e\u003cp\u003eA Look Inside MySQL’s Data Dictionary 459\u003c\/p\u003e\u003cp\u003eShowing Table Commands Within MySQL 460\u003c\/p\u003e\u003cp\u003eUsing INFORMATION_SCHEMA 461\u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003ePART V: More SQL Objects \u003c\/b\u003e \u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003eLESSON 19: Temporary Tables, Stored Procedures, Triggers, and Cursors 467\u003c\/b\u003e \u003c\/p\u003e\u003cp\u003eCreating Temporary Tables 468\u003c\/p\u003e\u003cp\u003eUsing Cursors 472\u003c\/p\u003e\u003cp\u003eCreating a Cursor 473\u003c\/p\u003e\u003cp\u003eOpening a Cursor 473\u003c\/p\u003e\u003cp\u003eScrolling a Cursor 473\u003c\/p\u003e\u003cp\u003eTesting a Cursor’s Status 474\u003c\/p\u003e\u003cp\u003eClosing a Cursor 475\u003c\/p\u003e\u003cp\u003eThe Scope of Cursors 475\u003c\/p\u003e\u003cp\u003eCreating and Using Stored Procedures 476\u003c\/p\u003e\u003cp\u003eRemoving a Stored Procedure 478\u003c\/p\u003e\u003cp\u003eDesigning and Using Triggers 479\u003c\/p\u003e\u003cp\u003eTriggers and Transactions 480\u003c\/p\u003e\u003cp\u003eRestrictions on Using Triggers 481\u003c\/p\u003e\u003cp\u003eNested Triggers 481\u003c\/p\u003e\u003cp\u003eUsing Embedded SQL 481\u003c\/p\u003e\u003cp\u003eStatic and Dynamic SQL 482\u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003eLESSON 20: New Objects in the Latest Standard 487\u003c\/b\u003e \u003c\/p\u003e\u003cp\u003eExploring the CREATE ROLE Statement 488\u003c\/p\u003e\u003cp\u003eCreating Triggers 490\u003c\/p\u003e\u003cp\u003eUsing the CREATE TYPE Statement 492\u003c\/p\u003e\u003cp\u003eRegular Expressions 497\u003c\/p\u003e\u003cp\u003eWorking with BLOB Data Types 498\u003c\/p\u003e\u003cp\u003eA Short XML Example 499\u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003ePART VI: Advanced SQL Programming \u003c\/b\u003e \u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003eLESSON 21: Using SQL to Generate SQL Statements 503\u003c\/b\u003e \u003c\/p\u003e\u003cp\u003eUnderstanding the Power of SQL Statement Generation 503\u003c\/p\u003e\u003cp\u003eMiscellaneous SQL*Plus Commands 505\u003c\/p\u003e\u003cp\u003eSET ECHO ON\/OFF 505\u003c\/p\u003e\u003cp\u003eSET FEEDBACK ON\/OFF 506\u003c\/p\u003e\u003cp\u003eSET HEADING ON\/OFF 506\u003c\/p\u003e\u003cp\u003eSPOOL FILENAME\/OFF 506\u003c\/p\u003e\u003cp\u003eCounting the Rows in All Tables 507\u003c\/p\u003e\u003cp\u003eGranting System Privileges to Multiple Users 511\u003c\/p\u003e\u003cp\u003eGranting Privileges on Your Tables to Another User 513\u003c\/p\u003e\u003cp\u003eDisabling Table Constraints to Load Data 516\u003c\/p\u003e\u003cp\u003eCreating Numerous Synonyms in a Single Bound 517\u003c\/p\u003e\u003cp\u003eCreating Views on Your Tables 520\u003c\/p\u003e\u003cp\u003eTruncating All Tables in a Schema 522\u003c\/p\u003e\u003cp\u003eUsing SQL to Generate Shell Scripts 523\u003c\/p\u003e\u003cp\u003eApplying SQL Generation and Other Concepts to the Real World 524\u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003eLESSON 22: Creating Complex SQL Queries 529\u003c\/b\u003e \u003c\/p\u003e\u003cp\u003eCREATE TABLE statements 529\u003c\/p\u003e\u003cp\u003eExamples of Complex Queries 532\u003c\/p\u003e\u003cp\u003eComputing Age from Date of Birth 532\u003c\/p\u003e\u003cp\u003eBreaking a Fraction of a Day into Hours, Minutes, and Seconds 533\u003c\/p\u003e\u003cp\u003eConverting Bytes to Kilobytes to Megabytes 536\u003c\/p\u003e\u003cp\u003eDatabase Fragmentation Report 536\u003c\/p\u003e\u003cp\u003eSubqueries in DML 537\u003c\/p\u003e\u003cp\u003eFormatting Your Dates 538\u003c\/p\u003e\u003cp\u003eSubquery Involving a Maximum Value 539\u003c\/p\u003e\u003cp\u003eMultiple Subqueries 540\u003c\/p\u003e\u003cp\u003eUsing Dashes and Parentheses to Format Numeric Values 541\u003c\/p\u003e\u003cp\u003eIncreasing a Numeric Value by a Given Percent 542\u003c\/p\u003e\u003cp\u003eFinding the Next Highest Numeric Value in a Column 542\u003c\/p\u003e\u003cp\u003eDealing with NULL Values 544\u003c\/p\u003e\u003cp\u003eTips for Building Complex Queries 546\u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003eLESSON 23: Debugging Your SQL Statements 551\u003c\/b\u003e \u003c\/p\u003e\u003cp\u003eExploring Common SQL Errors 551\u003c\/p\u003e\u003cp\u003eTable or View that Does Not Exist 552\u003c\/p\u003e\u003cp\u003eInvalid Username or Password 553\u003c\/p\u003e\u003cp\u003eFROM Keyword Not Specified 553\u003c\/p\u003e\u003cp\u003eGroup Function Not Allowed 554\u003c\/p\u003e\u003cp\u003eInvalid Column Name 555\u003c\/p\u003e\u003cp\u003eMissing Keyword 556\u003c\/p\u003e\u003cp\u003eMissing Left Parenthesis 556\u003c\/p\u003e\u003cp\u003eMissing Right Parenthesis 557\u003c\/p\u003e\u003cp\u003eMissing Comma 558\u003c\/p\u003e\u003cp\u003eColumn Ambiguously Defined 558\u003c\/p\u003e\u003cp\u003eSQL Command Not Properly Ended 559\u003c\/p\u003e\u003cp\u003eMissing Expression 559\u003c\/p\u003e\u003cp\u003eNot Enough Arguments for Function 560\u003c\/p\u003e\u003cp\u003eNot Enough Values 560\u003c\/p\u003e\u003cp\u003eIntegrity Constraint Violated–Parent Key Not Found 561\u003c\/p\u003e\u003cp\u003eOracle Not Available 562\u003c\/p\u003e\u003cp\u003eInserted Value Too Large for Column 562\u003c\/p\u003e\u003cp\u003eTNS: Listener Could Not Resolve SID Given in Connect Descriptor 563\u003c\/p\u003e\u003cp\u003eInsufficient Privileges During Grants 563\u003c\/p\u003e\u003cp\u003eEscape Character in Your Statement–Invalid Character 564\u003c\/p\u003e\u003cp\u003eCannot Create Operating System File 564\u003c\/p\u003e\u003cp\u003eExploring Common Logical Mistakes 564\u003c\/p\u003e\u003cp\u003eUsing Reserved Words in Your SQL Statement 564\u003c\/p\u003e\u003cp\u003eThe Use of DISTINCT When Selecting Multiple Columns 566\u003c\/p\u003e\u003cp\u003eDropping an Unqualified Table 566\u003c\/p\u003e\u003cp\u003eThe Use of Public Synonyms in a Multischema Database 567\u003c\/p\u003e\u003cp\u003eThe Dreaded Cartesian Product 567\u003c\/p\u003e\u003cp\u003eFailure to Enforce Input Standards 568\u003c\/p\u003e\u003cp\u003eFailure to Enforce File System Structure Conventions 568\u003c\/p\u003e\u003cp\u003eAllowing Large Tables to Take Default Storage Parameters 569\u003c\/p\u003e\u003cp\u003ePlacing Objects in the System Tablespace 569\u003c\/p\u003e\u003cp\u003eFailure to Compress Large Backup Files 570\u003c\/p\u003e\u003cp\u003eFailure to Budget System Resources 570\u003c\/p\u003e\u003cp\u003ePreventing Problems with Your Data 571\u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003eLESSON 24: Embedding SQL in Application Programming 575\u003c\/b\u003e \u003c\/p\u003e\u003cp\u003eA Quick Trip Through Some Application Development Tools 575\u003c\/p\u003e\u003cp\u003eODBC 576\u003c\/p\u003e\u003cp\u003eOracle Express 576\u003c\/p\u003e\u003cp\u003eSQL in Java with JDBC 576\u003c\/p\u003e\u003cp\u003eSQL in .NET with OleDB 577\u003c\/p\u003e\u003cp\u003eGetting Set Up for Oracle 577\u003c\/p\u003e\u003cp\u003eCreating the Database 577\u003c\/p\u003e\u003cp\u003eUsing Java and SQL 581\u003c\/p\u003e\u003cp\u003eUsing . NET and SQL 583\u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003ePART VII: SQL in Various Database Implementations \u003c\/b\u003e \u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003eLESSON 25: Using Oracle SQL*Plus to Satisfy Reporting Needs 587\u003c\/b\u003e \u003c\/p\u003e\u003cp\u003eAn Introduction to SQL*Plus 587\u003c\/p\u003e\u003cp\u003eThe SQL*Plus Buffer 588\u003c\/p\u003e\u003cp\u003eViewing Table Structure with the DESCRIBE Command 593\u003c\/p\u003e\u003cp\u003eDisplaying Settings with the SHOW Command 594\u003c\/p\u003e\u003cp\u003eManipulating Files with File Commands 595\u003c\/p\u003e\u003cp\u003eThe SAVE, GET, and EDIT Commands 595\u003c\/p\u003e\u003cp\u003eStarting a File 596\u003c\/p\u003e\u003cp\u003eSpooling Query Output 598\u003c\/p\u003e\u003cp\u003eCustomizing the Work Environment with SET Commands 599\u003c\/p\u003e\u003cp\u003eRemoving Settings with the CLEAR Command 603\u003c\/p\u003e\u003cp\u003eFormatting Your Output 603\u003c\/p\u003e\u003cp\u003eTTITLE and BTITLE 604\u003c\/p\u003e\u003cp\u003eFormatting Columns (COLUMN, HEADING, FORMAT) 605\u003c\/p\u003e\u003cp\u003eCreating Report and Group Summaries 606\u003c\/p\u003e\u003cp\u003eBREAK ON 607\u003c\/p\u003e\u003cp\u003eCOMPUTE 608\u003c\/p\u003e\u003cp\u003eUsing Variables in SQL*Plus 610\u003c\/p\u003e\u003cp\u003eSubstitution Variables (\u0026amp;) 611\u003c\/p\u003e\u003cp\u003eDEFINE 611\u003c\/p\u003e\u003cp\u003eACCEPT 612\u003c\/p\u003e\u003cp\u003eNEW_VALUE 614\u003c\/p\u003e\u003cp\u003eUsing the DUAL Table 615\u003c\/p\u003e\u003cp\u003eExploring the DECODE Function 616\u003c\/p\u003e\u003cp\u003eDATE Conversions 619\u003c\/p\u003e\u003cp\u003eRunning a Series of SQL Files 622\u003c\/p\u003e\u003cp\u003eAdding Comments to Your SQL Script 623\u003c\/p\u003e\u003cp\u003eCreating Advanced Reports 624\u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003eLESSON 26: An Introduction to Oracle PL\/SQL 629\u003c\/b\u003e \u003c\/p\u003e\u003cp\u003eIntroducing PL\/SQL 629\u003c\/p\u003e\u003cp\u003eThe Structure of a PL\/SQL Block 630\u003c\/p\u003e\u003cp\u003eThe DECLARE Section 632\u003c\/p\u003e\u003cp\u003eThe PROCEDURE Section 635\u003c\/p\u003e\u003cp\u003eThe EXCEPTION Section 640\u003c\/p\u003e\u003cp\u003eTransactional Control in PL\/SQL 644\u003c\/p\u003e\u003cp\u003ePutting Everything Together 644\u003c\/p\u003e\u003cp\u003eSample Tables and Data 645\u003c\/p\u003e\u003cp\u003eA Simple PL\/SQL Block 646\u003c\/p\u003e\u003cp\u003eA More Extended Example of a PL\/SQL Block 648\u003c\/p\u003e\u003cp\u003eUsing Stored Procedures, Packages, and Triggers 652\u003c\/p\u003e\u003cp\u003eSample Procedure 653\u003c\/p\u003e\u003cp\u003eSample Package 654\u003c\/p\u003e\u003cp\u003eSample Trigger 654\u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003eLESSON 27: An Introduction to Transact-SQL 661\u003c\/b\u003e \u003c\/p\u003e\u003cp\u003eAn Overview of Transact-SQL 661\u003c\/p\u003e\u003cp\u003eExtensions to ANSI QL 662\u003c\/p\u003e\u003cp\u003eWho Uses Transact-SQL? 662\u003c\/p\u003e\u003cp\u003eThe Basic Components of Transact-SQL 662\u003c\/p\u003e\u003cp\u003eData Types 663\u003c\/p\u003e\u003cp\u003eCharacter Strings 663\u003c\/p\u003e\u003cp\u003eNumeric Data Types 663\u003c\/p\u003e\u003cp\u003eDate Data Types 664\u003c\/p\u003e\u003cp\u003eMoney Data Types 664\u003c\/p\u003e\u003cp\u003eBinary Strings 664\u003c\/p\u003e\u003cp\u003ebit: A Logical Data Type 665\u003c\/p\u003e\u003cp\u003eAccessing the Database with Transact-SQL 665\u003c\/p\u003e\u003cp\u003eThe BASEBALL Database 665\u003c\/p\u003e\u003cp\u003eDeclaring Local Variables 668\u003c\/p\u003e\u003cp\u003eDeclaring Global Variables 668\u003c\/p\u003e\u003cp\u003eUsing Variables 670\u003c\/p\u003e\u003cp\u003eThe PRINT Command 671\u003c\/p\u003e\u003cp\u003eEstablishing Flow Control 672\u003c\/p\u003e\u003cp\u003eBEGIN and END Statements 672\u003c\/p\u003e\u003cp\u003eIF ...ELSE Statements 673\u003c\/p\u003e\u003cp\u003eThe EXISTS Condition 675\u003c\/p\u003e\u003cp\u003eTesting a Query’s Result 675\u003c\/p\u003e\u003cp\u003eThe WHILE Loop 676\u003c\/p\u003e\u003cp\u003eThe BREAK Command 677\u003c\/p\u003e\u003cp\u003eThe CONTINUE Command 677\u003c\/p\u003e\u003cp\u003eUsing the WHILE Loop to Scroll Through a Table 678\u003c\/p\u003e\u003cp\u003eUsing Transact-SQL Wildcard Operators 679\u003c\/p\u003e\u003cp\u003eDate Conversions 680\u003c\/p\u003e\u003cp\u003eSQL Server Diagnostic Tools–SET Commands 681\u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003eLESSON 28: Using MySQL on a UNIX-based System 685\u003c\/b\u003e \u003c\/p\u003e\u003cp\u003eMySQL Administration 686\u003c\/p\u003e\u003cp\u003eInstalling MySQL 686\u003c\/p\u003e\u003cp\u003eStarting and Stopping MySQL 687\u003c\/p\u003e\u003cp\u003eInitial MySQL Privileges 688\u003c\/p\u003e\u003cp\u003eThe MySQL Terminal Monitor 688\u003c\/p\u003e\u003cp\u003eConnecting to the Database 689\u003c\/p\u003e\u003cp\u003eCommand-Line Options 689\u003c\/p\u003e\u003cp\u003eEntering MySQL Monitor Commands 690\u003c\/p\u003e\u003cp\u003eCommand-Line History 692\u003c\/p\u003e\u003cp\u003eBatch Mode 692\u003c\/p\u003e\u003cp\u003eSHOW 693\u003c\/p\u003e\u003cp\u003eMySQL Utilities 694\u003c\/p\u003e\u003cp\u003eExercises 695\u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003ePART VIII: Appendices\u003c\/b\u003e \u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003cb\u003eAPPENDIX A: Answers 697\u003c\/b\u003e \u003c\/p\u003e\u003cp\u003e\u003cb\u003eAPPENDIX B: Code Examples to Create Tables 731 \u003c\/b\u003e \u003c\/p\u003e\u003cp\u003e\u003cb\u003eAPPENDIX C: Code Examples to Populate Tables 743 \u003c\/b\u003e \u003c\/p\u003e\u003cp\u003e\u003cb\u003eAPPENDIX D: Using MySQL for Exercises 763\u003c\/b\u003e \u003c\/p\u003e\u003cp\u003e\u003cb\u003eIndex 767 \u003c\/b\u003e \u003c\/p\u003e\u003cp\u003e\u003cb\u003e \u003c\/b\u003e \u003c\/p\u003e\u003cp\u003e\u003cb\u003eOnline Appendixes \u003c\/b\u003e \u003c\/p\u003e\u003cp\u003e\u003cb\u003eAPPENDIX E: Glossary of Common SQL Commands PDF:1 \u003c\/b\u003e \u003c\/p\u003e\u003cp\u003e\u003cb\u003eAPPENDIX F: Glossary of Common SQL Functions PDF:7\u003c\/b\u003e \u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e\u003cp\u003e\u003c\/p\u003e","brand":"Pearson Education","offers":[{"title":"Default Title","offer_id":47122803097840,"sku":"9780768690392","price":43.99,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0737\/7593\/9824\/files\/9780768690392_p0.jpg?v=1763661613","url":"https:\/\/shop-qa.barnesandnoble.com\/products\/9780768690392","provider":"Barnes \u0026 Noble (DEV)","version":"1.0","type":"link"}