Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2008
    Posts
    1

    Unanswered: Database design for a Q&A "board"

    Hi DbForum users,

    Currently im developing an online Q&A "board" in ASP.Net 2.0. Where users can post a question of a specific category and answers of a specific questions.

    For this Q&A board i need a database to store data but i have no idea how the database design should look like for this. So i hope you guys can help me out with this.

    This is what i have in mind:

    Core tables
    Code:
    Category
    - Id int (PK)
    - Category varchar(100)
    
    Question
    - Id int (PK)
    - Question varchar(200)
    - Category_Id int (FK- reference to Category.Id)
    
    Answer
    - Id int (PK)
    - Answer
    - Question_Id int (FK- reference to Question.Id)

    authorisation tables
    Code:
    UserType
    - Id int (PK)
    - UserType varchar(100)
    
    User
    - Id int (PK)
    - Name varchar(100)
    - SID varchar(100)
    - UserType_Id int (FK - reference to UserType.Id)

    Some questions:
    1 i need a mechanism for the core tables to identify which records belongs to a certain user. So i think i need to add a foreign key to these tables. is this the right way to do this?

    2 do i miss something important things for this design?

    3 are there things i can improve for this design?

    4 how do other Q&A database looks like?




    kind regards

    naruto

  2. #2
    Join Date
    Apr 2008
    Location
    Iasi, Romania
    Posts
    561
    Provided Answers: 2
    IMHO:

    - You need a FK id_user field in Answer table
    - You need a datetime field in both Answer and Question tables, to be able to order the answers/questions chronologically too.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •