database design help/query
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Patrick_Geary
Posted On:   Friday, May 2, 2003 06:00 AM

Hi I have set up a database which contains 4 tables:- personal_details,teams,team_entry,jtable. personal_details contains the following fields:- aid,first_name,last_name,address1,address2,address3,country,age,sex,email,fave_team,username,password. aid stands for account ID and set as primary key for that table. It auto increments each time a person registers their details on the website. teams contain the following fields:- tno,name,league_id,points. tno stands for team number.I have entered in 80 different team names such as Arsenal, Man Utd,Celtic,etc. tno is set as primary key. team_entry contains the followi   More>>

Hi


I have set up a database which contains 4 tables:-

personal_details,teams,team_entry,jtable.


personal_details contains the following fields:-



aid,first_name,last_name,address1,address2,address3,country,age,sex,email,fave_team,username,password.


aid stands for account ID and set as primary key for that table. It auto increments each time a person registers their details on the website.



teams contain the following fields:-


tno,name,league_id,points.


tno stands for team number.I have entered in 80 different team names such as Arsenal, Man Utd,Celtic,etc.


tno is set as primary key.



team_entry contains the following fields:-


tid,aid.


tid stands for team ID and is the primary key.



jtable contains the following fields:-


aid,tid,tno



When a user registers on the website their details are entered in to personal_details and they are identified by 'aid'.



They then have to select 10 different teams from the drop down menus available to them. I want to get the 'tno' for each team that is selected and store this in the 'team_entry' table and in the 'jtable' table



So 'team_entry' will contain the 'aid' of the person selecting the teams and the 'tno' of each team that they selected on the website.I am using JSPs on my webpages.



Do i need all these table or can i remove one of them???



Any help would be greatly appreciated.


Thanks

Patrick

   <<Less

Re: database design help/query

Posted By:   James_McLean  
Posted On:   Friday, May 2, 2003 07:24 AM

Sounds like you can get away with 3 tables.



The personal_details and teams tables look okie. Now we just need 1 table to associate the user with the selected teams.



So create a table like user-teams with fields aid and tno.



Once you do this you'll be able to a record for each user-teams assocaion that you want to create.





Cheers!
About | Sitemap | Contact