exam questions

Exam 70-762 All Questions

View all questions & answers for the 70-762 exam

Exam 70-762 topic 1 question 111 discussion

Actual exam question from Microsoft's 70-762
Question #: 111
Topic #: 1
[All 70-762 Questions]

DRAG DROP -

Case study -

Background -
You have a database named HR1 that includes a table named Employee.
You have several read-only, historical reports that contain regularly changing totals. The reports use multiple queries to estimate payroll expenses. The queries run concurrently. Users report that the payroll estimate reports do not always run. You must monitor the database to identify issues that prevent the reports from running.
You plan to deploy the application to a database server that supports other applications. You must minimize the amount of storage that the database requires.

Employee Table -
You use the following Transact-SQL statements to create, configure, and populate the Employee table:


Application -
You have an application that updates the Employees table. The application calls the following stored procedures simultaneously and asynchronously:
✑ UspA: This stored procedure updates only the EmployeeStatus column.
✑ UspB: This stored procedure updates only the EmployeePayRate column.
The application uses views to control access to data. Views must meet the following requirements:
✑ Allow users access to all columns in the tables that the view accesses.
Restrict updates to only the rows that the view returns.


You observe that the four indexes require a large amount of disk space. You must reduce the amount of disk space that the indexes are using.
You need to create a single index to replace the existing indexes.
Which three Transact-SQL segments should you use to develop the solution? To answer, move the appropriate Transact-SQL segments from the list of Transact-
SQL segments to the answer area and arrange them in the correct order.
NOTE: More than one order of answer choices is correct. You will receive credit for any of the correct orders you select.
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:
Scenario: You observe that the four indexes require a large amount of disk space. You must reduce the amount of disk space that the indexes are using.
Current indexes:

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
moehijawe
Highly Voted 5 years, 4 months ago
since our cluster index on Employee_ID so all non cluster indexes have this column inside so include should be : INCLUDE (HireData, DepartmentId)
upvoted 12 times
JohnFan
5 years, 3 months ago
I understand your point, but the question requirement is "to replace the existing indexes" and Employee_ID was in IX_2, so in the exam, I think you may be better to do what as required.
upvoted 1 times
...
...
Anette
Highly Voted 4 years, 11 months ago
I think this is the answer: create index IX_New on dbo.Employee(LastName, FirstName) INCLUDE (HireDate, DepartmentId, EmployeeId) Anyway, I am not sure about including EmployeeId, But since the request from question is to replace existing indexes, this column must be included BUT on the other hand we must reduce amount of disk and since EmployeeId is primary key we do not need to explicitly include in non-clustered indexes. I am in dilemma :/, someone help please :)
upvoted 7 times
LeonLeon
4 years, 11 months ago
To reduce does not mean the lowest disk space as possible. The question is, replace all the indexes by one. More answers are correct.
upvoted 1 times
...
delgadillo
4 years, 11 months ago
According to the image, it must be create index IX_New on dbo.Employee(LastName, FirstName) INCLUDE (HireDate, DepartmentId) , this is the best response according to the image
upvoted 6 times
...
...
Luzix
Most Recent 4 years, 7 months ago
Why departmentId is not in the index if you have it on the first one?
upvoted 1 times
...
Mvubu
4 years, 8 months ago
I am confused
upvoted 2 times
databasejamdown
4 years, 8 months ago
Annette answer minus the EmployeeId is correct
upvoted 1 times
RohitRaj2311
4 years, 7 months ago
i will go with answer.. Its correct
upvoted 1 times
...
...
...
JohnFan
5 years, 3 months ago
LastName has to go first before FirstName?
upvoted 1 times
Anette
4 years, 11 months ago
yes, since it is the same in existing indexes
upvoted 1 times
Anette
4 years, 11 months ago
the order of the columns in the index is very important. You should place the columns that you often use to query data at the beginning of the column list
upvoted 7 times
Mosufe
4 years, 10 months ago
That's new to me
upvoted 1 times
...
MarcusJB
4 years, 8 months ago
Yes, always use the most selective (that reduce the data the most) first.
upvoted 2 times
...
...
...
...
Zikato
5 years, 4 months ago
This solution doesn't include DepartmentId in the key columns as the Index1 does.The correct solution cannot be pieced together from these options.
upvoted 2 times
Bartek
5 years, 4 months ago
"More than one answer is correct..." Can be (Lastname, Firstname) INCLUDE (HireData, DepartmentId, EmployeeID) OR (Firstname, Lastname, DeparemtntID) INCLUDE (HireData, DepartmentId)
upvoted 3 times
Kuratko
5 years, 4 months ago
CREATE INDEX IX_New ON dbo.Employee (LastName, FirstName, DepartmentId) INCLUDE (HireDate) -> Column name 'DepartmentId' can be listed once ONLY; EmpleyeeID IS included AS relation to PRIMARY KEY, so it can but NOT REQUIRED IN INCLUDE Part. -> KEEP IX_1 AND DROP the others:) Aggree WITH Zikato. (Firstname, Lastname, DeparemtntID) INCLUDE (HireData, DepartmentId) --> have you try to run it?
upvoted 2 times
JohnFan
5 years, 3 months ago
Absolutely crazy.
upvoted 13 times
...
...
...
...
New_user
5 years, 5 months ago
Why don't use clustered index?
upvoted 1 times
Mosufe
4 years, 10 months ago
And a clustered index take more space
upvoted 2 times
geekeek1
4 years, 5 months ago
No, you’re wrong
upvoted 1 times
...
...
BruceWayne
5 years, 4 months ago
because the primary key already create a clustered index on the table
upvoted 21 times
...
lauferr
5 years, 1 month ago
And clustered index doesnt support include columns
upvoted 11 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...