Skip site navigation (1) Skip section navigation (2)

Trouble creating a survey database

From: dbaxter7(at)yahoo(dot)com (Dave)
To: pgsql-novice(at)postgresql(dot)org
Subject: Trouble creating a survey database
Date: 2003-10-17 13:53:28
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
I'm trying to implement a simple Y/N type survey on our website using
Postgresql and pHp.  I am having difficulty, though, getting the
database design straight.  I've tried multiple scenarios, none of
which have satified my needs. Here's what I'm looking to do:

Each week, I'd like to have a simple survey where I ask a question and
have a simple For or Against option as the answer.  Each survey may
have multiple questions.  We already have our members only site
integrated with our membership database, so I can pull the userID from
there to insure that each person only votes once.  My issue is I can't
think of the best design for the table structure.  Here's what I've

Table: Survey

Table: Questions

Table: Answers

Table: Users

What I think this allows me to do, is have multiple surveys, with
multiple questions, with multiple answers.  Of course, I will validate
that the user has not already submitted answers to the survey with a
session cookie when they initiate the response, so they will not be
able to vote twice.  But, this design does not appear to do what I'm
looking for.  I am trying to write the front end in Access so that
other people in my office can create surveys for our website, and I
will just change some code on the survey page to reflect the new
surveryID.  When I try to write the front end, it just doesn't work
like I expect it to.  Is there something I'm missing?  Any help would
be greatly appreciated.


pgsql-novice by date

Next:From: Doug SilverDate: 2003-10-17 23:46:41
Subject: Combining text fields
Previous:From: dev o'nullDate: 2003-10-17 10:45:29
Subject: scaleable design for multiple value tuple records

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group