Table Joins - Today's Code - Table Joins Motes Notes...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Today's Code - Table Joins Mote’s Notes 3/7/2011 -- Paid Employees and their Paychecks (implicit inner join) SELECT FirstName + ' ' + LastName AS Employee, PayDate, NetAmount FROM tblEmployee, tblPaycheck WHERE tblEmployee.EID = tblPaycheck.EID ORDER BY LastName, FirstName, PayDate DESC -- Paid Employees and their Paychecks (explicit inner join) SELECT FirstName + ' ' + LastName AS Employee, PayDate, NetAmount FROM tblEmployee INNER JOIN tblPaycheck ON tblEmployee.EID = tblPaycheck.EID ORDER BY LastName, FirstName, PayDate DESC -- ALL Employees and their Paychecks (outer join) SELECT FirstName + ' ' + LastName AS Employee, PayDate, NetAmount FROM tblEmployee LEFT OUTER JOIN tblPaycheck ON tblEmployee.EID = tblPaycheck.EID ORDER BY LastName, FirstName, PayDate DESC SELECT FirstName + ' ' + LastName AS Employee, PayDate, NetAmount FROM tblPaycheck RIGHT OUTER JOIN tblEmployee ON tblPaycheck.EID = tblEmployee.EID ORDER BY LastName, FirstName, PayDate DESC -- Employees with No Paychecks SELECT FirstName + ' ' + LastName AS Employee
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/26/2011 for the course MIS 325 taught by Professor Mote during the Spring '08 term at University of Texas at Austin.

Page1 / 3

Table Joins - Today's Code - Table Joins Motes Notes...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online