sql subquery examples
Example 1: what is subquery in sql
SUBQUERY IS NESTED QUERY INSIDE A SELECT,
INSERT OR UPDATE METHODS. OR INSIDE ANOTHER SUBQUERY
Example 2: why we use subquery in sql
We use subquery in order to get aggregate value in column without grouping data
Example 3: select in select sql
SELECT column1 = (SELECT column-name FROM table-name WHERE condition), column-names FROM table-name WEHRE condition
Example 4: subquery sql
UPDATE Book SET note= 'editore: ' + (SELECT name FROM Publisher WHERE Publisher.ID = Book.publisher)
Example 5: select in select sql
SELECT column-names FROM table-name1 WHERE value IN (SELECT column-name FROM table-name2 WHERE condition)
Example 6: subquery in sql
SUBQUERY IS NESTED QUERY INSIDE A
SELECT, INSERT OR UPDATE METHODS.
OR INSIDE ANOTHER SUBQUERY