Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
Old 12-02-2011, 09:43 AM ERD To Table
Junior Talker

Posts: 2
Trades: 0
i dont have enugh posts so i couldnt post the image.
please copy that link to your browser

picasaweb.google.com/107426447530298612514/December22011#5681470995564484754

hi

i have been given this ERD (cant be changed)
i made this table model
i am not sure it is perfect please give me some feedback and suggestions


CREATE TABLE person(
ID INTEGER
,[user_name] CHARACTER(15) NOT NULL
,[name] CHARACTER(15) NOT NULL
,[password] CHARACTER(15) NOT NULL
,PRIMARY KEY (ID)
,UNIQUE([user_name])
);

CREATE TABLE casual(
ID INTEGER
,num_of_logins INTEGER
,last_login DATETIME
,PRIMARY KEY (ID)
,FOREIGN KEY (ID) REFERENCES person
);

CREATE TABLE site_type(
theType CHARACTER(15) PRIMARY KEY
,Category CHARACTER(15)
,description TEXT(100)
);

CREATE TABLE experts(
ID INTEGER
,outsorce BINARY
,theType CHARACTER(15) NOT NULL
,PRIMARY KEY (ID)
,FOREIGN KEY (ID) REFERENCES person
,FOREIGN KEY (theType) REFERENCES site_type(theType)
);

CREATE TABLE site(
siteID INTEGER PRIMARY KEY
,geometry TEXT(100) NOT NULL
,site_name CHARACTER(15) NOT NULL
,avg_casual_rating DOUBLE
,avg_expert_rating DOUBLE
,theType CHARACTER(15) NOT NULL
,FOREIGN KEY (theType) REFERENCES site_type(theType)
);

CREATE TABLE POI(
POI_ID INTEGER UNIQUE NOT NULL
,point TEXT(100) NOT NULL
,POI_name CHARACTER(15) NOT NULL
,expected_visitors INTEGER
,Last_year_visitors INTEGER
,siteID INTEGER UNIQUE NOT NULL
,FOREIGN KEY (siteID) REFERENCES site(siteID)
,PRIMARY KEY (siteID,POI_ID)
);

CREATE TABLE rate(
ID INTEGER
,siteID INTEGER
,notes TEXT(100)
,[date] DATETIME
,rate TINYINT
,CHECK ((rate>=0) AND (rate<=100))
,FOREIGN KEY (siteID) REFERENCES site(siteID)
,FOREIGN KEY (ID) REFERENCES person(ID)
,PRIMARY KEY(siteID,ID)
);

CREATE TABLE tourism_site(
siteID INTEGER PRIMARY KEY
,closing_time CHARACTER(5) NOT NULL
,opening_time CHARACTER(5) NOT NULL
,avg_visitors DOUBLE
,FOREIGN KEY (siteID) REFERENCES site(siteID)
,ID INTEGER NOT NULL
,FOREIGN KEY (ID) REFERENCES experts(ID)
,description TEXT(100) NOT NULL
,[date] DATETIME NOT NULL
);

CREATE TABLE road(
siteID INTEGER PRIMARY KEY
,num_of_lanes INTEGER
,speed_limit INTEGER
,FOREIGN KEY (siteID) REFERENCES site(siteID)
);

CREATE TABLE localities(
siteID INTEGER
,num_of_residents INTEGER
,roadID INTEGER NOT NULL
,FOREIGN KEY (siteID) REFERENCES site(siteID)
,FOREIGN KEY (roadID) REFERENCES road(siteID)
,PRIMARY KEY(siteID,roadID)
);

CREATE TABLE junction(
junctionID INTEGER PRIMARY KEY
,traffic_light BINARY
);

CREATE TABLE meets(
roadID1 INTEGER NOT NULL
,[connection] TEXT(100)
,roadID2 INTEGER NOT NULL
,junctionID INTEGER NOT NULL
,FOREIGN KEY (roadID1) REFERENCES road(siteID)
,FOREIGN KEY (roadID2) REFERENCES road(siteID)
,FOREIGN KEY (junctionID) REFERENCES junction
,PRIMARY KEY (junctionID,roadID1,roadID2)
);
s1s2s3s2000 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-02-2011, 09:46 AM Re: ERD To Table
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,336
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Homework?

Coursework?

Or your employment?

And why is this a .net question?
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-02-2011, 12:41 PM Re: ERD To Table
Junior Talker

Posts: 2
Trades: 0
yes homework... i havent found a more sutible forum.
do you have any suggetions? (with the HW and with a more sutible forum)
s1s2s3s2000 is offline
Reply With Quote
View Public Profile
 
Old 12-02-2011, 03:30 PM Re: ERD To Table
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,336
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Database forum


Quote:
do you have any suggetions?
Nope! I don't do homework for lazy students.
Either pay attention in your classes or fail your course.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to ERD To Table
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13964 seconds with 12 queries