QuestionQ1
Design and develop database solutionsYou have an Azure SQL database containing these SQL graph tables:
- A NODE table named
dbo.Person - An EDGE table named
dbo.Knows
Each row in dbo.Person contains these columns:
PersonID(int)DisplayName(nvarchar(100))
You need to use a MATCH operator with exactly two directed Knows relationships to return the PersonID and DisplayName of people reachable from the person identified by an input parameter named @StartPersonId.
Which Transact-SQL query should you use?
QuestionQ2
Secure, optimize, and deploy database solutionsYou have an Azure SQL database that includes a column named Notes.
A security review finds that Notes contains sensitive data. You need to protect the data so that neither stored values nor query inputs disclose information about the actual data. The solution must prevent a user from inferring data relationships or repetitions from the encrypted output.
Which should you use?
Community Discussion
QuestionQ3
Secure, optimize, and deploy database solutionsYou have a SQL database in Microsoft Fabric that includes the following functions:
- A multi-statement table-valued function (TVF) named
Sales.mstvf_OrderStatus()that returns order status information. - A scalar user-defined function (UDF) named
dbo.ufn_GetTaxMultiplier (@TaxAmt money, @StateCode char(2))that returns a numeric multiplier used in tax calculations.
Reporting queries frequently join Sales.mstvf_OrderStatus() to Sales.SalesOrderHeader and return large result sets. A performance review shows that the queries generate inconsistent execution plans.
During a code review, a developer finds that the following Transact-SQL statement produced an error:
EXEC @ret = ufn_GetTaxMultiplier @TaxAmt = 100.00, @StateCode = ‘WA’;
For each of the following statements, select Yes if the statement is true. Otherwise, select No.
| Statements | Yes | No |
|---|---|---|
| You can use GETDATE() in dbo.ufn_GetTaxMultiplier to produce nondeterministic results. | ||
| Rewriting Sales.mstvf_OrderStatus() as an inline table TVF will reduce the number of inconsistent execution plans. | ||
| Replacing ufn_GetTaxMultiplier with dbo.ufn_GetTaxMultiplier in the EXEC function statement will resolve the error. |
Community Discussion
QuestionQ4
Secure, optimize, and deploy database solutionsYou have an Azure SQL database that contains order data.
A reporting query that aggregates monthly revenue for each customer runs frequently. You need to reduce the time required to retrieve the computed values. The solution must not change any underlying table structure.
What should you do?
Community Discussion
QuestionQ5
Design and develop database solutionsYou have a Microsoft SQL Server 2025 database containing a table named dbo.CustomerMessages. dbo.CustomerMessages has two columns: MessageID (int) and MessageRaw (nvarchar(max)).
MessageRaw can include a phone number in several formats, and some rows do not include a phone number.
Write one SELECT query that meets these requirements:
- Return
MessageID,RawNumber,DigitsOnly, andPhoneStatus. RawNumbermust contain the first substring that matches a phone-number pattern, orNULLwhen no match is found.DigitsOnlymust remove every non-digit character fromRawNumber, or returnNULL.PhoneStatusmust returnValidwhenMessageRawcontains a phone number; otherwise, it must returnMissing.
Each value may be used once, more than once, or not at all.
SELECT MessageID, MessageRaw, '\d{3}[\.\-\s]\d{3}[\.\-\s]\d{4}') AS RawNumber, MessageRaw, '\d{3}[\.\-\s]\d{3}[\.\-\s]\d{4}'), '\D', '') AS DigitsOnly, CASE WHEN MessageRaw, '\d{3}[\.\-\s]\d{3}[\.\-\s]\d{4}') = 1 THEN 'Valid' ELSE 'Missing' END AS PhoneStatus FROM dbo.CustomerMessages;







Community Discussion