DRAG DROP
You have a database that contains the following tables:
A delivery person enters an incorrect value for the CustomerID column in the Invoices table and enters the
following text in the ConfirmedReceivedBy column: “Package signed for by the owner Tim.”
You need to find the records in the Invoices table that contain the word Tim in the CustomerName field.
How should you complete the Transact-SQL statement? To answer, drag the appropriate Transact-SQL
segments to the correct locations. Each Transact-SQL segment may be used once, more than once, or not at
all. You may need to drag the split bar between panes or scroll to view content.
NOTE: Each correct selection is worth one point.
Select and Place:
Explanation:
Box 1:SELECT CustomerID FROM Sales.Invoices
Box 2:INNER JOIN Sales.Customers.CustomerID = Sales.Invoices.CustomerID
Box 3:WHERE CustomerName LIKE ‘%tim%’
Box 4:WHERE ConfirmedReceiveBy IN (SELECT CustomerName FROM Sales.Customers)
select Invoices.customerID
from Invoices
Inner join customers
on customers.customerID = Invoices.customerID
where CustomerName like ‘%tim%’
go
3
14
Correct!
2
9
Select CustomerId From Sales.Customers
Where CustomerName Like ‘%tim%’
UNION
Select CustomerId From Sales.Invoces
Where ConfirmedReceivedBy Like ‘%tim%’
35
6
agree with this E Rod.
Why the original answer has fucking three where clauses together.
13
1
this query returns all records where the name is tim, not the records of the Invoices table where the name is tim -> ” You need to find the records in the Invoices table that contain the word Tim in the CustomerName field”
1
3
agree, remember the delivery person entered the WRONG customer ID, so you need to research how many people have guys called “TIM” signing for packages
0
0
Select CustomerId From Sales.Customers
Where CustomerName Like ‘%tim%’
UNION ALL
Select CustomerId From Sales.Invoces
Where ConfirmedReceivedBy Like ‘%tim%’
16
1
but in this question, we have only **4** empty blocs to answer the question.
and your solve is with **5** blocs statements.
0
1
the solution is 4 blocks as your choice, and one already set. so 5 blocks
1
0
Why is it not possible union instead of union all?
Because with ‘union all’ you will have customers repeated.
0
0
I am able now to understand the question and the options because i have found this question in another place and it is “You need to find the records in the Invoices table that contain the word Tim in the CustomerName field along with the incorrectly entered row from the Sales.Invoice table.”
6
0