Documente Academic
Documente Profesional
Documente Cultură
Microsoft
70-461 Exam
Querying Microsoft SQL Server 2012
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?
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?
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?
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?
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
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
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?
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?
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?
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)
http://www.justcerts.com
Questios & Aoswers PDF Page 14
http://www.justcerts.com/Microsoft/70-461-practice-questions.html
http://www.justcerts.com