Exam 70-761: Querying Data with Transact-SQL Practice Test
Exam 70-761: Querying Data with Transact-SQL concerns retrieving and shaping relational data with SQL Server queries. The available practice material samples row filtering and ordering, distinct values, computed expressions, aggregate filtering, set operations, and data-type conversion. It also touches on date-range predicates and scalar operators used to produce precise results from tables.
Exam overview
About the Exam 70-761: Querying Data with Transact-SQL Exam
Working with Transact-SQL requires understanding how query clauses interact and how their placement affects results. You may need to choose between WHERE, which filters input rows, and HAVING, which filters groups after aggregation; use ORDER BY with a computed alias; or distinguish UNION from UNION ALL when combining result sets. Other useful skills include limiting rows after sorting, excluding NULL values, writing inclusive date-range conditions, and converting text safely with TRY_CONVERT. These decisions support routine database work such as retrieving recent events, preparing department summaries, and returning only records that meet application parameters. Pay attention to result-set behavior: sorting determines which rows qualify as the first or most recent, while duplicate handling and NULL treatment can change what a query returns.
Sample Practice Questions
Review a selection from this exam's published US Practice Tests practice bank.
A query must return the first 20 rows from dbo.Products after sorting by ProductID in ascending order. Which syntax is appropriate in SQL Server?
Show answer
Correct answer: BSQL Server uses TOP to limit the number of returned rows. ORDER BY defines which rows are first; without an ordering, the selected subset is not predictably ordered.
Which query returns each distinct Country value from dbo.Customers, excluding NULL values?
Show answer
Correct answer: ADISTINCT removes duplicate Country values, while IS NOT NULL excludes rows with no Country value. The other choices use unsupported or incorrect syntax, or do not express the required filtering.
A SELECT statement computes a value for each row and assigns it the alias ExtendedCost. Which clause should refer to ExtendedCost to sort the final result by that computed value?
Show answer
Correct answer: CORDER BY can refer to a SELECT-list alias and controls the ordering of the final result. The alias is not available to the earlier logical processing stages such as WHERE.
A table contains an integer column Quantity. Which expression returns 1 when Quantity is at least 10 and 0 otherwise?
Show answer
Correct answer: AIIF evaluates a Boolean condition and returns its second argument when true or its third argument when false. Here those values are 1 and 0.
A query returns one row per department with its average salary. Which clause filters out departments whose average salary is below 60000?
Show answer
Correct answer: BHAVING filters groups after aggregation, so it can test AVG(Salary). WHERE filters individual input rows and cannot directly use an aggregate function in this way.
A query uses UNION ALL to combine two compatible result sets. What happens to rows that appear in both result sets?
Show answer
Correct answer: BUNION ALL concatenates the result sets without removing duplicates, so repeated rows remain repeated. Duplicate elimination is performed by UNION, not UNION ALL.
An application receives a date as text and needs to convert it to the date type, returning NULL if the text is not a valid date. Which expression is designed for this conversion?
Show answer
Correct answer: BTRY_CONVERT attempts the requested conversion and returns NULL when the conversion fails. CAST and CONVERT ordinarily raise an error for an invalid conversion.
How to use this practice test
The free US Practice Tests practice session draws up to 20 random questions from the 50-question bank. Answer them to check your understanding of the sampled Transact-SQL query patterns; results appear after the session. Use missed or uncertain items to identify concepts to revisit, such as aggregate filters, ordering, conversion, or duplicate handling.
Preparation tips
- Write paired examples using WHERE and HAVING, and note whether each condition filters source rows or grouped results.
- Practice TOP with ORDER BY, including ascending and descending sorts, so row limits return the intended records.
- Compare UNION with UNION ALL on sample data containing duplicate rows; verify how each affects the combined result.
- Test NULL-sensitive predicates and distinct-value queries, and distinguish ordinary conversion from TRY_CONVERT when invalid text should produce NULL.
- Use inclusive date ranges with supplied boundary values and confirm that both endpoints are returned.