Welcome to awslagi.com – Sharing AWS, Anthropic, Google Cloud, Microsoft Azure IT Exams. It's free for all!

Querying Data with Transact-SQL

Query data with Transact-SQL accurately and efficiently.

4.8★★★★★(270 ratings)
19,486 studentsIntermediate
Build strong SQL querying skills using Transact-SQL for data retrieval, filtering, grouping, and analysis. The exam provides a practical foundation for anyone working with SQL Server data. This certification is valuable for analysts, developers, and database learners who need reliable query skills. It supports better data understanding and stronger technical performance in data-centric roles.

What you'll learn

  • Write T-SQL queries- Join and filter data- Aggregate results- Use functions and expressions- Work with query logic

70-761

Lectures2
Questions61
Duration30 week
Students19,486

$20.00

Full Free Question Bank (61 Questions)

Querying Data with Transact-SQL (70-761) Practice Questions & Verified Answers

Click any option to test your knowledge, or reveal the verified answer and detailed explanation below each question.

Jump to Section:
Question #1Part 1

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?

AYes
BNo
Question #2Part 1

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?

AYes
BNo
Question #3Part 1

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?

AYes
BNo
Question #4Part 1

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 Customer by running the following Transact-SQL statement: You must insert the following data into the Customer table: You need to ensure that both records are inserted or neither record is inserted. Solution: You run the following Transact-SQL statement: Does the solution meet the goal?

AYes
BNo
Question #5Part 1

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 Customer by running the following Transact-SQL statement: You must insert the following data into the Customer table: You need to ensure that both records are inserted or neither record is inserted. Solution: You run the following Transact-SQL statement: Does the solution meet the goal?

AYes
BNo
Question #6Part 1

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 Customer by running the following Transact-SQL statement: You must insert the following data into the Customer table: You need to ensure that both records are inserted or neither record is inserted. Solution: You run the following Transact-SQL statement: Does the solution meet the goal?

AYes
BNo
Question #7Part 1

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?

AYes
BNo
Question #8Part 1

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?

AYes
BNo
Question #9Part 1

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?

AYes
BNo
Question #10Part 1

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 in this series. You query a database that includes two tables: Project and Task. The Project table includes the following columns: The Task table includes the following columns: You plan to run the following query to update tasks that are not yet started: UPDATE Task SET StartTime = GETDATE() WHERE StartTime IS NULL You need to return the total count of tasks that are impacted by this UPDATE operation, but are not associated with a project. What set of Transact-SQL statements should you run?

AB.
CD.
Question #11Part 1

You need to create a database object that meets the following requirements: ✑ accepts a product identified as input ✑ calculates the total quantity of a specific product, including quantity on hand and quantity on order ✑ caches and reuses execution plan ✑ returns a value ✑ can be called from within a SELECT statement ✑ can be used in a JOIN clause What should you create?

Aan extended stored procedure
Ba user-defined scalar function
Ca user-defined stored procedure that has an OUTPUT parameter
Da temporary table that has a columnstore index
Question #12Part 1

You need to create an indexed view that requires logic statements to manipulate the data that the view displays. Which two database objects should you use? Each correct answer presents a complete solution.

Aa user-defined table-valued function
Ba CRL function
Ca stored procedure
Da user-defined scalar function
Question #13Part 1

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?

AB.
CD.
AOption A
BOption B
COption C
DOption D
Question #14Part 1

You have a database that contains the following tables: Customer - CustomerAudit - Where the value of the CustomerID column equals 3, you need to update the value of the CreditLimit column to 1000 for the customer. You must ensure that the change to the record in the Customer table is recorded on the CustomerAudit table. Which Transact-SQL statement should you run?

AB.
CD.
AOption A
BOption B
COption C
DOption D
Question #15Part 1

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.

AB.
CD.
Question #16Part 1

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 discover an application bug that impacts customer data for records created on or after January 1, 2014. In order to fix the data impacted by the bug, application programmers require a report that contains customer data as it existed on December 31, 2013. You need to provide the query for the report. Which Transact-SQL statement should you use?

AB.
CD.
ENo answers
Question #17Part 1

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 table named Products that contains information about the products that your company sells. The table contains many columns that do not always contain values. You need to implement an ANSI standard method to convert the NULL values in the query output to the phrase "Not Applicable". What should you implement?

