04-24-2010, 08:33 PM
Starting to Hate:
Today's SQL class just got exponentially harder.
Code:
create table Employee (
Initials Char(2) not null,
Name Char(30) not null,
CellPhone Char(20) not null,
ExperienceLevel Char(10) not null,
CONSTRAINT Employee_ID Primary Key(Initials)
)
create table PropertyTable (
PropertyID int not null IDENTITY (1,1),
PropertyName char(30) not null,
Street char(50) not null,
City char(50) not null,
State char(25) not null,
zip char(10) not null,
OwnerID int not null,
CONSTRAINT PropertyID_PK Primary Key(PropertyID),
CONSTRAINT OwnerTable_FK Foreign Key(OwnerID)
References OwnerTable (OwnerID)
On Update Cascade
);
create table OwnerTable (
OwnerID int not null IDENTITY (1,1),
ownername char(50) not null,
email VarChar(40) not null,
type char(5) not null,
CONSTRAINT OwnerID_PK Primary Key(OwnerID),
)
create table servicetable (
propertyID int not null,
Initials char(2) not null,
Date datetime not null,
hoursworked numeric(5,2) not null,
CONSTRAINT DateID_PK Primary Key(Date),
CONSTRAINT PropertyID_FK Foreign Key(propertyID)
References PropertyTable(propertyID),
CONSTRAINT Initials_FK Foreign Key(Initials)
References Employee(Initials)
)Today's SQL class just got exponentially harder.
[SIGPIC][/SIGPIC]
![[Image: Viper-Adjusted-Mini-Sig.png]](http://img.photobucket.com/albums/v308/OBLCDiomedes/Viper-Adjusted-Mini-Sig.png)
![[Image: Trixie-Mini-Sig-Fixed.png]](http://img.photobucket.com/albums/v308/OBLCDiomedes/Recent%20Signatures/Trixie-Mini-Sig-Fixed.png)
Fighting to the bitter end is an advantage when your opponent does not wish to perish.

