Building an In-Text Advertising System Under ASP.NET 3.5 - Database Design
(Page 4 of 5 )
As introduced above, the main data contained in the in-text ad system includes: ad keywords, the ad contents associated with the special keyword, the ad hitting record, and the website owner's information. Therefore, the database (in this case named 'ad.mdf') mainly involves four tables, i.e.keyArray,ad,hit, andsiteUser, respectively.
Table Structure Definitions
Next, let's delve into the above four tables one by one.
1. keyArray
The keyArray table is used to persist all the ad keywords. Note, for simplicity, we've not classified the keywords, while in real-life scenarios you must. Here are the descriptions of each of the fields defined in thekeyArray table:
Id: the id of the ad keyword
Name: the name of the ad keyword
Notes: remarks on the ad keyword
More detailed information on the above fields is shown in Figure 6.
Figure 6-the structure for the keyArray table

2. ad
The ad table is used to persist all of the ad keyword related contents. In this case, per ad content will be rendered in a double-underlined hyperlink form. Here are the descriptions of each of the fields defined in the keyArray table:
Id: the id of the ad keyword related content
Keyid: the id of the corresponding keyword
Description: the link text of the ad content
url: the link address of the ad content
More detailed information on the fields is shown in Figure 7.
Figure 7-the structure for the ad table

3. hit
The hit table is used to record information related to ad clicks. Here are the descriptions of each of the fields defined in thehit table:
Id: the id of the record clicked
UserName: the account of the website owner
url: the advertiser's website address
Datetime: the date and time of the ad click
More detailed information on the fields is shown in Figure 8.
Figure 8-the structure for the hit table

4. siteUser
The siteUser tableis used to save the information related to the website owner. For simplicity, we've only provided a few fields defined in the siteUser table:
Id: the id of the special website owner related information
UserName: the login account of the website owner
Userpass: the login password
More detailed information on the fields is shown in Figure 9.
Figure 9-the structure for the siteUser table

Next: Procedures >>
More ASP.NET Articles
More By Xianzhong Zhu