70-457 Exam

70-457 Exam

Exam Number/Code : 70-457

Exam Name : Transition MCTS on SQL Serv 08 to MCSA: SQL Serv 2012, Pt 1

Questions and Answers : 75 Q&As

Question: 1

You create a table that has the StudentCode, SubjectCode, and Marks columns to record mid-year marks for students. The table has marks obtained by 50 students for various subjects. 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 the same average, incremental ranks must be given based on the order they are created. • Ranks must be sequential without gaps in between. Which Transact-SQL query should you use?

A. SELECT StudentCode as Code, RANK ( ) OVER (ORDER BY AVG (Marks) DESC) AS Value FROM StudentMarks  GROUP BY StudentCode

B. SELECT Id, Name, Marks, DENSE_RANK () OVER (ORDER BY Marks DESC) AS Rank FROM StudentMarks

C. SELECT StudentCode as Code, DENSE_RANK () OVER (ORDER BY AVG (Marks) DESC) AS Value FROM StudentMarks GROUP BY StudentCode

D. SELECT StudentCode as Code, NTILE (2) OVER (ORDER BY AVG (Marks) DESC) AS Value FROM StudentMarks  GROUP BY StudentCode

E. SELECT StudentCode AS Code,Marks AS Value  FROM (SELECT StudentCode, Marks AS Marks, RANK () OVER (PARTITION BY SubjectCode ORDER BY Marks ASC) AS Rank FROM StudentMarks)  tmp WHERE Rank = 1

F. SELECT StudentCode AS Code,Marks AS Value FRCM ( SELECT StudentCode, Marks AS Marks, RANK() OVER (PARTITION BY SubjectCode ORDER 3Y Marks DESC) AS Rank FRCM StudentMarks)  tmp WHERE Rank = 1

G. SELECT StudentCode AS Code,Marks AS Value FROM  (SELECT StudentCode, Marks AS Marks, RANK () OVER (PARTITION BY StudentCode ORDER BY Marks ASC) AS Rank FROM StudentMarks)  tmp WHERE Rank = 1

H. SELECT StudentCode AS Code,Marks AS Value FROM  (SELECT StudentCode, Marks AS Marks, RANXO OVER (PARTITION BY StudentCode ORDER BY Marks DESC) AS Rank FROM StudentMarks)  tmp WHERE Rank = 1

Answer: C

 

 

Question: 2

You create a table that has the StudentCode, SubjectCode, and Marks columns to record mid-year marks for students. The table has marks obtained by 50 students for various subjects. 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 the same 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 Value FROM StudentMarks  GROUP BY StudentCode

B. SELECT Id, Name, Marks, DENSE_RANK () OVER (ORDER BY Marks DESC) AS Rank FROM StudentMarks

C. SELECT StudentCode as Code, DENSE_RANK () OVER (ORDER BY AVG (Marks) DESC) AS Value FROM StudentMarks GROUP BY StudentCode

D. SELECT StudentCode as Code, NTILE (2) OVER (ORDER BY AVG (Marks) DESC) AS Value FROM StudentMarks  GROUP BY StudentCode

E. SELECT StudentCode AS Code,Marks AS Value  FROM (SELECT StudentCode, Marks AS Marks, RANK () OVER (PARTITION BY SubjectCode ORDER BY Marks ASC) AS Rank FROM StudentMarks)  tmp WHERE Rank = 1

F. SELECT StudentCode AS Code,Marks AS Value FRCM ( SELECT StudentCode, Marks AS Marks, RANK() OVER (PARTITION BY SubjectCode ORDER 3Y Marks DESC) AS Rank FRCM StudentMarks)  tmp WHERE Rank = 1

G. SELECT StudentCode AS Code,Marks AS Value FROM  (SELECT StudentCode, Marks AS Marks, RANK () OVER (PARTITION BY StudentCode ORDER BY Marks ASC) AS Rank FROM StudentMarks)  tmp WHERE Rank = 1

H. SELECT StudentCode AS Code,Marks AS Value FROM  (SELECT StudentCode, Marks AS Marks, RANXO OVER (PARTITION BY StudentCode ORDER BY Marks DESC) AS Rank FROM StudentMarks)  tmp WHERE Rank = 1

Answer: A

 

 

Question: 3

You create a table that has the StudentCode, SubjectCode, and Marks columns to record mid-year marks for students. The table has marks obtained by 50 students for various subjects. You need to ensure that the top half of the students arranged by their average marks must be 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 StudentMarks  GROUP BY StudentCode

B. SELECT Id, Name, Marks, DENSE_RANK () OVER (ORDER BY Marks DESC) AS Rank FROM StudentMarks

C. SELECT StudentCode as Code, DENSE_RANK () OVER (ORDER BY AVG (Marks) DESC) AS Value FROM StudentMarks GROUP BY StudentCode

D. SELECT StudentCode as Code, NTILE (2) OVER (ORDER BY AVG (Marks) DESC) AS Value FROM StudentMarks  GROUP BY StudentCode

E. SELECT StudentCode AS Code,Marks AS Value  FROM (SELECT StudentCode, Marks AS Marks, RANK () OVER (PARTITION BY SubjectCode ORDER BY Marks ASC) AS Rank FROM StudentMarks)  tmp WHERE Rank = 1

F. SELECT StudentCode AS Code,Marks AS Value FRCM ( SELECT StudentCode, Marks AS Marks, RANK() OVER (PARTITION BY SubjectCode ORDER 3Y Marks DESC) AS Rank FRCM StudentMarks)  tmp WHERE Rank = 1

G. SELECT StudentCode AS Code,Marks AS Value FROM  (SELECT StudentCode, Marks AS Marks, RANK () OVER (PARTITION BY StudentCode ORDER BY Marks ASC) AS Rank FROM StudentMarks)  tmp WHERE Rank = 1

H. SELECT StudentCode AS Code,Marks AS Value FROM  (SELECT StudentCode, Marks AS Marks, RANXO OVER (PARTITION BY StudentCode ORDER BY Marks DESC) AS Rank FROM StudentMarks)  tmp WHERE Rank = 1

Answer: D

 

 

Question: 4

You are developing a database application by using Microsoft SQL Server 2012. You have a query that runs slower than expected. You need to capture execution plans that will include detailed information on missing indexes recommended by the query optimizer. What should you do?

A. Add a HASH hint to the query.

B. Add a LOOP hint to the query.

C. Add a FORCESEEK hint to the query.

D. Add an INCLUDE clause to the index.

E. Add a FORCESCAN hint to the Attach query.

F. Add a columnstore index to cover the query.

G. Enable the optimize for ad hoc workloads option.

H. Cover the unique clustered index with a columnstore index. I. Include a SET FORCEPLAN ON statement before you run the query.

J. Include a SET STATISTICS PROFILE ON statement before you run the query.

K. Include a SET STATISTICS SHOWPLAN_XML ON statement before you run the query.

L. Include a SET TRANSACTION ISOLATION LEVEL REPEATABLE READ statement before you run the query.

M. Include a SET TRANSACTION ISOLATION LEVEL SNAPSHOT statement before you run the query.

N. Include a SET TRANSACTION ISOLATION LEVEL SERIALIZABLE statement before you run the query.

Answer: K

 

 

Question: 5

You are developing a database application by using Microsoft SQL Server 2012. An application that uses a database begins to run slowly. Your investigation shows the root cause is a query against a read-only table that has a clustered index. The query returns the following six columns: • One column in its WHERE clause contained in a non-clustered index • Four additional columns • One COUNT (*) column based on a grouping of the four additional columns You need to optimize the statement. What should you do?

A. Add a HASH hint to the query.

B. Add a LOOP hint to the query.

C. Add a FORCESEEK hint to the query.

D. Add an INCLUDE clause to the index.

E. Add a FORCESCAN hint to the Attach query.

F. Add a columnstore index to cover the query.

G. Enable the optimize for ad hoc workloads option.

H. Cover the unique clustered index with a columnstore index.

I. Include a SET FORCEPLAN ON statement before you run the query.

J. Include a SET STATISTICS PROFILE ON statement before you run the query.

K. Include a SET STATISTICS SHOWPLAN_XML ON statement before you run the query.

L. Include a SET TRANSACTION ISOLATION LEVEL REPEATABLE READ statement before you run the query.

M. Include a SET TRANSACTION ISOLATION LEVEL SNAPSHOT statement before you run the query.

N. Include a SET TRANSACTION ISOLATION LEVEL SERIALIZABLE statement before you run the query.

Answer: F
http://www.exam1pass.com/70-457-exam.html
http://www.exam1pass.com/Microsoft-series.html

Processing your request, Please wait....

Leave a Reply