{ "query": "Which term describes composing SQL statements as text at runtime so they can be executed by a procedure or a query?", "options": [ { "text": "Prepared Statements", "explanation": "Prepared statements are precompiled queries that execute with parameters rather than being assembled at runtime.", "correct": false, "selected": false }, { "text": "Dynamic SQL", "explanation": "Dynamic SQL is SQL that is assembled as text at runtime and executed by procedures or queries.", "correct": true, "selected": false }, { "text": "Static SQL", "explanation": "Static SQL is fixed at compile time and is not assembled or modified at runtime.", "correct": false, "selected": false } ], "answer": "
The correct answer is Dynamic SQL.
Dynamic SQL means building SQL statements as text at runtime and then executing those text strings from a procedure or query. This approach lets the application or stored procedure change the shape of the SQL based on logic or input and it is commonly executed with commands such as EXECUTE or database specific facilities for running SQL text.
Prepared Statements is not correct because prepared statements involve preparing and often caching a parameterized statement for repeated execution rather than composing arbitrary SQL text on the fly. Prepared statements emphasize reuse and parameter binding rather than runtime composition of full statements.
Static SQL is not correct because static SQL is written into the program or procedure before runtime and does not change during execution. Static SQL is fixed at compile or deployment time and cannot be assembled as text while the application runs.
", "batch_id": "50", "answerCode": "2", "type": "multiple-choice", "originalQuery": "Identify the missing word(s) in the following sentence within the context of Microsoft Azure. [?] is a concept where a query is built programmatically and allows T-SQL statements to be generated within a stored procedure or a query itself. See the following code as an example. SQL SELECT 'BACKUP DATABASE ' + name + ' TO DISK =''\\\\backup\\sql1\\' + name + ' . bak ''' FROM sys.databases", "originalOptions": "A. Dynamic SQLWhen the question mentions building or modifying SQL text while the code is running look for the term dynamic or wording about composing statements as text at runtime.
", "references": [ "PostgreSQL PL/pgSQL executing dynamic SQL", "SQL Server sp_executesql and dynamic SQL", "Dynamic SQL on Wikipedia" ], "video_url": "https://certificationation.com/videos/azure/dp-300-database-admin-assoc/azure-the-following-sentence-within-the-exam-448.html", "url": "https://certificationation.com/questions/azure/dp-300-database-admin-assoc/azure-the-following-sentence-within-the-exam-448.html" }