070-761 Exam Question 31

CORRECT TEXT
You have a database that contains the following tables.

You need to create a query that lists the highest-performing salespersons based on the current year-to-date sales period. The query must meet the following requirements:
Construct the query using the following guidelines:

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.
1 SELECT top 3 lastname,salesYTD
2 FROM Person AS p INNER JOIN SalesPerson AS s
3 ON p.PersonID = s.SalesPersonID
4 WHERE territoryid is null
5 order by salesytd dsec
Use the Check Syntax button to verify your work. Any syntax or spelling errors will be reported by line and character position.

070-761 Exam Question 32

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.
After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.
You have a database named DB1 that contains two tables named Sales.Customers and Sales.Orders.
Sales.Customers has a foreign key relationship to a column named CustomerID in Sales.Orders.
You need to recommend a query that returns all the customers. The query must also return the number of orders that each customer placed in 2016.
Solution: You recommend the following query:

Does this meet the goal?
  • 070-761 Exam Question 33

    Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.
    After you answer a question in this section. You will NOT be able to return to it. As a result, these questions will not appear in the review screen.
    You have a table that was created by running the following Transact-SQL statement:

    The Products table includes the data shown in the following table:

    TotalUnitPrice is calculated by using the following formula:
    TotalUnitPrice = UnitPrice * (UnitsInStock + UnitsOnOrder)
    You need to ensure that the value returned for TotalUnitPrice for ProductB is equal to 600.00.
    Solution: You run the following Transact-SQL statement:

    Does the solution meet the goal?
  • 070-761 Exam Question 34

    You run the following Transact-SQL statement:

    You need to create a stored procedure that meets the following requirements:
    * Inserts data into the Employees table.
    * Processes all data changes as a single unit of work.
    * Sets the exception severity level to 16 and an error number of 60, 000 when any error occurs.
    * If a Transact-SQL statement raises a runtime error, terminates and reverts the entire unit of work, and
    * indicates the line number in the statement where the error occurred.
    * Inserts the value New Employee for the Title column if no title is provided.
    How should you complete the Transact-SQL statement? To answer, drag the appropriate Transact-SQL segment to the correct target. Each Transact-SQL segment 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.
    NOTE: Each correct selection is worth one point.

    070-761 Exam Question 35

    Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.
    After you answer a question in this section. You will NOT be able to return to it. As a result, these questions will not appear in the review screen.
    You have a database that tracks orders and deliveries for customers in North America. The database contains the following tables:
    Sales.Customers

    Application.Cities

    Sales.CustomerCategories

    The company's development team is designing a customer directory application. The application must list customers by the area code of their phone number. The area code is defined as the first three characters of the phone number.
    The main page of the application will be based on an indexed view that contains the area and phone number for all customers.
    You need to return the area code from the PhoneNumber field.
    Solution: You run the following Transact-SQL statement:

    Does the solution meet the goal?