Which three Transact-SQL statements should you use?

You administer a Microsoft SQL Server 2008 database that includes a table named Products.
The Products table has the following schema:
CREATE TABLE dbo.Products(
ProductID nchar(4) NOT NULL,
ProductName nvarchar(50) NULL,
ProductDescription nvarchar(50) NULL,
UnitCost money NULL,
UnitPrice money NULL,
CONSTRAINT PK_Products PRIMARY KEY CLUSTERED (ProductID ASC))
GO
You create a User-Defined Function (UDF) in the same database. The UDF has the following schema:
CREATE FUNCTION dbo.CalculateProductProfit(@ProductID nchar(4))
RETURNS Money
WITH SCHEMABINDINGAS
BEGIN
DECLARE @Profit Money;
SELECT @Profit = UnitPrice – UnitCost FROM dbo.Products WHERE ProductID = @ProductID;
RETURN @Profit;
END
You need to meet the following requirements:
•Ensure that the UnitPrice column does not accept NULL values.
•Use the CalculateProductProfit() UDF.
•Avoid accidental drop or change of the Product table.
Which three Transact-SQL statements should you use? (To answer, move the appropriate statements from the list of statements to the answer area and arrange them in the correct order.)
Build List and Reorder:


microsoft-exams

Leave a Reply

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


The reCAPTCHA verification period has expired. Please reload the page.