Question 31

You have a database named MyDb. You run the following Transact-SQL statements:

A value of 1 in the IsActive column indicates that a user is active.
You need to create a count for active users in each role. If a role has no active users. You must display a zero as the active users count.
Which Transact-SQL statement should you run?
  • Question 32

    Note: This question is part of a series of questions that use the same or similar answer choices. An answer choice may be correct for more than one question in the series. Each question is independent of the other questions in this series. Information and details provided in a question apply only to that question.
    You have a database that contains tables named Customer_CRMSystem and Customer_HRSystem. Both tables use the following structure:

    The tables include the following records:
    Customer_CRMSystem

    Customer_HRSystem

    Records that contain null values for CustomerCode can be uniquely identified by CustomerName.
    You need to display a list of customers that do not appear in the Customer_HRSystem table.
    Which Transact-SQL statement should you run?

  • Question 33

    SIMULATION
    You have a database that contains the following tables.

    You need to create a query that returns each complaint, the names of the employees handling the complaint, and the notes on each interaction. The Complaint field must be displayed first, followed by the employee's name and the notes. Complaints must be returned even if no interaction has occurred.
    Construct the query using the following guidelines:
    Use two-part column names.

    Use one-part table names.

    Use the first letter of the table name as its alias.

    Do not Transact-SQL functions.

    Do not use implicit joins.

    Do not surround object names with square brackets.

    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 c.Complaint, e.Name, i.Notes
    2 FROM Complaints c
    3 JOIN __________________
    4 JOIN __________________

    Question 34

    You have a database that includes the tables shown in the exhibit. (Click the exhibit button.)

    You need to create a list of all customers, the order ID for the last order that the customer placed, and the date that the order was placed. For customers who have not placed orders, you must substitute a zero for the order ID and 01/01/1990 for the date.
    Which Transact-SQL statement should you run?
  • Question 35

    Note: This question is part of a series of questions that use the same or similar answer choices. An answer choice may be correct for more than one question in the series. Each question is independent of the other questions in this series. Information and details provided in a question apply only to that question.
    You have a database that contains tables named Customer_CRMSystem and
    Customer_HRSystem. Both tables use the following structure:
    The tables include the following records:
    Customer_CRMSystem

    Customer_HRSystem

    Records that contain null values for CustomerCode can be uniquely identified by CustomerName.
    You need to create a list of all unique customers that appear in either table.
    Which Transact-SQL statement should you run?