dbTalk Databases Forums  

database structure problem - advice please?

comp.databases.oracle comp.databases.oracle


Discuss database structure problem - advice please? in the comp.databases.oracle forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Johnson
 
Posts: n/a

Default database structure problem - advice please? - 09-06-2004 , 12:08 AM






Here's what I was doing, it is obviously stupid because i have exceeded the
"too many fields defined error"

I have to create a database driven application that allows students to
update the records of which classes they took, what grade they received, and
what semester they took the class in.

I was using one database table, with some unique identifiers for each
student. Then for each of the 50 classes they have to take, I had 4 fields
each, one for whether they took it or not, one for the semester, one for the
year, one for the grade they received.

So all in all I had 4x50 fields for the classes and then the various unique
identifiers.

I just can't fathom how to simplify this problem. Anybody got any ideas?



Reply With Quote
  #2  
Old   
Mark C. Stock
 
Posts: n/a

Default Re: database structure problem - advice please? - 09-06-2004 , 06:12 AM







"Johnson" <johnson (AT) spam (DOT) troll> wrote

Quote:
Here's what I was doing, it is obviously stupid because i have exceeded
the
"too many fields defined error"

I have to create a database driven application that allows students to
update the records of which classes they took, what grade they received,
and
what semester they took the class in.

I was using one database table, with some unique identifiers for each
student. Then for each of the 50 classes they have to take, I had 4
fields
each, one for whether they took it or not, one for the semester, one for
the
year, one for the grade they received.

So all in all I had 4x50 fields for the classes and then the various
unique
identifiers.

I just can't fathom how to simplify this problem. Anybody got any ideas?


you seem to be treating the relational database as if it were a big
spreadsheet

you need to get at least a rudimentary understanding of data normalization,
and basic entity/relationship analysis


get a good book on relational database design (Richard Barker's CASE
Methodology Data Modelling or David Hayes Patterns in Data Modeling are
still excellent references)

you will find that you need many, many more tables, likely:

STUDENTS -- 'master list' of students, likely with STUDENT_ID as the primary
key
CLASSES -- 'master list' of classes, likely with CLASS_ID as PK
SCHEDULED_CLASSES -- list of each occurrence of each class, likely with
CLASS_ID plus CLASS_DATE or a system-assigned sequence number as PK
STUDENT_CLASSES -- list that relates STUDENTS to STUDENT_SCHEDULED_CLASSES

don't just start creating these tables -- find out why 4 (or more) tables
are needed by reading up on basic relational database theory

++ mcs




Reply With Quote
Reply




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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.