2013 Latest MCSA 70-461 Exam Questions 51-55

Ensurepass

QUESTION 6
You are a database developer of a Microsoft SQL Server 2012 database. You are designing a table that will store Customer data from different sources. The table will include a column that contains the CustomerID from the source system and a column that contains the SourceID. A sample of this data is as shown in the following table.
You need to ensure that the table has no duplicate CustomerID within a SourceID. You also need to ensure that the data in the table is in the order of SourceID and then CustomerID. Which Transact- SQL statement should you use?
A. CREATE TABLE Customer
(SourceID int NOT NULL IDENTITY,
CustomerID int NOT NULL IDENTITY,
CustomerName varchar(255) NOT NULL);
B. CREATE TABLE Customer
(SourceID int NOT NULL,
CustomerID int NOT NULL PRIMARY KEY CLUSTERED,
CustomerName varchar(255) NOT NULL);
C. CREATE TABLE Customer
(SourceID int NOT NULL PRIMARY KEY CLUSTERED,
CustomerID int NOT NULL UNIQUE,
CustomerName varchar(255) NOT NULL);
D. CREATE TABLE Customer (SourceID int NOT NULL, CustomerID int NOT NULL,
CustomerName varchar(255) NOT NULL, CONSTRAINT PK_Customer PRIMARY KEY CLUSTERED (SourceID, CustomerID));
Correct Answer: D
Explanation/Reference:
Verified the answer as correct.

QUESTION 7
You have three tables that contain data for vendors, customers, and agents. You create a view that is used to look up telephone numbers for these companies. The view has the following definition:
You need to ensure that users can update only the phone numbers by using this view. What should you do? A. Alter the view. Use the EXPAND VIEWS query hint along with each SELECT statement.
B. Drop the view. Re-create the view by using the SCHEMABINDING clause, and then create an index on the view.
D. Create an INSTEAD OF UPDATE trigger on the view.
Correct Answer: D
Explanation/Reference:
Reference: http://msdn.microsoft.com/en-us/library/ms187956.aspx

QUESTION 8
You develop a Microsoft SQL Server 2012 database that contains tables named Employee and Person. The tables have the following definitions:
You create a view named VwEmployee as shown in the following Transact-SQL statement.
Users are able to use single INSERT statements or INSERT…SELECT statements into this view. You need to ensure that users are able to use a single statement to insert records into both Employee and Person tables by using the VwEmployee view. Which Transact-SQL statement should you use?
A. CREATE TRIGGER TrgVwEmployee
N VwEmployee
FOR INSERT
AS
BEGIN
INSERT INTO Person(Id F rstNameLastName) SELECT IdF rstName LastNameFROM nserted
INSERT INTO Employee(PersonId EmployeeNumber) SELECT IdEmployeeNumber FROM serted
END
B. CREATE TRIGGER TrgVwEmployee
N VwErr loyee INSTEAD OF INSERT AS
BEGIN
INSERT INTO Person(Id F rstNameLastName) SELECT IdF rstName LastNameFROM nserted
INSERT INTO Employee(PersonId EmployeeNumber) SELECT IdEmployeeNumber FROM serted
END
c. CREATE TRIGGER TrgVwEmployee
N VwErr loyee INSTEAD OF INSERT AS
BEGIN
DECLARE @ID INT@F rstName NVARCHAR( 5) @LastName NVARCHAR( 5) @PersonID INT @EmployeeNumber NVARCR(15)
SELECT @ID 1@F rstNameF rstName @LastNameLastName
EmployeeNumberEmployeeNumber
FROM serted
INSERT INTO Person(Id F rstNameLastName) VALUES(@ID @F rstName@LastName)
INSERT INTO Employee(Person EmployeeNumber) VALUES(@PersonID @EmployeeNumber
End
D. CREATE TRIGGER TrgVwEmployee
N VwErr loyee INSTEAD OF INSERT AS
BEGIN
INSERT INTO Person(Id F rstNameLastName) SELECT IdF rstName LastName FROM VwEmployee
INSERT INTO Employee(Person EmployeeNumber) SELECT IdEmployeeNumber FROM VwEmployee
End
Correct Answer: B
5ection: (none) Explanation
Explanation/Reference: Verified answer as correcl
QUE5TION 9
You develop a Microsoft SQL Server 2012 dalabase lhalconlains a lable named Producls. The Producls
table has the following definition:
You need to create an audit record only when either the RetailPrice or WholeSalePrice column is updated. Which Transact-SQL query should you use?
A. CREATE TRIGGER TrgPriceChange ON Products FOR UPDATE AS IF CCLUMNS_CHANGED(RetailPrice, WholesalePrice)
– – Create Audit Records
B. CREATE TRIGGER TrgPriceChange ON Products FOR UPDATE AS IF EXISTS(SELECT RetailPrice from inserted) OR
EXISTS (SELECT WholeSalePnce FROM inserted)
– – Create Audit Records
C. CREATE TRIGGER TrgPriceChange ON Products FOR UPDATE AS IF COLUMNS_UPDATED(RetailPrice, WholesalePrice)
– – Create Audit Records
D. CREATE TRIGGER TrgPriceChange ON Products FOR UPDATE AS IF UPDATE(RetailPrice) OR UPDATE(WholeSalePrice)
– – Create Audit Records
Correct Answer: D
Explanation/Reference:
Verified answer as correct.
Reference: http://msdn.microsoft.com/en-us/library/bb510663.aspx
Reference: http://msdn.microsoft.com/en-us/library/ms186329.aspx

QUESTION 10
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?
A. ALTER TABLE Inventory
ADD TotalItems AS ItemsInStore + ItemsInWarehouse
B. ALTER TABLE Inventory
ADD ItemsInStore – ItemsInWarehouse = TotalItems
C. ALTER TABLE Inventory
ADD TotalItems = ItemsInStore + ItemsInWarehouse
D. ALTER TABLE Inventory
ADD TotalItems AS SUM(ItemsInStore, ItemslnWarehouse);
Correct Answer: A
Explanation/Reference:
Verified answer as correct.
Reference: http://technet.microsoft.com/en-us/library/ms190273.aspx

Download Ensurepass Latest 2013 MCSA 70-461 Real Exam Questions , help you to pass exam 100%.