70-461-exam-guide-querying-microsoft-sql-server-2012_VERY GOOD.pdf

10
70-461 Exam Guide Querying Microsoft SQL Server 2012 If you are looking for preparation materials for 70-461 exam querying Microsoft SQL Server 2012 than hopefully you will find this blog posts useful. You will see links that will point you directly to the area you want to study and you will see both our website links and comprehensive Microsoft documentation links. If you are new to SQL we suggest to start with our SQL Tutorial first. You can test your SQL Knowledge using our SQL Telephone Interview Questions. NOTE: These are interview questions NOT 70-461 exam questions so they may not represent exam topics. Create Database Objects (24%) Create and alter tables using T-SQL syntax (simple statements). o This objective may include but is not limited to: o Create tables without using the built-in tools; o CREATE TABLE Our Links: SQL CREATE TABLE - Find out how to use CREATE TABLE. We start with very simple example and add extra opons one step at a me. Microsoſt Links: hp://msdn.microsoſt.com/en- us/library/ms174979(v=sql.110).aspx DROP TABLE Our links: SQL DROP TABLE - Short and easy to follow blog post that show how to remove table using SSMS Interface and SQL DROP TABLE Statement. Microsoft links: http://msdn.microsoft.com/en- us/library/ms173790(v=sql.110).aspx ALTER TABLE Microsoft Links: http://msdn.microsoft.com/en- us/library/ms190273(v=sql.110).aspx ALTER COLUMN Our Links: SQL ALTER TABLE ADD COLUMN

Transcript of 70-461-exam-guide-querying-microsoft-sql-server-2012_VERY GOOD.pdf

Page 1: 70-461-exam-guide-querying-microsoft-sql-server-2012_VERY GOOD.pdf

70-461 Exam Guide Querying Microsoft SQL

Server 2012

If you are looking for preparation materials for 70-461 exam querying Microsoft SQL Server 2012 than hopefully

you will find this blog posts useful.

You will see links that will point you directly to the area you want to study and you will see both our website

links and comprehensive Microsoft documentation links.

If you are new to SQL we suggest to start with our SQL Tutorial first.

You can test your SQL Knowledge using our SQL Telephone Interview Questions. NOTE: These are interview

questions NOT 70-461 exam questions so they may not represent exam topics.

Create Database Objects (24%)

Create and alter tables using T-SQL syntax (simple statements).

o This objective may include but is not limited to:

o Create tables without using the built-in tools;

o

CREATE TABLE

Our Links:

SQL CREATE TABLE - Find out how to use CREATE

TABLE. We start with very simple example and add

extra options one step at a time.

Microsoft Links:

http://msdn.microsoft.com/en-

us/library/ms174979(v=sql.110).aspx

DROP TABLE

Our links:

SQL DROP TABLE - Short and easy to follow blog

post that show how to remove table using SSMS

Interface and SQL DROP TABLE Statement.

Microsoft links:

http://msdn.microsoft.com/en-

us/library/ms173790(v=sql.110).aspx

ALTER TABLE

Microsoft Links:

http://msdn.microsoft.com/en-

us/library/ms190273(v=sql.110).aspx

ALTER COLUMN

Our Links:

SQL ALTER TABLE ADD COLUMN

Page 2: 70-461-exam-guide-querying-microsoft-sql-server-2012_VERY GOOD.pdf

Microsoft links:

See Alter table above

Create and alter views (simple statements).

o This objective may include but is not limited to:

o create views without using the built-in tools

o

CREATE VIEW

Microsoft links:

http://msdn.microsoft.com/en-

us/library/ms187956(v=sql.110).aspx

ALTER VIEW

Microsoft links:

http://msdn.microsoft.com/en-

us/library/ms173846(v=sql.110).aspx

DROP VIEW

Our Links:

SQL DROP VIEW - Short and easy to follow blog post

that show how to remove view using SSMS Interface

and SQL DROP TABLE Statement.

Microsoft links:

http://msdn.microsoft.com/en-

us/library/ms173492(v=sql.110).aspx

Create indexed views

Microsoft links:

http://msdn.microsoft.com/en-

us/library/ms191432(v=sql.110).aspx

Design views.

o This objective may include but is not limited to:

o

ensure code non regression by

keeping consistent signature

for procedure, views, and

function (interfaces)

I need to decode the exact requirement..... Many thanks

to Cameron for decoding this requirement and here is

decoded message with answers:

"Ensure that a legacy, non-recompiled application

(which accesses a database;OLTP) is not broken

(becomes unusable) because table schema (such as data

types which might have been upgraded in SQL Server

2012) is changed.

This is accomplished by creating/modifying Views,

Stored Procedures, and Functions to emulate the

Page 3: 70-461-exam-guide-querying-microsoft-sql-server-2012_VERY GOOD.pdf

interface (signature) which the applications expects (to

work successfully).

So if tables, their columns, data types, constraints, etc.

have been changed/updated, instead of doing what lazy

programmers hate most (upgrading their applications),

business continuity is ensured via the easier task of

creating/modifying views to emulate (mimic) the data

structure expected by the application (code)."

Microsoft link:

http://msdn.microsoft.com/en-

us/library/ms187956.aspx

security implications

icrosoft links:

http://msdn.microsoft.com/en-

us/library/ms187956.aspx

Create and modify constraints (simple statements).

o This objective may include but is not limited to:

o

create constraints on tables

Our Links:

SQL CHECK Constraint - Find out how to

restrict user values and ensure only good quality

data is entered that meets business rules.

Microsoft links:

http://msdn.microsoft.com/en-

us/library/ms188066(v=sql.110).aspx

define constraints

Microsoft links:

See above

unique constraints

Our Links:

SQL UNIQUE Constraint - Find out how to

create UNIQUE Constraint and check two

popular examples.

Microsoft links:

See above

default constraints Our links:

Page 4: 70-461-exam-guide-querying-microsoft-sql-server-2012_VERY GOOD.pdf

SQL DEFAULT CONSTRAINT - Find out how

to provide default value during insert when not

value is provided for the specified field.

Microsoft links:

See above

primary and foreign key constraints

Our Links:

SQL Primary Key Constraint - Find out how to

add primary key using alter table statement.

SQL Foreign Key Constraint - Find out how to

add foreign key constraint using alter table

statement.

Microsoft links:

See above

Create and alter DML triggers.

o This objective may include but is not limited to:

o

inserted and deleted tables;

Microsoft links:

http://msdn.microsoft.com/en-

us/library/ms189799(v=sql.110).aspx

http://msdn.microsoft.com/en-

us/library/ms176072(v=sql.110).aspx

nested triggers;

Microsoft links:

http://msdn.microsoft.com/en-

us/library/ms190739(v=sql.110).aspx

types of triggers;

Microsoft links:

http://msdn.microsoft.com/en-

us/library/ms178110(v=sql.110).aspx

update functions;

handle multiple rows in a session;

Microsoft links:

http://msdn.microsoft.com/en-

us/library/ms190752(v=sql.110).aspx

performance implications of triggers

Work with Data (27%) Query data by using SELECT statements.

o This objective may include but is not limited to:

o

Page 5: 70-461-exam-guide-querying-microsoft-sql-server-2012_VERY GOOD.pdf

use the ranking function to select top(X) rows for

multiple categories in a single query;

Microsoft links:

http://msdn.microsoft.com/en-

us/library/ms189798(v=sql.110).aspx

write and perform queries efficiently using

the new code items such as synonyms and

joins (except, intersect);

Our links:

SQL Except

Microsoft links:

http://msdn.microsoft.com/en-

us/library/ms188055(v=sql.105).aspx

implement logic which uses dynamic SQL

and system metadata

write efficient, technically complex SQL

queries, including all types of joins versus

the use of derived tables;

determine what code may or may not

execute based on the tables provided;

given a table with constraints, determine

which statement set would load a table;

use and understand different data access

technologies;

CASE versus ISNULL versus COALESCE Implement sub-queries.

o This objective may include but is not limited to:

o

identify problematic elements

in query plans;

pivot and unpivot;

Microsoft links:

