29.01.2014 Views

Introduction to Database Systems Queries in SQL The select ...

Introduction to Database Systems Queries in SQL The select ...

Introduction to Database Systems Queries in SQL The select ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Outer Jo<strong>in</strong>: Examples<br />

<strong>select</strong> fatherChild.child, father, mother<br />

from motherChild jo<strong>in</strong> fatherChild<br />

on motherChild.child = fatherChild.child<br />

<strong>select</strong> fatherChild.child, father, mother<br />

from motherChild left outer jo<strong>in</strong> fatherChild<br />

on motherChild.child = fatherChild.child<br />

<strong>select</strong> fatherChild.child, father, mother<br />

from motherChild right outer jo<strong>in</strong> fatherChild<br />

on motherChild.child = fatherChild.child<br />

<strong>select</strong> fatherChild.child, father, mother<br />

from motherChild full outer jo<strong>in</strong> fatherChild<br />

on motherChild.child = fatherChild.child<br />

39<br />

Order<strong>in</strong>g the Result: order by<br />

“Return name and <strong>in</strong>come of persons under thirty, <strong>in</strong><br />

alphabetic order of the names”<br />

<strong>select</strong> name, <strong>in</strong>come<br />

from person<br />

where age < 30<br />

order by name<br />

<strong>select</strong> name, <strong>in</strong>come<br />

from person<br />

where age < 30<br />

order by name desc<br />

ascend<strong>in</strong>g<br />

order<br />

descend<strong>in</strong>g<br />

order<br />

40

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!