Topic: Wierd database puzzle Pages that link to <a href="https://ozoneasylum.com/backlink?for=31687" title="Pages that link to Topic: Wierd database puzzle" rel="nofollow" >Topic: Wierd database puzzle\

 
Author Thread
ruffy
Nervous Wreck (II) Inmate

From:
Insane since: Jun 2008

IP logged posted posted 02-21-2010 20:02 Edit Quote

For me it's complex, anyways.

How do I handle this Mysql 4-table scenario:

SCHOOLS to STUDENTS is a 1 to many relationship.
AUCTIONS to PRIZES is also 1 to many.
But now, SCHOOLS to AUCTIONS is many to many,
i.e., a school can participate in many auctions,
or one auction can be registered with many schools.

My question:
Since STUDENTS to PRIZES can be 1 to many,
how do I handle this table setup - to query winners of the prizes?

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

IP logged posted posted 02-21-2010 21:04 Edit Quote

you'll need to provide more details for an example, but you'll need a multi join.

Maskkkk
Paranoid (IV) Inmate

From: Johnstown, PA
Insane since: Mar 2002

IP logged posted posted 02-22-2010 16:00 Edit Quote

A many to many consists of 3 tables.

code:
| SCHOOLS |1---M|SCHOOLS_AUCTION_WEAK_ENTITY|M---1|AUCTION|




Additionally, try drawing an ERD (Entity Relationship Diagram) of the database using DIA (free open source diagramming tool).



- AIM: MASKKKK

01001101011000010111001101101011011010110110101101101011


(Edited by Maskkkk on 02-22-2010 16:01)



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu