The Guru's Guide to Transact-SQL

Size: px
Start display at page:

Download "The Guru's Guide to Transact-SQL"

Transcription

1 The Guru's Guide to Transact-SQL Ken Henderson HLuHB Darmstadt TT ADDISON-WESLEY Boston San Francisco New York Toronto Montreal London Munich Paris Madrid Capetown Sydney Tokyo Singapore Mexico City

2 Contents Foreword xvi Preface xvii About the Sample Databases Results Abridged xviii On Formality xviii Acknowledgments xix xviii Chapter 1: Introductory Transact-SQL 1 Choosing a SQL Editor 2 Creating a Database 3 Creating Tables 3 Inserting Data 5 Updating Data 6 Deleting Data 7 Querying Data 7 Column Lists 8 SELECTing Variables and Expressions Functions 9 Converting Data Types 10 CASE 10 Aggregate Columns 11 Filtering Data 11 Joins 13 Outer Joins 14 Other Types of Joins 16 Subqueries 18 Grouping Data 18 HAVING 19 Ordering Data 19 Column Aliases 20 Table Aliases 21

3 vi Contents Managing Transactions 21 Summary 22 Chapter 2: Transact-SQL Data Type Nuances 23 Dates 23 Y2K and Other Date Problems 24 Date Functions 25 Dates and Simple Arithmetic 26 Determining Time Gaps 27 Building Calendars 31 Strings 34 Concatenation 35 Char vs. Varchar 35 SET ANSI_PADDING 36 String Functions 37 CHARINDEX() 37 SOUNDEX() 37 A Better SOUNDEX() 38 DIFFERENCEO 46 Xp_sprintf 47 Xp_sscanf 47 Masks 48 Executing Strings 49 Unicode 54 Numerics 54 Floating Point Fun 55 Division by Zero 57 Funny Money 58 Formatting Numeric Data 58 BLOBs 59 Caveats 59 Retrieving BLOB Data 60 Updating BLOB Data 63 BLOB Updates and the Transaction Log 65 Bits 66 UNIQUEIDENTIFIER 67 Cursor Variables 68 Timestamps 73 Summary 75 Chapter 3: Missing Values 77 NULL and Expressions 78 NULL and Functions 78 NULL and ANSI SQL 79

4 Contents vii NULL and Stored Procedures 81 NULL If You Must 83 Chapter 4: DDL Insights 85 CREATE TABLE 86 Some Thoughts on Referential Integrity 86 Foreign Keys 86 ANSI Referential Actions 87 The NULL Exception 87 Unique Index Requirement 87 No TRUNCATE TABLE 87 Default Constraints 87 Dropping Objects 89 CREATE INDEX 90 No Bit or BLOB Indexes 90 No Computed Column Indexes 90 PADJNDEX 90 DROP_EXISTING 91 TEMPORARY OBJECTS 91 No More Unusable Temporary Objects 91 Can't Create Objects in Other Databases 91 Temporary Stored Procedures 92 Increased Temporary Table Name Length 92 Global Temporary Status Tables 92 Object Naming and Dependencies 93 Changing the Database Context Temporarily 94 Temporary Table Indexes 94 Be Wary of Unusable Views 94 Object Dependencies 94 Summary 95 Chapter 5: DML Insights 97 INSERT 97 DEFAULT and NULL 98 SET IDENTITYJNSERT 99 INSERT...DEFAULT VALUES 100 INSERT...SELECT 100 INSERT...EXEC 101 Extended Procedures 102 INSERT and Errors 103 Using INSERT to Remove Duplicate Rows 104 INSERT and Clustered Indexes 105 BULK INSERT 105 BULK INSERT and Triggers 106

5 BULK INSERT and Constraints 106 BULK INSERT and Identity Columns 106. UPDATE 107 The Halloween Problem 108 UPDATE and CASE 109 Using UPDATE to Check Constraints 110 Limiting the Number of Rows Affected by an UPDATE 111 Swapping Column Values with UPDATE 112 UPDATE and Cursors 113 DELETE 114 DELETE and Cursors 116 TRUNCATE TABLE 117 Detecting DML Errors 118 Summary 118 Chapter 6: The Mighty SELECT Statement 119 Simple SELECTS 119 Computational and Derived Fields 120 SELECT TOP 121 Derived Tables 122 Joins 126 Outer Joins and Join Order 126 Predicates 128 BETWEEN 128 LIKE 131 EXISTS 133 NULLs 134 EXISTS and IN 135 Joins 136 Result Set Emptiness 137 EXISTS Outside WHERE and HAVING 137 IN 138 Optimizing IN 138 ANY and ALL 140 Subqueries 140 WHERE and Subqueries 141 Correlated Subqueries 141 Relational Division 145 Aggregate Functions 147 GROUP BY and HAVING 150 Pivot Tables 152 CUBE and ROLLUP 153 HAVING 157 UNION 157 ORDER BY 159 Summary 161

6 Contents ix Chapter 7: Views 163 Restrictions 163 DML Restrictions 164 ANSI SQL Schema VIEWs 165 Getting a VIEW'S Source Code 166 Updatable VIEWs 166 WITH CHECK OPTION 167 Derived Tables 167 Dynamic VIEWs 168 Partitioning Data Using Views 170 Summary 172 Chapter 8: Statistical Functions 173 The Case for CASE 174 Efficiency Concerns 176 Variance and Standard Deviation 176 Medians 177 The Identity Column Technique 177 The CASE Technique 181 Vector Medians 183 Duplicate Values 184 Clipping 185 Returning the Top n Rows 186 SETROWCOUNT 188 Rankings 190 Modes 193 Histograms 193 Stratified Histograms 194 Cumulative and Sliding Aggregates 195 Sliding Aggregates 196 Extremes 197 Determining Extreme Attributes 198 Summary 199 Chapter 9: Runs and Sequences 201 Sequences 201 Time Series Fluctuation 202 Sampling Every nth Value 203 Regions 203 Relative Condition Regions 204 Constraining Region Sizes 205 Region Boundaries 206 Runs 207 Regions 207 Region Boundaries 208 Constrained Regions 209

