exam questions

Exam 70-762 All Questions

View all questions & answers for the 70-762 exam

Exam 70-762 topic 1 question 137 discussion

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

Note: This question is part of a series of questions that use the same or similar answer choices. As answer choice may be correct for more than one question in the series. Each question is independent of the other questions in this series.
Information and details provided in a question apply only to that question.
You have a Microsoft SQL Server database named DB1 that contains the following tables:

There are no foreign key relationships between TBL1 and TBL2.
You need to minimize the amount of time required for queries that use data from TBL1 and TBL2 to return data.
What should you do?

  • A. Create clustered indexes on TBL1 and TBL2.
  • B. Create a clustered index on TBL1.Create a nonclustered index on TBL2 and add the most frequently queried column as included columns.
  • C. Create a nonclustered index on TBL2 only.
  • D. Create UNIQUE constraints on both TBL1 and TBL2. Create a partitioned view that combines columns from TBL1 and TBL2.
  • E. Drop existing indexes on TBL1 and then create a clustered columnstore index. Create a nonclustered columnstore index on TBL1.Create a nonclustered index on TBL2.
  • F. Drop existing indexes on TBL1 and then create a clustered columnstore index. Create a nonclustered columnstore index on TBL1.Make no changes to TBL2.
  • G. Create CHECK constraints on both TBL1 and TBL2. Create a partitioned view that combines columns from TBL1 and TBL2.
  • H. Create an indexed view that combines columns from TBL1 and TBL2.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️
