exam questions

Exam 70-761 All Questions

View all questions & answers for the 70-761 exam

Exam 70-761 topic 1 question 151 discussion

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

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.
After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.
You have a database named DB1 that contains two tables named Sales.Customers and Sales.Orders. Sales.Customers has a foreign key relationship to a column named CustomerID in SalesOrders.
You need to recommend a query that returns all the customers. The query must also return the number of orders that each customer placed in 2016.
Solution: You recommend the following query:

Does this meet the goal?

  • A. Yes
  • B. No
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️
Reference:
https://docs.microsoft.com/en-us/sql/t-sql/functions/count-transact-sql?view=sql-server-2017

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
Andy7622
4 years, 4 months ago
First of all it use CustomerName for Group by . But CustomerName may be not UNIQUE and we can group different persons in one group. CustomerId is unique and should be used in GROUP BY
upvoted 1 times
...
stm22
4 years, 10 months ago
no. at least bc no ref to 2016 in query
upvoted 1 times
...
MML
5 years, 1 month ago
It would be correct if it was like this: select c.CusName, NumOfOrders=count(OrderId) from #Customer c left join #Orders o on o.Cusid=c.CusId group by c.CusName
upvoted 2 times
MML
5 years, 1 month ago
plus if it was there a predicate about year 2016
upvoted 3 times
...
...
raja1234567890
5 years, 5 months ago
Can select query contains = symbol?
upvoted 1 times
blueday
5 years, 2 months ago
yes it can
upvoted 2 times
...
BabyBee
4 years, 5 months ago
Yes, it is another way to assign an alias. Equivalent to: COUNT(OrderID) AS NumOfOrders.
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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago