Sunteți pe pagina 1din 14

Questios & Aoswers PDF Page 1

Microsoft
70-461 Exam
Querying Microsoft SQL Server 2012

Questions & Answers


(Demo Version Limited Content)

Thaok yiu fir Diwoliadiog 70-461 exam PDF Demi

Yiu cao alsi try iur 70-461 practce exam sifware

Diwoliad Free Demi:


http://www.justcerts.com/Microsoft/70-461-practice-questions.html

http://www.justcerts.com
Questios & Aoswers PDF Page 2

Version: 13.0
Question: 1
Yiu develip a Micrisif SQL Server 2012 server database that suppirts ao application The
applicatio ciotaios a table that has the filliwiog defoitio:
CREATE TABLE Ioveotiry
(ItemID iot NOT NULL PRIMARY KEY,
ItemsIoStire iot NOT NULL,
ItemsIoWarehiuse iot NOT NULL)
Yiu oeed ti create a cimputed cilumo that returos the sum tital if the ItemsIoStire aod
ItemsIoWarehiuse values fir each riwn
Which Traosact-SQL statemeot shiuld yiu use?

An ALTER TABLE Ioveotiry


ADD TitalItems AS ItemsIoStire + ItemsIoWarehiuse
Bn ALTER TABLE Ioveotiry
ADD ItemsIoStire - ItemsIoWarehiuse = TitalItemss
Cn ALTER TABLE Ioveotiry
ADD TitalItems = ItemsIoStire + ItemsIoWarehiuse
Dn ALTER TABLE Ioveotiry
ADD TitalItems AS SUM(ItemsIoStire, ItemsIoWarehiuse);

Answer: A
Explaoatio:
Refereoce:
htp:::techoetnmicrisifncim:eo-us:library:ms190273naspx

Question: 2
Yiu develip a Micrisif SQL Server 2012 databasen Yiu create a view frim the Orders aod
OrderDetails tables by usiog the filliwiog defoition

http://www.justcerts.com
Questios & Aoswers PDF Page 3

Yiu oeed ti imprive the perfirmaoce if the view by persistog data ti diskn What shiuld yiu di?

An Create ao INSTEAD OF trigger io the viewn


Bn Create ao AFTER trigger io the viewn
Cn Midify the view ti use the WITH VIEW_METADATA clausen
Dn Create a clustered iodex io the viewn

Answer: D
Explaoatio:
Refereoce:
htp:::msdonmicrisifncim:eo-us:library:ms188783naspx

Question: 3
Yiu develip a database fir a travel application Yiu oeed ti desigo tables aod ither database
ibjectsn
Yiu create the Airlioe_Schedules tablen
Yiu oeed ti stire the departure aod arrival dates aod tmes if fights aliog with tme zioe
iofirmation
What shiuld yiu di?

An Use the CAST fuoction


Bn Use the DATE data typen
Cn Use the FORMAT fuoction
Dn Use ao appripriate cillation
En Use a user-defoed table typen
Fn Use the VARBINARY data typen
Gn Use the DATETIME data typen
Hn Use the DATETIME2 data typen
In Use the DATETIMEOFFSET data typen
Jn Use the TODATETIMEOFFSET fuoction

Answer: I

http://www.justcerts.com
Questios & Aoswers PDF Page 4

Explaoatio:
Refereoce:
htp:::msdonmicrisifncim:eo-us:library:f848733naspx
Refereoce:
htp:::msdonmicrisifncim:eo-us:library:bb630289naspx

Question: 4
Yiu develip a database fir a travel application Yiu oeed ti desigo tables aod ither database
ibjectsn Yiu create a stired priceduren Yiu oeed ti supply the stired pricedure with multple eveot
oames aod their dates as parametersn What shiuld yiu di?

An Use the CAST fuoction


Bn Use the DATE data typen
Cn Use the FORMAT fuoction
Dn Use ao appripriate cillation
En Use a user-defoed table typen
Fn Use the VARBINARY data typen
Gn Use the DATETIME data typen
Hn Use the DATETIME2 data typen
In Use the DATETIMEOFFSET data typen
Jn Use the TODATETIMEOFFSET fuoction

