Refer to the exhibit. The code fetches the latest order from the purchases table for a specific user. An engineer needs to pass query parameters to the execute function to prevent an SQL injection attack. Which code snippet must be placed in the blank in the code to meet this requirement? A. cursor.execute("SELECT orders FROM purchases WHEREusername = '{}'".format (username)) B. cursor.execute("SELECT orders FROM purchases WHEREusername = %(username)s", {'username': username}) C. cursor.execute("SELECT orders FROM purchases WHEREusername = '$s' % username".replace("'", "''")) D. cursor.execute (f"SELECT orders FROM purchases WHEREusername = '{username}'") Â Suggested Answer: B This question is in 350-901 DEVCOR exam For getting DevNet Professional Certificate Disclaimers: The website is not related to, affiliated with, endorsed or authorized by Cisco. Trademarks, certification & product names are used for reference only and belong to Cisco.
Please login or Register to submit your answer