Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Poll system DB design
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Poll system DB design

 Post Reply Post Reply
Author
theSCIENTIST View Drop Down
Senior Member
Senior Member


Joined: 31 July 2003
Location: United Kingdom
Status: Offline
Points: 440
Post Options Post Options   Thanks (0) Thanks(0)   Quote theSCIENTIST Quote  Post ReplyReply Direct Link To This Post Topic: Poll system DB design
    Posted: 12 December 2003 at 9:52am

Hi folks, I'm beginning to develop a polling system for a web site, the coding is no problem, but my question is in relation to the database design.

What would work best:

  1. One DB, one table, each row is a poll.
  2. One DB, each table is a poll.
  3. Each DB is a poll.

To help you to help me, let me tell you a bit about this system, it will be used only by the site registered users, so each vote can be traceable and done once only from that user.

Then I also want users to be able to create polls with the question and answers, data of who creates the poll is also collected.

I'm inclined to adopt option N.1, that would work faster, but each row (poll) would have to have lots of colums, not only for the creator, but also for the question, answers, votes, who voted and when and all the rest of it.

If I'm not going for option N.1, it would mean that tables and/or databases have to be dynamically created, and even worse, several calls to several DB's and/or tables have to be made.

Do you guys think going for option N.1 is the best or possible at all?

Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 12 December 2003 at 9:56am
One Db

2 tables

Poll list
Columns
[ID]
[Name]

Votes
Columns
[ID]
[PollID] (relates to ID in Poll list table)
etc.


Edited by Mart
Back to Top
zaboss View Drop Down
Senior Member
Senior Member


Joined: 20 August 2002
Location: Romania
Status: Offline
Points: 454
Post Options Post Options   Thanks (0) Thanks(0)   Quote zaboss Quote  Post ReplyReply Direct Link To This Post Posted: 12 December 2003 at 10:35am

Even Better:

a: 1 question/multiple options.

Table Questions with QuestionID, PollQuestion, PollLauncher
Table Options: OptionID, QuestionID, Votes
TableVotes: OptionID, Voted by

This way you can have as many options you want.

b) multiuple questions/poll with multiple options

Table Polls: PollID, PollLauncher...
Table Questions: PollID, QuestionID, PollQuestion,
Table Options: OptionID, QuestionID, Votes
TableVotes: OptionID, Voted by

This way you can have as many questions want with as many options you need.

Cristian Banu
Soft 4 web
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.