My web server - of data. It, and other products like it,
of data. It, and other products like it, exist mainly because in the real world, there are natural one-to-many relationships among different types of data. For example, suppose your site offers some kind of items to users. The items might be products you sell, courses you offer, Web seminars that people sign up for, or something like that. In cases such as these there are two natural one-to-many relationships between users and the items being offered: Any one user might purchase many items. Any one item might be purchased by many users. Any time you have two one-to-many relationships like that, you have what s called a many-to-many relationship. You have many users purchasing (or enrolling in, or attending) many items. To illustrate, let s look at simplified versions of the aspnet_Users table and a table of items that the site offers to users. At the left side of Figure 11-4 is a table showing a couple of columns and some rows from a table of users. Each record in that table represents a single user account. On the right side is a simple Items table. Each record in that table represents a single item offered to users. In between the two tables is the burning question How do I connect these? The answer is pretty straightforward: By creating a third table that keeps track of who purchased what. It might help to think of it this way. Each time a user purchases a product, that s a transaction. You need to keep track of these transactions specifically, who purchased what and that requires two pieces of information per transaction: who (a UserId), and what (an ItemId). So, at the very least, this third table (which I ll name Transactions) must contain two fields: One field to record the user s identification (UserId), and the other to record the item purchased (ItemId). You can imagine this as a table with two fields named UserId and ItemId between the aspnet_Users table and the Items table. Users Items How do I connect these? Figure 11-4: Sample aspnet_ Users and Items tables. 224 Part III: Personalization and Databases
If you are in need for chaep and reliable webhost to host your website, our recommendation is http web server services.