+ All Categories
Home > Documents > certasap 70-457 Practice Exam PDF Demo

certasap 70-457 Practice Exam PDF Demo

Date post: 06-Apr-2016
Category:
Upload: cert24-practice
View: 217 times
Download: 1 times
Share this document with a friend
Description:
We believe in helping our customers achieve their goals. For this reason, we take great care while preparing our Questions and Answers Microsoft MCSA 70-457 Transition Your MCTS on SQL Server 2008 to MCSA: SQL Server 2012, Part 1. Our practice tests Microsoft MCSA 70-457 Transition Your MCTS on SQL Server 2008 to MCSA: SQL Server 2012, Part 1 are prepared with the help of highly professional people from the industry, so we benefit from their vast experience and knowledge.
15
www.certasap.com original question and answer Exam Number/Code:70-457 Exam Name: Transition Your MCTS on SQL Server 2008 to MCSA:SQL Server 2012, Part 1 Version: Demo
Transcript
Page 1: certasap 70-457 Practice Exam PDF Demo

www.certasap.com original question and answer

Exam Number/Code:70-457

Exam Name: Transition Your MCTSon SQL Server 2008 toMCSA:SQL Server2012, Part 1

Version: Demo

Page 2: certasap 70-457 Practice Exam PDF Demo

www.certasap.com original question and answer

QUESTION: 1

You administer a Microsoft SQL Server 2012 database named ContosoDb. Tables aredefined as shown in the exhibit. (Click the Exhibit button.)

You need to display rows from the Orders table for the Customers row having theCustomerId value set to 1 in the following XML format.

<row OrderId= "1" orderDate="2000-01-01T00:00:00", Amount="3400.00"Name="Customer A" Country="Australia" />

<row OrderId="2" OrderDate="2001-01-01T00:00:00" Amount="4300.00"Name="Customer A" Country-"Australia" />

Which Transact-SQL query should you use?

A. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOINCustomers ON Orders.CustomerId = Customers.CustomerId WHERECustomers.CustomerId = 1FOR XML RAWB. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOINCustomers ON Orders.CustomerId = Customers.CustomerId WHERECustomers.CustomerId = 1FOR XML RAW, ELEMENTSC. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOINCustomers ON Orders.CustomerId = Customers.CustomerId WHERECustomers.CustomerId = 1FOR XML AUTOD. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOINCustomers ON Orders.CustomerId - Customers.CustomerId WHERECustomers.CustomerId= 1FOR XML AUTO, ELEMENTS

Page 3: certasap 70-457 Practice Exam PDF Demo

www.certasap.com original question and answer

E. SELECT Name, Country, OrderId, OrderDate, Amount FROM Orders INNER JOINCustomers ON Orders.CustomerId= Customers.CustomerIdWHERE Customers.CustomerId- 1FOR XML AUTOF. SELECT Name, Country, Orderld, OrderDate, Amount FROM Orders INNER JOINCustomers ON Orders.CustomerId= Customers.CustomerId WHERECustomers.CustomerId= 1FOR XML AUTO, ELEMENTSG. SELECT Name AS '@Name', Country AS '@Country', OrderId, OrderDate, AmountFROM Orders INNER JOIN Customers ON Orders.CustomerId= Customers.CustomerIdWHERE Customers.CustomerId= 1FOR XML PATH ('Customers')H. SELECT Name AS 'Customers/Name', Country AS 'Customers/Country', OrderId,OrderDate, AmountFROM Orders INNER JOIN Customers ON Orders.CustomerId= Customers.CustomerIdWHERE Customers.CustomerId= 1FOR XML PATH ('Customers')

Answer: AExplanation: http://msdn.microsoft.com/en-us/library/bb510464.aspx

QUESTION: 2

You administer a Microsoft SQL Server 2012 database named ContosoDb. Tables aredefined as shown in the exhibit. (Click the Exhibit button.)

You need to display rows from the Orders table for the Customers row having theCustomerIdvalue set to 1 in the following XML format.

Page 4: certasap 70-457 Practice Exam PDF Demo

www.certasap.com original question and answer

Which Transact-SQL query should you use?

A. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOINCustomers ON Orders.CustomerId = Customers.CustomerId WHERECustomers.CustomerId = 1FOR XML RAWB. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOINCustomers ON Orders.CustomerId = Customers.CustomerId WHERECustomers=CustomerId = 1FOR XML RAW, ELEMENTSC. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOINCustomers ON Orders.CustomerId = Customers.CustomerId WHERECustomers.CustomerId = 1FOR XML AUTOD. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOINCustomers ON Orders.CustomerId = Customers.CustomerId WHERECustomers.CustomerId= 1FOR XML AUTO, ELEMENTSE. SELECT Name, Country, OrderId, OrderDate, Amount FROM Orders INNER JOINCustomers ON Orders.CustomerId= Customers.CustomerId WHERECustomers.CustomerId= 1FOR XML AUTOF. SELECT Name, Country, Orderld, OrderDate, Amount FROM Orders INNER JOINCustomers ON Orders.CustomerId= Customers.CustomerId WHERECustomers.CustomerId= 1FOR XML AUTO, ELEMENTSG. SELECT Name AS '@Name', Country AS '@Country', OrderId, OrderDate, AmountFROM Orders INNER JOIN Customers ON Orders.CustomerId= Customers.CustomerIdWHERE Customers.CustomerId= 1FOR XML PATH ('Customers')H. SELECT Name AS 'Customers/Name', Country AS 'Customers/Country', OrderId,OrderDate, AmountFROM Orders INNER JOIN Customers ON Orders.CustomerId= Customers.CustomerIdWHERE Customers.CustomerId= 1FOR XML PATH ('Customers')

Answer: CReference: http://msdn.microsoft.com/en-us/library/ms188273.aspx

Page 5: certasap 70-457 Practice Exam PDF Demo

www.certasap.com original question and answer

QUESTION: 3

You administer a Microsoft SQL Server 2012 database named ContosoDb. Tables aredefined as shown in the exhibit. (Click the Exhibit button.)

You need to display rows from the Orders table for the Customers row having theCustomerId value set to 1 in the following XML format.

Which Transact-SQL query should you use?

Which Transact-SQL query should you use?

A. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOINCustomers ON Orders.CustomerId = Customers.CustomerId WHERECustomers.CustomerId = 1FOR XML RAWB. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOINCustomers ON Orders.CustomerId = Customers.CustomerId WHERECustomers.CustomerId = 1FOR XML RAW, ELEMENTSC. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOINCustomers ON Orders.CustomerId = Customers.CustomerId WHERECustomers.CustomerId = 1FOR XML AUTO

Page 6: certasap 70-457 Practice Exam PDF Demo

www.certasap.com original question and answer

D. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOINCustomers ON Orders.CustomerId - Customers.CustomerId WHERECustomers.CustomerId= 1FOR XML AUTO, ELEMENTSE. SELECT Name, Country, OrderId, OrderDate, Amount FROM Orders INNER JOINCustomers ON Orders.CustomerId= Customers.CustomerId WHERECustomers.CustomerId= 1FOR XML AUTOF. SELECT Name, Country, Orderld, OrderDate, Amount FROM Orders INNER JOINCustomers ON Orders.CustomerId= Customers.CustomerId WHERECustomers.CustomerId= 1FOR XML AUTO, ELEMENTSG. SELECT Name AS '@Name', Country AS '@Country', OrderId, OrderDate, AmountFROM Orders INNER JOIN Customers ON Orders.CustomerId= Customers.CustomerIdWHERE Customers.CustomerId= 1FOR XML PATH ('Customers')H. SELECT Name AS 'Customers/Name', Country AS 'Customers/Country', OrderId,OrderDate, AmountFROM Orders INNER JOIN Customers ON Orders.CustomerId= Customers.CustomerIdWHERE Customers.CustomerId= 1FOR XML PATH ('Customers')

