You are developing a database that will contain price information.
You need to store the prices that include a fixed precision and a scale of six digits.
Which data type should you use?
Answer : D
Explanation:
Numeric is the only one in the list that can give a fixed precision and scale.
Reference:
http://msdn.microsoft.com/en-us/library/ms179882.aspx
You administer a Microsoft SQL Server database that supports a banking transaction management application.
You need to retrieve a list of account holders who live in cities that do not have a branch location.
Which Transact-SQL query or queries should you use? (Each correct answer presents a complete solution. Choose all that apply.)
Answer : AB
References:
http://msdn.microsoft.com/en-us/library/ms188047.aspx
http://msdn.microsoft.com/en-us/library/ms177682.aspx
http://msdn.microsoft.com/en-us/library/ms173545.aspx
Note: This question is part of a series of questions that use the same set of answer choices. An answer choice may be correct for more than one question in the series.
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 tab.)
Answer : D
Explanation:
Note: This question is part of a series of questions that use the same set of answer choices. An answer choice may be correct for more than one question in the series.
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 tab.)
Answer : C
Explanation:
You administer a Microsoft SQL Server database that includes a table named Products. The Products table has columns named ProductId, ProductName, and
CreatedDateTime.
The table contains a unique constraint on the combination of ProductName and CreatedDateTime.
You need to modify the Products table to meet the following requirements:
-> Remove all duplicates of the Products table based on the ProductName column.
-> Retain only the newest Products row.
Which Transact-SQL query should you use?
WITH CTEDupRecords -
A.
AS -
(
SELECT MIN(CreatedDateTime) AS CreatedDateTime, ProductName
FROM Products -
GROUP BY ProductName -
HAVING COUNT(*) > 1 -
)
DELETE p -
FROM Products p -
JOIN CTEDupRecords cte ON cte.ProductName = p.ProductName
AND cte.CreatedDateTime > p.CreatedDateTime
WITH CTEDupRecords -
B.
AS -
(
SELECT MIN(CreatedDateTime) AS CreatedDateTime, ProductName
FROM Products -
GROUP BY ProductName -
HAVING COUNT(*) > 1 -
)
DELETE p -
FROM Products p -
JOIN CTEDupRecords cte ON p.ProductName = cte.ProductName
AND p.CreatedDateTime > cte.CreatedDateTime
C.
WITH CTEDupRecords -
AS -
(
SELECT MIN(CreatedDateTime) AS CreatedDateTime, ProductName
FROM Products -
GROUP BY ProductName -
)
DELETE p -
FROM Products p -
JOIN CTEDupRecords cte ON p.ProductName = cte.ProductName
D.
WITH CTEDupRecords -
AS -
(
SELECT MAX(CreatedDateTime) AS CreatedDateTime, ProductName
FROM Products -
GROUP BY ProductName -
HAVING COUNT(*) > 1 -
)
DELETE Products -
FROM Products p -
JOIN CTEDupRecords cte ON p.ProductName = cte.ProductName
Answer : B
Explanation:
You develop three Microsoft SQL Server databases named Database1, Database2, and Database3. You have permissions on both Database1 and Database2.
You plan to write and deploy a stored procedure named dbo.usp_InsertEvent in Database3.dbo.usp_InsertEvent must execute other stored procedures in the other databases.
You need to ensure that callers that do not have permissions on Database1 or Database2 can execute the stored procedure.
Which Transact-SQL statement should you use?
Answer : B
Reference:
http://msdn.microsoft.com/en-us/library/ms188354.aspx
http://blog.sqlauthority.com/2007/10/06/sql-server-executing-remote-stored-procedure-callingstored-procedure-on-linked-server/
You administer a Microsoft SQL Server database that has multiple tables in the Sales schema. Some users must be prevented from deleting records in any of the tables in the Sales schema. You need to manage users who are prevented from deleting records in the Sales schema.
You need to achieve this goal by using the minimum amount of administrative effort. What should you do?
Answer : A
Explanation:
You administer a Microsoft SQL Server database. The database contains a Product table created by using the following definition:
Answer : D
References:
http://msdn.microsoft.com/en-us/library/cc280449.aspx
http://msdn.microsoft.com/en-us/library/cc280464.aspx
http://msdn.microsoft.com/en-us/library/cc280576.aspx
http://msdn.microsoft.com/en-us/library/ee240835.aspx
You generate a daily report according to the following query:
Answer : A
Explanation:
You administer a Microsoft SQL Server database named ContosoDb. Tables are defined as shown in the exhibit. (Click the Exhibit button.)
Answer : A
Explanation:
The following query returns product model information. RAW mode is specified in the FOR XML clause.
Example -
SELECT ProductModelID, Name -
FROM Production.ProductModel -
WHERE ProductModelID=122 or ProductModelID=119
FOR XML RAW;
This is the partial result:
<row ProductModelID="122" Name="All-Purpose Bike Stand" />
<row ProductModelID="119" Name="Bike Wash" />
References:
http://msdn.microsoft.com/en-us/library/bb510464.aspx
SIMULATION -
You have a database that contains the tables as shown in the exhibit. (Click the Exhibit button.)
Answer : Please review the explanation part for this answer.
Explanation:
SELECT SalesTerritoryID,
ProductID,
AVG(UnitPrice),
MAX(OrderQty),
MAX(DiscountAmount)
FROM Sales.Details -
GROUP BY SalesTerritoryID , ProductID
ORDER BY SalesTerritoryID DESC, ProductID DESC
SIMULATION -
You have a database that contains the tables shown in the exhibit. (Click the Exhibit button).
Answer : Please review the explanation part for this answer.
Explanation:
SELECT C.LastName, MAX(O.OrderDate) AS MostRecentOrderDate
FROM Customers AS C INNER JOIN Orders AS O
ON C.CustomerID = O.CustomerID -
GROUP BY C.LastName -
ORDER BY MostRecentOrderDate DESC
SIMULATION -
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.
Answer : Please review the explanation part for this answer.
Explanation:
DECLARE @XML1 XML(Sales.InvoiceSchema)
Reference:
http://msdn.microsoft.com/en-us/library/ms176009.aspx
SIMULATION -
You have a database that contains the tables as shown in the exhibit. (Click the Exhibit button.)
Answer : Please review the explanation part for this answer.
Explantation:
SELECT ProductCatalog.CatID, ProductCatalog.CatName, ProductCatalog.ProductID,
ProductCatalog.ProdName,ProductCatalog.UnitPrice,
RANK() OVER (ORDER BY ProductCatalog.UnitPrice DESC) AS PriceRank
FROM Sales.ProductCatalog -
ORDER BY ProductCatalog.UnitPrice DESC
References:
https://msdn.microsoft.com/en-us/library/ms176102.aspx
SIMULATION -
You have a database that contains the tables shown in the exhibit. (Click the Exhibit button.)
Answer : See explanation below.
Explanation:
CREATE PROCEDURE usp_Customers @Count int
AS -
SELECT TOP(@Count)Customers.LastName
FROM Customers -
ORDER BY Customers.LastName -
Have any questions or issues ? Please dont hesitate to contact us