70-433 · Question #116
You have two tables named dbo.Products and dbo.PriceChange. Table dbo.Products contains ten products. Five products are priced at $20 per unit and have PriceIncrease set to 1. The other five…
The correct answer is A. Five rows are updated in dbo.Products. See the full explanation below for the reasoning.
Question
You have two tables named dbo.Products and dbo.PriceChange. Table dbo.Products contains ten products. Five products are priced at $20 per unit and have PriceIncrease set to 1. The other five products are priced at $10 per unit and have PriceIncrease set to 0. You have the following query:
INSERT dbo.PriceChange (ProductID, Change, ChangeDate) SELECT ProductID, inPrice -delPrice, SYSDATETIME() FROM ( UPDATE dbo.Products SET Price *= 1.1 OUTPUT inserted.ProductID, inserted.Price, deleted.Price WHERE PriceIncrease = 1 ) p (ProductID, inPrice, delPrice); You need to predict the results of the query. Which results should the query produce?
Options
- AFive rows are updated in dbo.Products.
- BFive rows are updated in dbo.Products.
- CNo rows are updated in dbo.Products.
- DNo rows are updated in dbo.Products.
How the community answered
(37 responses)- A76% (28)
- B8% (3)
- C14% (5)
- D3% (1)
Community Discussion
No community discussion yet for this question.