Question 91

Note: This question is part of a series of questions that use the same scenario. For your convenience, the scenario is repeated in each question. Each question presents a different goal and answer choices, but the text of the scenario is exactly the same in each question on this series.
You have a database that tracks orders and deliveries for customers in North America. System versioning is enabled for all tables. The database contains the Sales.Customers, Application.Cities, and Sales.CustomerCategories tables.
Details for the Sales.Customers table are shown in the following table:

Details for the Application.Cities table are shown in the following table:

Details for the Sales.CustomerCategories table are shown in the following table:

You need to create a query that meets the following requirements:
- For customers that are not on a credit hold, return the CustomerID and the latest recorded population for the delivery city that is associated with the customer.
- For customers that are on a credit hold, return the CustomerID and the latest recorded population for the postal city that is associated with the customer.
Which two Transact-SQL queries will achieve the goal? Each correct answer presents a complete solution.
  • Question 92

    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?
  • Question 93

    DRAG DROP
    You have a database that includes the following tables:

    You need to create a list of all customer IDs and the date of the last order that each customer placed. If the customer has not placed any orders, you must return the date
    January 1, 1900. The column names must be CustomerID and LastOrderDate.
    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.

    Question 94

    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 create a table named Products by running the following Transact-SQL statement:

    You have the following stored procedure:

    You need to modify the stored procedure to meet the following new requirements:
    Insert product records as a single unit of work.

    Return error number 51000 when a product fails to insert into the database.

    If a product record insert operation fails, the product information must not be permanently written to the

    database.
    Solution: You run the following Transact-SQL statement:

    Does the solution meet the goal?
  • Question 95

    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?