Professional Documents
Culture Documents
DM-1.
Visio
Home
PK
homeid
FK1
street
city
state
zip
nobedms
nobaths
sqft
ownoccupied
ownerid
Owner
PK
owns
ownerid
ownname
ownSSN
ownprofess
spousename
spouseprofess
spouseSSN
owner
owns
ownerid
ownname
ownSSN
ownprofess
spousename
spouseprofess
spouseSSN
Note: The Visio ERD shows foreign keys explicitly; but the ER-Assistant ERD does not show foreign
keys. Both ways of drawing ERDs are acceptable. But be sure to consistent: Do not mix these two
different methods.
Note: The Visio ERD method is currently more popular; most ERD tools use it. In the final exam, ERD
questions will require foreign keys shown explicitly. So, I strongly suggest you to use Visio or a
comparable tool.
DM-2.
Visio
Home
PK
homeid
FK1
FK2
street
city
state
zip
nobedms
nobaths
sqft
ownoccupied
ownerid
agentid
Owner
PK
owns
ownerid
ownname
ownSSN
ownprofess
spousename
spouseprofess
spouseSSN
lists
Agent
PK
agentid
agentname
officeid
phone
owner
owns
lists
agent
agentid
agentname
officeid
phone
ownerid
ownname
ownSSN
ownprofess
spousename
spouseprofess
spouseSSN
DM-3.
Visio
Home
PK
homeid
FK1
FK2
street
city
state
zip
nobedms
nobaths
sqft
ownoccupied
ownerid
agentid
Owner
PK
ownerid
ownname
ownSSN
ownprofess
spousename
spouseprofess
spouseSSN
owns
lists
Office
PK
Agent
PK
agentid
FK1
agentname
officeid
phone
worksat
officeid
address
mgrname
phone
owner
owns
ownerid
ownname
ownSSN
ownprofess
spousename
spouseprofess
spouseSSN
lists
agent
agentid
agentname
Phone
ssn
office
worksat
officeid
address
mgrname
phone
DM-4.
Visio
Home
PK
homeid
FK1
FK2
street
city
state
zip
nobedms
nobaths
sqft
ownoccupied
ownerid
agentid
PK
Office
PK
Agent
agentid
FK1
agentname
officeid
phone
worksat
ownerid
address
mgrname
phone
owns
lists
ownerid
ownname
ownSSN
ownprofess
spousename
spouseprofess
spouseSSN
workswith
agent
agentid
agentname
phone
ssn
buyerid
FK1
buyerSSN
buyername
buyeraddress
buyerphone
spousename
spouseSSN
bdrms
bthrms
minprice
maxprice
agentid
officeid
workswith
homeid
street
city
state
zip
nobedrms
nobaths
sqft
ownoccupied
commission
salesprice
PK
ownname
ownSSN
ownprofess
spousename
spouseprofess
spouseSSN
lists
PK
Buyer
Owner
owns
office
worksat
officeid
address
mgrname
phone
buyerid
buyerSSN
buyername
buyeraddress
spousename
spouseSSN
bdrms
bthrms
minprice
maxprice
DM-5.
Visio
Csutomer
PK
Home
PK
homeid
FK2
FK1
street
city
state
zip
nobedms
nobaths
sqft
ownoccupied
agentid
customerid
customerid
name
SSN
spousename
spouseSSN
Buyer
Owner
owns
PK,FK1
ownerid
PK,FK2
buyerid
FK1
buyerphone
bdrms
bthrms
minprice
maxprice
agentid
ownprofess
spouseprofess
lists
Office
PK
Agent
PK
agentid
FK1
agentname
officeid
phone
worksat
officeid
address
mgrname
phone
workswith
D,C
home
homeid
street
city
state
zip
nobedrms
nobaths
sqft
ownoccupied
commission
salesprice
buyer
owner
owns
ownprofess
spouseprofess
lists
workswith
agent
agentid
agentname
phone
SSN
office
worksat
officeid
address
mgrname
phone
buyeraddress
minprice
bdrms
bthrms
maxprice
DM-6.
Csutomer
PK
Home
PK
homeid
FK2
FK1
street
city
state
zip
nobedms
nobaths
sqft
ownoccupied
agentid
customerid
customerid
name
SSN
spousename
spouseSSN
Buyer
Owner
owns
PK,FK1
ownerid
PK,FK2
buyerid
FK1
buyerphone
bdrms
bthrms
minprice
maxprice
agentid
ownprofess
spouseprofess
Offer
lists
madefor
PK
offerno
FK1
FK2
price
submitdate
expdate
buyerid
homeid
Agent
PK
agentid
FK1
agentname
officeid
phone
workswith
Office
worksat
PK
officeid
address
mgrname
phone
Note: The Offer entity may have submittime and exptime attributes.
makes
offer
madefor
OfferNo
expdate
price
counteroffer
SubmitDate
person
ssn
name
phone
home
D,C
homeid
street
city
state
zip
nobedrms
nobaths
sqft
ownoccupied
commission
salesprice
makes
buyer
owner
owns
ssn
spousename
profession
spouseprofess
ssn
address
minprice
bdrms
bthrms
maxprice
workswith
lists
office
agent
agentid
agentname
phone
worksat
officeid
address
mgrname
phone
Note: There are some incorrect and missing attributes in the authors ERD.
Instead of the following short description, you may use the CREATE TABLE command.
Conv-1.
home(homeid, agentid, ssn, street, city, state, zip, nobedrms, nobaths,
sqft, ownoccupied, commission, salesprice)
PRIMARY KEY: homeid
FOREIGN KEY: agentid REFERENCES agent.agentid
FOREIGN KEY: ssn REFERENCES owner.ssn
agent(agentid, officeid, name, phone)
PRIMARY KEY: agentid
FOREIGN KEY: officeid REFERENCES office.officeid
owner(ssn, name, spousename, profess, spouseprofess)
PRIMARY KEY: ssn
office(officeid, mgrname, phone, address)
PRIMARY KEY: officeid
Conv-5.
account(acctid, acctname, balance, parent_acctid)
PRIMARY KEY: acctid
FOREIGN KEY: acctid REFERENCES account.acctid
Note: Instead of the above account table, one may have the following two tables.
account(acctid, acctname, balance)
PRIMARY KEY: acctid
decomposed(acctid, parent_acctid)
PRIMARY KEY: acctid, parent_acctid
FOREIGN KEY: acctid REFERENCES account.acctid
FOREIGN KEY: parent_acctid REFERENCES account.acctid
part(partno, partdesc, color)
PRIMARY KEY: partno
contains(super_partno, sub_partno)
PRIMARY KEY: super_partno, sub_partno
FOREIGN KEY: super_partno REFERENCES part.partno
FOREIGN KEY: sub_partno REFERENCES part.partno
Conv-6.
student(stdid, name, gender, dob, admitdate)
PRIMARY KEY: stdid
undstudent(stdid, major, minor, class)
PRIMARY KEY: stdid
FOREIGN KEY: stdid REFERENCES student.stdid
gradstudent(stdid, advisor, thesistitle, asststatus)
PRIMARY KEY: stdid
FOREIGN KEY: stdid REFERENCES student.stdid
Conv-8.
project(projno, projname)
PRIMARY KEY: projno
specialty(specno, specname)
PRIMARY KEY: specno
contractor(contrno, specno, contrname)
PRIMARY KEY: contrno
FOREIGN KEY: specno REFERENCES specialty.specno
projectneeds(projno, specno)
PRIMARY KEY: projno, specno
FOREIGN KEY: projno REFERENCES project.projno
FOREIGN KEY: specno REFERENCES specialty.specno
providedby(contrno, projno, specno)
PRIMARY KEY: contrno, projno, specno
FOREIGN KEY: (projno, specno) REFERENCES
projectneeds.(projno, specno)
FOREIGN KEY: contrno REFERENCES contractor.contrno
10