deeper skill set certification requirement broader skill set recertification relevance rigor

69

Upload: archibald-evans

Post on 23-Dec-2015

222 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor
Page 2: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Querying Microsoft SQL Server 2012

boB Taylor MCA, MCM, MCSD, MCSE, MCT

Principal Consultant - Premier DeveloperEmail: [email protected]: @sqlboBTBlog: http://blogs.msdn.com/bobtaylor

Page 3: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

YOU KNOW SQL SERVER 2012How do you become certified?

Identify Certification GoalFind GapsFill GapsTake Exam

Page 4: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Microsoft Certification

Page 5: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

For YouIncreased confidence in your abilities at workEnhanced product knowledgeLearn about certification to educate your coworkers and bosses

Page 6: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

For Your CareerMakes a great commitmentShows drive and initiativeTangible way to demonstrate mastery of a productSets you apart from your peers at review timeRecognition inside and outside of MicrosoftCompletely achievable at TechEd

Page 7: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Changes to Certifications and Exams

Deeper Skill Set

Certification Requirement

Broader Skill Set

Recertification

Relevance Rigor

Page 8: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

MCSE and MCSD Certifications

Web Applications Windows Store Apps

Server Infrastructure Desktop Infrastructure

Business Intelligence Data Platform

Private Cloud

Page 9: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Increased RigorReflection of the real worldLearn more, validate moreSolutions are more complex, questions must reflect thatBest way to measure candidates know what they know

New item typesFewer multiple choiceCase studies

Scenario basedSee big picture and make decisions

Innovative item types

Page 10: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Exam Tips

Page 11: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Exam Basics40-60 questions1-4 hours to complete examCan review questions

Cannot move between case studies700 is passing700 is not 70%

Page 12: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Exam ScoringEach exam has a "cut score"Each question is worth one pointNo partial creditNo points deducted for wrong answers

Page 13: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

How to interpret questions

One or Multiple Correct Answers

Goal Statement

Business ProblemAll questions have a consistent anatomy

Multiple Distracters

Questions are not intended to trick you

Page 14: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Identify Your Certification Goals

Page 15: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

MCSA: SQL Server 2012Certification Requirements

Exam 70-461:Querying Microsoft SQL Server 2012

MCSA: SQL Server 2012

Exam 70-462:Administering Microsoft SQL Server 2012 Databases

Exam 70-463:Implementing a Data Warehouse

with Microsoft SQL Server 2012

Page 16: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

MCSE: Data PlatformCertification Requirements

MCSA: SQL Server 2012

MCSE: Data Platform

Exam 70-464:Developing

Microsoft SQL Server 2012 Databases

Exam 70-465:Designing Database

Solutions for SQL Server 2012

Page 17: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

FIND KNOWLEDGE GAPS

Page 18: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Exam 70-461 GuideSkills Measured

Functional groups and individual topicsRelative weighting of functional groupsLinks to more information about functional topics

Preparation Options

Check the Exam Guide

Page 19: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

70-461 Exam OutlineObjective %

Create Database Objects 24%

Work with Data 27%

Modify Data 24%

Troubleshoot and Optimize Queries 25%

Details of each area

Page 20: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

FILL KNOWLEDGE GAPS

Page 21: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Topics Outline

Create Database ObjectsQuerying DataModifying DataOptimizing Queries

Page 22: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Topics Outline

Create Database ObjectsQuerying DataModifying DataOptimizing Queries

Page 23: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Notable Data Types

XMLSpatial

GeometryGeography

DateDateTimeDateTime2DateTimeOffset

Page 24: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Constraints

CheckPrimary KeyForeign KeyUniqueDefault

[ColumnDefinition] ConstraintName TYPE Options

Page 25: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

DML Triggers

Update tables to maintain integrityPerform complex checksAuditingTypes

Instead ofAfter

CREATE TRIGGER ProductCategory_InsertON Production.ProductCategoryAFTER INSERTASBEGIN

SET NOCOUNT ONINSERT INTO ProductCategoryLog

(ProductCategoryID, Name, CreationDate)

SELECT INSERTED.ProductCategoryID

, INSERTED.Name, GETDATE()

FROM INSERTEDEND

Note: Always part of the current transaction

Page 26: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

View Restrictions

1024 columnsSingle queryRestricted data modificationsNo top (without order by)

Page 27: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

View Options

SchemabindingEncryptionView MetadataCheck

Page 28: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

QuestionYou are a database developer. One of the requirements is to create searchable maps of floor plans to allow customers to determine where items are stored. What data type should use?A.GeometryB.VarbinaryC.BigIntD.Geography

Page 29: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Answer

You are a database developer. One of the requirements is to create searchable maps of floor plans to allow customers to determine where items are stored. What data type should use?A.GeometryB.VarbinaryC.BigIntD.Geography

Takeaway: Geometry for flat surfaces

