Web site hosting - Now, imagine that user Carol (UserId 66cd…) purchases

Now, imagine that user Carol (UserId 66cd…) purchases item 10003. The Transactions would need a new record with 66cd in its UserId field and the 10003 in its ItemId field. If you then trace an imaginary line from the user to the transaction to the item, you ll see how the record in the Transactions table provides the link from a specific user to a specific item purchased, as in Figure 11-5. Every time a user purchases something, the Transactions table grows by one record. As time goes by, the Transactions table continues to grow, perhaps to thousands of records. Each record represents a single transaction where a specific user purchased a specific product. Recall that the natural many-to-many relationship between users and items is actually two one-to-many relationships. Any one user might purchase many items, and any one item might be purchased by many users. The Transactions table provides the map that allows code to find all transactions by any one user. No matter how many records are in the Transactions table, that table still provides the one-to-many link from users to items. To illustrate, pick one user, such as Carol (UserId 66cd…). Each record in the Transactions table that has 66cd… is a transaction made by that user. The ItemId field in Transactions identifies exactly which item the user purchased, as shown in Figure 11-6. Users Transactions Items Figure 11-6: One-tomany link from a user to many products purchased. Users Transactions Items Figure 11-5: Third Transactions table links user to item purchased. Chapter 11: SQL Server Crash Course 225
You need excellent and relaible webhost company to host your web applications? Then pay a visit to Inexpensive Web Hosting services.

Leave a Reply