Which rows will be displayed?

You have the following two tables.
Products
ProductID ProductName VendorID
1 Product1 0
2 Product2 1
3 Product3 1
4 Product4 0
ProductChanges ProductID ProductName VendorID
1 Product1 1
2 Product2 1
3 NewProduct3 2
5 Product5 1
You execute the following statement.
MERGE Products
USING ProductChanges
ON (Products.ProductID = ProductChanges.ProductID)
WHEN MATCHED AND Products.VendorID = 0
THEN DELETE
WHEN MATCHED
THEN UPDATE SET Products.ProductName = ProductChanges.ProductName
Products.VendorID = ProductChanges.VendorID;
You need to identify the rows that will be displayed in the Products table. Which rows will be
displayed?

You have the following two tables.
Products
ProductID ProductName VendorID
1 Product1 0
2 Product2 1
3 Product3 1
4 Product4 0
ProductChanges ProductID ProductName VendorID
1 Product1 1
2 Product2 1
3 NewProduct3 2
5 Product5 1
You execute the following statement.
MERGE Products
USING ProductChanges
ON (Products.ProductID = ProductChanges.ProductID)
WHEN MATCHED AND Products.VendorID = 0
THEN DELETE
WHEN MATCHED
THEN UPDATE SET Products.ProductName = ProductChanges.ProductName
Products.VendorID = ProductChanges.VendorID;
You need to identify the rows that will be displayed in the Products table. Which rows will be
displayed?

A.
ProductID ProductName VendorID
2 Product2 1

3 NewProduct3 2

B.
ProductID ProductName VendorID
2 Product2 1
3 NewProduct3 2
4 Product4 0

C.
ProductID ProductName VendorID
1 Product1 1
2 Product2 1
3 NewProduct3 2
5 Product5 1

D.
ProductID ProductName VendorID
1 Product1 1
2 Product2 1
3 NewProduct3 2
4 Product4 0
5 Product5 1



Leave a Reply 0

Your email address will not be published. Required fields are marked *