References:
http://www.sqlservergeeks.com/sql-server-indexing-for-aggregates-in-sql-server/

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
EdwardWang
Highly Voted 5 years, 5 months ago
Correct Answer is H
upvoted 6 times
New_user
5 years, 4 months ago
Good decision if you need data from both tables at the same time. But there's not such task. Correct answer is A
upvoted 7 times
als2kool
5 years, 3 months ago
The question states there are no foreign keys between both tables, and that you want to get data from both tables so that implies you want to get data from both tables quickly. An indexed view can do this so H is probably the correct answer.
upvoted 1 times
JohnFan
5 years, 3 months ago
So do you mean G?
upvoted 1 times
...
...
MML
4 years, 11 months ago
"A" suggests to create clustered indexes on TBL1 and TBL2. But both tables have already primary keys so they have already clustered indexes..
upvoted 3 times
...
virgo999
5 years, 2 months ago
i was reasoning like this at first, but the question says "for queries that use data from TBL1 and TBL2 to return data". It does not say table 1 or table 2. therefore you need to minimize the amount for the retrieval of a query that uses data from table 1 and table 2 and that is with alternative H.
upvoted 3 times
...
...
...
Hoglet
Highly Voted 4 years, 12 months ago
TBL1 and TBL2 are very similar, the only real difference being TBL2 has infrequent updates and TBL1 has none. Both are over 20million rows in size. Queries result hight percentage of rows, with aggregates. To me this says columnstore indexes, so options E or F. Neither provide a columstore index for TBL2, so the updates and deletes must be the issue. Might as well pick E as we can use the index to improve the performance of queries. https://docs.microsoft.com/en-us/sql/relational-databases/indexes/columnstore-indexes-overview?view=sql-server-2016 If you don't agree with columnstore indexes, then B, purely because from the limited information, why not use an index with includes to improve performance. Not a great question
upvoted 5 times
MML
4 years, 11 months ago
E and F suggest multiple columnstore indexes in a table, that is not supported by SQL server..
upvoted 2 times
...
stm22
4 years, 11 months ago
I agree with columnstore indexe tbl1 due to big tables and aggregates
upvoted 1 times
...
...
eggzamtaker
Most Recent 4 years, 5 months ago
C is the least incomplete answer. So C.
upvoted 1 times
...
SoupDJ
4 years, 7 months ago
Woops - sorry, I meant A using my reasoning. Also - a primary key does not need to be the clustered index. And since both these tables are unchanging or almost unchanging, there is little downside to changing an existing clustered index to something new (based on the aggregates) - note that in the study guide it is mentioned that the primary key is primarily important for table operations (INSERT, UPDATE, DELETE) which don't apply (so much) to these two tables.
upvoted 1 times
lh2607
4 years, 7 months ago
Can't be A there are already clustered Indexes on both tables and A doesn't mention dropping.
upvoted 1 times
...
...
SoupDJ
4 years, 7 months ago
In a world of imperfect options, I choose B as the best - assuming the options have no typos - which melvin9900 indicates. Creating a columnstore index for each table is the best option - if the question listed that as an option. But, unfortunately, because you can't add a second columnstore index to the same table, several of options are ruled out. We do know (see the answer reference link) that choosing a rowstore index has a positive affect if we know what index to choose - and because these two tables have aggregates, we would know what they are aggregating on. So I vote for B as the best of some suboptimal options and some clearly disallowed options.
upvoted 3 times
...
Cococo
4 years, 9 months ago
Have a look at question 136-139, they seem like part of the same task: 136 - no link between tables - answer is B - clustered for both tables 137 - no link again - hell knows how many columns they have and what they are (plus first table has the historical data) - seems like A 138 - tables joined - aggregations - Answer is H - indexed view 139 - tables joined - PKs, 2016 and 2015 - answer is G - Partitioned view (check constraint needed) Looks like 137 with Column1 as PK is just teasing us to pick the Partitioned View but we have no idea about the columns of those tables:)
upvoted 3 times
...
CristianCruz
4 years, 9 months ago
Answers is C A.B. clustered, But both tables have primary keys assigned to them. Therefore they already have a clustered index. E and F suggest multiple columnstore indexes in a table, that is not supported by SQL server.. D, G and H There are no foreign key relationships between TBL1 and TBL2. so you cannot create a meaningful result set to be return via a view
upvoted 4 times
eggzamtaker
4 years, 5 months ago
This has been the best response so far. Each point addressed adequately. Sadly, this is not a good question, but I submit that C is the least worst answer. So, C.
upvoted 1 times
...
...
melvin9900
4 years, 10 months ago
Queries return aggregates So i think should go with Column store. I believe the column store options are typo. From text book -105 "Columnstore indexes basically give you great aggregate and scan performance for most of the combinations of attributes you might consider without custom pre-planning."
upvoted 1 times
melvin9900
4 years, 10 months ago
if it's not typo then I will go for "indexed view to improve aggregate query performance"
upvoted 1 times
melvin9900
4 years, 10 months ago
Done with the exam. No Typo in the Options. The options all correct.
upvoted 2 times
julie2020
4 years, 9 months ago
Melvin, You mean correct Ans. is H ?
upvoted 2 times
geekeek1
4 years, 5 months ago
He doesn't know himself
upvoted 1 times
...
...
...
...
...
MML
4 years, 11 months ago
I thin B is correct
upvoted 2 times
...
Hoglet
4 years, 12 months ago
D, G and H are wrong. There is no relationship between TBL1 and TBL2, so you cannot create a meaningful result set to be return via a view. What would the result set look like?
upvoted 2 times
...
gtc108
5 years, 2 months ago
I think the answer is D because Table 1' contains historical data. Also, we'll need a UNIQUE constraint because there is chance that the primary key for both tables might be the same so the UNIQUE constraint will ensure there are no duplicates.
upvoted 1 times
...
rya
5 years, 3 months ago
The correct answer is H
upvoted 2 times
Twigit
5 years, 3 months ago
H makes no sense. The tables are not related.
upvoted 5 times
JohnFan
5 years, 2 months ago
An indexed view (sometimes referred to as a materialized view), is a view that has been made into more than just a simple stored query by creating a clustered index on it. By doing this, it basically makes it into a copy of data in a physical structure much like a table.
upvoted 1 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 ...