Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 01-15-2006, 10:07 PM   #1 (permalink)
 
Newb Techie

Join Date: Jan 2006

Posts: 12

techno_kid

Default how will you handle this?

how will you handle one to one, one to many, and many to many relationships in creating databases?

thanks guys.. =)
techno_kid is offline  
Old 01-25-2006, 03:03 PM   #2 (permalink)
simple's Avatar
 
True Techie

Join Date: Jan 2006

Location: Earth

Posts: 171

simple

Default

it would help if you would be more specific. i mean what exactly do you mean by "how will you handle"???. do you want the sql commands for it or just conceptual schemas or what??
simple is offline  
Old 01-25-2006, 04:57 PM   #3 (permalink)
 
Ultra Techie

Join Date: Jul 2005

Posts: 530

TheHeadFL

Send a message via AIM to TheHeadFL
Default

Relationships are established with foreign keys in a database like mySQL.

Say you have two tables

users and messages

users is defined:
user_id, username, user_fullname, user_lastlogin

messages is defined
msg_id, sender_id, recipient_id, msg_subject, msg_time, msg_body

Then you can link sender_id and recipient_id to table users via keys. Whatever value is stored within sender_id or recipient_id would be a user_id of a corresponding users table entry.

Therefore users has *two* one-to-many relationships with messages.

That is a simple example of what is involved.
__________________
Desktop machine: 2 x Opteron 246, Asus K8N-DL, 2GB PC3200 ECC Reg., XFX GeForce 6600GT, 74gb WD Raptor, 2 x 19\" LCDs, Windows XP x64
Server machine: Intel P4 3.0GHz 2MB EM64T, ECS i865pe, 1GB PC3200, 36gb WD Raptor, Windows Server 2003
Laptop: Dell Inspiron 9100 (Intel P4 3.2GHz 1MB Prescott, i865pe, 512MB PC3200, Mobility Radeon 9700, DVD+R/DL Burner), Windows XP
Linux: P3 450Mhz, 386MB ram, Slackware 10.1 (Running mySQL/Apache)
TheHeadFL is offline  
 
Closed Thread

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On