What are the Properties and Different Types of Sub-Queries?


Properties of a Sub-Query

  • A sub-query must be enclosed in the parenthesis.
  • A sub-query must be put on the right hand of the comparison operator, and
  • A sub-query cannot contain an ORDER BY clause, however sub-query can use ORDER BY when used with TOP clause.

Types of Sub-query

  • Single-row sub-query, where the sub-query returns only one row.
  • Multiple-row sub-query, where the sub-query returns multiple rows, and
  • Multiple column sub-query, where the sub-query returns multiple columns

No comments:

Post a Comment

What is Normalization?

Database normalization is a data design and organization process applied to data structures based on rules that help building relational dat...