<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1013359" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1013359</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/database-design#comment-1077683</link>
    <description> &lt;p&gt;I&#039;m so sorry.  I miss understood the question.  I just re-read the original post.  My initail reading made me think of an anonymous survey... not an ongoing thing where you would want to keep track of users.  (I was thinking more along the lines of a poll than survey)&lt;/p&gt;
&lt;p&gt;Sorry about that.&lt;/p&gt;
 </description>
     <pubDate>Thu, 01 Feb 2001 06:14:03 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1077683 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/database-design#comment-1077665</link>
    <description> &lt;p&gt;Thanks for all the support guys. I knew this database design would start a good post! The idea behind this database is that a patient will submit this survey within 6 months, a year and 2 years of a surgery. It is designed to keep track of the patient and generate statistics. So yes, I will need a date field. I was worried that having so many records would slow down the db, but Peter had a good point saying that there would only be like 4 fields, so there shouldn&#039;t be any problem...&lt;/p&gt;
&lt;p&gt;I&#039;m about to put this in my PHPMyAdmin and see how it goes...&lt;/p&gt;
 </description>
     <pubDate>Wed, 31 Jan 2001 21:14:44 +0000</pubDate>
 <dc:creator>Gil</dc:creator>
 <guid isPermaLink="false">comment 1077665 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/database-design#comment-1077664</link>
    <description> &lt;p&gt;Mark,&lt;/p&gt;
&lt;p&gt;You&#039;re right MSSQL is another way of saying Microsoft SQL Server. There&#039;s always multiple ways of performing queries, and yes this will work on SQL Server. I usually don&#039;t use JOINS in examples I do as this can sometimes lead to more questions &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/sad.png&quot; title=&quot;Sad&quot; alt=&quot;Sad&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I&#039;m still not sure why you would use LIMIT in this example though, maybe I&#039;m missing something? The query will only return the amount of records corresponding to that user, not the whole 100,000. So let&#039;s say there are 300 questions, UserA fills out the whole survey and submits it, so now UserA has 300 records in the Answer table. The query that I originally posted would return 300 records which then could be looped through using a Do While...Loop.&lt;/p&gt;
&lt;p&gt;If they submit it again then there will be more records which was why I suggested maybe adding a datetime field.&lt;/p&gt;
 </description>
     <pubDate>Wed, 31 Jan 2001 19:53:13 +0000</pubDate>
 <dc:creator>Peter J. Boettcher</dc:creator>
 <guid isPermaLink="false">comment 1077664 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/database-design#comment-1077663</link>
    <description> &lt;p&gt;MSSQL = Microsoft SQL Server?&lt;br /&gt;
I&#039;ve never used a query like that for multiple tables. I&#039;ve always used INNER JOIN and such. Does is actually work that way? &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/surprise.png&quot; title=&quot;Shocked&quot; alt=&quot;Shocked&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I would have used the limit just so I could use a DO WHILE LOOP and not get 100k results printed to my screen.  Also, the SQL server should stop looking after it reaches it&#039;s LIMIT, so the load on the server is shorter. (though perhaps not noticable &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/wink.png&quot; title=&quot;Wink&quot; alt=&quot;Wink&quot; class=&quot;smiley-content&quot; /&gt;)&lt;/p&gt;
&lt;p&gt;For a mySQL server, SELECT limits the number of fields returned, LIMIT limits the number of records returned.&lt;/p&gt;
 </description>
     <pubDate>Wed, 31 Jan 2001 19:11:53 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1077663 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/database-design#comment-1077632</link>
    <description> &lt;p&gt;Mark/Max,&lt;/p&gt;
&lt;p&gt;I&#039;m curious as to why you would say that query is &quot;built wrong&quot; for SQL 7? I have almost no expereince with MySQL so my example was based on MSSQL which I&#039;ve been using for almost 5 years, so if anything it&#039;s probably &quot;built wrong&quot; for MySQL. &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/wink.png&quot; title=&quot;Wink&quot; alt=&quot;Wink&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Gil,&lt;/p&gt;
&lt;p&gt;100,000 should be no problem. Remember, that&#039;s a pretty small table (memory wise) all it&#039;s holding is 3 integers and 1 varchar fields, that&#039;s nothing.&lt;/p&gt;
&lt;p&gt;I&#039;m not sure why you would want to use LIMIT. Your SELECT statement is going to be limiting the number of rows that are returned. If the user is going to be submitting the survey multiple times you might want to add a date field in the answer table. That would give you a differentiator as to which answers to retrieve for that user.&lt;/p&gt;
 </description>
     <pubDate>Wed, 31 Jan 2001 14:15:53 +0000</pubDate>
 <dc:creator>Peter J. Boettcher</dc:creator>
 <guid isPermaLink="false">comment 1077632 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/database-design#comment-1077611</link>
    <description> &lt;p&gt;uh, well.... you&#039;ll want to use LIMIT&lt;br /&gt;
&lt;a href=&quot;http://www.mysql.com/doc/S/E/SELECT.html&quot; class=&quot;bb-url&quot;&gt;http://www.mysql.com/doc/S/E/SELECT.html&lt;/a&gt;&lt;/p&gt;
 </description>
     <pubDate>Wed, 31 Jan 2001 02:54:03 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1077611 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/database-design#comment-1077606</link>
    <description> &lt;p&gt;This site will be utilizing MySQL. I&#039;ll be using PHP for processing the info. I believe Peter&#039;s solution will work, but can MySQL handle 100,000 answers in that answer table?&lt;/p&gt;
 </description>
     <pubDate>Wed, 31 Jan 2001 01:24:22 +0000</pubDate>
 <dc:creator>Gil</dc:creator>
 <guid isPermaLink="false">comment 1077606 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/database-design#comment-1077605</link>
    <description> &lt;p&gt;Peter- That query will work with mySQL, but it&#039;s built wrong for SQL Server 7, and we don&#039;t know what is using yet.&lt;/p&gt;
&lt;p&gt;Gil- what do you want to write this with?&lt;/p&gt;
 </description>
     <pubDate>Wed, 31 Jan 2001 00:15:37 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1077605 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/database-design#comment-1077593</link>
    <description> &lt;p&gt;My site (also a medical survey, although all answers are multiple-choice) uses Peter&#039;s method as well.  I also left gaps between the values in the ID field -- which I always order the query by -- of the questions (e.g. using 10, 20, 30 ... rather than 1, 2, 3 ...) so that in the future if I need to insert a new question in between existing ones I can just pick an intermediate number (say, 25) for the new one.&lt;/p&gt;
 </description>
     <pubDate>Tue, 30 Jan 2001 20:44:27 +0000</pubDate>
 <dc:creator>KLWong</dc:creator>
 <guid isPermaLink="false">comment 1077593 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/database-design#comment-1077581</link>
    <description> &lt;p&gt;Gil,&lt;/p&gt;
&lt;p&gt;I would recommend the following setup. I would use 3 tables, one for questions, one for answers, and one for user information.&lt;/p&gt;
&lt;p&gt;UserTable:&lt;br /&gt;
User_ID integer identity (primekey)&lt;br /&gt;
UserInformation_One varchar(whatever)&lt;br /&gt;
etc, etc&lt;/p&gt;
&lt;p&gt;QuestionTable:&lt;br /&gt;
Question_ID integer identity (primekey)&lt;br /&gt;
Question_One_Text varchar(whatever)&lt;br /&gt;
Question_Two_Text varchar(whatever)&lt;br /&gt;
etc, etc&lt;/p&gt;
&lt;p&gt;AnswerTable:&lt;br /&gt;
Answer_ID integer identity (primekey)&lt;br /&gt;
Answer_ID varchar(whatever)&lt;br /&gt;
Question_ID integer (From QuestionTable)&lt;br /&gt;
User_ID integer (From UserTable)&lt;/p&gt;
&lt;p&gt;So after someone submits this survey to get back their information all you would have to do is:&lt;/p&gt;
&lt;p&gt;SELECT * FROM UserTable,QuestionTable,AnswerTable&lt;br /&gt;
WHERE User_Table.User_ID = Answer_Table.User_ID&lt;br /&gt;
AND QuestionTable.Question_ID = AnswerTable.Question_ID&lt;/p&gt;
&lt;p&gt;Saving the answers as varchar might not be super efficient but it saves you trouble down the road if you ever have to change the survey.&lt;/p&gt;
 </description>
     <pubDate>Tue, 30 Jan 2001 17:30:51 +0000</pubDate>
 <dc:creator>Peter J. Boettcher</dc:creator>
 <guid isPermaLink="false">comment 1077581 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