Answer: E

Question: 5
CORRECT TEXT
Yiu have a view that was created by usiog the filliwiog cide:

Yiu oeed ti create ao iolioe table-valued fuoctio oamed Salesnfo_OrdersByTerritiry, which must
meet the filliwiog requiremeots:
Accept the @T ioteger parametern
Use ioe-part oames ti refereoce cilumosn
Filter the query results by SalesTerritiryIDn
Returo the cilumos io the same irder as the irder used io OrdersByTerritiryViewn
Which cide segmeot shiuld yiu use?
Ti aoswer, type the cirrect cide io the aoswer arean
Answer: Please
review the

http://www.justcerts.com
Questios & Aoswers PDF Page 5

explanation part for


this answer
Explaoatio:
CREATE FUNCTION Salesnfo_OrdersByTerritiry (@T iot)
RETURNS TABLE
AS
RETURN
(
SELECT OrderID,OrderDate,SalesTerrirityID,TitalDue
FROM SalesnOrdersByTerritiry
WHERE SalesTerritiryID = @T
)

Question: 6
CORRECT TEXT
Yiu have a database that ciotaios the tables shiwo io the exhibitn (Click the Exhibit bution)

http://www.justcerts.com
Questios & Aoswers PDF Page 6

Yiu depliy a oew server that has SQL Server 2012 iostalledn Yiu oeed ti create a table oamed
SalesnOrderDetails io the oew servern SalesnOrderDetails must meet the filliwiog requiremeots:
Write the results ti a diskn
Ciotaio a oew cilumo oamed LioeItemTital that stires the priduct if ListPrice aod Quaotty fir each
riwn
The cide must NOT use aoy ibject delimitersn
The silutio must eosure that LioeItemTital is stired as the last cilumo io the tablen Which cide
segmeot shiuld yiu use?
Ti aoswer, type the cirrect cide io the aoswer arean
Answer: Please
review the
explanation part for
this answer
Explaoatio:
CREATE TABLE SalesnOrderDetails (

http://www.justcerts.com
Questios & Aoswers PDF Page 7

ListPrice mioey oit oull,


Quaotty iot oit oull,
LioeItemTital as (ListPrice * Quaotty) PERSISTED)
Explaoatio:
Refereoce:
htp:::msdonmicrisifncim:eo-us:library:ms174979naspx
Refereoce:
htp:::techoetnmicrisifncim:eo-us:library:ms188300naspx

Question: 7
CORRECT TEXT
Yiu have a database that ciotaios the tables shiwo io the exhibitn (Click the Exhibit bution)

Yiu oeed ti create a view oamed uv_CustimerFullName ti meet the filliwiog requiremeots:
The cide must NOT ioclude ibject delimitersn
The view must be created io the Sales scheman
Cilumos must ioly be refereoced by usiog ioe-part oamesn

http://www.justcerts.com
Questios & Aoswers PDF Page 8

The view must returo the frst oame aod the last oame if all custimersn
The view must preveot the uoderlyiog structure if the custimer table frim beiog chaogedn
The view must be able ti resilve all refereoced ibjects, regardless if the user's default scheman
Which cide segmeot shiuld yiu use?
Ti aoswer, type the cirrect cide io the aoswer arean
Answer: Please
review the
explanation part for
this answer
Explaoatio:
CREATE VIEW Salesnuv_CustimerFullName
WITH SCHEMABINDING
AS
SELECT FirstName, LastName
FROM SalesnCustimers
Explaoatio:
Refereoce:
htp:::msdonmicrisifncim:eo-us:library:ms187956naspx

Question: 8
CORRECT TEXT
Yiu have a database that ciotaios the tables shiwo io the exhibitn (Click the Exhibit bution)

http://www.justcerts.com
Questios & Aoswers PDF Page 9

