Tables and Relationships for an ASP.NET AJAX Server-Centric Based Online Shopping Website
(Page 1 of 4 )
This is the second part of an eleven-part series focused on building an online shopping web site. In the previous part, we introduced the modules we will use as well as the main flow charts. In this part, we will take a closer look at the database design and describe the table structures and their relationships.
A
downloadable .rar file is available for this article.
Database Design
With the modules and main flow charts introduced, now we are ready to shift our attention to the database design.
Tables Design
In this article, we'll design a database named ShoppingDB.mdf, which contains more than tentables. For brevity, we choose to use table form to describe the table structuresof each related table, as follows:
Table 1—Structure for table ‘Role’
Field name | Type | Notes |
RoleID | int | Primary Key identifying the record |
RoleName | varchar(50) | The name of the role |
Table 2—Structure for table ‘Users’
Field name | Type | Notes |
UserID | int | Primary Key identifying the record |
UserName | varchar(50) | The registering name of the user |
RealName | varchar(50) | The real name of the registered user |
Password | varchar(255) | The password of the registered user |
Address | varchar(200) | The address of the user |
Phone | varchar(20) | Phone number of the user |
Mobile | varchar(20) | The mobile number of the user |
Email | varchar(200) | The email address of the user |
CreateDate | datetime | Date and time when the user registers |
Status | bit | Identifies the current status of the user |
RoleID | int | Foreign key, referring to field RoleID in table ‘Role’ |
Remark | text | Other info of the user |
Table 3—Structure for table ‘Category’
Field name | Type | Notes |
CategoryID | int | Primary Key identifying the record |
Desn | varchar(200) | The category name |
ParentID | int | The ID value of the parent category |
OrderBy | int | The order number when in sort |
Remark | text | Memo info |
Next: Tables continued >>
More ASP.NET Articles
More By Xianzhong Zhu