Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 12-01-2004, 11:07 PM
sully02 sully02 is offline
 
Join Date: Jul 2004
Posts: 161
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Looking for input on data organization/queries

I'm working on a project that will add a "team page" to my boards for all professional sports teams. As far as programming experience, I'm still a relative PHP/SQL newbie, but I've taken classes that teach C, C++, and Java, so I figure it won't be that hard for me to pick up. Right now, I'm working on organizing tables for the SQL database and figuring out the best arrangement. Right now, I want to get this done so I can work on the team standings portion of the project. That portion will put the team's division standings on the respective team page. Here's the tables I have along with items in each table:

clubhouse_sportname: sportid (smallint-2), sportname (varchar-200), sportabbrev (varchar-5)

clubhouse_conferences: confid (smallint-3), sportid (smallint-2), confname (varchar-200), confabbrev (varchar-5)

clubhouse_divisions: divid (smallint-3), confid (smallint-3), sportid (smallint-2), divname (varchar-100), divabbrev (varchar-8)

clubhouse_teams: teamid (smallint-4), divid (smallint-3), confid (smallint-3), sportid (smallint-2), teamname (varchar-100), teamabbrev (varchar-5)

Now, the way I'm thinking to do this would be to have the teams viewable by clubhouse.php?team=1, for example (Not sure of the exact terminology). At that point, I'd do a query to the teams table to get the team's data in regards to division, etc.

From there, I could do a query into a separate standings table to get the standings for each team. Then comes the interesting part. In the case of tiebreakers, I'd have to sort by multiple methods (For example, I'd have to sort by team record THEN division record, and so on).

Now that I've given you the information, my questions. I'm not asking how to do it, per se, but if how I'm doing it would be the most organized and efficient way. If you have any suggestions, I'd greatly appreciate it.

1] Is this the best way I can go about organizing my data?
2] Is the method I have in mind for doing queries the best one I could use?
3] Is it possible to sort using multiple criteria (multiple sorts of data) using SQL queries?

And of course, any other suggestions would be greatly appreciated.
Reply With Quote
 


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

Forum Jump


All times are GMT. The time now is 08:16 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04310 seconds
  • Memory Usage 2,218KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)showthread_list
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_threadedmode.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids_threaded
  • showthread_threaded_construct_link
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete