注意:此页面搜索的是所有试题
题目内容
(软件工程)
你有名为Sales.SalesOrderDetails和Sales.SalesOrderHeader的表。你的任务是更新某个销售人员的销售折扣额。你需要将Sales.SalesOrderDetail中只对应SalesPersonID 290的所有项的UnitPriceDiscount设置为0.1。应使用哪一条Transact-SQL语句?
A.UPDATE d SET UnitPriceDiscount = .1 FROM
Sales.SalesOrderDetail d INNER JOIN Sales.SalesOrderHeader h ON h.SalesOrderID
= d.SalesOrderID WHERE h.SalesPersonID = 290;
B.UPDATE Sales.SalesOrderDetail SET UnitPriceDiscount =
.1 FROM Sales.SalesOrderHeader h WHERE h.SalesPersonID = 290;
C.UPDATE Sales.SalesOrderDetail SET UnitPriceDiscount =
.1 WHERE EXISTS ( SELECT * FROM Sales.SalesOrderHeader h WHERE h.SalesPersonID
= 290);
D.UPDATE Sales.SalesOrderDetail SET UnitPriceDiscount =
.1 FROM Sales.SalesOrderDetail d WHERE EXISTS ( SELECT * FROM
Sales.SalesOrderHeader h WHERE h.SalesPersonID = 290);
A.UPDATE d SET UnitPriceDiscount = .1 FROM
Sales.SalesOrderDetail d INNER JOIN Sales.SalesOrderHeader h ON h.SalesOrderID
= d.SalesOrderID WHERE h.SalesPersonID = 290;
B.UPDATE Sales.SalesOrderDetail SET UnitPriceDiscount =
.1 FROM Sales.SalesOrderHeader h WHERE h.SalesPersonID = 290;
C.UPDATE Sales.SalesOrderDetail SET UnitPriceDiscount =
.1 WHERE EXISTS ( SELECT * FROM Sales.SalesOrderHeader h WHERE h.SalesPersonID
= 290);
D.UPDATE Sales.SalesOrderDetail SET UnitPriceDiscount =
.1 FROM Sales.SalesOrderDetail d WHERE EXISTS ( SELECT * FROM
Sales.SalesOrderHeader h WHERE h.SalesPersonID = 290);
参考答案