Microsoft - Examsoon.70 461.v2013!12!30.by - Terri.29q
Microsoft - Examsoon.70 461.v2013!12!30.by - Terri.29q
Number: 70-461
Passing Score: 800
Time Limit: 120 min
File Version: 25.4
http://www.gratisexam.com/
QUESTION 1
You work as a database administrator at ABC.com. ABC.com has a SQL Server 2012 database named
ProductsDB. The relevant part of the ProductsDB is shown in the following database diagram:
You need to write a Transact-SQL query that display a single row in the following XML format:
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 2
You work as a database administrator at ABC.com. ABC.com has a SQL Server 2012 database named
SalesDB. The SalesDB is shown in the following database diagram:
You need to write a Transact-SQL query that display a single row in the following XML format:
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 3
You work as a database administrator at ABC.com. ABC.com has a SQL Server 2012 database named
ProductsDB. The ProductsDB database is shown in the following database diagram:
You need to write a Transact-SQL query that displays all the products received by a single supplier in the
following XML format:
</Suppliers>
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 4
You work as a database developer at ABC.com. ABC.com has a SQL Server 2012 database named SalesDB
that has a table named WeeklySales. The WeeklySales table records the sales amount for each of ABC.com's
20 sales representitives.
You need to write a Transact-SQL query that ranks the sales representatives by the average sales amount for
the past year. You want the sales representatives with the same average sales amount to have the same rank
with the subsequent rank being skipped.
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Ref: http://msdn.microsoft.com/en-us/library/ms189798.aspx
QUESTION 5
You work as a SQL Server 2012 database developer at ABC.com. You are developing a query for a database
driven Web application that allows visitors to vote for the cricket player of the week. The number of votes is
stored in a table named WeeklyVotes that has columns named Week, PlayerName, Votes.
You need to write a Transact-SQL query that returns the cricket player that received the most votes for each
week, as well as the number of votes they received.
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 6
You work as a database developer at ABC.com. ABC.com has a SQL Server 2012 database named SalesDB
that has a table named Inventory.
The Inventory table has three columns named ProductID, InStore and InWarehouse. The ProductID column is
the primary key and is linked to the Products table. The InStore column stores the quantity of a product that is
held at ABC.com's retail shop, while the InWarehouse column stores the quantity of a product that is held at
ABC.com's warehouse.
http://www.gratisexam.com/
You need to add a computed column that stores the total number of a product that ABC.com has.
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Ref: http://www.kodyaz.com/articles/sql-server-computed-column-calculated-column-sample.aspx
QUESTION 7
You are the database administrator of a SQL Server 2012 database infrastructure at ABC.com.
You need to optimize a very large database table that contains several million rows of data by designing a view
based on the table. The view must allow users to perform aggregations on several columns.
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 8
You are the database developer at ABC.com. ABC.com has a SQL Server 2012 database infrastructure that
has a database named ComDB with a table named Partners.
The Partners table was created using the following Transact-SQL code:
CREATE TABLE [dbo].[Partners]
You develop a new table named Events using the following Transact-SQL code:
How would you guarantee that values in the Events.CompanyID column already exist in the
Partners.CompanyID column?
Explanation/Reference:
Explanation:
Ref: http://msdn.microsoft.com/en-us/library/ms179610.aspx
QUESTION 9
You work as a database administrator at ABC.com. ABC.com has a SQL Server 2012 database named
SalesDB. The SalesDB database is shown in the following database diagram:
You create a view on the SalesDB using the following Transact-SQL code:
WITH SCHEMABINDINGS
AS
OrderDetail.ProductID = Products.ProducID
OrderDetail.InvoiceID = Invoices.InvoiceID
GROUP BY Products.ProductID, Invoices.InvoiceDate
GO
How should you alter this view to allow users to update data through the SalesV?
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 10
CORRECT TEXT
You are employed as a SQL Server 2012 database developer at ABC.com. ABC.com has a SalesDB database
with a view named SalesV. The SalesV view was created using the following Transact-SQL code:
AS
FROM SalesDB.Orders;
You want to create an inline table-valued function named fn_ABC that accepts a @ProductID parameter of the
integer data type. The inline table-valued function should also allow for sales orders for each product to be
listed by the latest sale.
A.
B.
C.
D.
Correct Answer:
Section: (none)
Explanation
Explanation/Reference:
Answer: CREATE FUNCTION SalesDB.fn_ABC ( @ProductID int ) RETURNS TABLE
AS
RETURN
(
SELECT OrderID, ProductID, ShipDate, OrderDate, Amount
QUESTION 11
CORRECT TEXT
You are employed as a SQL Server 2012 database developer at ABC.com. ABC.com has a database named
SalesDB with tables named Customer and Orders. The Customer and Orders tables were created using the
following Transact-SQL code:
GO
GO
You must now create an OrderDetails table as shown in the following database diagram:
The TotalPrice column must be a computed column based on the product of the UnitPrice and Quantity
columns and the data must be stored in the table.
A.
B.
C.
D.
Correct Answer:
Section: (none)
Explanation
Explanation/Reference:
Answer: CREATE TABLE SalesDB.OrderDetails
(
OrderID int NOT NULL,
ProductID int NOT NULL,
Quantity int NOT NULL,
UnitPrice money NOT NULL,
TotalPrice AS (Quantity * UnitPrice) PERSISTED
)
QUESTION 12
You work as a SQL Server 2012 database developer at ABC.com. ABC.com has a database named SalesDB.
You are developing a stored procedure that takes a parameter named @date that uses the varchar datatype.
The @date parameter must be compared to the value in a datetime column
named OrderDate.
Which of the following WHERE clauses would be the most efficient WHERE clause to use?
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 13
You work as a database developer at ABC.com. ABC.com has a SQL Server 2012 database infrastructure with
several databases. You have permissions on two of these databases, namely, CommDB and SalesDB.
You need to develop a stored procedure named dbo.ABC_addEntry in a database named AssetsDB. The
dbo.ABC_addEntry stored procedure will run stored procedures in CommDB and SalesDB.
How should you design the stored procedure so that callers that do not paver permissions on CommDB and
SalesDB can run the dbo.ABC_addEntry stored procedure successfully?
A. You should configure the stored procedure to call the xp_cmdshell extended stored procedure.
B. You should configure the stored procedure to call the sp_configure system stored procedure.
C. You should assign users permission to the stored procedure.
D. You should include the EXECUTE AS CALLER clause when creating the stored procedure.
E. You should include the EXECUTE AS OWNER clause when creating the stored procedure.
Correct Answer: E
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 14
You work as a database developer at ABC.com. ABC.com has a SQL Server 2012 database infrastructure with
a very large database named SalesDB. You create a new table named SalesHistory that will hold historical data
from the SalesDB database.
You need to perform a batch update from the SalesDB database to the SalesHistory table. You want the status
information from the batch process to be logged to a SQL Server table that must be created by the batch
process.
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 15
You are developing a SQL Server 2012 database for ABC.com. You need to create a computed column that
returns the data by referencing another table using an INNER JOIN.
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 16
You work as a SQL Server 2012 database developer at ABC.com.
ABC.com has a database SalesDB with a large Orders table. You create a heap named OldData that will store
historical data from the Orders table.
You need to write a Transact-SQL query that will insert rows of data from the Orders table that are marked as
closed and are more than six months old.
Which of the following table hints should you use in your query if you want to optimize transaction logging and
locking for the query?
Correct Answer: E
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 17
You are employed as a SQL Server 2012 database developer at ABC.com. You have a stored procedure that is
executed quite often. The stored procedure joins data from two tables.
ABC.com users report that the stored procedure takes a long time to execute. You analyze the
query plan and find that the stored procedure often makes use of table scans rather than indexes when the
estimated rows do not match the actual rows on one of the tables.
A. You should make use of the KEEPIDENTITY table hint in the stored procedure.
B. You should make use of the KEEPDEFAULTS table hint in the stored procedure.
C. You should make use of the IGNORE_CONSTRAINTS table hint in the stored procedure.
D. You should make use of the FORCESEEK table hint in the stored procedure.
E. You should update statistics on the tables queried by the stored procedure.
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 18
You work as a SQL Server 2012 database developer at ABC.com. You are developing a database driven Web
application. The application executes a store procedure based on the location of the web user.
The location of the Web user is determined by IP Geolocation. You want to develop a process that will execute
the correct stored procedure for every Web user based on the user's location.
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 19
You work as a database administrator at ABC.com. You are developing a database that will be used by a web
site analysis application name ABCWeb1.
The ABCWeb1 application must display the date and time each visitor visits a page on a website as well as the
date and time they leave that web page. This data needs to be displayed in different date and time formats.
How would you accomplish this?
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 20
You work as a database administrator at ABC.com. ABC.com has a SQL Server 2012 database named
SalesDB. The SalesDB database is shown in the following database diagram:
You create a view on the SalesDB database using the following Transact-SQL code:
WITH SCHEMABINDINGS
AS
OrderDetail.ProductID = Products.ProducID
OrderDetail.InvoiceID = Invoices.InvoiceID
GO
You want the SalesV view to persist data to disk in order to improve performance.
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Ref: http://msdn.microsoft.com/en-us/library/ms190174
QUESTION 21
You work as a database developer at ABC.com. ABC.com has a SQL Server 2012 database named SalesDB
with a table named Invoices.
Application developers are developing several in-house applications that will access the Invoices table. You
need to develop a solution that will allow the applications to access the table indirectly while still allowing them
to update the Invoice table.
http://www.gratisexam.com/
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 22
You work as a database administrator at ABC.com. ABC.com has a SQL Server 2012 database
named SalesDB. The SalesDB database is shown in the following database diagram:
You need to write a Transact-SQL query that displays all Customers, whether they have invoices or not. The
query must also display the InvoiceDate for a Customer that has an Invoice.
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 23
You work as a database administrator at manufacturing company named ABC.com. ABC.com has a SQL
Server 2012 database named ProductionDB. The ProductionDB database has a table named Sites that was
created using the following Transact-SQL code:
You want to write the Transact-SQL query that returns the number of items produced at each
location for each week. In addition, you want the result set to include a column named PrevItemsProduced that
holds the number of items produced at each location for the week before.
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 24
You work as a SQL Server 2012 database developer at ABC.com. You are developing a stored procedure for
ABC.com's e-Commerce application.
Your stored procedure must display unique values from one column in multiple columns in the result set.
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 25
You work as a SQL Server 2012 database developer at ABC.com. ABC.com has a large database
named SalesDB.
New rows are inserted into the tables in the SalesDB database and updates to existing rows occur on a high
frequency. The inserts and updates often blocked by queries retrieving and reading data.
How would you prevent queries that retrieve and read data from blocking queries that insert and update data?
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Ref: http://msdn.microsoft.com/en-us/library/ms173763.aspx
QUESTION 26
You work as a database developer at ABC.com. ABC has an in-house application named ABCApp3 that runs a
Transact-SQL query against a SQL Server 2012 database named SalesDB.
ABC.com users report that ABCApp3 is functioning sluggishly. You discover that concurrent updates are
causing blockages on the SalesDB database.
How would you ensure that the query to use the original data when updates occur?
A. You should have the query run in the REPEATABLE READ ISOLATION LEVEL.
B. You should have the query run in the SERIALIZABLE ISOLATION LEVEL.
C. You should have the query run in the READCOMMITTED ISOLATION LEVEL.
D. You should have the query run in the SNAPSHOT ISOLATION LEVEL.
E. You should have the query run in the READPAST ISOLATION LEVEL.
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 27
You work as a database developer at ABC.com. ABC has an in-house application named ABCApp3 that runs a
Transact-SQL query against a SQL Server 2012 database.
You want to run an execution plan against the query that will provide detailed information on missing indexes.
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 28
You work as a database administrator at ABC.com. ABC.com has a SQL Server 2012 database infrastructure
that contains a database named ABCDB.
The ABCDB database is used by an in-house application named ABCApp3 that queries a read- only table with
a clustered index. ABC.com users report that ABCApp3 is functioning sluggishly.
You suspect query the application uses is causing the problem. You analyze the query and discover that
column referenced in the WHERE clause is not part of the clustered index. You also notice that the query
returns five columns, as well as a COUNT (*) clause grouped on the five columns.
Correct Answer: F
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 29
You work as a SQL Server 2012 database developer at ABC.com. ABC.com has a database named SalesDB
with tables named Customer and Orders. The Customer and Orders tables were created using the following
Transact-SQL code:
GO
GO
You are developing a stored procedure named OrdersByDate that returns the OrderID,
CustomerID, CustomerName and OrderDate. The stored procedure will take a parameter named @date that
uses the int datatype. The @date parameter will be used to filter the result set based on the OrderDate column
in the Orders table.
Explanation/Reference:
Explanation:
http://www.gratisexam.com/