Athe COALESCE function
Ba view
Ca table-valued function
Dthe TRY_PARSE function
Ea stored procedure
Question #18Part 1

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 is denormalized. Users make frequent changes to data in a primary table. You need to ensure that users cannot change the tables directly, and that changes made to the primary table also update any related tables. What should you implement?

Athe COALESCE function
Ba view
Ca table-valued function
Dthe TRY_PARSE function
Ea stored procedure
Question #19Part 1

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 stores sales and order information. Users must be able to extract information from the tables on an ad hoc basis. They must also be able to reference the extracted information as a single table. You need to implement a solution that allows users to retrieve the data required, based on variables defined at the time of the query. What should you implement?

Athe COALESCE function
Ba view
Ca table-valued function
Dthe TRY_PARSE function
Ea stored procedure
Question #20Part 1

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 table named AuditTrail that tracks modifications to data in other tables. The AuditTrail table is updated by many processes. Data input into AuditTrail may contain improperly formatted date time values. You implement a process that retrieves data from the various columns in AuditTrail, but sometimes the process throws an error when it is unable to convert the data into valid date time values. You need to convert the data into a valid date time value using the en-US format culture code. If the conversion fails, a null value must be returned in the column output. The conversion process must not throw an error. What should you implement?

Athe COALESCE function
Ba view
Ca table-valued function
Dthe TRY_PARSE function
Ea stored procedure
Question #21Part 1

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?

AB.
CD.
Question #22Part 1

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?

AB.
CD.
Question #23Part 1

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?

AB.
CD.
EF.
Question #24Part 1

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 customers who appear in both tables and have a proper CustomerCode. Which Transact-SQL statement should you run?

AB.
CD.
ENo answers
Question #25Part 1

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 Cartesian product, combining both tables. Which Transact-SQL statement should you run?

AB.
CD.
EF.
Question #26Part 1

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?

AB.
CD.
EF.
Question #27Part 1

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 audit all customer data. Which Transact-SQL statement should you run?

AB.
CD.
EF.
Question #28Part 1

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?

AB.
CD.
EF.
Question #29Part 1

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 are developing a report that displays customer information. The report must contain a grand total column. You need to write a query that returns the data for the report. Which Transact-SQL statement should you run?

AB.
CD.
EF.
Question #30Part 1

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 named Customers. Data stored in the table must be exchanged between web pages and web servers by using AJAX calls that use REST endpoint. You need to return all customer information by using a data exchange format that is text-based and lightweight. Which Transact-SQL statement should you run?

AB.
CD.
EF.
Question #31Part 1

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 are developing a report that aggregates customer data only for the year 2014. The report requires that the data be denormalized. You need to return the data for the report. Which Transact-SQL statement should you run?

AB.
CD.
EF.
Question #32Part 1

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 develop a query that meets the following requirements: ✑ Output data by using a tree-like structure. ✑ Allow mixed content types. ✑ Use custom metadata attributes. Which Transact-SQL statement should you run?

AB.
CD.
EF.
Question #33Part 1

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. A database has two tables as shown in the following database diagram: You need to list all provinces that have at least two large cities. A large city is defined as having a population of at least one million residents. The query must return the following columns: ✑ tblProvince.ProvinceId ✑ tblProvince.ProvinceName ✑ a derived column named LargeCityCount that presents the total count of large cities for the province Solution: You run the following Transact-SQL statement: Does the solution meet the goal?

AYes
BNo
Question #34Part 1

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. A database has two tables as shown in the following database diagram: You need to list all provinces that have at least two large cities. A large city is defined as having a population of at least one million residents. The query must return the following columns: ✑ tblProvince.ProvinceId ✑ tblProvince.ProvinceName ✑ a derived column named LargeCityCount that presents the total count of large cities for the province Solution: You run the following Transact-SQL statement: Does the solution meet the goal?

AYes
BNo
Question #35Part 1

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. A database has two tables as shown in the following database diagram: You need to list all provinces that have at least two large cities. A large city is defined as having a population of at least one million residents. The query must return the following columns: ✑ tblProvince.ProvinceId ✑ tblProvince.ProvinceName ✑ a derived column named LargeCityCount that presents the total count of large cities for the province Solution: You run the following Transact-SQL statement: Does the solution meet the goal?

AYes
BNo
Question #36Part 1

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?

AYes
BNo
Question #37Part 1

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 includes the tables shown in the exhibit (Click the Exhibit button.) You need to create a Transact-SQL query that returns the following information: ✑ the customer number ✑ the customer contact name ✑ the date the order was placed, with a name of DateofOrder ✑ a column named Salesperson, formatted with the employee first name, a space, and the employee last name ✑ orders for customers where the employee identifier equals 4 The output must be sorted by order date, with the newest orders first. The solution must return only the most recent order for each customer. Solution: You run the following Transact-SQL statement: Does the solution meet the goal?

AYes
BNo
Question #38Part 1

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 includes the tables shown in the exhibit (Click the Exhibit button.) You need to create a Transact-SQL query that returns the following information: ✑ the customer number ✑ the customer contact name ✑ the date the order was placed, with a name of DateofOrder ✑ a column named Salesperson, formatted with the employee first name, a space, and the employee last name ✑ orders for customers where the employee identifier equals 4 The output must be sorted by order date, with the newest orders first. The solution must return only the most recent order for each customer. Solution: You run the following Transact-SQL statement: Does the solution meet the goal?

AYes
BNo
Question #39Part 1

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 includes the tables shown in the exhibit (Click the Exhibit button.) You need to create a Transact-SQL query that returns the following information: ✑ the customer number ✑ the customer contact name ✑ the date the order was placed, with a name of DateofOrder ✑ a column named Salesperson, formatted with the employee first name, a space, and the employee last name ✑ orders for customers where the employee identifier equals 4 The output must be sorted by order date, with the newest orders first. The solution must return only the most recent order for each customer. Solution: You run the following Transact-SQL statement: Does the solution meet the goal?

AYes
BNo
Question #40Part 1

You need to create a table named MiscellaneousPayment that meets the following requirements: Which Transact-SQL statement should you run?

AB.
CD.
EF.
Question #41Part 1

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. Multiple processes use the data from a table named Sales and place it in other databases across the organization. Some of the processes are not completely aware of the data types in the Sales table. This leads to data type conversion errors. You need to implement a method that returns a NULL value id data conversion fails instead of throwing an error. What should you implement?

Athe COALESCE function
Ba view
Ca table-valued function
Dthe TRY_PARSE function
Ea stored procedure
Question #42Part 1

You have a database that contains the following tables: You need to write a query that returns a list of all customers who have not placed orders. Which Transact-SQL statement should you run?

ASELECT c.custid FROM Sales.Customers c INNER JOIN Sales.Order o ON c.custid = o.custid
BSELECT custid FROM Sales.Customers INTERSECT SELECT custid FROM Sales.Orders
CSELECT c.custid FROM Sales.Customers c LEFT OUTER Sales.Order o ON c.custid = o.custid
DSELECT c.custid FROM Sales.Customers c LEFT OUTER JOIN Sales.Order o ON c.custid = o.custid WHERE orderid IS NULL
ESELECT custid FROM Sales.Customers UNION ALL SELECT custid FROM Sales.Orders
Question #43Part 1

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?

AB.
CD.
Question #44Part 1

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 to that question. You have a database for a banking system. The database has two tables named tblDepositAcct and tblLoanAcct that store deposit and loan accounts, respectively. Both tables contain the following columns: You need to determine the total number of customers who have either deposit accounts or loan accounts, but not both types of accounts. Which Transact-SQL statement should you run?

AB.
CD.
EF.
Question #45Part 1

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 to that question. You have a database for a banking system. The database has two tables named tblDepositAcct and tblLoanAcct that store deposit and loan accounts, respectively. Both tables contain the following columns: You need to determine the total number of customers who have only loan accounts. Which Transact-SQL statement should you run?

AB.
CD.
EF.
Question #46Part 1

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 to that question. You have a database for a banking system. The database has two tables named tblDepositAcct and tblLoanAcct that store deposit and loan accounts, respectively. Both tables contain the following columns: You need to run a query to find the total number of customers who have both deposit and loan accounts. Which Transact-SQL statement should you run?

AB.
CD.
EF.
Question #47Part 1

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 named Products that stores information about products your company sells. The table has a column named ListPrice that stores retail pricing information for products. Some products are used only internally by the company. Records for these products are maintained in the Products table for inventory purposes. The price for each of these products is $0.00. Customers are not permitted to order these products. You need to increase the list price for products that cost less than $100 by 10 percent. You must only increase pricing for products that customers are permitted to order. Solution: You run the following Transact-SQL statement: Does the solution meet the goal?

