You develop a Microsoft SQL Server 2012 database. You need to create a batch process that meets the following requirements:
* Status information must be logged to a status table.
* If the status table does not exist at the beginning of the batch, it must be created.
Which object should you use?
You administer a Microsoft SQL Server 2012 database that has Trustworthy set to On. You create a stored procedure that returns database-level information from Dynamic Management Views. You grant User1 access to execute the stored procedure. You need to ensure that the stored procedure returns the required information when User1 executes the stored procedure. You need to achieve this goal by granting the minimum permissions required. What should you do? (Each correct answer presents a complete solution. Choose all that apply.)
Answer : D, E
You have a database that contains the tables shown in the exhibit. (Click the Exhibit button.)

You need to create a query that calculates the total sales of each OrderId from the Sales.Details table. The solution must meet the following requirements:
* Use one-part names to reference columns.
* Sort the order of the results from OrderId.
* NOT depend on the default schema of a user.
* Use an alias of TotalSales for the calculated ExtendedAmount.
* Display only the OrderId column and the calculated TotalSales column.
Which code segment should you use?
To answer, type the correct code in the answer area.
Answer : B
You have an XML schema collection named Sales.InvoiceSchema.
You need to declare a variable of the XML type named XML1. The solution must ensure that XML1 is validated by using Sales.InvoiceSchema.
Which code segment should you use?
To answer, type the correct code in the answer area.
Note: This question is part of series of questions that use the same or similar answer choices. An answer choice may be correct for more than one question in the series. Each question is independent of the other questions in the series. Information and details provided in a question apply only to that question.
You administer a Microsoft SQL Server database.
The database contains a table named Employee. Part of the Employee table is shown in the exhibit. (Click the Exhibit button.)


Unless stated above, no columns in the Employee table reference other tables.
Confidential information about the employees is stored in a separate table named EmployeeData. One record exists within EmployeeData for each record in the Employee table.
You need to assign the appropriate constraints and table properties to ensure data integrity and visibility.
Which column in the Employee table should be referenced in a one-to-one relationship by the EmployeeData table?
Answer : C
You develop a Microsoft SQL Server 2012 database.
You need to create and call a stored procedure that meets the following requirements:
* Accepts a single input parameter for CustomerID.
* Returns a single integer to the calling application.
Which Transact-SQL statement or statements should you use? (Each correct answer presents part of the solution. Choose all that apply.)
Answer : A, E
You are designing a Microsoft SQL Server database named Orders.
You create a table by running the following Transact-SQL statement:

You create a stored procedure to be used by an ASP.NET application that runs the following statement:

You need to ensure that the query runs as efficiently as possible.
Which Transact-SQL statement should you run?

Answer : B
Creating a primary key automatically creates a corresponding unique clustered index, or a nonclustered index if specified as such.
Example: To create a primary key in an existing table
The following example creates a primary key on the column TransactionID in the AdventureWorks database.
ALTER TABLE Production.TransactionHistoryArchive
ADD CONSTRAINT PK_TransactionHistoryArchive_TransactionID PRIMARY KEY CLUSTERED (TransactionID);
References:
https://docs.microsoft.com/en-us/sql/relational-databases/tables/create-primary-keys