Difficulty: Easy
Correct Answer: Hard-coded SQL statements in a program language such as Java.
Explanation:
Introduction:
Applications interact with databases using SQL. When SQL text is written directly inside source code files and compiled with the application, we call it embedded SQL. Understanding this term helps contrast approaches such as dynamic SQL and ORM frameworks.
Given Data / Assumptions:
Concept / Approach:
Embedded SQL means the SQL statements are part of the program source and are hard-coded. Historically, some languages used precompilers for embedded SQL, while modern languages often execute embedded SQL via driver APIs. This differs from purely dynamic SQL generation, which constructs statements at runtime, and from server-side stored code, which lives in the database, not in the application source file.
Step-by-Step Solution:
Identify that the SQL text is present directly in application code.Recognize that compilation or packaging includes those SQL statements.Contrast with stored procedures or triggers, which are database-resident.Conclude that embedded SQL is hard-coded SQL inside a host programming language.
Verification / Alternative check:
Inspect a codebase and search for SELECT, INSERT, UPDATE, or DELETE strings; their presence inside program source indicates embedded SQL usage.
Why Other Options Are Wrong:
Common Pitfalls:
Mixing dynamic SQL and embedded SQL concepts, and forgetting to parameterize embedded SQL to avoid injection vulnerabilities.
Final Answer:
Hard-coded SQL statements in a program language such as Java.
Discussion & Comments