Answer: E

QUESTION: 4

You administer a Microsoft SQL Server 2012 database named ContosoDb. Tables aredefined as shown in the exhibit. (Click the Exhibit button.)

You need to display rows from the Orders table for the Customers row having theCustomerId value set to 1 in the following XML format.

Page 7: certasap 70-457 Practice Exam PDF Demo

www.certasap.com original question and answer

Which Transact-SQL query should you use?

A. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOINCustomers ON Orders.CustomerId = Customers.CustomerId WHERECustomers.CustomerId = 1FOR XML RAWB. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOINCustomers ON Orders.CustomerId = Customers.CustomerId WHERECustomers.CustomerId = 1FOR XML RAW, ELEMENTSC. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOINCustomers ON Orders.CustomerId = Customers.CustomerId WHERECustomers.CustomerId = 1FOR XML AUTOD. SELECT OrderId, OrderDate, Amount, Name, Country FROM Orders INNER JOINCustomers ON Orders.CustomerXd - Customers.CustomerId WHERECustomers.CustomerId= 1FOR XML AUTO, ELEMENTSE. SELECT Name, Country, OrderId, OrderDate, Amount FROM Orders INNER JOINCustomers ON Orders.CustomerId= Customers.CustomerId WHERECustomers.CustomerId- 1FOR XML AUTOF. SELECT Name, Country, Orderld, OrderDate, Amount FROM Orders INNER JOINCustomers ON Orders.CustomerId= Customers.CustomerIdWHERE Customers.CustomerId= 1FOR XML AUTO, ELEMENTS

Page 8: certasap 70-457 Practice Exam PDF Demo

www.certasap.com original question and answer

G. SELECT Name AS '@Name', Country AS '@Country', OrderId, OrderDate, AmountFROM Orders INNER JOIN Customers ON Orders.CustomerId= Customers.CustomerIdWHERE Customers.CustomerId= 1FOR XML PATH ('Customers')H. SELECT Name AS 'Customers/Name', Country AS 'Customers/Country', OrderId,OrderDate, AmountFROM Orders INNER JOIN Customers ON Orders.CustomerId= Customers.CustomerIdWHERE Customers.CustomerId= 1FOR XML PATH ('Customers')

Answer: D

QUESTION: 5

You create a table that has the StudentCode, SubjectCode, and Marks columns to recordmid-year marks for students. The table has marks obtained by 50 students for varioussubjects.

You need to ensure that the top half of the students arranged by their average marks mustbe given a rank of 1 and the remaining students must be given a rank of 2.

Which Transact-SQL query should you use?

A. SELECT StudentCode as Code,RANK ( ) OVER (ORDER BY AVG (Marks) DESC) AS Value FROM StudentMarksGROUP BY StudentCodeB. SELECT Id, Name, Marks, DENSE_RANK () OVER (ORDER BY Marks DESC) ASRank FROM StudentMarksC. SELECT StudentCode as Code,DENSE_RANK () OVER (ORDER BY AVG (Marks) DESC) AS Value FROMStudentMarks GROUP BY StudentCodeD. SELECT StudentCode as Code,NTILE (2) OVER (ORDER BY AVG (Marks) DESC) AS Value FROM StudentMarksGROUP BY StudentCodeE. SELECT StudentCode AS Code,Marks AS ValueFROM (SELECT StudentCode, Marks AS Marks,RANK () OVER (PARTITION BY SubjectCode ORDER BY Marks ASC) AS Rank FROMStudentMarks)tmp WHERE Rank = 1F. SELECT StudentCode AS Code,Marks AS Value FRCM (SELECT StudentCode, MarksAS Marks,

Page 9: certasap 70-457 Practice Exam PDF Demo

www.certasap.com original question and answer

RANK() OVER (PARTITION BY SubjectCode ORDER 3Y Marks DESC) AS Rank FRCMStudentMarks)tmp WHERE Rank = 1G. SELECT StudentCode AS Code,Marks AS Value FROM (SELECT StudentCode,Marks AS Marks,RANK () OVER (PARTITION BY StudentCode ORDER BY Marks ASC) AS Rank FROMStudentMarks)tmp WHERE Rank = 1H. SELECT StudentCode AS Code,Marks AS Value FROM (SELECT StudentCode,Marks AS Marks,RANXO OVER (PARTITION BY StudentCode ORDER BY Marks DESC) AS Rank FROMStudentMarks)tmp WHERE Rank = 1

Answer: D

QUESTION: 6

You create a table that has the StudentCode, SubjectCode, and Marks columns to recordmid-year marks for students. The table has marks obtained by 50 students for varioussubjects.

You need to ensure that the following requirements are met:

Students must be ranked based on their average marks. If one or more students have thesame average, the same rank must be given to these students.Consecutive ranks must be skipped when the same rank is assigned.

Which Transact-SQL query should you use?

A. SELECT StudentCode as Code,RANK() OVER(ORDER BY AVG (Marks) DESC) AS ValueFROM StudentMarksGROUP BY StudentCodeB. SELECT Id, Name, Marks,DENSE_RANK() OVER(ORDER BY Marks DESC) AS RankFROM StudentMarksC. SELECT StudentCode as Code,DENSE_RANK() OVER(ORDER BY AVG (Marks) DESC) AS Value FROM StudentMarksGROUP BY StudentCodeD. SELECT StudentCode as Code,NTILE(2) OVER(ORDER BY AVG (Marks) DESC) AS Value FROM StudentMarks

Page 10: certasap 70-457 Practice Exam PDF Demo

www.certasap.com original question and answer

GROUP BY StudentCodeE. SELECT StudentCode AS Code,Marks AS Value FROM ( SELECT StudentCode,Marks AS Marks,RANK() OVER(PARTITION BY SubjectCode ORDER BY Marks ASC) AS Rank FROMStudentMarks) tmpWHERE Rank = 1F. SELECT StudentCode AS Code,Marks AS Value FROM ( SELECT StudentCode,Marks AS Marks,RANK() OVER(PARTITION BY SubjectCode ORDER BY Marks DESC) AS Rank FROMStudentMarks) tmpWHERE Rank = 1G. SELECT StudentCode AS Code,Marks AS Value FROM ( SELECT StudentCode,Marks AS Marks,RANK() OVER(PARTITION BY StudentCode ORDER BY Marks ASC) AS Rank FROMStudentMarks) tmpWHERE Rank = 1H. SELECT StudentCode AS Code,Marks AS Value FROM ( SELECT StudentCode,Marks AS Marks,RANXO OVER(PARTITION BY StudentCode ORDER BY Marks DESC) AS Rank FROMStudentMarks) tmpWHERE Rank = 1

Answer: AReference:

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

QUESTION: 7

You create a table that has the StudentCode, SubjectCode, and Marks columns to recordmid-year marks for students. The table has marks obtained by 50 students for varioussubjects.

You need to retrieve the students who scored the highest marks for each subject alongwith the marks.

Which Transact-SQL query should you use?A. SELECT StudentCode as Code, RANK() OVER(ORDER BY AVG(Marks) DESC) ASValueFROM StudentMarksGROUP BY StudentCode

Page 11: certasap 70-457 Practice Exam PDF Demo

www.certasap.com original question and answer

