Results 1 to 4 of 4

Thread: How are subqueries different from Joins queries in SQL ?

  1. #1
    Join Date
    Dec 2010
    Posts
    49

    How are subqueries different from Joins queries in SQL ?

    I am a student studying in the second year of my BSC(IT) course , I want to be an administrator in the field of database or you can say that I want to DBA , I am quite capable of doing the simple queries in the SQL language , but I get quite confused when it comes to querying multiple tables , I get confused that what should I use instead ? Should I use joins or make use of Subqueries . Please guide me what is the actual difference between those two .

  2. #2
    Join Date
    Apr 2009
    Posts
    488

    Re: How are subqueries different from Joins queries in SQL ?

    Subquery or Inner query or sometimes also called as Nested query is a query that is present inside a query. A subquery is generally added in the WHERE Clause of the SQL statement. The majority of the time, a subquery is used while you are aware that how to search for a value making use of a SELECT statement, but do not exactly know the value.Subqueries are is an other method of returning data from multiple tables.

  3. #3
    Join Date
    May 2009
    Posts
    539

    Re: How are subqueries different from Joins queries in SQL ?

    A subquery is a also a query like a normal one but it is nested within a SELECT, INSERT, UPDATE, or DELETE statement or within an additional subquery. A subquery can go again a set of rows or only one tuple to its outer query. A scalar subquery is a query that returns precisely single value: a solitary row, with a solitary column. Scalar subqueries can be used in nearly all places in a SQL statement where you may possibly make use of an expression or a literal value.

  4. #4
    Join Date
    May 2009
    Posts
    543

    Re: How are subqueries different from Joins queries in SQL ?

    A subquery is frequently known as to as an internal query, and the statement inside which it happens is then known the outer query. There is nothing incorrect with this concept , apart from that it may mean that you can only have two stages, internal and external. In reality, the Oracle implementation of subqueries does not oblige or force any sensible restrictions on the stage of nesting: the intensity of nesting allowed in the FROM clause of a statement is limitless.

Similar Threads

  1. What are joins in SQL?
    By Dëfrim in forum Software Development
    Replies: 3
    Last Post: 10-01-2011, 05:59 AM
  2. Subqueries used in MySQL
    By MacKenze in forum Software Development
    Replies: 2
    Last Post: 04-01-2011, 01:59 AM
  3. Subqueries in oracle database
    By Landan in forum Software Development
    Replies: 4
    Last Post: 09-02-2010, 05:57 PM
  4. About mysql table subqueries
    By Benito in forum Software Development
    Replies: 2
    Last Post: 04-08-2009, 06:07 PM
  5. Differences between UNION and JOINS?
    By Swati in forum Software Development
    Replies: 3
    Last Post: 13-02-2009, 05:58 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,435,469.19486 seconds with 17 queries