exam questions

Exam 70-461 All Questions

View all questions & answers for the 70-461 exam

Exam 70-461 topic 1 question 9 discussion

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

You have a Microsoft SQL Server database that contains tables named Customers and Orders.
The tables are related by a column named CustomerID.
You need to create a query that meets the following requirements:
✑ Returns the CustomerName for all customers and the OrderDate for any orders that they have placed.
✑ Results must include customers who have not placed any orders.
Which Transact-SQL query should you use?

  • A. SELECT CustomerName, OrderDate FROM Customers RIGHT OUTER JOIN Orders ON Customers.CustomerID = Orders.CustomerID
  • B. SELECT CustomerName, OrderDate FROM Customers JOIN Orders ON Customers.CustomerID = Orders.CustomerID
  • C. SELECT CustomerName, OrderDate FROM Customers CROSS JOIN Orders ON Customers.CustomerID = Orders.CustomerID
  • D. SELECT CustomerName, OrderDate FROM Customers LEFT OUTER JOIN Orders ON Customers.CustomerID = Orders.CustomerID
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️
Reference:
http://msdn.microsoft.com/en-us/library/ms177634.aspx

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
Tomprof
4 years, 1 month ago
Sorry. Use a left join
upvoted 2 times
...
Tomprof
4 years, 1 month ago
The correct answer is D. The question requires you to show al sutlers who haven't place any other yet which is in the customers Table (thus making it the right table). All you have to do is to use the right outer join to bring in a matching values from the Orders table (left table).
upvoted 2 times
...
Jaywalker
4 years, 1 month ago
Option D is correct because the second criteria states ----( Results must include customers who have not placed any orders) so we are expected to populate all Customers whether or not they have orders
upvoted 3 times
ammariii
3 years, 11 months ago
YES, thank you
upvoted 1 times
...
...
putriafebriana
4 years, 3 months ago
select cust.customer_id,cust.cut_name,orders.order_date from Customer cust left outer join Order orders on cust.customer_id=orders.customer_id
upvoted 1 times
...
saurabh100
4 years, 3 months ago
there is another same question in which slight change in second point is there, for that question B option is correct.
upvoted 1 times
...
Sugar
4 years, 7 months ago
No doubt, B is the answer. Right outer join is needed to return all orders
upvoted 1 times
...
NIDHAL01
4 years, 9 months ago
i think that the right answer is B not D
upvoted 1 times
...
rania
4 years, 10 months ago
the correct answer is B because D is incomplet answer
upvoted 1 times
...
davidkuz
5 years ago
Agreed, the suggested answer is syntactically wrong
upvoted 2 times
...
Zviko
5 years, 7 months ago
your answer is wrong here, the correct answer must be 'B'
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