http://msdn.microsoft.com/en-

us/library/ms177410(v=SQL.105).aspx

apply operator;

Microsoft links:

http://msdn.microsoft.com/en-

us/library/ms175156(v=SQL.105).aspx

cte statement;

Microsoft links:

http://msdn.microsoft.com/en-

us/library/ms190766(v=SQL.105).aspx

with statement

Microsoft links:

http://msdn.microsoft.com/en-

us/library/ms175972(v=sql.110).aspx

Implement data types.

o This objective may include but is not limited to:

o

use appropriate data;

Page 6: 70-461-exam-guide-querying-microsoft-sql-server-2012_VERY GOOD.pdf

understand the uses

and limitations of

each data type;

SQL Server 2012 Data Types - Data Type is a very

important concept in SQL Server and we in this

article you give you overview of data types and show

key information related to them.

impact of GUID

(newid,

newsequentialid) on

database

performance,

QUICK ANSWER: newID is slower than newsequentialid.

Articles to cover it will be included later on.

QUICK ANSWER: newsequentialid is not entirely secure and

you may guess the value...NewID is random and better for

"randomization" (get truly random exactly 20 rows)

Microsoft links:

http://msdn.microsoft.com/en-us/library/ms190348.aspx

http://msdn.microsoft.com/en-

us/library/ms189786(v=sql.110).aspx

when to use which

data type for columns Implement aggregate queries.

o This objective may include but is not limited to:

o

new analytic functions;

Microsoft links:

http://msdn.microsoft.com/en-us/library/hh213234

grouping sets;

spatial aggregates;

Microsoft links:

http://msdn.microsoft.com/en-

us/library/hh403400(v=sql.110).aspx

apply ranking functions Query and manage XML data.

o This objective may include but is not limited to:

o

understand XML datatypes and their

schemas and interoperability with

limitations and restrictions;

Microsoft links:

http://msdn.microsoft.com/en-

us/library/ms189887(v=SQL.90).aspx

implement XML schemas and handling of

XML data;

Microsoft links:

http://msdn.microsoft.com/en-

us/library/ms176009(v=sql.110).aspx

how to handle XML data in SQL Server and

when and when not to use it, including

XML namespaces;

Microsoft links:

http://msdn.microsoft.com/en-

us/library/bb522446(v=sql.110).aspx

import and export XML; Microsoft links:

Page 7: 70-461-exam-guide-querying-microsoft-sql-server-2012_VERY GOOD.pdf

http://msdn.microsoft.com/en-

us/library/aa179112(v=SQL.80).aspx

http://msdn.microsoft.com/en-

us/library/aa179108(v=sql.110).aspx

XML indexing

Microsoft links:

http://msdn.microsoft.com/en-

us/library/ms191497(v=sql.110).aspx

Modify Data (24%) Create and alter stored procedures (simple statements).

o This objective may include but is not limited to:

o

Our own requirements:

Create, Alter and Drop stored procedure

Our Links:

SQL DROP STORED

PROCEDURE - In this tutorial you

will learn how to drop procedure

(remove from database) using both

interface and script.

write a stored procedure to meet a given set

of requirements;

Microsoft links:

http://msdn.microsoft.com/en-

us/library/ms190782(v=sql.110).aspx

branching logic;

Microsoft links:

http://msdn.microsoft.com/en-

us/library/ms182717(v=sql.110).aspx

create stored procedures and other

programmatic objects;

Microsoft links:

http://msdn.microsoft.com/en-

us/library/ms187926(v=sql.110).aspx

techniques for developing stored

procedures;

different types of stored procedure results;

QUICK ANSWER: User-

defined SP, Extended SP (Do

not use; replaced with CLR)

and system SP. Write article.

create a stored procedure for data access

layer;

program stored procedures, triggers, and

functions with T-SQL Modify data by using INSERT, UPDATE, and DELETE statements.

Page 8: 70-461-exam-guide-querying-microsoft-sql-server-2012_VERY GOOD.pdf

o This objective may include but is not limited to:

o

given a set of code with defaults,

constraints, and triggers, determine the

output of a set of DDL;

