Microsoft 70-461 Querying Microsoft SQL Server 2012 Online Training
Microsoft 70-461 Online Training
The questions for 70-461 were last updated at Dec 20,2024.
- Exam Code: 70-461
- Exam Name: Querying Microsoft SQL Server 2012
- Certification Provider: Microsoft
- Latest update: Dec 20,2024
DRAG DROP
You are the administrator for a heavily-used OLTP Microsoft SQL Server database.
You are troubleshooting performance issues seen when using stored procedures in the database. The database stores millions of orders across thousands of customers. Some of the customers have large numbers of orders, while others have only one order. You update the statistics and perform defragmentation of all tables and indexes, but two stored procedures still have issues when accessing data.
p_GetCustomer accepts @companyID as a parameter. From the results of profiling, you know that 90 percent of the calls use the @companyid value of 5, while the other 10 percent of calls are evenly distributed across another 10000 values. While viewing the execution plan, you discover that a non-clustered index seek is used.
p_GetShipDate accepts @orderID as a parameter and returns the ship date for that order. You discover that the execution plan is performing a scan on a non-clustered index that has orderID as the index key.
You need to add appropriate query hints to each stored procedure to improve the performance.
What should you do? To answer, drag the appropriate procedures to the correct hints. Each procedure may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.
You use Microsoft SQL Server to develop a database application. Your application sends data to a VARCHAR (50) variable named @var. You need to write a Transact-SQL statement that will return information on a successful or
unsuccessful cast to an integer in a table.
Which Transact-SQL statement should you run?
- A . Option A
- B . Option B
- C . Option C
- D . Option D
DRAG DROP
You are developer for a Microsoft Azure SQL Database instance.
You are creating a new stored procedure. The procedure must perform the following tasks in this order: -1. Update a table named OrderHistory. -2. Delete rows from a table named Orders. -3. Delete rows from a table named Customers. -4. Insert rows into a table named ProcessHistory.
You need to ensure that the procedure meets the following requirements:
-If either DELETE operation fails, the rest of operation must continue. -If either the UPDATE operation or the INSERT operation fails, the whole procedure should fail and no changes should be retained.
Which four Transact-SQL segments should you use to develop the solution? To answer, move the appropriate Transact-SQL segments from the list of Transact-SQL segments to the answer area and arrange them in the correct order.
CORRECT TEXT
You have a SQL Server database that contains all of the sales data for your company.
You need to create a query that returns the customers who represent the top five percent of the total actual sales.
Part of the correct Transact-SQL has been provided in the answer area below. Enter the code in the answer area that resolves the problem and meets the stated goals or requirements. You can add code within the code that has been provided as well as below it.
Use the Check Syntax button to verify your work. Any syntax or spelling errors will be reported by
line and character position.
CORRECT TEXT
You plan to deploy a stored procedure for a database named TICKETS.
You need to implement error handling for the stored procedure to ensure that the system-defined error messages are returned if an error occurs upon insert. Part of the correct Transact-SQL has been provided in the answer are below. Enter the code in the answer area that resolves the problem and meets the stated goals or requirements.
You can add code within the code that has been provided as well as below it.
Use the ‘Check Syntax’ button to verify your work. Any syntax or spelling errors will be reported by line and character position.
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 develop a database for a travel application. You create a view that displays details of events and
attractions. The names of the event and attractions are sorted alphabetically.
You need to sort the names in a case-sensitive, dictionary order.
What should you do?
- A . Use the CAST function.
- B . Use the DATE data type.
- C . Use the FORMAT function.
- D . Use an appropriate collation.
- E . Use a user-defined table type.
- F . Use the VARBINARY data type.
- G . Use the DATETIME data type.
- H . Use the DATETIME2 data type.
- I . Use the DATETIMEOFFSET data type.
- J . Use the TODATETIMEOFFSET function.
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 develop a database for a travel application. You need to design tables and other database objects.
You create the Historical_Events table.
You need to store dates by using the smallest possible storage size.
What should you do?
- A . Use the CAST function.
- B . Use the DATE data type.
- C . Use the FORMAT function.
- D . Use an appropriate collation.
- E . Use a user-defined table type.
- F . Use the VARBINARY data type.
- G . Use the DATETIME data type.
- H . Use the DATETIME2 data type.
- I . Use the DATETIMEOFFSET data type.
- J . Use the TODATETIMEOFFSET function.
DRAG DROP
You develop a Microsoft SQL Server Database.
The database contains a table named Status that is defined by the following Transact-SQL statement:
There are thousands of rows in the Status table, with significant duplication of data in the Color column. Ninety percent of the rows in the table have Color="Red", and the remaining 10 percent have Color="Green".
You want to normalize the Color information in this table.
You create a table named Colors that is defined by the following DDL:
You populate the new Colors table by using the following Transact-SQL statement:
INSERT Colors (ColorName) SELECT DISTINCT Color FROM Status
You need to ensure that the following requirements are met:
– The Status table uses only colors that exist in the Colors table.
– Data redundancy in the Status table is reduced.
– Data integrity is enforced during the normalization process.
Which three Transact-SQL segments should you use to develop the solution? To answer, move the appropriate Transact-SQL segment from the list of Transact-SQL segments to the answer area and arrange them in the correct order.
DRAG DROP
You use Microsoft SQL Server client tool to develop a Microsoft Azure SQL Database instance to support an e-commerce application.
The database consists of a Product table, a Store table, and a StoreProduct table as shown in the exhibit. (Click the Exhibit button.)
You need to write a trigger that meets the following requirements:
– Stores are not physically deleted, but are marked as deleted.
– When a store is deleted, the products that are sold in that store are marked as discontinued.
Which four Transact-SQL segments should you use to develop the solution? To answer, move the appropriate Transact-SQL segments from the list of Transact-SQL segments to the answer area and arrange them in the correct order.
Exhibit
HOTSPOT
You have a database that contains the following related tables:
You create a view named OrderSummary by using the following Transact-SQL statement: For each of the following statements, select Yes if the statement is true. Otherwise, select No.