Page 30: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Topics Outline

Create Database ObjectsQuerying DataModifying DataOptimizing Queries

Page 31: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

SQL 2012 Functions

TRY_CONVERT(type, value)PARSE(value AS type USING culture)

TRY_PARSE also available

FORMAT(value, format, culture)IIF(boolean, True, False)

Page 32: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Ranking Options

RankDense rankNtileRow number

Page 33: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Joins

InnerOuterFullCross

Page 34: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Apply Operators

Join to a functionCross Apply

“Inner Join”

Outer Apply“Outer Join”

Page 35: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Common table expresssion (CTE)

WITH CustomersWithOrders(CustomerID) AS (SELECT CustomerID FROM Sales.Customer INTERSECT SELECT CustomerID FROM Sales.SalesOrderHeader)SELECT cwo.CustomerID, c.FirstName, c.LastName, c.EmailAddressFROM CustomersWithOrders cwo INNER JOIN Sales.Customer c ON cwo.CustomerID = c.CustomerID;

Page 36: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Handling Null Values

Null != NullUse Column IS NULL or Column IS NOT NULL

CaseISNULLCOALESCE

Page 37: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

PivotWITH SalesData AS (SELECT st.Name AS TerritoryName, soh.SubTotal AS SalesAmount, Year(soh.OrderDate) AS SalesYear FROM Sales.SalesTerritory st INNER JOIN Sales.SalesOrderHeader soh ON st.TerritoryID = soh.TerritoryID)SELECT *FROM SalesData PIVOT (Sum(SalesAmount) FOR SalesYear IN ([2001], [2002], [2003], [2004])) AS PvtORDER BY TerritoryName;

Page 38: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Rollup and CubeSELECT Region

, Country, Category, SUM(TotalSold) AS TotalSales

FROM Sales.SalesInformation

GROUP BY ROLLUP(Region, Country, Category); -- One pass-- ORGROUP BY ROLLUP(Region, Country, Category); -- Every Pass

Page 39: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Grouping SetsSELECT Region

, Country, Category, SUM(TotalSold) AS TotalSales

FROM Sales.SalesInformationGROUP BY GROUPING SETS (

(Region, Country, Category), (Country, Category), (Region, Category), (Category)

);

Page 40: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

FOR XML – RAWSELECT FirstName

, LastNameFROM Person.ContactFOR XML RAW('Contact')

, ROOT('Contacts'), ELEMENTS

<Contacts> <Contact> <FirstName>...</FirstName> <LastName>...</LastName> </Contact></Contacts>

Page 41: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

FOR XML – AUTOSELECT FirstName

, LastNameFROM Person.Contact AS ContactFOR XML AUTO

, ROOT('Contacts'), ELEMENTS

<Contacts> <Contact> <FirstName>...</FirstName> <LastName>...</LastName> </Contact></Contacts>

Page 42: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

FOR XML - EXPLICITSELECT 1 AS Tag

, NULL AS Parent , ProductID AS [Product!1! ID], Name AS [Product!1!Name!ELEMENT]

FROM SalesLT.ProductWHERE ProductCategoryID = 5FOR XML EXPLICIT

, ROOT('Products');

<Products> <Product ID="..."> <Name>...</Name> </Product></Products>

Page 43: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

XML - Retrieving Elements and Attributes (PATH)SELECT ProductID AS [@ID]

, NameFROM SalesLT.ProductWHERE ProductCategoryID = 5FOR XML PATH('Product')

, ROOT('Products');<Products> <Product ID="..."> <Name>...</Name> </Product></Products>

Page 44: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Fetch and OffsetSELECT FirstName

, LastNameFROM HumanResources.EmployeeORDER BY LastName

OFFSET @StartingRowNumber ROWSFETCH NEXT @Rows ROWS ONLY;

Page 45: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

QuestionYou have a query that returns data using the cube option. One of the columns contains null data. You need to identify when a field is being used to display aggregated data. What should you include in your query?A.CASEB. ISNULLC.GROUPING_IDD.COALESCE

Page 46: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

QuestionYou have a query that returns data using the cube option. One of the columns contains null data. You need to identify when a field is being used to display aggregated data. What should you include in your query?A.CASEB. ISNULLC.GROUPING_IDD.COALESCE

Page 47: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Topics Outline

Create Database ObjectsQuerying DataModifying DataOptimizing Queries

Page 48: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Stored Procedure Options

EncryptionExecute As

OwnerSelfCaller'user'

Recompile

Page 49: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Update StatementUPDATE Production.ProductSET ListPrice = tp.ListPriceOUTPUT DELETED.Name

, INSERTED.ListPrice AS NewPrice, DELETED.ListPrice AS OldPrice

FROM Production.Product pINNER JOIN #TempProducts tp

ON p.ProductID = tp.ProductID

Page 50: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Merge Statement

Merge data from one table with anotherComponents

TargetSourceOn statement

“Join” for Target and SourceMatchedNot matchedOutput

Page 51: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Merge SyntaxMERGE Target AS TUSING Source AS S

ON (T.EmployeeID = S.EmployeeID) WHEN NOT MATCHED BY TARGET -- INSERT THEN INSERT(EmployeeID, EmployeeName)

VALUES(S.EmployeeID, S.EmployeeName)WHEN MATCHED -- UPDATE THEN UPDATE SET T.EmployeeName = S.EmployeeNameOUTPUT $action AS [Action]

, inserted.EmployeeID AS [NewID], inserted.EmployeeName AS [NewName], deleted.EmployeeID AS [OldID], deleted.EmployeeName AS [OldName];

Page 52: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

QuestionYou need to create a stored procedure to update rows in a table named Customers. You have permissions to alter rows in Customers. You need to ensure all callers of this stored procedure will be able to perform the operation even if they don’t have permissions access to the table. Which option should you use when creating the stored procedure?A. ENCRYPTIONB. EXECUTE AS CALLERC. EXECUTE AS SELFD. RECOMPILE

Page 53: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

QuestionYou need to create a stored procedure to update rows in a table named Customers. You have permissions to alter rows in Customers. You need to ensure all callers of this stored procedure will be able to perform the operation even if they don’t have permissions access to the table. Which option should you use when creating the stored procedure?A. ENCRYPTIONB. EXECUTE AS CALLERC. EXECUTE AS SELFD. RECOMPILE

Page 54: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Topics Outline

Create Database ObjectsQuerying DataModifying DataOptimizing Queries

Page 55: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Join Types

Nested LoopSmall joins

Merge JoinsLarge, sorted data

Hash JoinLarge, unsorted data

Page 56: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Transactions

BeginCommitRollbackSave

Page 57: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Isolation LevelsRead Uncommitted

No locks

Read CommittedSelect only locks during execution

Repeatable ReadSelect locks data that has been returned

SerializableSelect locks the range

May incur a table lock

Page 58: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Snapshot Isolation

Uses versioningEveryone gets a sandbox

Additional TempDB overheadMust be enabled at the database levelREAD_COMMITTED_SNAPSHOT

Converts read committed to snapshot

Page 59: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Try/CatchBEGIN TRY

BEGIN TRANSACTION-- Perform Work, assuming successCOMMIT TRANSACTION

END TRYBEGIN CATCH

ROLLBACK TRANSACTION

PRINT ERROR_MESSAGE()PRINT ERROR_NUMBER()PRINT ERROR_LINE()

END CATCH

Page 60: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Cursors

Row based logicGenerally slows performance

Steps to use a cursorDeclare cursorOpen cursorFetch dataCreate loopUse dataClose cursorDeallocate cursor

Page 61: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Query HintUsed to suggest how optimizer should execute query

Table HintUsed to suggest how optimizer should access a table

Using Hints

SELECT * FROM Person.AddressWHERE City = @city_name AND PostalCode = @postal_codeOPTION (OPTIMIZE FOR (@city_name = 'Seattle', @postal_code UNKNOWN));

UPDATE Production.Product WITH (TABLOCK) SET ListPrice = ListPrice * 1.10WHERE ProductNumber LIKE 'BK-%';

Page 62: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

SCHEDULE AND TAKE THE EXAM

Page 63: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Exam Tips• Set a date• Set small goals• Sleep well

Before the Exam

• Don’t panic• Keep an eye on time• Don’t spend too long on one question

During the Exam

• Eliminate wrong answers• Mark the question for review• Guess

Tough Question

Page 64: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Resources

Register for the examwww.prometric.com

Prepare for the examExam 70-461 Exam Preparation

Microsoft Official Courseware10774A – Querying Microsoft SQL Server 2012

Microsoft PressTraining Kit (Exam 70-461) Querying Microsoft SQL Server 2012Microsoft SQL Server 2012 T-SQL Fundamentals

Page 65: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Resources

Learning

Microsoft Certification & Training Resources

www.microsoft.com/learning

msdn

Resources for Developers

http://microsoft.com/msdn

TechNet

Resources for IT Professionals

http://microsoft.com/technet

Sessions on Demand

http://channel9.msdn.com/Events/TechEd

Page 66: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Complete an evaluation and enter to win!

Page 67: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Evaluate this session

Scan this QR code to evaluate this session.

Page 68: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

Related contentLabs DBI-H305 What's New for T-SQL in Microsoft SQL Server 2012

Related Certification Exam 70-462 Administering Microsoft SQL Server 2012 Databases

Find Me Later At Ask The Experts

or Exam Prep for Exam 70-462

Page 69: Deeper Skill Set Certification Requirement Broader Skill Set Recertification Relevance Rigor

© 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.