<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1019232" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1019232</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/comment-book-store-db-design#comment-1114396</link>
    <description> &lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;Quote: &lt;em&gt;Originally posted by Peter J. Boettcher &lt;/em&gt;&lt;br /&gt;
[B]&lt;br /&gt;
customerGroups Table&lt;br /&gt;
--------------------&lt;br /&gt;
Same except I would remove the customerGroupSponserID fk. You had two fks linked to each other, maybe I&#039;m missing something.&lt;/p&gt;
&lt;p&gt;Then I would add a junction table.&lt;/p&gt;
&lt;p&gt;UsersCustomerGroups Table&lt;br /&gt;
-------------------------&lt;br /&gt;
UserID fk from users&lt;br /&gt;
CustomerGroupID fk from customerGroups
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;The reason I did it this way is that I want each user to belong to no more than one customerGroup. The idea of a customerGroup is to set the products I display according to a user&#039;s group affiliation. The script will need to associate the user with only one group. Junction tables are for many to many relationships, which I don&#039;t want here.&lt;/p&gt;
&lt;p&gt;The same user, however, can be the sponser of lots of groups even though as a customer, he only belongs to one ConsumerGroup. That means he has helped me put together userGroups and may qualify for discounts based on how many books were bought by members of his group. It&#039;s sort of like an affiliate program.&lt;/p&gt;
 </description>
     <pubDate>Wed, 18 Sep 2002 17:45:12 +0000</pubDate>
 <dc:creator>akohl</dc:creator>
 <guid isPermaLink="false">comment 1114396 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/comment-book-store-db-design#comment-1114316</link>
    <description> &lt;p&gt;I&#039;m not exactly sure how your app works but I think I would change it a bit. I would keep all your tables with the modifications below:&lt;/p&gt;
&lt;p&gt;users Table&lt;br /&gt;
-----------&lt;br /&gt;
Same except I would remove the customerGroupID fk&lt;/p&gt;
&lt;p&gt;customerGroups Table&lt;br /&gt;
--------------------&lt;br /&gt;
Same except I would remove the customerGroupSponserID fk. You had two fks linked to each other, maybe I&#039;m missing something.&lt;/p&gt;
&lt;p&gt;Then I would add a junction table.&lt;/p&gt;
&lt;p&gt;UsersCustomerGroups Table&lt;br /&gt;
-------------------------&lt;br /&gt;
UserID fk from users&lt;br /&gt;
CustomerGroupID fk from customerGroups&lt;/p&gt;
&lt;p&gt;I would also setup a separate Discount table&lt;/p&gt;
&lt;p&gt;Discounts Table&lt;br /&gt;
---------------&lt;br /&gt;
DiscountID&lt;br /&gt;
DiscountType&lt;br /&gt;
DiscountDescription&lt;br /&gt;
Any other fields you might need&lt;/p&gt;
&lt;p&gt;Then I would setup a junction table&lt;/p&gt;
&lt;p&gt;UsersDiscount Table&lt;br /&gt;
-------------------&lt;br /&gt;
UserID fk from users&lt;br /&gt;
DiscountID fk from Discounts&lt;/p&gt;
&lt;p&gt;Also, from what I see hear it looks like you can&#039;t list what books every user has bought, only the customer group. You might want to add one more junction table.&lt;/p&gt;
&lt;p&gt;UsersBooks Table&lt;br /&gt;
----------------&lt;br /&gt;
UserID fk from users&lt;br /&gt;
BookID fk from books&lt;/p&gt;
&lt;p&gt;The reason I like to use junction tables is so I don&#039;t repeat data unnecessarily which makes the database larger and slows down your queries.&lt;/p&gt;
 </description>
     <pubDate>Wed, 18 Sep 2002 02:08:35 +0000</pubDate>
 <dc:creator>Peter J. Boettcher</dc:creator>
 <guid isPermaLink="false">comment 1114316 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
