View Single Post
Join Date: Dec 2004
Posts: 4,279
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 494
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: Whether my database structure is right or wrong?

 
0
  #2
Aug 1st, 2008
When I directed you to Database Design section of the forum I was hopping some "DB monkey" will take care of the business. However it does look like we will have to trade ideas...

OK, I have here few questions and suggestions that I need to get answered:
  1. Does the user table gone hold only students details or also administrator details?
    • If it will hold both, how will you distinguish between student and admin?
    • If you planning to have separated table for each of them, do you have any specific idea about login implementation?
  2. In the user table you have groupid. Can the user be only member of one group or many groups?
  3. I feel like Questionid table and QuestionBank (described in 4th point) should be more flexible. I would prefer to call Questionid table Questioners or Surveys and have it following structure
    • surveyid - primary key, created from groupid+school year+additional number of test/survey (not required if only one per year)
    • groupid
    • description (survey/test title)
    • type - questioner(not marking) in class test(require marking)
  4. As mentioned before I would like to make it more flexible therefore I would drop idea of single question bank and create multiple tables with the surveyid as actual table name. This way
    • Query doesn't have to search whole question bank in order to locate questions related to selected survey
    • If somebody from admin/teachers mess up survey table they will not damage rest of the surveys
    • It will make easier to remove old surveys from the system
    The structure will be
    • questionNo - it is not necessary as you can do rows count
    • question
    • optionA
    • optionB
    • optionC
    • optionD
    • other
    • correctAnswer - if one or many of the A-D
  5. In same manner I would drop Final table and replace with surveyid+result with structure where number of "q+number" is dependent on number of questions in surveyid
    • userid
    • taken - boolean true/false as for survey taken or not
    • q1 - submitted answer
    • q2 - submitted answer
    • score - final mark if it is test for marking or not to create this field when the table is created

The whole concept can be extended further, but I do not want to over-kill and just trying to provide suggestions for possible improvements. Ask questions, I will do my best answer them and shape this design if we will agree upon it.
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote