-1

Friends i am building a shopping site project in asp.net.

i have used these table for my database

LoginInfo

Column Name      Data Type      Constraint
UserName         Varchar(100)   Primary key
Password         Varchar(100)   
RoleName         Varchar(100)   
EmailID          Varchar(100)   Unique key
SecurityQuestion Varchar(1000)  
SecurityAnswer   Varchar(100)   
LastLogin        Datetime   

ProductCategory

Column Name   Data Type     Constraint
CategoryID    Varchar(20)   Primary key
CategoryNam   Varchar(100)  Unique key
Description   Varchar(1000) 

ProductSubCategory

Column Name      Data Type      Constraint
SubCategoryID    Int            Auto increment , Primary key
SubCategoryName  Varchar(100)   
Description      Varchar(1000)  
CategoryID       Varchar(20)    Foreign key with Product Category

ProductSubCategory2

Column Name       Data Type    Constraint
SubCategory2ID     Int         Auto increment , Primary key
SubCategory2Name   Varchar(100) 
Description        Varchar(1000)    
SubCategoryID      Varchar(20)  Foreign key with Product SubCategory

CompanyInfo

Column Name Data Type   Constraint
CompanyID   Varchar(20) Primary key
CompanyName Varchar(100)    Unique key
Description Varchar(1000)   

ProductInfo

Column Name   Data Type Constraint
ProductID     Int           Primary key , auto increment
ProductName   Varchar(100)  
SubCategoryID Int           Foreign key with ProductSubCategory
CompanyID     Varchar(20)   Foreign key with CompanyInfo
Price         Float 
Quantity      Int   
Description   Varchar(1000) 

ProductStock

Column Name Data Type   Constraint
StockID Int Primary key,auto increment
ProductID   Int Foreign key with ProductInfo
Quantity    Int 
StockType   Enum(‘IN’,’OUT’)    
StockDate   Datetime    

ProductPhoto

Column Name Data Type   Constraint
PhotoID     Int       Primary key,auto increment
PhotoName   Varchar(100)    
ExtName     Varchar(100)    
PhotoType   Varchar(100)    
PhotoSize   Int 
ProductID   Int          Foreign key with product info

So now my Question is in every shopping site there exist 4-5 photos for every product. So i should add the in database or the will be managed at client side. Currently i have added only single photo for every product.

4

3 回答 3

2

为什么没有将照片链接到 ProductID 的表格,那么每个产品的数量就没有限制

于 2013-07-26T12:04:57.143 回答
2

您应该有一个照片表,它是具有 PK 和 FK 关系的产品(父)的子表。

于 2013-07-26T12:06:19.587 回答
1

几乎没有发现

  1. 为什么将 RoleName 作为一列?为什么不创建一个新表角色(添加所有类型的角色)并放置一个外键。

  2. 安全问题和安全答案必须加密

  3. 为什么没有 Created 和 Modified 列?您将如何跟踪对数据进行了哪些更改以及何时更改?这必须被跟踪,因为它对购物车非常重要

  4. 我没有找到什么用户会购买什么产品表?

于 2013-07-26T12:35:09.637 回答