exam questions

Exam 70-761 All Questions

View all questions & answers for the 70-761 exam

Exam 70-761 topic 1 question 198 discussion

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

You run the following Transact-SQL statement:

You use the table to store data about training courses: when they finished the location, and the number of participants in the courses.
You need to display a result set that shows aggregates for all possible combinations of the number of participants.
Which Transact-SQL statement should you run?

  • A. SELECT CourseID, CourseDate, SUM(NumParticipants) FROM CourseParticipants GROUP BY CourseID, CourseDate
  • B. SELECT CourseID, CourseDate, SUM(DISTINCT NumParticipants) FROM CourseParticipants GROUP BY CourseID, CourseDate
  • C. SELECT CourseID, CourseDate, SUM(NumParticipants) FROM CourseParticipants GROUP BY CourseID, CourseDate WITH CUBE
  • D. SELECT CourseID, CourseDate, SUM(DISTINCT NumParticipants) FROM CourseParticipants GROUP BY CourseID, CourseDate WITH ROLLUP
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️
The WITH CUBE clause causes the query to compute all possible totals
References:
https://blogs.msdn.microsoft.com/craigfr/2007/09/27/aggregation-with-cube/

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
lh2607
4 years, 4 months ago
Correctimundo
upvoted 3 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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago