12.07.2015 Views

Module 13 (Introduction to SQL - Part 2).pdf

Module 13 (Introduction to SQL - Part 2).pdf

Module 13 (Introduction to SQL - Part 2).pdf

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Using JOIN and WHEREIf, for example, we want <strong>to</strong> find out order his<strong>to</strong>ryfor only those employees earning $50,000/year,we can add this in the WHERE clause:SELECT *FROM Employees E INNER JOIN Orders OON E.EmployeeID = O.EmployeeIDWHERE E.Salary >= 50000ORDER BY E.Salary, O.Cus<strong>to</strong>merID

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

Saved successfully!

Ooh no, something went wrong!