If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Is this 3NF?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-28-09, 18:04
djslothario djslothario is offline
Registered User
 
Join Date: Jan 2009
Posts: 4
Is this 3NF?

I've created an SQL database design, and I need to make sure if it's properly normalized and efficient. I'm attaching a flow chart, so let me know if it looks good.

Question 1)
I'm creating software to manage a debate tournament. Every time a student participates in an event, her participation is recorded in the "student round log" table (see diagram below). This just has one primary and a few foreign keys, which link to general information about students, what the tournament was like, what happened in the particular debate event, and what kind of school she goes to. I'll then take these tables and generate all the information you can imagine--like creating wins/losses statistics, brackets, etc. Is this an efficient way to arrange my database?

Is this 3NF?-database-format.jpg

Question 2)
Okay, say for 3 years the program manages 10 tournaments a week, each with 200 students, who each participate in an average of 10 events. That's about 3,000,000 entries in the big "student round info" table at the bottom. It seems wasteful to constantly be searching through records that are a few years old, that you only need occasionally. Should I optimize somehow? If so, would it make the code more cumbersome? What factors should I consider?
Reply With Quote
  #2 (permalink)  
Old 01-28-09, 18:54
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Quote:
Originally Posted by djslothario
Question 1)
Is this an efficient way to arrange my database?
StudentRoundLog has student_id twice, but other than that, yes

Quote:
Originally Posted by djslothario
Question 2)
Should I optimize somehow? If so, would it make the code more cumbersome?
yes, optimize by assigning indexes, and no, there is no effect on the code at all



__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 01-28-09, 19:30
djslothario djslothario is offline
Registered User
 
Join Date: Jan 2009
Posts: 4
Thanks. Also--pardon my n00bish questions, I'm learning this all through online tutorials--I can create new records for students and tournaments without having an event associated with them yet, right? For instance, someone would first register a tournament, then register students, and then only later would students participate in events. Something I read vaguely gave me the impression that it's not a good idea, though. I can do that safely, right?
Reply With Quote
  #4 (permalink)  
Old 01-28-09, 21:27
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Quote:
Originally Posted by djslothario
I can do that safely, right?
yeppir
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #5 (permalink)  
Old 01-28-09, 22:16
djslothario djslothario is offline
Registered User
 
Join Date: Jan 2009
Posts: 4
One more thing. This has one big table at the bottom that records every single round an individual student takes part in, but there are certain types of round--say LD debate, CX debate, extemporaneous speaking. Should we split that big table at the bottom into each event type? What are the benefits/drawbacks of doing that?
Reply With Quote
  #6 (permalink)  
Old 01-28-09, 22:50
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
how are the different event types different? what different data values does any one event type have from other event types?
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #7 (permalink)  
Old 01-29-09, 02:21
djslothario djslothario is offline
Registered User
 
Join Date: Jan 2009
Posts: 4
Actually, the events are a little different, so I'm going to make a table for each one of them. For instance, extemporaneous speaking is more based on individual ranking, so I'm going to make one entry in the extemp table per student per event, but since, say, LD debate is always made up of two students, there's going to be one entry per debate.

I think I have a pretty clear idea of what I'm doing now. Thanks for your help. If you see anything else, though, please point it out.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On