lecturedatabase-create - - SQL commands for creating sample...

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

View Full Document Right Arrow Icon
-- SQL commands for creating sample database (copy/paste into Management Studio) -- NOTE: If you have other versions of these tables in your database, -- then they must be dropped before the new ones can be created IF Object_ID('tblPaycheckArchive') IS NOT NULL DROP TABLE tblPaycheckArchive IF Object_ID('tblPaycheck') IS NOT NULL DROP TABLE tblPaycheck IF Object_ID('tblFamily') IS NOT NULL DROP TABLE tblFamily IF Object_ID('tblEmployee') IS NOT NULL DROP TABLE tblEmployee -- Create tables, relationships and secondary indices CREATE TABLE tblEmployee ( EID Varchar(20) Primary Key Nonclustered Check(Len(EID)>=3), Password Varchar(10) Not Null, FirstName Varchar(20) Not Null Check(Len(FirstName)>=2), LastName Varchar(30) Not Null Check(Len(LastName)>=2), JobTitle Varchar(30) Not Null, AnnualSalary Money Not Null Check(AnnualSalary>0), Active Char(1) Not Null Check(Active='Y' Or Active='N') Default 'Y', Supervisor Varchar(20) Null, SSN Char(11) Not Null Check(Len(SSN)=11), Gender Char(1) Not Null Check(Gender='F' Or Gender='M'),
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 09/30/2011 for the course MIS 325 taught by Professor Mote during the Spring '08 term at University of Texas at Austin.

Page1 / 3

lecturedatabase-create - - SQL commands for creating sample...

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