Nested queries, Database Management System

Assignment Help:

Nested Queries

Let us see some more complex queries in this section.

Sub-queries:

Some of the basic concerns of sub-queries are:

  • A sub-query is a SELECT statement that is fixed in a clause of another SELECT statement. They are often referred to as a SUB SELECT or NESTED SELECT or INNER SELECT.
  • The sub-query (inner query) implements first before the main query. The product of the sub-query is used by the outer query (main query).
  • Sub-query can be placed in HAVING or WHERE or FROM clauses.
  • Format of using sub-queries:

                 SELECT

                 FROM

                 WHERE expr OPERATOR

                                                          (SELECT FROM

WHERE);

                Operator has a comparison operator (one or multiple row operators)

Single row operator:   >, =, >=, <, <=, <>

                         Multiple row operators: IN, ALL, ANY,

  • Order by clause can't be used in sub-query, if specified it must be the end clause in the main select statement.
  • Parts of sub-queries:

         ‰  Single row sub-query: It gives only single row from the inner select statement.

        ‰   Multiple row sub-queries: It gives more than single row from the inner select statement

        ‰  Multiple column sub-queries: It gives more than single column from the inner select statement.

Single row operators are used with one row sub queries and multiple row operators are used with numerous row sub queries.

  • The Inner and Outer queries can get data from different tables.
  • Group Functions are used in sub queries.

Related Discussions:- Nested queries

Complexity- drawbacks of data distribution, Complexity : A distributed DBMS...

Complexity : A distributed DBMS that is available, reliable, and secure is inherently more difficult than a centralised DBMS. Though, adequate data replication is essential to have

Which method of access uses key transformation, Which method of access uses...

Which method of access uses key transformation? A Hash method of access uses key transformation.

Lack of redundancy, Lack of Redundancy We have talked about the problems o...

Lack of Redundancy We have talked about the problems of repetition of information in a database. Such repetition should be stay away as much as possible. Let us state once again t

Explain trivial dependency, Explain trivial dependency? Functional depe...

Explain trivial dependency? Functional dependency of the form α ->β. is trivial if α C β. Trivial functional dependencies are satisfied by all the relations.

Data mining, 1.Why we need data mining? Give an example to illustrate your ...

1.Why we need data mining? Give an example to illustrate your answer. 2. Why data mining is considered as "misleading name"? 3. Distinguish the difference between database an

Optimistic concurrency control, Optimistic Concurrency Control Is locki...

Optimistic Concurrency Control Is locking the only way to stop concurrency related problems? There exist some other ways too. One such way is known as an Optimistic Concurrency

State the step- implement software control designer, Implementing software ...

Implementing software control To implement software control designer must redesign strategy of state event model which is present in dynamic model. There are three basic ap

Define value set, Define value set? Value set: It is a set of values. Y...

Define value set? Value set: It is a set of values. You do not always need a user to enter junk free text within all the fields. Therefore, Oracle Apps uses value set to valida

Draw an erd for the above relational schema, The following relational datab...

The following relational database schema represents part of a simplified database used by a library: tblBook (BookID, Title, PublisherID, Category,Price) tblPublisher (Publishe

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd