SQL Action commands - Today's Code - Action Commands Motes...

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

View Full Document Right Arrow Icon
Mote’s Notes 3/21/2011 -- New Employee INSERT INTO tblEmployee ( EID, FirstName, LastName, JobTitle, AnnualSalary, Active, Supervisor, Password, SSN, Gender, DOB, Phone ) VALUES ( 'JM7021', 'Jennifer', 'MacDougal', 'Assistant Manager', 97500, 'Y', 'C123', 'JennyMac', '458-03-7182', 'F', '11/28/1969', '(512) 555-2341' ) INSERT INTO tblFamily ( FID, FirstName, LastName, EID, Relationship, Gender, DOB ) VALUES ( 'FW9473', 'Mark', 'MacDougal', 'JM7021', 'Spouse', 'M', '6/10/1969' ) INSERT INTO tblFamily ( FID, FirstName, LastName, EID, Relationship, Gender, DOB ) VALUES ( 'FJ3911', 'Allison', 'MacDougal', 'JM7021', 'Child', 'F', '3/5/1997' ) -- Worked Last Year (physical table approach) CREATE TABLE tblWorkedIn2010 ( EID Varchar(20) Primary Key, FullName Varchar(Max) Not Null ) INSERT INTO tblWorkedIn2010 ( EID, FullName ) SELECT EID, FirstName + ' ' + LastName FROM tblEmployee WHERE EID IN ( SELECT Distinct EID FROM tblPaycheck WHERE YEAR(PayDate) = 2010 )
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.

Page1 / 3

SQL Action commands - Today's Code - Action Commands Motes...

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