B. SELECT Id, Name, Marks, DENSE_RANK() OVER(ORDER BY Marks DESC) ASRank FROM StudentMarksC. SELECT StudentCode as Code, DENSE_RANK() OVER(ORDER BY AVG(Marks)DESC) ASValueFROM StudentMarksGROUP BY StudentCodeD. SELECT StudentCode as Code, NTILE(2) OVER(ORDER BY AVG(Marks) DESC) ASValueFROM StudentMarksGROUP BY StudentCodeE. SELECT StudentCode AS Code, Marks AS Value FROM ( SELECT StudentCode,Marks AS Marks,RANK() OVER(PARTITION BY SubjectCode ORDER BY Marks ASC) AS Rank FROMStudentMarks) tmpWHERE Rank = 1F. SELECT StudentCode AS Code, Marks AS Value FROM ( SELECT StudentCode,Marks AS Marks,RANK() OVER(PARTITION BY SubjectCode ORDER BY Marks DESC) AS Rank FROMStudentMarks) tmpWHERE Rank = 1G. SELECT StudentCode AS Code, Marks AS Value FROM ( SELECT StudentCode,Marks AS Marks,RANK() OVER(PARTITION BY StudentCode ORDER BY Marks ASC) AS Rank FROMStudentMarks) tmpWHERE Rank = 1H. SELECT StudentCode AS Code, Marks AS Value FROM ( SELECT StudentCode,Marks AS Marks,RANXO OVER(PARTITION BY StudentCode ORDER BY Marks DESC) AS Rank FROMStudentMarks) tmpWHERE Rank = 1

Answer: F

QUESTION: 8

You use a Microsoft SQL Server 2012 database.

You need to create an indexed view within the database for a report that displaysCustomer

Name and the total revenue for that customer.

Page 12: certasap 70-457 Practice Exam PDF Demo

www.certasap.com original question and answer

Which four T-SQL statements should you use? (To answer, move the appropriate SQLstatements from the list of statements to the answer area and arrange them in the correctorder.)

Answer:

Page 13: certasap 70-457 Practice Exam PDF Demo

www.certasap.com original question and answer

QUESTION: 9

You develop a Microsoft SQL Server 2012 server database that supports an application.The application contains a table that has the following definition:

CREATE TABLE Inventory (

ItemID int NOT NULL PRIMARY KEY,

ItemsInStore int NOT NULL,

ItemsInWarehouse int NOT NULL)

You need to create a computed column that returns the sum total of the ItemsInStore andItemsInWarehouse values for each row.

The new column is expected to be queried heavily, and you need to be able to index thecolumn.

Which Transact-SQL statement should you use?

A. ALTER TABLE InventoryADD TotalItems AS ItemslnStore + ItemsInWarehouse

Page 14: certasap 70-457 Practice Exam PDF Demo

www.certasap.com original question and answer

B. ALTER TABLE InventoryADD TotalItems AS ItemsInStore + ItemsInWarehouse PERSISTEDC. ALTER TABLE InventoryADD TotalItems AS SUM(ItemsInStore, ItemsInWarehouse) PERSISTEDD. ALTER TABLE InventoryADD TotalItems AS SUM(ItemsInStore, ItemsInWarehouse)

Answer: BReference: http://msdn.microsoft.com/en-us/library/ms174979.aspx

QUESTION: 10

You develop a Microsoft SQL Server 2012 database that contains a table namedCustomers.

The Customers table has the following definition:

You need to create an audit record only when either the MobileNumber or HomeNumbercolumn is updated.

Which Transact-SQL query should you use?

A. CREATE TRIGGER TrgPhoneNumberChangeON Customers FOR UPDATEASIF COLUMNS_UPDATED (HomeNumber, MobileNumber)- - Create Audit RecordsB. CREATE TRIGGER TrgPhoneNumberChangeON Customers FOR UPDATEAS

Page 15: certasap 70-457 Practice Exam PDF Demo

www.certasap.com original question and answer

IF EXISTS( SELECT HomeNumber FROM inserted) OREXISTS (SELECT MobileNumber FROM inserted)- - Create Audit RecordsC. CREATE TRIGGER TrgPhoneNumberChangeON Customers FOR UPDATEASIF COLUMNS_CHANGED (HomeNumber, MobileNumber)- - Create Audit RecordsD. CREATE TRIGGER TrgPhoneNumberChangeON Customers FOR UPDATEASIF UPDATE (HomeNumber) OR UPDATE (MobileNumber)- - Create Audit Records

Answer: DReference: http://msdn.microsoft.com/en-us/library/bb510663.aspx

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


Recommended