[thelist] database eating brain...

David McCreath mccreath at alaska.net
Tue Jul 4 13:04:24 CDT 2000


Hey, Matt and Rudy --

Thanks for taking the time to look over my scribblings. I feel like I just
traded in my Tercel (FileMaker) for the Batmobile (SQLServer). They'll both
get me there on four wheels, but one has a lot more buttons (and a rocket
launcher).

I've posted all the new stuff that I've done for the tables here:

http://www.alaska.net/~mccreath/sdfs.html

to keep it from bogging down the mail.

> Where is the grant table? Do grants only relate to genGoals? If so, you
need
> a genGoalID in the grant table, and get rid of the grantID from the
genGoals
> table. However, if a grant can have many genGoal records associated with
it,
> you need another table:

Actually, the grant-genGoal relationship is o-m -- each grant can have many
goals, but each goal relates specifically to only one grant.

> Now, what I see misssing is a table that identifies a school. If I'm
> understanding it correctly, you'd need some sort of table structure which
> held information about a specific school... or even a specific user which
> relates to a school

I already have a table called "coordinator" (instead of "user") and a table
called "school". Each school can have more than one coordinator. See the
link above to see how they fit in.

> where userID relates to the table appUser (or something other than "user"
> which is a reserved word in most databases):
>
> TABLE: appUser
>     userID
>     fname    (pk)
>     lname    (pk)
>     schoolID (pk)
>
> where the combination of fname, lname, and schoolID *must* be unique. And
> schoolID relates to a table called school
>
> TABLE: school
>     schoolID
>     name           (pk)
>     districtID     (pk)
>     ...
>
> that's how i'd do it. of course, you could go cheap and just make each of
> the IDs the pk, but the more I learn more about data modeling, the more I
> think that's a waste of a primary key.

We don't actually need a districtID, as everybody applying is in the same
district (see the school table at the link above), but how is it that you
have more than one item marked as the primary key in the tables above? I
thought each table could only have one primary key. Does that mean that
they're primary keys in a different table? If so, could they also be listed
as foreign keys?

Thanks!
Dave





More information about the thelist mailing list