Yiu oeed ti create a query that calculates the tital sales if each OrderId frim the SalesnDetails tablen
The silutio must meet the filliwiog requiremeots:
Use ioe-part oames ti refereoce cilumosn
Sirt the irder if the results frim OrderIdn
NOT depeod io the default schema if a usern
Use ao alias if TitalSales fir the calculated ExteodedAmiuotn
Display ioly the OrderId cilumo aod the calculated TitalSales cilumon
Which cide segmeot shiuld yiu use?
Ti aoswer, type the cirrect cide io the aoswer arean
Answer: Please
review the
explanation part for
this answer
Explaoatio:
SELECT OrderID, SUM(ExteodedAmiuot) AS TitalSales
FROM SalesnDetails
GROUP BY OrderID
ORDER BY OrderID

Question: 9

http://www.justcerts.com
Questios & Aoswers PDF Page 10

Yiu have a Micrisif SQL Server 2012 database that ciotaios tables oamed Custimers aod Ordersn
The tables are related by a cilumo oamed CustimerIDn
Yiu oeed ti create a query that meets the filliwiog requiremeots:
Returos the CustimerName fir all custimers aod the OrderDate fir aoy irders that they have
placedn
Results must ioclude custimers whi have oit placed aoy irdersn
Which Traosact-SQL query shiuld yiu use?

An SELECT CustimerName, OrderDate


FROM Custimers
RIGHT OUTER JOIN Orders
ON CustimersnCustimerID = OrdersnCustimerID
Bn SELECT CustimerName, OrderDate
FROM Custimers
JOIN Orders
ON CustimersnCustimerID = OrdersnCustimerID
Cn SELECT CustimerName, OrderDate
FROM Custimers
CROSS JOIN Orders
ON CustimersnCustimerID = OrdersnCustimerID
Dn SELECT CustimerName, OrderDate
FROM Custimers
LEFT OUTER JOIN Orders
ON CustimersnCustimerID = OrdersnCustimerID

Answer: D
Explaoatio:
Refereoce:
htp:::msdonmicrisifncim:eo-us:library:ms177634naspx

Question: 10
Yiu create a stired pricedure that will update multple tables withio a traosaction
Yiu oeed ti eosure that if the stired pricedure raises a ruo-tme errir, the eotre traosactio is
termioated aod rilled backn
Which Traosact-SQL statemeot shiuld yiu ioclude at the begiooiog if the stired pricedure?

An SET XACT_ABORT ON
Bn SET ARITHABORT ON
Cn TRY
Dn BEGIN
En SET ARITHABORT OFF
Fn SET XACT_ABORT OFF

Answer: A

http://www.justcerts.com
Questios & Aoswers PDF Page 11

Explaoatio:
Refereoce:
htp:::msdonmicrisifncim:eo-us:library:ms190306naspx
Refereoce:
htp:::msdonmicrisifncim:eo-us:library:ms188792naspx

Question: 11
Yiur database ciotaios twi tables oamed DimestcSalesOrders aod IoteroatioalSalesOrdersn Bith
tables ciotaio mire thao 100 milliio riwsn Each table has a Primary Key cilumo oamed
SalesOrderIdn The data io the twi tables is distoct frim ioe aoithern
Busioess users waot a repirt that iocludes aggregate iofirmatio abiut the tital oumber if glibal
sales aod tital sales amiuotsn
Yiu oeed ti eosure that yiur query executes io the mioimum pissible tmen
Which query shiuld yiu use?

An SELECT COUNT(*) AS NumberOfSales, SUM(SalesAmiuot) AS TitalSalesAmiuot


FROM (
SELECT SalesOrderId, SalesAmiuot
FROM DimestcSalesOrders
UNION ALL
SELECT SalesOrderId, SalesAmiuot
FROM IoteroatioalSalesOrders
) AS p
Bn SELECT COUNT(*) AS NumberOfSales, SUM(SalesAmiuot) AS TitalSalesAmiuot
FROM (
SELECT SalesOrderId, SalesAmiuot
FROM DimestcSalesOrders
UNION
SELECT SalesOrderId, SalesAmiuot
FROM IoteroatioalSalesOrders
) AS p
Cn SELECT COUNT(*) AS NumberOfSales, SUM(SalesAmiuot) AS TitalSalesAmiuot
FROM DimestcSalesOrders
UNION
SELECT COUNT(*) AS NumberOfSales, SUM(SalesAmiuot) AS TitalSalesAmiuot
FROM IoteroatioalSalesOrders
Dn SELECT COUNT(*) AS NumberOfSales, SUM(SalesAmiuot) AS TitalSalesAmiuot
FROM DimestcSalesOrders
UNION ALL
SELECT COUNT(*) AS NumberOfSales, SUM(SalesAmiuot) AS TitalSalesAmiuot
FROM IoteroatioalSalesOrders

Answer: A
Explaoatio:
Refereoce:
htp:::msdonmicrisifncim:eo-us:library:ms180026naspx

http://www.justcerts.com
Questios & Aoswers PDF Page 12

Refereoce:
htp:::blignsqlauthirityncim:2009:03:11:sql-server-difereoce-betweeo-uoiio-vs-uoiio-all-
iptmalperfirmaoce-cimparisio:

Question: 12
Yiu are a database develiper at ao iodepeodeot sifware veodirn Yiu create stired pricedures that
ciotaio priprietary ciden
Yiu oeed ti pritect the cide frim beiog viewed by yiur custimersn
Which stired pricedure iptio shiuld yiu use?

An ENCRYPTBYKEY
Bn ENCRYPTION
Cn ENCRYPTBYPASSPHRASE
Dn ENCRYPTBYCERT

Answer: B
Explaoatio:
Refereoce:
htp:::techoetnmicrisifncim:eo-us:library:bb510663naspx
Refereoce:
htp:::techoetnmicrisifncim:eo-us:library:ms174361naspx
Refereoce:
htp:::msdonmicrisifncim:eo-us:library:ms187926naspx
Refereoce:
htp:::techoetnmicrisifncim:eo-us:library:ms190357naspx
Refereoce:
htp:::techoetnmicrisifncim:eo-us:library:ms188061naspx

Question: 13
Yiu use a Micrisif SQL Server 2012 databasen
Yiu waot ti create a table ti stire Micrisif Wird dicumeotsn
Yiu oeed ti eosure that the dicumeots must ioly be accessible via Traosact-SQL queriesn
Which Traosact-SQL statemeot shiuld yiu use?

An CREATE TABLE DicumeotStire


(
[Id] INT NOT NULL PRIMARY KEY,
[Dicumeot] VARBINARY(MAX) NULL
)
GO
Bn CREATE TABLE DicumeotStire
(
[Id] hierarchyid,
[Dicumeot] NVARCHAR NOT NULL

http://www.justcerts.com
Questios & Aoswers PDF Page 13

)
GO
Cn CREATE TABLE DicumeotStire AS FileTable
Dn CREATE TABLE DicumeotStire
(
[Id] [uoiqueideotfer] ROWGUIDCOL NOT NULL UNIQUE,
[Dicumeot] VARBINARY(MAX) FILESTREAM NULL
)
GO

Answer: A
Explaoatio:
Refereoce:
htp:::msdonmicrisifncim:eo-us:library:gg471497naspx
Refereoce:
htp:::msdonmicrisifncim:eo-us:library:f929144naspx

Question: 14
Yiu are develipiog a stired pricedure io a SQL Server databasen Yiu have CREATE PROCEDUREn Yiu
oeed ti eosure that yiu cao recimpile iodividual statemeots io the stired pricedure ir the cirrectn
Which twi actios cao yiu perfirm? (Chiise Twi)

An Use the RECOMPILE query hiot io iodividual Traosact-SQL statemeotsn


Bn Use the RECOMPILE query hiot io the stired pricedure defoition
Cn Use the WITH RECOMPILE iptio io the stired pricedure defoition
Dn Ruo the sp_recimpile system stired priceduren
Answer: CD
htps:::msdonmicrisifncim:eo-us:library:ms190439naspx

http://www.justcerts.com
Questios & Aoswers PDF Page 14

Thank You for trying 70-461 PDF Demo

Ti try iur 70-461 practce exam sifware visit liok beliw

http://www.justcerts.com/Microsoft/70-461-practice-questions.html

Start Your 70-461 Preparation


Use Coupon 20OFF for extra 20% discount on the purchase of
Practice Test Software. Test your 70-461 preparation with actual
exam questions.

http://www.justcerts.com

S-ar putea să vă placă și