Independence Day Deal! Unlock 25% OFF Today – Limited-Time Offer - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Microsoft Exam DP-420 Topic 10 Question 32 Discussion

Actual exam question for Microsoft's DP-420 exam
Question #: 32
Topic #: 10
[All DP-420 Questions]

You have a database in an Azure Cosmos DB Core (SQL) API account.

You need to create an Azure function that will access the database to retrieve records based on a variable named accountnumber. The solution must protect against SQL injection attacks.

How should you define the command statement in the function?

Show Suggested Answer Hide Answer
Suggested Answer: A

Contribute your Thoughts:

Goldie
2 months ago
Hey, at least it's not as bad as Bobby Tables' dad. That guy's a real troublemaker!
upvoted 0 times
Theron
18 days ago
D) cmd = \'SELECT * FROM Persons p WHERE p.accountnumber = '\' + accountnumber + \''\'
upvoted 0 times
...
Emogene
19 days ago
I heard about Bobby Tables' dad too, he caused quite a mess!
upvoted 0 times
...
Fernanda
20 days ago
C) cmd = \'SELECT * FROM Persons p WHERE p.accountnumber = @accountnumber\'
upvoted 0 times
...
Robt
2 months ago
A) cmd = \'SELECT * FROM Persons p WHERE p.accountnumber = 'accountnumber'
upvoted 0 times
...
...
Tarra
2 months ago
Wait, what's SQL injection? I thought we were just retrieving some records. Did I miss something important here?
upvoted 0 times
...
Antonio
2 months ago
I agree with Amie. Option C is the way to go to ensure the security of the database.
upvoted 0 times
Henriette
1 months ago
I agree, option C is the safest choice to protect the database from potential threats.
upvoted 0 times
...
Henriette
1 months ago
I think option C is the correct one. It uses parameterized queries to prevent SQL injection attacks.
upvoted 0 times
...
...
Cyndy
2 months ago
I'm not sure, but I think option D might also work.
upvoted 0 times
...
Amie
2 months ago
Option C is the correct answer. Using parameterized queries is the best way to protect against SQL injection attacks.
upvoted 0 times
Yasuko
2 months ago
Definitely, it's an important security measure to keep our data safe.
upvoted 0 times
...
Wynell
2 months ago
So we should always use parameterized queries when accessing databases in Azure functions.
upvoted 0 times
...
Cammy
2 months ago
Yes, you're right. Parameterized queries help protect against SQL injection attacks.
upvoted 0 times
...
Dulce
2 months ago
I think the correct answer is C) cmd = \'SELECT * FROM Persons p WHERE p.accountnumber = @accountnumber\'
upvoted 0 times
...
...
Stevie
3 months ago
I agree with Minna, option C protects against SQL injection attacks.
upvoted 0 times
...
Minna
3 months ago
I think the correct answer is C.
upvoted 0 times
...

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77