Microsoft links:

http://msdn.microsoft.com/en-

us/library/ms174335(v=sql.110).aspx

http://msdn.microsoft.com/en-

us/library/ms177523(v=sql.110).aspx

http://msdn.microsoft.com/en-

us/library/ms189835(v=sql.110).aspx

know which SQL statements are best to

solve common requirements; ??

use output statement

Microsoft links:

http://msdn.microsoft.com/en-

us/library/ms177564(v=sql.110).aspx

Combine datasets.

o This objective may include but is not limited to:

o

difference between UNION and UNION

all;

Our links:

SQL UNION - Simple example of how to

use union and comments related to

UNION ALL

Microsoft links:

http://msdn.microsoft.com/en-

us/library/ms180026(v=sql.110).aspx

case vs. isnull vs. coalesce;

modify data by using MERGE statements

Microsoft links:

http://msdn.microsoft.com/en-

us/library/bb510625(v=sql.110).aspx

Work with functions.

o This objective may include but is not limited to:

o

Our own requirements:

How to create, alter and drop functions

Our Links:

SQL DROP FUNCTION - Find out

how to remove function (drop) from

database using both interface and

script.

understand deterministic and non-

deterministic functions;

Microsoft links:

http://msdn.microsoft.com/en-

us/library/aa214775(v=SQL.110).aspx

Page 9: 70-461-exam-guide-querying-microsoft-sql-server-2012_VERY GOOD.pdf

scalar and table values;

apply built-in scalar functions;

create and alter user-defined functions

(UDFs)

Microsoft links:

http://msdn.microsoft.com/en-

us/library/ms186755(v=sql.110).aspx

http://msdn.microsoft.com/en-

us/library/ms186967(v=sql.110).aspx

Troubleshoot and Optimize Queries (25%) Optimize queries.

o This objective may include but is not limited to:

o

understand statistics;

Microsoft links:

http://msdn.microsoft.com/en-

us/library/ms190397(v=sql.110).aspx

read query plans;

plan guides;

DMVs;

Microsoft links:

http://msdn.microsoft.com/en-

us/library/ms188754(v=sql.110).aspx

hints;

Microsoft links:

http://msdn.microsoft.com/en-

us/library/ms181714(v=sql.110).aspx

statistics IO;

Microsoft links:

http://msdn.microsoft.com/en-

us/library/ms184361(v=sql.110).aspx

dynamic vs. parameterized queries;

describe the different join types (HASH,

MERGE, LOOP) and describe the scenarios

in which they would be used Manage transactions.

o This objective may include but is not limited to:

o

mark a transaction;

understand begin tran,

commit, and rollback;

Microsoft links:

http://msdn.microsoft.com/en-

us/library/ms174377(v=sql.110).aspx

http://msdn.microsoft.com/en-

us/library/ms188929(v=sql.110).aspx

http://msdn.microsoft.com/en-

us/library/ms190295(v=sql.110).aspx

Page 10: 70-461-exam-guide-querying-microsoft-sql-server-2012_VERY GOOD.pdf

http://msdn.microsoft.com/en-

us/library/ms181299(v=sql.110).aspx

implicit vs. explicit

transactions;

Microsoft links:

http://msdn.microsoft.com/en-

us/library/ms187807(v=sql.110).aspx

isolation levels;

Microsoft links:

http://msdn.microsoft.com/en-us/library/ms173763.aspx

scope and type of locks;

trancount

Microsoft links:

http://msdn.microsoft.com/en-

us/library/ms187967(v=sql.110).aspx

Evaluate the use of row-based operations vs. set-based operations.

o This objective may include but is not limited to:

o

when to use cursors;

impact of scalar UDFs;

combine multiple DML operations Implement error handling.

o This objective may include but is not limited to:

o

implement try/catch/throw;

Microsoft links:

http://msdn.microsoft.com/en-

us/library/ms175976(v=sql.110).aspx

use set based rather than row based logic;

transaction management

Microsoft links:

http://msdn.microsoft.com/en-

us/library/ms174377(v=sql.110).aspx

Take care

Katie & Emil