7 x Contents Intervals 210 Partitioned Intervals 211 Summary 212 Chapter 10: Arrays 213 Arrays as Big Strings 213 Modifying Array Elements 219 Arrays as Tables 220 Sorting 221 Transposing Dimensions 223 Ensuring Array Integrity 225 Reshaping the Array 225 Comparing Arrays 226 Summary 228 Chapter 11: Sets 229 Unions 230 Differences 231 Intersections 234 Subsets 235 Returning Every nth Row 238 Summary 239 Chapter 12: Hierarchies 241 Simple Hierarchies 241 Multilevel Hierarchies 242 Indenting a Hierarchy 245 Another Approach 246 Listing Leaf Nodes 248 Indented Lists 249 Summary 250 Chapter 13: Cursors 251 On Cursors and ISAMs 251 Types of Cursors 253 Forward-Only Cursors 254 Dynamic Cursors 255 Static Cursors 256 Keyset Cursors 257 Appropriate Cursor Use 258 Dynamic Queries 259 Row-Oriented Operations 261 Scrollable Forms 263

8 Contents xi T-SQL Cursor Syntax 263 DECLARE CURSOR 264 Global vs. Local Cursors 267 OPEN 268 FETCH 269 CLOSE 272 DEALLOCATE 272 Configuring Cursors 272 Asynchronous Cursors 272 ANSI /ISO Automatic Cursor Closing 274 Defaulting to Global or Local Cursors 276 Updating Cursors 276 Cursor Variables 277 Cursor Stored Procedures 279 Optimizing Cursor Performance 279 Summary 281 Chapter 14: Transactions 283 Transactions Defined 283 The ACID Test 283 Atomicity 284 Consistency 284 Isolation 284 Durability 284 How SQL Server Transactions Work 284 Transactions and Nonlogged Operations 285 Transactions and Triggers 285 Types of Transactions 285 Automatic Transactions 285 Implicit Transactions 286 User-Defined Transactions 286 Distributed Transactions 287 Avoiding Transactions Altogether 287 Commands That Minimize Logging 287 Read-Only and Single-User Databases 287 Automatic Transaction Management 288 Transaction Isolation Levels 289 READ UNCOMMITTED 289 READ COMMITTED 290 REPEATABLE READ 291 SERIALIZABLE 292 Transaction Commands and Syntax 293 Nested Transactions 293 SAVE TRAN and Save Points 296

9 xii Contents Avoid Accidental ROLLBACKS 297 Invalid T-SQL Syntax in Transactions 299 Debugging Transactions 299 Optimizing Transactional Code 300 Summary 301 Chapter 15: Stored Procedures and Triggers 303 Stored Procedure Advantages 304 Internals 305 Creation 305 User Execution 305 Compilation 305 Server Execution 306 Creating Stored Procedures 307 Creation Tips 308 Temporary Procedures 312 System Procedures 312 Extended Procedures 314 Faux Procedures 316 Executing Stored Procedures 316 INSERT and EXEC 317 Environmental Concerns 317 Parameters 320 Output Parameters 321 Result Codes 322 Listing Procedure Parameters 323 General Parameter Notes 323 Important Automatic Variables 323 Flow Control Language 324 Errors ERROR 328 xpjogevent 328 Nesting 328 Recursion 328 Autostart Procedures 330 Encryption 330 Triggers 330 Debugging Procedures 334 Summary 335 Chapter 16: Transact-SQL Performance Tuning 337 General Performance Guidelines 337 Database Design Performance Tips 338 Index Performance Tips 340

10 Contents xm SELECT Performance Tips 342 INSERT Performance Tips 344 Bulk Copy Performance Tips 344 DELETE and UPDATE Performance Tips 346 Cursor Performance Tips 346 Stored Procedure Performance Tips 347 SARGs 351 Denormalization 368 Basic Guidelines 369 Basic Techniques 369 Contrived Columns 370 Redundant Data 370 Summary Tables 371 Vertical Partitioning 374 Horizontal Partitioning 380 The Query Optimizer 384 Join Optimizations 385 Nested Loops 385 Merge Joins 385 Hash Joins 386 Index Optimizations 387 Index Joins 387 Index Merging and Intersection 388 Data Warehouse Optimizations 389 Semijoins 391 Grouping Optimizations 391 Predicate Clause Optimizations 391 The Index Tuning Wizard 394 Profiler 396 Perfmon 397 User Counters 398 Perfmon-Related DBCC Commands 398 Summary 399 Chapter 17: Administrative Transact-SQL 401 GUI Administration 401 System Stored Procedures 402 Administrative Transact-SQL Commands 402 Administrative System Functions 402 Administrative Automatic Variables 402 Where's the Beef? 404 Status Routines 405 sp_active_processes 405 sp_pss 410

11 xiv Contents sp_find_root_blocker 414 sp_lock_verbose 416 Catalog Procedures 419 sp_table 419 sp_dir 421 sp_object 427 Maintenance Routines 432 sp_update_stats_all 432 sp_updateusage_all 435 sp_rebuildindexes_all 437 sp_dbbackup 440 sp_copyfile 443 sp_make_portable 445 INIT_SERVER.SQL 448 sp_readtextfile 453 Scripting Routines 456 Summary 461 Chapter 18: Full-Text Search 463 Full-Text Predicates 468 The CONTAINS() Predicate 469 The FREETEXTO Predicate 471 Rowset Functions 471 The CONTAINSTABLE() Rowset Function 472 The FREETEXTTABLE() Rowset Function 474 Summary 474 Chapter 19: OLE Automation 475 sp_exporttable 476 sp_importtable 480 sp_getsqlregistry 484 Summary 486 Chapter 20: Undocumented T-SQL 487 Defining Undocumented 487 Undocumented DBCC Commands 488 DBCC ADDEXTENDEDPROC(procname,DLL) 488 DBCC ADDINSTANCE(object,instance) 488 DBCC BCPTABLOCK(dbid, tabid, setflag) 489 DBCC BUFFER(dbid[ > objid][,numberofbuffers][,printopt {01112}]) 489 DBCC BYTES(startingaddress,length) 490 DBCC CALLFULLTEXT(funcid[,catid][,objid]) 490 DBCC DBCONTROL(dbname,option) 491 DBCC DBINFO(dbname) 491 DBCC DBRECOVER(dbname) 492 DBCC DBTABLE(dbid) 492 DBCC DELETEINSTANCE(object,instance) 493

