Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm not sure if topic can get you understand what I want to explain. Follow guide in my old question, now I have these tables and its columns:

  • Course: name,...
  • Topic: name, course_id
  • Question: content, topic_id
  • GeneralExam: name, description, semester, number_question (total number of questions of general exam), duration, used (boolean), user_id, course_id
  • GeneralQuestion: general_exam_id, question_id

To sum up association:

  • Course - Topic: one-to-many
  • Topic - Question: one-to-many
  • Course - GeneralExam: one-to-many
  • Question - GeneralExam: many-to-many, join table: GeneralQuestion

Now, When creating new General Exam (GE) for a course, I want to specific a number of questions for each topic of that course, so that I can get questions for that GE ( I want to do(specific) it on form, I had a form for create new GE now). So, should I create new table to store a number of questions of each topic of course when creating new GE? If I should, how table I should design?

I image table I should design will like this (I can't get name of table now):

NameOfTable: general_exam_id, course_id, topic_id, number_question

Is this table good?

share|improve this question

If the number of questions for each topic on each course varies from one General Exam to another, then yes, you want a structure like this (which is pretty much what you have):

GE_ID int FK
Course_ID int FK
Topic_ID int FK
MaxQuestions int
share|improve this answer
yes, every GE has different number of questions of course's topics. Ah, maybe I don't need Course_ID, because it's already in GE table, right? – Kien Thanh Nov 18 '12 at 19:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.