How to relate tables and display the correct values..

celtnots

New member
Local time
Today, 14:25
Joined
Feb 16, 2008
Messages
8
I'm sorry if this is obvious, but I have asked local professionals and scoured this site for answers before posting...

I have a database that I'm using to store and analyze language samples (basically, the mistakes that students make when trying to speak in another language). For each bit of language, I want to be able to say what domain the mistake belongs to - e.g. the 'clause', 'phrase', or 'word' domain. I have a table containing the five domains. I also have a table for each of these domains, containing the specific types of mistakes relevant to that domain. It is conceivable, but unlikely, that I will ever add to the domain table, but highly likely that I will add types of mistakes in the five related tables.

As I analyze bits of language, I will be appending each analysis (record) to a table as shown in the attached image. So far so good. The part that I cannot fathom, though, is how to display (let alone perform calculations on) this data: While the ErrorDomainID is a foreign key to the ErrorDomain table, the ErrorUnitID could refer to one of five tables, so that an ErrorUnitID of 2, for example, could refer to one thing if the Domain is 1 but quite another if the domain is 1 or 5 or whatever.

I've tried all kinds of coding and SQL workarounds, but I have a feeling I'm just missing something very basic here. If anyone could offer some guidance, I'd be extremely grateful!

James
 

Attachments

  • analysis.jpg
    analysis.jpg
    33.1 KB · Views: 118
the ErrorUnitID could refer to one of five tables, so that an ErrorUnitID of 2, for example, could refer to one thing if the Domain is 1 but quite another if the domain is 1 or 5 or whatever.


James

I think your problem lies here. Should not the Error Types (ErrorUnitID) all belong in one table, with a 1 to many link to the Domain table? Then your analysis queries area lot easier
 

Users who are viewing this thread

Back
Top Bottom