12 Contents xv DBCC DES(dbid,objid) 493 DBCC DETACHDB(dbname) 493 DBCC DROPCLEANBUFFERS 493 DBCC DROPEXTENDEDPROC(procname) 493 DBCC ERRORLOG 494 DBCC EXTENTINFO(dbname, tablename, indid) 494 DBCC FLUSHPROCINDB(dbid) 494 DBCC FREEPROCCACHE 494 DBCC IND(dbid, objid[,printopt {01112}]) 494 DBCC LOCKOBJECTSCHEMA (objname) 495 DBCC LOG(dbid) 495 DBCC PAGE (dbidldbnarne, filenum, pagenum [,printopt][,cacheopt]) 496 DBCC PRTIPAGE(dbid, objid, indexidf, printopt {01112}]) 497 DBCC RESOURCE 497 DBCC SETINSTANCE(object,counter,instance,val) 498 DBCC TAB(dbid,objid[,printopt {01112}}]) 499 DBCC UPGRADEDB(dbname) 499 Undocumented Functions and Variables 499 ENCRYPT(string) 499 GET_SID(usemame) 499 OBJECT_ID(..,'local') 500 PWDCOMPARE(str,pwd,oldenc) 500 PWDENCRYPT(str) 501 TSEQUAL(tsl,ts2) Undocumented Trace Flags 502 Undocumented Procedures 503 Summary 509 Chapter 21: Potpourri 511 Obscure Functions 511 Status Functions 511 Property Functions 513 Identifier Functions 514 Index Functions 515 Data Functions 518 Unusual String Functions 519 Data Scrubbing 521 Removing Duplicates 524 Iteration Tables 525 Summary 526 Appendix: Suggested Resources 527 Books 527 Internet Resources 528 Index 529

FHE DEFINITIVE GUIDE. ^phihri^^lv JEFFREY GARBUS. Joe Celko. Alvin Chang. PLAMEN ratchev JONES & BARTLETT LEARN IN G. y ti rvrrtuttnrr i t i r

FHE DEFINITIVE GUIDE. ^phihri^^lv JEFFREY GARBUS. Joe Celko. Alvin Chang. PLAMEN ratchev JONES & BARTLETT LEARN IN G. y ti rvrrtuttnrr i t i r : 1. FHE DEFINITIVE GUIDE fir y ti rvrrtuttnrr i t i r ^phihri^^lv ;\}'\^X$:^u^'! :: ^ : ',!.4 '. JEFFREY GARBUS PLAMEN ratchev Alvin Chang Joe Celko g JONES & BARTLETT LEARN IN G Contents About the Authors

More information

SQL Server. 2012 for developers. murach's TRAINING & REFERENCE. Bryan Syverson. Mike Murach & Associates, Inc. Joel Murach

SQL Server. 2012 for developers. murach's TRAINING & REFERENCE. Bryan Syverson. Mike Murach & Associates, Inc. Joel Murach TRAINING & REFERENCE murach's SQL Server 2012 for developers Bryan Syverson Joel Murach Mike Murach & Associates, Inc. 4340 N. Knoll Ave. Fresno, CA 93722 www.murach.com murachbooks@murach.com Expanded

More information

MOC 20461C: Querying Microsoft SQL Server. Course Overview

MOC 20461C: Querying Microsoft SQL Server. Course Overview MOC 20461C: Querying Microsoft SQL Server Course Overview This course provides students with the knowledge and skills to query Microsoft SQL Server. Students will learn about T-SQL querying, SQL Server

More information

Instant SQL Programming

Instant SQL Programming Instant SQL Programming Joe Celko Wrox Press Ltd. INSTANT Table of Contents Introduction 1 What Can SQL Do for Me? 2 Who Should Use This Book? 2 How To Use This Book 3 What You Should Know 3 Conventions

More information

AV-005: Administering and Implementing a Data Warehouse with SQL Server 2014

AV-005: Administering and Implementing a Data Warehouse with SQL Server 2014 AV-005: Administering and Implementing a Data Warehouse with SQL Server 2014 Career Details Duration 105 hours Prerequisites This career requires that you meet the following prerequisites: Working knowledge

More information

Querying Microsoft SQL Server

Querying Microsoft SQL Server Course 20461C: Querying Microsoft SQL Server Module 1: Introduction to Microsoft SQL Server 2014 This module introduces the SQL Server platform and major tools. It discusses editions, versions, tools used

More information

Duration Vendor Audience 5 Days Oracle End Users, Developers, Technical Consultants and Support Staff

Duration Vendor Audience 5 Days Oracle End Users, Developers, Technical Consultants and Support Staff D80198GC10 Oracle Database 12c SQL and Fundamentals Summary Duration Vendor Audience 5 Days Oracle End Users, Developers, Technical Consultants and Support Staff Level Professional Delivery Method Instructor-led

More information

Course ID#: 1401-801-14-W 35 Hrs. Course Content

Course ID#: 1401-801-14-W 35 Hrs. Course Content Course Content Course Description: This 5-day instructor led course provides students with the technical skills required to write basic Transact- SQL queries for Microsoft SQL Server 2014. This course

More information

Oracle Database: SQL and PL/SQL Fundamentals

Oracle Database: SQL and PL/SQL Fundamentals Oracle University Contact Us: 1.800.529.0165 Oracle Database: SQL and PL/SQL Fundamentals Duration: 5 Days What you will learn This course is designed to deliver the fundamentals of SQL and PL/SQL along

More information

DBMS / Business Intelligence, SQL Server

DBMS / Business Intelligence, SQL Server DBMS / Business Intelligence, SQL Server Orsys, with 30 years of experience, is providing high quality, independant State of the Art seminars and hands-on courses corresponding to the needs of IT professionals.

More information

Oracle Database 10g: Introduction to SQL

Oracle Database 10g: Introduction to SQL Oracle University Contact Us: 1.800.529.0165 Oracle Database 10g: Introduction to SQL Duration: 5 Days What you will learn This course offers students an introduction to Oracle Database 10g database technology.

More information

Querying Microsoft SQL Server 20461C; 5 days

Querying Microsoft SQL Server 20461C; 5 days Lincoln Land Community College Capital City Training Center 130 West Mason Springfield, IL 62702 217-782-7436 www.llcc.edu/cctc Querying Microsoft SQL Server 20461C; 5 days Course Description This 5-day

More information

Module 1: Getting Started with Databases and Transact-SQL in SQL Server 2008

Module 1: Getting Started with Databases and Transact-SQL in SQL Server 2008 Course 2778A: Writing Queries Using Microsoft SQL Server 2008 Transact-SQL About this Course This 3-day instructor led course provides students with the technical skills required to write basic Transact-

More information

LearnFromGuru Polish your knowledge

LearnFromGuru Polish your knowledge SQL SERVER 2008 R2 /2012 (TSQL/SSIS/ SSRS/ SSAS BI Developer TRAINING) Module: I T-SQL Programming and Database Design An Overview of SQL Server 2008 R2 / 2012 Available Features and Tools New Capabilities

More information

Oracle Database: SQL and PL/SQL Fundamentals NEW

Oracle Database: SQL and PL/SQL Fundamentals NEW Oracle University Contact Us: + 38516306373 Oracle Database: SQL and PL/SQL Fundamentals NEW Duration: 5 Days What you will learn This Oracle Database: SQL and PL/SQL Fundamentals training delivers the

More information

Writing Queries Using Microsoft SQL Server 2008 Transact-SQL

Writing Queries Using Microsoft SQL Server 2008 Transact-SQL Course 2778A: Writing Queries Using Microsoft SQL Server 2008 Transact-SQL Length: 3 Days Language(s): English Audience(s): IT Professionals Level: 200 Technology: Microsoft SQL Server 2008 Type: Course

More information

Querying Microsoft SQL Server Course M20461 5 Day(s) 30:00 Hours

Querying Microsoft SQL Server Course M20461 5 Day(s) 30:00 Hours Área de formação Plataforma e Tecnologias de Informação Querying Microsoft SQL Introduction This 5-day instructor led course provides students with the technical skills required to write basic Transact-SQL

More information

MOC 20461 QUERYING MICROSOFT SQL SERVER

MOC 20461 QUERYING MICROSOFT SQL SERVER ONE STEP AHEAD. MOC 20461 QUERYING MICROSOFT SQL SERVER Length: 5 days Level: 300 Technology: Microsoft SQL Server Delivery Method: Instructor-led (classroom) COURSE OUTLINE Module 1: Introduction to Microsoft

More information

Introducing Microsoft SQL Server 2012 Getting Started with SQL Server Management Studio

Introducing Microsoft SQL Server 2012 Getting Started with SQL Server Management Studio Querying Microsoft SQL Server 2012 Microsoft Course 10774 This 5-day instructor led course provides students with the technical skills required to write basic Transact-SQL queries for Microsoft SQL Server

More information

SQL Server. 1. What is RDBMS?

SQL Server. 1. What is RDBMS? SQL Server 1. What is RDBMS? Relational Data Base Management Systems (RDBMS) are database management systems that maintain data records and indices in tables. Relationships may be created and maintained

More information

Writing Queries Using Microsoft SQL Server 2008 Transact-SQL

Writing Queries Using Microsoft SQL Server 2008 Transact-SQL Lincoln Land Community College Capital City Training Center 130 West Mason Springfield, IL 62702 217-782-7436 www.llcc.edu/cctc Writing Queries Using Microsoft SQL Server 2008 Transact-SQL Course 2778-08;

More information

Querying Microsoft SQL Server 2012

Querying Microsoft SQL Server 2012 Course 10774A: Querying Microsoft SQL Server 2012 Length: 5 Days Language(s): English Audience(s): IT Professionals Level: 200 Technology: Microsoft SQL Server 2012 Type: Course Delivery Method: Instructor-led

More information

Oracle Database 12c: Introduction to SQL Ed 1.1

Oracle Database 12c: Introduction to SQL Ed 1.1 Oracle University Contact Us: 1.800.529.0165 Oracle Database 12c: Introduction to SQL Ed 1.1 Duration: 5 Days What you will learn This Oracle Database: Introduction to SQL training helps you write subqueries,

More information

Oracle Database: SQL and PL/SQL Fundamentals

Oracle Database: SQL and PL/SQL Fundamentals Oracle University Contact Us: +966 12 739 894 Oracle Database: SQL and PL/SQL Fundamentals Duration: 5 Days What you will learn This Oracle Database: SQL and PL/SQL Fundamentals training is designed to

More information

Course 10774A: Querying Microsoft SQL Server 2012

Course 10774A: Querying Microsoft SQL Server 2012 Course 10774A: Querying Microsoft SQL Server 2012 About this Course This 5-day instructor led course provides students with the technical skills required to write basic Transact-SQL queries for Microsoft

More information

Course 10774A: Querying Microsoft SQL Server 2012 Length: 5 Days Published: May 25, 2012 Language(s): English Audience(s): IT Professionals

Course 10774A: Querying Microsoft SQL Server 2012 Length: 5 Days Published: May 25, 2012 Language(s): English Audience(s): IT Professionals Course 10774A: Querying Microsoft SQL Server 2012 Length: 5 Days Published: May 25, 2012 Language(s): English Audience(s): IT Professionals Overview About this Course Level: 200 Technology: Microsoft SQL

More information

Course 20461C: Querying Microsoft SQL Server Duration: 35 hours

Course 20461C: Querying Microsoft SQL Server Duration: 35 hours Course 20461C: Querying Microsoft SQL Server Duration: 35 hours About this Course This course is the foundation for all SQL Server-related disciplines; namely, Database Administration, Database Development

More information

Oracle 10g PL/SQL Training

Oracle 10g PL/SQL Training Oracle 10g PL/SQL Training Course Number: ORCL PS01 Length: 3 Day(s) Certification Exam This course will help you prepare for the following exams: 1Z0 042 1Z0 043 Course Overview PL/SQL is Oracle's Procedural

More information

Beginning SQL Server. 2012 Administration. Apress. Rob Walters Grant Fritchey

Beginning SQL Server. 2012 Administration. Apress. Rob Walters Grant Fritchey Beginning SQL Server 2012 Administration Rob Walters Grant Fritchey Apress Contents at a Glance About the Authors About the Technical Reviewer Acknowledgments Introduction xv xvi xvii xviii Chapter 1:

More information

Oracle SQL. Course Summary. Duration. Objectives

Oracle SQL. Course Summary. Duration. Objectives Oracle SQL Course Summary Identify the major structural components of the Oracle Database 11g Create reports of aggregated data Write SELECT statements that include queries Retrieve row and column data

More information

SQL Server 2012 Query. Performance Tuning. Grant Fritchey. Apress*

SQL Server 2012 Query. Performance Tuning. Grant Fritchey. Apress* SQL Server 2012 Query Performance Tuning Grant Fritchey Apress* Contents J About the Author About the Technical Reviewer Acknowledgments Introduction xxiii xxv xxvii xxix Chapter 1: SQL Query Performance

More information

Introduction. Part I: Finding Bottlenecks when Something s Wrong. Chapter 1: Performance Tuning 3

Introduction. Part I: Finding Bottlenecks when Something s Wrong. Chapter 1: Performance Tuning 3 Wort ftoc.tex V3-12/17/2007 2:00pm Page ix Introduction xix Part I: Finding Bottlenecks when Something s Wrong Chapter 1: Performance Tuning 3 Art or Science? 3 The Science of Performance Tuning 4 The

More information

Database Programming with PL/SQL: Learning Objectives

Database Programming with PL/SQL: Learning Objectives Database Programming with PL/SQL: Learning Objectives This course covers PL/SQL, a procedural language extension to SQL. Through an innovative project-based approach, students learn procedural logic constructs

More information

Demystified CONTENTS Acknowledgments xvii Introduction xix CHAPTER 1 Database Fundamentals CHAPTER 2 Exploring Relational Database Components

Demystified CONTENTS Acknowledgments xvii Introduction xix CHAPTER 1 Database Fundamentals CHAPTER 2 Exploring Relational Database Components Acknowledgments xvii Introduction xix CHAPTER 1 Database Fundamentals 1 Properties of a Database 1 The Database Management System (DBMS) 2 Layers of Data Abstraction 3 Physical Data Independence 5 Logical

More information

SQL Server 2008 Administration

SQL Server 2008 Administration SQL Server 2008 Administration Real World Skills for ITP Certification and Beyond Tom Carpenter WILEY Wiley Publishing, Inc. Contents Introduction xxi Part i Introducing SQL Server 2008 1 Chapter 1 Understanding

More information

BIRT: A Field Guide to Reporting

BIRT: A Field Guide to Reporting BIRT: A Field Guide to Reporting x:.-. ^ 11 Diana Peh Alethea Hannemann Nola Hague AAddison-Wesley Upper Saddle River, NJ Boston Indianapolis San Francisco New York Toronto Montreal London Munich Parts

More information

Beginning C# 5.0. Databases. Vidya Vrat Agarwal. Second Edition

Beginning C# 5.0. Databases. Vidya Vrat Agarwal. Second Edition Beginning C# 5.0 Databases Second Edition Vidya Vrat Agarwal Contents J About the Author About the Technical Reviewer Acknowledgments Introduction xviii xix xx xxi Part I: Understanding Tools and Fundamentals

More information

Microsoft SQL Server 2008 Bible

Microsoft SQL Server 2008 Bible Brochure More information from http://www.researchandmarkets.com/reports/1093469/ Microsoft SQL Server 2008 Bible Description: Harness the power of SQL Server, Microsoft s high-performance database and

More information

The Data Access Handbook

The Data Access Handbook The Data Access Handbook Achieving Optimal Database Application Performance and Scalability John Goodson and Robert A. Steward PRENTICE HALL Upper Saddle River, NJ Boston Indianapolis San Francisco New

More information

Netezza SQL Class Outline

Netezza SQL Class Outline Netezza SQL Class Outline CoffingDW education has been customized for every customer for the past 20 years. Our classes can be taught either on site or remotely via the internet. Education Contact: John

More information

SQL SERVER DEVELOPER Available Features and Tools New Capabilities SQL Services Product Licensing Product Editions Will teach in class room

SQL SERVER DEVELOPER Available Features and Tools New Capabilities SQL Services Product Licensing Product Editions Will teach in class room An Overview of SQL Server 2005/2008 Configuring and Installing SQL Server 2005/2008 SQL SERVER DEVELOPER Available Features and Tools New Capabilities SQL Services Product Licensing Product Editions Preparing

More information

David Dye. Extract, Transform, Load

David Dye. Extract, Transform, Load David Dye Extract, Transform, Load Extract, Transform, Load Overview SQL Tools Load Considerations Introduction David Dye derekman1@msn.com HTTP://WWW.SQLSAFETY.COM Overview ETL Overview Extract Define

More information

Oracle Database: SQL and PL/SQL Fundamentals NEW

Oracle Database: SQL and PL/SQL Fundamentals NEW Oracle University Contact Us: 001-855-844-3881 & 001-800-514-06-97 Oracle Database: SQL and PL/SQL Fundamentals NEW Duration: 5 Days What you will learn This Oracle Database: SQL and PL/SQL Fundamentals

More information

Expert Oracle. Database Architecture. Techniques and Solutions. 10gr, and 11g Programming. Oracle Database 9/, Second Edition.

Expert Oracle. Database Architecture. Techniques and Solutions. 10gr, and 11g Programming. Oracle Database 9/, Second Edition. Expert Oracle Database Architecture Oracle Database 9/, Techniques and Solutions 10gr, and 11g Programming Second Edition TECHNiSCHE JNFORMATIONSBIBLIOTHEK UN!VERSITAT BIBLIOTHEK HANNOVER Thomas Kyte Apress

More information

Oracle8/ SQLJ Programming

Oracle8/ SQLJ Programming Technisch&AJniversitatDarmstadt Fachbeteich IpfcJrrnatik Fachgebiet PrjN^ische Informattk 7 '64283 Dar ORACLE Oracle Press Oracle8/ SQLJ Programming Tecbnischa UniversMt Osr FACHBEREICH INFORMATiK BIBLIOTHEK

More information

Development and Management

Development and Management Cloud Database Development and Management Lee Chao CRC Press Taylor & Francis Group Boca Raton London New York CRC Press is an imprint of the Taylor & Francis Croup, an Informa business AN AUERBACH BOOK

