L
LurfysMa
I am working on an electronic flashcard program. Most of the subjects
are simple lists of questions and answers. Those seem to be working.
Some of the "subjects" have "categories" of questions.
One example is a kind of trivia subject. There are several
"categories" such as "geography", "history", etc., like in the Trivial
Pursuit game. Each card has a question in each category.
Since the categories really don't factor into the question other than
being a title, my plan was to define a lookup field in the table for
the categories:
Field Data Type Description
QuestionID Long (4) Primary key. Autonum.
Category Lookup Trivia categories.
Question Memo The trivia question.
Answer Memo The answer.
Is that a reasonable table design for this application?
A second example involves a more complicated use of categories. It's a
database about various information about the 50 US states. For each
state, I neeed to store information about the capitol city, the date
it was admitted to the union, the size, etc.
For this application, I think I need two tables (States and
Categories) with a junction table to effect a many-to-many
relationship:
tblStates:
Field Data Type Description
StateID Long (4) Primary key. Autonum.
State Text (20) Name of the state.
tblCategories:
Field Data Type Description
CatID Long (4) Primary key. Autonum.
CatTitle Text (20) Name of the state.
CatQuestion Memo The question.
tblAnswer
Field Data Type Description
StateID Long (4) Link to tblStates.
CatID Long (4) Link to tblCategories.
Answer Memo The answer.
Here's some sample data:
tblStates:
StateID State
1 Alabama
2 Alaska
3 Arizona
tblCategories:
CatID State Question
1 Capitol City What is the capitol city?
2 Date Admitted When was the state admitted to the Union?
tblAnswers:
StateID CatID Answer
1 1 Montgomery
1 2 December 14, 1819
2 1 Juneau
2 2 January 3, 1959
3 1 Phoenix
3 2 February 14, 1912
Is this a good database design for this application?
Thanks
are simple lists of questions and answers. Those seem to be working.
Some of the "subjects" have "categories" of questions.
One example is a kind of trivia subject. There are several
"categories" such as "geography", "history", etc., like in the Trivial
Pursuit game. Each card has a question in each category.
Since the categories really don't factor into the question other than
being a title, my plan was to define a lookup field in the table for
the categories:
Field Data Type Description
QuestionID Long (4) Primary key. Autonum.
Category Lookup Trivia categories.
Question Memo The trivia question.
Answer Memo The answer.
Is that a reasonable table design for this application?
A second example involves a more complicated use of categories. It's a
database about various information about the 50 US states. For each
state, I neeed to store information about the capitol city, the date
it was admitted to the union, the size, etc.
For this application, I think I need two tables (States and
Categories) with a junction table to effect a many-to-many
relationship:
tblStates:
Field Data Type Description
StateID Long (4) Primary key. Autonum.
State Text (20) Name of the state.
tblCategories:
Field Data Type Description
CatID Long (4) Primary key. Autonum.
CatTitle Text (20) Name of the state.
CatQuestion Memo The question.
tblAnswer
Field Data Type Description
StateID Long (4) Link to tblStates.
CatID Long (4) Link to tblCategories.
Answer Memo The answer.
Here's some sample data:
tblStates:
StateID State
1 Alabama
2 Alaska
3 Arizona
tblCategories:
CatID State Question
1 Capitol City What is the capitol city?
2 Date Admitted When was the state admitted to the Union?
tblAnswers:
StateID CatID Answer
1 1 Montgomery
1 2 December 14, 1819
2 1 Juneau
2 2 January 3, 1959
3 1 Phoenix
3 2 February 14, 1912
Is this a good database design for this application?
Thanks