You have below table
CREATE TABLE Inventory
(ItemID int NOT NULL PRIMARY KEY,
ProductsInStore int NOT NULL,
ProductsInWarehouse int NOT NULL)

How to create a computed column that returns the sum total of the ProductsInStore and ProductsInWarehouse values for each row ?

 Posted by Bandi on 8/29/2017 | Category: Sql Server Interview questions | Views: 4694 | Points: 40
Select from following answers:
  1. ALTER TABLE Inventory ADD TotalProducts AS ProductsInStore + ProductsInWarehouse
  2. ALTER TABLE Inventory ADD ProductsInStore - ProductsInWarehouse = TotalProducts
  3. ALTER TABLE Inventory ADD TotalProducts AS SUM(ProductsInStore, ProductslnWarehouse);
  4. ALTER TABLE Inventory ADD TotalProducts = ProductsInStore + ProductsInWarehouse
  5. All Above

Show Correct Answer


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response