More information

PL/SQL Programming Workbook

PL/SQL Programming Workbook ORACLG Oracle Press Oracle Database 11 g PL/SQL Programming Workbook TIB/UB Hannover 89 ACKNOWLEDGMENTS INTRODUCTION xvii xix PARTI PL/SQL Fundamentals 1 Oracle Development Overview 3 History and Background

More information

SQL Server Developer Training Program. Topics Covered

SQL Server Developer Training Program. Topics Covered SQL Server Developer Training Program Duration: 50 Hrs Training Mode: Class Room/On-line Training Methodology: Real-time Project oriented Training Features: 1) Trainers from Corporate 2) Unlimited Lab

More information

Course -Oracle 10g SQL (Exam Code IZ0-047) Session number Module Topics 1 Retrieving Data Using the SQL SELECT Statement

Course -Oracle 10g SQL (Exam Code IZ0-047) Session number Module Topics 1 Retrieving Data Using the SQL SELECT Statement Course -Oracle 10g SQL (Exam Code IZ0-047) Session number Module Topics 1 Retrieving Data Using the SQL SELECT Statement List the capabilities of SQL SELECT statements Execute a basic SELECT statement

More information

Querying Microsoft SQL Server 2012

Querying Microsoft SQL Server 2012 Querying Microsoft SQL Server 2012 Duration: 5 Days Course Code: M10774 Overview: Deze cursus wordt vanaf 1 juli vervangen door cursus M20461 Querying Microsoft SQL Server. This course will be replaced

More information

Oracle Database: Introduction to SQL

Oracle Database: Introduction to SQL Oracle University Contact Us: +381 11 2016811 Oracle Database: Introduction to SQL Duration: 5 Days What you will learn Understanding the basic concepts of relational databases ensure refined code by developers.

More information

Teradata Utilities Class Outline

Teradata Utilities Class Outline Teradata Utilities Class Outline CoffingDW education has been customized for every customer for the past 20 years. Our classes can be taught either on site or remotely via the internet. Education Contact:

More information

Querying Microsoft SQL Server (20461) H8N61S

Querying Microsoft SQL Server (20461) H8N61S HP Education Services course data sheet Querying Microsoft SQL Server (20461) H8N61S Course Overview In this course, you will learn the technical skills required to write basic Transact-SQL (T-SQL) queries

More information

D61830GC30. MySQL for Developers. Summary. Introduction. Prerequisites. At Course completion After completing this course, students will be able to:

D61830GC30. MySQL for Developers. Summary. Introduction. Prerequisites. At Course completion After completing this course, students will be able to: D61830GC30 for Developers Summary Duration Vendor Audience 5 Days Oracle Database Administrators, Developers, Web Administrators Level Technology Professional Oracle 5.6 Delivery Method Instructor-led

More information

SQL SERVER TRAINING CURRICULUM

SQL SERVER TRAINING CURRICULUM SQL SERVER TRAINING CURRICULUM Complete SQL Server 2000/2005 for Developers Management and Administration Overview Creating databases and transaction logs Managing the file system Server and database configuration

More information

Oracle Database: Introduction to SQL

Oracle Database: Introduction to SQL Oracle University Contact Us: 1.800.529.0165 Oracle Database: Introduction to SQL Duration: 5 Days What you will learn View a newer version of this course This Oracle Database: Introduction to SQL training

More information

Design and Implementation

Design and Implementation Pro SQL Server 2012 Relational Database Design and Implementation Louis Davidson with Jessica M. Moss Apress- Contents Foreword About the Author About the Technical Reviewer Acknowledgments Introduction

More information

Saskatoon Business College Corporate Training Centre 244-6340 corporate@sbccollege.ca www.sbccollege.ca/corporate

Saskatoon Business College Corporate Training Centre 244-6340 corporate@sbccollege.ca www.sbccollege.ca/corporate Microsoft Certified Instructor led: Querying Microsoft SQL Server (Course 20461C) Date: October 19 23, 2015 Course Length: 5 day (8:30am 4:30pm) Course Cost: $2400 + GST (Books included) About this Course

More information

Oracle Database 11 g Performance Tuning. Recipes. Sam R. Alapati Darl Kuhn Bill Padfield. Apress*

Oracle Database 11 g Performance Tuning. Recipes. Sam R. Alapati Darl Kuhn Bill Padfield. Apress* Oracle Database 11 g Performance Tuning Recipes Sam R. Alapati Darl Kuhn Bill Padfield Apress* Contents About the Authors About the Technical Reviewer Acknowledgments xvi xvii xviii Chapter 1: Optimizing

More information

Oracle Database 11g SQL

Oracle Database 11g SQL AO3 - Version: 2 19 June 2016 Oracle Database 11g SQL Oracle Database 11g SQL AO3 - Version: 2 3 days Course Description: This course provides the essential SQL skills that allow developers to write queries

More information

ORACLE 9I / 10G / 11G / PL/SQL COURSE CONTENT

ORACLE 9I / 10G / 11G / PL/SQL COURSE CONTENT ORACLE 9I / 10G / 11G / PL/SQL COURSE CONTENT INTRODUCTION: Course Objectives I-2 About PL/SQL I-3 PL/SQL Environment I-4 Benefits of PL/SQL I-5 Benefits of Subprograms I-10 Invoking Stored Procedures

More information

Choosing a Data Model for Your Database

Choosing a Data Model for Your Database In This Chapter This chapter describes several issues that a database administrator (DBA) must understand to effectively plan for a database. It discusses the following topics: Choosing a data model for

More information

How To Improve Performance In A Database

How To Improve Performance In A Database 1 PHIL FACTOR GRANT FRITCHEY K. BRIAN KELLEY MICKEY STUEWE IKE ELLIS JONATHAN ALLEN LOUIS DAVIDSON 2 Database Performance Tips for Developers As a developer, you may or may not need to go into the database

More information

Database Migration from MySQL to RDM Server

Database Migration from MySQL to RDM Server MIGRATION GUIDE Database Migration from MySQL to RDM Server A Birdstep Technology, Inc. Raima Embedded Database Division Migration Guide Published: May, 2009 Author: Daigoro F. Toyama Senior Software Engineer

More information

NUTECH COMPUTER TRAINING INSTITUTE 1682 E. GUDE DRIVE #102, ROCKVILLE, MD 20850 WEB: www.nutechtraining.com TEL: 301-610-9300

NUTECH COMPUTER TRAINING INSTITUTE 1682 E. GUDE DRIVE #102, ROCKVILLE, MD 20850 WEB: www.nutechtraining.com TEL: 301-610-9300 NUTECH COMPUTER TRAINING INSTITUTE 1682 E. GUDE DRIVE #102, ROCKVILLE, MD 20850 WEB: www.nutechtraining.com TEL: 301-610-9300 MCTS SQL Server 2005 Developer Course Outlines Exam 70 431: TS: Microsoft SQL

More information

SQL Server An Overview

SQL Server An Overview SQL Server An Overview SQL Server Microsoft SQL Server is designed to work effectively in a number of environments: As a two-tier or multi-tier client/server database system As a desktop database system

More information

SQL Databases Course. by Applied Technology Research Center. This course provides training for MySQL, Oracle, SQL Server and PostgreSQL databases.

SQL Databases Course. by Applied Technology Research Center. This course provides training for MySQL, Oracle, SQL Server and PostgreSQL databases. SQL Databases Course by Applied Technology Research Center. 23 September 2015 This course provides training for MySQL, Oracle, SQL Server and PostgreSQL databases. Oracle Topics This Oracle Database: SQL

More information

Information Systems SQL. Nikolaj Popov

Information Systems SQL. Nikolaj Popov Information Systems SQL Nikolaj Popov Research Institute for Symbolic Computation Johannes Kepler University of Linz, Austria popov@risc.uni-linz.ac.at Outline SQL Table Creation Populating and Modifying

More information

Data Tool Platform SQL Development Tools

Data Tool Platform SQL Development Tools Data Tool Platform SQL Development Tools ekapner Contents Setting SQL Development Preferences...5 Execution Plan View Options Preferences...5 General Preferences...5 Label Decorations Preferences...6

More information

Guide to SQL Programming: SQL:1999 and Oracle Rdb V7.1

Guide to SQL Programming: SQL:1999 and Oracle Rdb V7.1 Guide to SQL Programming: SQL:1999 and Oracle Rdb V7.1 A feature of Oracle Rdb By Ian Smith Oracle Rdb Relational Technology Group Oracle Corporation 1 Oracle Rdb Journal SQL:1999 and Oracle Rdb V7.1 The

More information

Migrating from Sybase to SQL Server

Migrating from Sybase to SQL Server Migrating from to Table of Contents: Migrating from to Data Compatibility Mode Behavior Optimizer Hints Conclusion Migrating from to Projects involving database migration are common. In this article, we

More information

SQL Server 2008 Core Skills. Gary Young 2011

SQL Server 2008 Core Skills. Gary Young 2011 SQL Server 2008 Core Skills Gary Young 2011 Confucius I hear and I forget I see and I remember I do and I understand Core Skills Syllabus Theory of relational databases SQL Server tools Getting help Data

More information

Oracle Database: Introduction to SQL

Oracle Database: Introduction to SQL Oracle University Contact Us: 1.800.529.0165 Oracle Database: Introduction to SQL Duration: 5 Days What you will learn This Oracle Database: Introduction to SQL training teaches you how to write subqueries,

More information

CHAPTER 2 DATABASE MANAGEMENT SYSTEM AND SECURITY

CHAPTER 2 DATABASE MANAGEMENT SYSTEM AND SECURITY CHAPTER 2 DATABASE MANAGEMENT SYSTEM AND SECURITY 2.1 Introduction In this chapter, I am going to introduce Database Management Systems (DBMS) and the Structured Query Language (SQL), its syntax and usage.

More information

SQL Server 2016 New Features!

SQL Server 2016 New Features! SQL Server 2016 New Features! Improvements on Always On Availability Groups: Standard Edition will come with AGs support with one db per group synchronous or asynchronous, not readable (HA/DR only). Improved

More information

Querying Microsoft SQL Server 2012. Querying Microsoft SQL Server 2014 20461D. Course 10774A: Course Det ails. Co urse Outline

Querying Microsoft SQL Server 2012. Querying Microsoft SQL Server 2014 20461D. Course 10774A: Course Det ails. Co urse Outline Course 10774A: Querying Microsoft SQL Server 2012 20461D Querying Microsoft SQL Server 2014 Course Det ails Co urse Outline M o d ule 1: Intr o d uctio n to M icro so ft SQL Ser ver 2012 This module introduces

More information

BCA. Database Management System

BCA. Database Management System BCA IV Sem Database Management System Multiple choice questions 1. A Database Management System (DBMS) is A. Collection of interrelated data B. Collection of programs to access data C. Collection of data

More information

Querying Microsoft SQL Server 2012

Querying Microsoft SQL Server 2012 Querying Microsoft SQL Server 2012 MOC 10774 About this Course This 5-day instructor led course provides students with the technical skills required to write basic Transact-SQL queries for Microsoft SQL

More information

Discovering SQL. Wiley Publishing, Inc. A HANDS-ON GUIDE FOR BEGINNERS. Alex Kriegel WILEY

Discovering SQL. Wiley Publishing, Inc. A HANDS-ON GUIDE FOR BEGINNERS. Alex Kriegel WILEY Discovering SQL A HANDS-ON GUIDE FOR BEGINNERS Alex Kriegel WILEY Wiley Publishing, Inc. INTRODUCTION xxv CHAPTER 1: DROWNING IN DATA, DYING OF THIRST FOR KNOWLEDGE 1 Data Deluge and Informational Overload

More information

Programming with SQL

Programming with SQL Unit 43: Programming with SQL Learning Outcomes A candidate following a programme of learning leading to this unit will be able to: Create queries to retrieve information from relational databases using

More information

IT2305 Database Systems I (Compulsory)

IT2305 Database Systems I (Compulsory) Database Systems I (Compulsory) INTRODUCTION This is one of the 4 modules designed for Semester 2 of Bachelor of Information Technology Degree program. CREDITS: 04 LEARNING OUTCOMES On completion of this

More information

Top 10 Oracle SQL Developer Tips and Tricks

Top 10 Oracle SQL Developer Tips and Tricks Top 10 Oracle SQL Developer Tips and Tricks December 17, 2013 Marc Sewtz Senior Software Development Manager Oracle Application Express Oracle America Inc., New York, NY The following is intended to outline

More information

Topics Advanced PL/SQL, Integration with PROIV SuperLayer and use within Glovia

Topics Advanced PL/SQL, Integration with PROIV SuperLayer and use within Glovia Topics Advanced PL/SQL, Integration with PROIV SuperLayer and use within Glovia 1. SQL Review Single Row Functions Character Functions Date Functions Numeric Function Conversion Functions General Functions

More information

Duration Vendor Audience 5 Days Oracle Developers, Technical Consultants, Database Administrators and System Analysts

Duration Vendor Audience 5 Days Oracle Developers, Technical Consultants, Database Administrators and System Analysts D80186GC10 Oracle Database: Program with Summary Duration Vendor Audience 5 Days Oracle Developers, Technical Consultants, Database Administrators and System Analysts Level Professional Technology Oracle

More information

MS-50401 - Designing and Optimizing Database Solutions with Microsoft SQL Server 2008

MS-50401 - Designing and Optimizing Database Solutions with Microsoft SQL Server 2008 MS-50401 - Designing and Optimizing Database Solutions with Microsoft SQL Server 2008 Table of Contents Introduction Audience At Completion Prerequisites Microsoft Certified Professional Exams Student

More information

ICAB4136B Use structured query language to create database structures and manipulate data

ICAB4136B Use structured query language to create database structures and manipulate data ICAB4136B Use structured query language to create database structures and manipulate data Release: 1 ICAB4136B Use structured query language to create database structures and manipulate data Modification

More information

How To Create A Table In Sql 2.5.2.2 (Ahem)

How To Create A Table In Sql 2.5.2.2 (Ahem) Database Systems Unit 5 Database Implementation: SQL Data Definition Language Learning Goals In this unit you will learn how to transfer a logical data model into a physical database, how to extend or

More information

IT2304: Database Systems 1 (DBS 1)

IT2304: Database Systems 1 (DBS 1) : Database Systems 1 (DBS 1) (Compulsory) 1. OUTLINE OF SYLLABUS Topic Minimum number of hours Introduction to DBMS 07 Relational Data Model 03 Data manipulation using Relational Algebra 06 Data manipulation

More information

Using SQL Server Management Studio

Using SQL Server Management Studio Using SQL Server Management Studio Microsoft SQL Server Management Studio 2005 is a graphical tool for database designer or programmer. With SQL Server Management Studio 2005 you can: Create databases

More information

Introduction and Overview for Oracle 11G 4 days Weekends

Introduction and Overview for Oracle 11G 4 days Weekends Introduction and Overview for Oracle 11G 4 days Weekends The uses of SQL queries Why SQL can be both easy and difficult Recommendations for thorough testing Enhancing query performance Query optimization

More information

ATTACHMENT 6 SQL Server 2012 Programming Standards

ATTACHMENT 6 SQL Server 2012 Programming Standards ATTACHMENT 6 SQL Server 2012 Programming Standards SQL Server Object Design and Programming Object Design and Programming Idaho Department of Lands Document Change/Revision Log Date Version Author Description

More information

Oracle Database 11g: SQL Tuning Workshop Release 2

Oracle Database 11g: SQL Tuning Workshop Release 2 Oracle University Contact Us: 1 800 005 453 Oracle Database 11g: SQL Tuning Workshop Release 2 Duration: 3 Days What you will learn This course assists database developers, DBAs, and SQL developers to

More information

Upon completion of the program, students are given a full support to take and pass Microsoft certification examinations.

Upon completion of the program, students are given a full support to take and pass Microsoft certification examinations. Upon completion of the program, students are given a full support to take and pass Microsoft certification examinations. After completing this course, students will be able to: Plan and install SQL Server

More information

W I S E. SQL Server 2008/2008 R2 Advanced DBA Performance & WISE LTD.

W I S E. SQL Server 2008/2008 R2 Advanced DBA Performance & WISE LTD. SQL Server 2008/2008 R2 Advanced DBA Performance & Tuning COURSE CODE: COURSE TITLE: AUDIENCE: SQSDPT SQL Server 2008/2008 R2 Advanced DBA Performance & Tuning SQL Server DBAs, capacity planners and system

More information

50439B: Basics of Transact SQL with SQL Server 2008 R2

50439B: Basics of Transact SQL with SQL Server 2008 R2 50439B: Basics of Transact SQL with SQL Server 2008 R2 Duration: 3 days Class Description This instructor-led course provides students with the necessary knowledge to work with the data in SQL Server 2008R2.

More information

Physical Database Design and Tuning

Physical Database Design and Tuning Chapter 20 Physical Database Design and Tuning Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1. Physical Database Design in Relational Databases (1) Factors that Influence

More information

http://www.sqlauthority.com

http://www.sqlauthority.com SQL Interview Questions with Answers http://www.sqlauthority.com What is RDBMS? Relational Data Base Management Systems (RDBMS) are database management systems that maintain data records and indices in

More information

Oracle Database 11g: Administer a Data Warehouse

Oracle Database 11g: Administer a Data Warehouse Oracle Database 11g: Administer a Data Warehouse Volume I Student Guide D70064GC10 Edition 1.0 July 2008 D55424 Authors Lauran K. Serhal Mark Fuller Technical Contributors and Reviewers Hermann Baer Kenji

More information

OPTIMIZING QUERIES IN SQL SERVER 2008

OPTIMIZING QUERIES IN SQL SERVER 2008 Scientific Bulletin Economic Sciences, Vol. 9 (15) - Information technology - OPTIMIZING QUERIES IN SQL SERVER 2008 Professor Ph.D. Ion LUNGU 1, Nicolae MERCIOIU 2, Victor VLĂDUCU 3 1 Academy of Economic

More information

"Charting the Course... MOC 55144 AC SQL Server 2014 Performance Tuning and Optimization. Course Summary

Charting the Course... MOC 55144 AC SQL Server 2014 Performance Tuning and Optimization. Course Summary Description Course Summary This course is designed to give the right amount of Internals knowledge, and wealth of practical tuning and optimization techniques, that you can put into production. The course

More information