making test tables and implementing it

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
shivam0101
Forum Contributor
Posts: 197
Joined: Sat Jun 09, 2007 12:09 am

making test tables and implementing it

Post by shivam0101 »

Hi,

I am making test module, for which the structure is,

test name
test category
test sub category
test question
test answers


I made the tables as,

test_name
test_name_id(pk, auto inc), test_name

test category
test_category_id(pk, auto inc), test_ category_name, test_name_id


test sub category
test_sub_category_id(pk, auto inc), test_sub_category_name, test_category_id


test_question
test_question_id(pk, auto_inc), test_question_name, test_sub_category_id

test_answers
test_answers_id(pk, auto_inc), test_answers, test_question_id


1. The questions will be in multiple choice type. If somebody tell me if there is any better way of making tables for this.

2. How to add the data to the tables? i.e,
a) Show the form for adding test name - add to test_name_table
b) Show the form for adding test_category_name - choose a test_name and add test_category_name to test_category_table
c) Show the form for adding test_sub_category_name - choose a test_category_name and add test_sub_category_name to test_sub_category_table
d) Show the form for adding test_questions - choose a test_sub_category_name and add a question to test_question_table and add answers to the test_answers table.

OR


a) Show the form for adding test name - add to test_name_table
b) Show the form for adding test_category_name - choose a test_name and add test_category_name to test_category_table
c) Show the form for adding test_sub_category_name - choose a test_category_name and add test_sub_category_name to test_sub_category_table
d) Show the form for adding test_questions - choose test_name, choose test_category_name, choose test_sub_category_name, add question and answers


Which is better?


Thanks
Post Reply