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

You need to return normalized data for all customers that were added in the year 2014.
Which Transact-SQL statement should you run?
A:

B:

C:

D:

E:

F:

G:

H:

You create a table by running the following Transact-SQL statement:

You need to return normalized data for all customers that were added in the year 2014.
Which Transact-SQL statement should you run?
A:

B:

C:

D:

E:

F:

G:

H:

Question 122
You have a database that stored information about servers and application errors. The database contains the following tables.
Servers

Errors

You need to return all error log messages and the server where the error occurs most often.
Which Transact-SQL statement should you run?

Servers

Errors

You need to return all error log messages and the server where the error occurs most often.
Which Transact-SQL statement should you run?

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

You need to return normalized data for all customers that were added in the year 2014.
Which Transact-SQL statement should you run?

You create a table by running the following Transact-SQL statement:

You need to return normalized data for all customers that were added in the year 2014.
Which Transact-SQL statement should you run?

Question 124
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?
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?
Question 125
CORRECT TEXT
You have a table named Cities that has the following two columns: CityID and CityName.
The CityID column uses the int data type, and CityName uses nvarchar(max).
You have a table named RawSurvey. Each row includes an identifier for a question and the number of persons that responded to that question from each of four cities. The table contains the following representative data:

A reporting table named SurveyReport has the following columns: CityID, QuestionID, and RawCount, where RawCount is the value from the RawSurvey table.
You need to write a Transact-SQL query to meet the following requirements:
* Retrieve data from the RawSurvey table in the format of the SurveyReport table.
* The CityID must contain the CityID of the city that was surveyed.
* The order of cities in all SELECT queries must match the order in the RawSurvey table.
* The order of cities in all IN statements must match the order in the RawSurvey table.
Construct the query using the following guidelines:
* Use one-part names to reference tables and columns, except where not possible.
* ALL SELECT statements must specify columns.
* Do not use column or table aliases, except those provided.
* 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.

Use the Check Syntax button to verify your work. Any syntax or spelling errors will be reported by line and character position.
You have a table named Cities that has the following two columns: CityID and CityName.
The CityID column uses the int data type, and CityName uses nvarchar(max).
You have a table named RawSurvey. Each row includes an identifier for a question and the number of persons that responded to that question from each of four cities. The table contains the following representative data:

A reporting table named SurveyReport has the following columns: CityID, QuestionID, and RawCount, where RawCount is the value from the RawSurvey table.
You need to write a Transact-SQL query to meet the following requirements:
* Retrieve data from the RawSurvey table in the format of the SurveyReport table.
* The CityID must contain the CityID of the city that was surveyed.
* The order of cities in all SELECT queries must match the order in the RawSurvey table.
* The order of cities in all IN statements must match the order in the RawSurvey table.
Construct the query using the following guidelines:
* Use one-part names to reference tables and columns, except where not possible.
* ALL SELECT statements must specify columns.
* Do not use column or table aliases, except those provided.
* 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.

Use the Check Syntax button to verify your work. Any syntax or spelling errors will be reported by line and character position.