AYes
BNo
Question #48Part 1

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 named Products that stores information about products your company sells. The table has a column named ListPrice that stores retail pricing information for products. Some products are used only internally by the company. Records for these products are maintained in the Products table for inventory purposes. The price for each of these products is $0.00. Customers are not permitted to order these products. You need to increase the list price for products that cost less than $100 by 10 percent. You must only increase pricing for products that customers are permitted to order. Solution: You run the following Transact-SQL statement: Does the solution meet the goal?

AYes
BNo
Question #49Part 1

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 named Products that stores information about products your company sells. The table has a column named ListPrice that stores retail pricing information for products. Some products are used only internally by the company. Records for these products are maintained in the Products table for inventory purposes. The price for each of these products is $0.00. Customers are not permitted to order these products. You need to increase the list price for products that cost less than $100 by 10 percent. You must only increase pricing for products that customers are permitted to order. Solution: You run the following Transact-SQL statement: Does the solution meet the goal?

AYes
BNo
Question #50Part 1

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?

AYes
BNo
Question #51Part 1

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?

AYes
BNo
Question #52Part 1

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?

AYes
BNo
Question #53Part 1

You have a database that stores information about server and application errors. The database contains the following table: Servers - Errors - You need to return all unique error log messages and the server where the error occurs most often. Which Transact-SQL statement should you run?

AB.
CD.
Question #54Part 1

You have a database that includes the following tables. HumanResources.Employee - Sales.SalesPerson - The HumanResources.Employee table has 2,500 rows, and the Sales.SalesPerson table has 2,000 rows. You review the following Transact-SQL statement: You need to determine the performance impact of the query. How many times will a lookup occur on the primary key index on the Sales.SalesPerson table?

A200
B2,000
C2,500
D5,500
Question #55Part 1

You are building a stored procedure that will update data in a table named Table1 by using a complex query as the data source. You need to ensure that the SELECT statement in the stored procedure meets the following requirements: ✑ Data being processed must be usable in several statements in the stored procedure. ✑ Data being processed must contain statistics. What should you do?

AUpdate Table1 by using a common table expression (CTE).
BInsert the data into a temporary table, and then update Table1 from the temporary table.
CPlace the SELECT statement in a derived table, and then update Table1 by using a JOIN to the derived table.
DInsert the data into a table variable, and then update Table1 from the table variable.
Question #56Part 1

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 and the date that the customer placed their last order. 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?

AB.
CD.
Question #57Part 1

You have a disk-based table that contains 15 columns. You query the table for the number of new rows created during the current day. You need to create an index for the query. The solution must generate the smallest possible index. Which type of index should you create?

Aclustered
Bfiltered nonclustered with a getdate() predicate in the WHERE statement clause
Chash
Dnonclustered with compression enabled
Question #58Part 1

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 several connected tables. The tables contain sales data for customers in the United States only. You have the following partial query for the database. (Line numbers are included for reference only.) You need to complete the query to generate the output shown in the following table. Which statement clause should you add at line 3?

AGROUP BY
BMERGE
CGROUP BY ROLLUP
DLEFT JOIN
EGROUP BY CUBE
Question #59Part 1

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 several connected tables. The tables contain sales data for customers in the United States only. You have the following partial query for the database. (Line numbers are included for reference only.) You need to complete the query to generate the output shown in the following table. Which statement clause should you add at line 3?

AGROUP BY
BMERGE
CGROUP BY ROLLUP
DLEFT JOIN
EGROUP BY CUBE
Question #60Part 1

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 several connected tables. The tables contain sales data for customers in the United States only. You have the following partial query for the database. (Line numbers are included for reference only.) You need to complete the query to generate the output shown in the following table. Which statement clause should you add at line 3?

AGROUP BY
BMERGE
CGROUP BY ROLLUP
DLEFT JOIN
EGROUP BY CUBE
Question #61Part 2

You create a table by running the following Transact-SQL statement: You need to view all customer data. Which Transact-SQL statement should you run?

AB.
CD.
EF.

📢 Unlock Full Access to Success!

"The content displayed here is a promotional preview and contains only 50% of the actual exam database. To access the complete set of updated questions, please upgrade to the Full Version."

👉 Click the button and follow the instructions to secure your full access immediately!