SUBQUERIES SQL

-These are the SQL Statements which are embedded inside another SQL Statements.

Example:-
--1)To find the details of the person who earns the maximum salary or 3rd highest salary we have to use the subquery.

1. Subquery is always written in parentheses.
2.Subquery evaluates a particular data which can then be used as the input to the main query.
3.Subquery evaluates first.
4. Subqueries can be nested.

---Types of Subqueries:--

--1)Single row Subqueries

--2)Multiple row Subqueries.

---3)Subqueries using the exists operator:

---Single row Subqueries:--

---Only 1 row is returned by the subquery.

--Multiple row Subqueries:-

--More than 1 row is returned by the subquery.

--An error message will be generated which can then be resolved using the in operator.

--Exists operator subquery:-

---The subquery will just  return true or false

--values to the main query on the basis of which

--the main query will execute.
SUBQUERIES SQL Reviewed by Rupesh on 13:09 Rating: 5

No comments:

All Rights Reserved by Technology from Developers Eye © 2014 - 2015
Powered By Blogger, Designed by Aadics
Disclaimers:: The information provided within this blogsite is for general informational purposes only. While we try to keep the information up-to-date and correct, there are no representations or warranties, express or implied, about the completeness, accuracy, reliability, suitability or availability with respect to the information, products, services, or related graphics contained in this blogsite for any purpose.The author does not assume and hereby disclaims any liability to any party for any loss, damage, or disruption caused by errors or omissions, whether such errors or omissions result from accident, negligence, or any other cause.

Contact Form

Name

Email *

Message *

Powered by Blogger.