In: Computer Science
What is dynamic SQL?
What is a subquery, and what are its basic characteristics?
Dynamic SQL is a programming technique that helps us to build SQL statement dynamically at run time.It helps us to create more general purpose and flexible application even when full text of a SQL statement may be unknown at compilation.Example-: Dynamic SQL helps us to create a procedure that operates on a table whose name is unknown untill runtime.
A subquery is a query (expressed as a SELECT statement) that is located inside another SQL query.
The characteristics of a subquery are-:
1.The first SQL statement is known as the outer query, the
second is known as the inner query or subquery.
2. The inner query or subquery is normally executed first.
3. The output of the inner query is used as the input for the outer
query.
4.A subquery is normally expressed inside parenthesis and can
return zero, one, or more rows and each row can have one or more
columns.