READ Free Dumps For Microsoft- 70-461
Question ID 15151 | You develop an SQL Server database. The database contains a table that is defined by the The table contains duplicate records based on the combination of values in the surName,
|
Option A |
Example: let us write a query which will delete all duplicate data in one shot. We will use a CTE (Common Table Expression) for this purpose. We will read in future posts what a CTE is and why it is used. On a lighter note, CTE's can be imagined as equivalent to temporary result sets that can be used only in an underlying SELECT, INSERT, UPDATE, DELETE or CREATE VIEW statement. ;WITH CTE AS ( SELECT Name , City , [State] , ROW_NUMBER() OVER(PARTITION BY Name, City, [State] ORDER BY [Name]) AS Rnum FROM Persons ) DELETE FROM CTE WHERE Rnum <> 1 In the code by saying WHERE Rnum <> 1, we are asking SQL Server to keep all the records with Rank 1, which are not duplicates, and delete any other record. After executing this query in SQL Server Management Studio, you will end up with no duplicates in your table. To confirm that just run a simple query against your table. |
Correct Answer | A |
Question ID 15152 | You are maintaining a Microsoft SQL Server database. You run the following query: You observe performance issues when you run the query. You capture the following query You need to ensure that the query performs returns the results as quickly as possible. |
Option A | Add a new index to the ID column of the Person table. |
Option B | Add a new index to the EndDate column of the History table. |
Option C | Create a materialized view that is based on joining data from the ActiveEmployee and History tables. |
Option D | Create a computed column that concatenates the GivenName and SurName columns. |
Correct Answer | A |