PrepAway - Latest Free Exam Questions & Answers

Which Transact-SQL statement should you use?

You develop a Microsoft SQL Server 2012 server database that supports an application. The
application contains a table that has the following definition:
CREATE TABLE Inventory
(ItemID int NOT NULL PRIMARY KEY,
ItemsInStore int NOT NULL,
ItemsInWarehouse int NOT NULL)
You need to create a computed column that returns the sum total of the ItemsInStore and
ItemsInWarehouse values for each row.
Which Transact-SQL statement should you use?

PrepAway - Latest Free Exam Questions & Answers

A.
ALTER TABLE Inventory
ADD TotalItems AS ItemsInStore + ItemsInWarehouse

B.
ALTER TABLE Inventory
ADD ItemsInStore – ItemsInWarehouse = TotalItemss

C.
ALTER TABLE Inventory
ADD TotalItems = ItemsInStore + ItemsInWarehouse

D.
ALTER TABLE Inventory
ADD TotalItems AS SUM(ItemsInStore, ItemslnWarehouse);

Explanation:
http://technet.microsoft.com/en-us/library/ms190273.aspx

58 Comments on “Which Transact-SQL statement should you use?

    1. A says:

      No the correct answer is A, “+” is used for concat (via cast function) many strings also for adding values, sum function require only one argument and it is used for aggregation.




      0



      0
  1. HuncwotVincent says:

    This file for this exam is not great at all. Quite a few incorrect answers. I found that this lead2pass 179q dump covered this file and also had more accurate answers and passed with 945 scores this morning.




    0



    0

Leave a Reply