Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
This table holds all the products on display in the site. Each product is tied to a category, has a price, and also has its stock maintained. Whenever the product has reached its reorder level, an alert is raised to the Manager and Administrator of the site to procure it. The Product table structure is shown in Table 21.5.
| Column Name | Datatype | Key | Description |
|---|---|---|---|
| ProductId | Int | Primary Key | Identity field (auto-generated number to identify the uniqueness of the record). |
| ProductName | Varchar(50) | Not Null | The name of the product. |
| Description | Varchar(250) | Not Null | The description of the product. |
| CategoryId | Int | Foreign Key | The product associated with a category. |
| QuantityInStock | Int | Not Null | The current quantity of products. |
| ReorderLevel | Int | Not Null | The minimum quantity of a product before it has to be procured. |
| CostPrice | money | Not Null | The purchase price from the supplier. |
| SellingPrice | money | Not Null | The sale price to the customer. |
| ImageId table | Int | Foreign Key | Fetched from the images. |
| Notes | Varchar(250) | Allow Null | Any notes/remarks on the product. |
| CreatedDate | Datetime | Not Null [Default—Getdate()] | The date of creation of the product in the system. |
| CreatedBy | Int | Not Null [Logged-in user. Either the Manager’s UserId or the Administrator’s UserId.] | The UserId of the user who created this record. |