Ylbtech-dbs:ylbtech-3,barcode (Barcode resource System) |
-- =============================================
--Barcode Resource system
--Yuranbo
--10:36 2015/3/15
-- =============================================
1.A, Database diagram (db Diagram) back to top |
1.B, database design script back to top |
1.b.1,3,purplebarcode.sql
-- =============================================--Barcode Resource System--Yuranbo--10:36 2015/3/15-- ============================================= UseMasterGO--Drop The database if it already existsIF EXISTS ( SELECTname fromsys.databasesWHEREName=N'Purplebarcode')DROP DATABASEPurplebarcodeGOCREATE DATABASEPurplebarcodeGO UsePurplebarcodeGoGo-- =============================================--ylb:1, category "Level 2"-- =============================================Create TableCategory (CategoryIdint Identity(101001,1)Primary Key,--ref. "ID,PK"Categerynamevarchar( -),--Category nameBaseIDint default(-1),--Parent IDFlagsystembit default(0),--System Classification 0: System (no operation); 1: UserFlagvisablebit default(0),--visible 0: visible; 1: HiddenDisablebit default(0)--whether 0 is disabled: normal; 1: Disabled)Go-- =============================================--Ylb:1, company table (Asset table)-- =============================================Create TableCompany (CompanyIDint Identity(101001,1)Primary Key,--ref. "ID,PK"Companycodevarchar( $),--Vendor CodeCompanyNamevarchar( -),--Manufacturer namePwdvarchar( -),--PasswordCountryvarchar( $),--Commodity Country[type] varchar( $),--category[Status] varchar( $),--Registration Statuspubdatedatetime,--Registration TimeDisablebit default(0)--whether 0 is disabled: normal; 1: Disabled)Go-- =============================================--ylb:1, Commodity table (Asset table)-- =============================================Create TableProduct (ProductIdint Identity(101001,1)Primary Key,--ref. "ID,PK"BarCodevarchar( -)Unique,--Commodity Barcode (Auxiliary input product information) "UK"ProductNamevarchar( -),--Product NameProductintrovarchar(4000),--Product IntroductionUnitPricedecimal(6,2),--Reference Price Number int,--QuantityAmountdecimal,--AmountImgurlvarchar( -),--product Picture "Only one card allowed"pubdatedatetime,--Add TimePubdate2datetime,--Add TimePubdate3datetime,--Last Modified DateDisablebit default(0),--whether 0 is disabled: normal; 1: DisabledCategeryidint --Category ID "FK")Go-- =============================================--ylb:1, customer account-- =============================================Create Tableaccountguest (Accountguestidint Identity(101001,1)Primary Key,--ref. "ID,PK"Usernamevarchar( -),--User namePwdvarchar( -),--PasswordIntrovarchar( -),--Personal Signaturepubdatedatetime,--Registration TimeDisablebit default(0)--whether 0 is disabled: normal; 1: Disabled)Go-- =============================================--ylb:1, comment form (info)-- =============================================Create TableComment (Commentidint Identity(101001,1)Primary Key,--ref. "ID,PK"Contentvarchar( -),--contentpubdatedatetime default(getdate()),--Comment TimeproductIdint,--Product ID "FK"Accountguestidint --customer account ID "FK")Go-- =============================================--ylb:1, purchase form-- =============================================Create TableBuy (Buyidint Identity(101001,1)Primary Key,--ref. "ID,PK"Buynamevarchar( -),--Store NameUnitPricedecimal(6,2)--Unit Price)
View Code
1.b.2,
1.C, functional implementation code (function implementation codes) back to top |
|
Ylbtech Source: http://ylbtech.cnblogs.com/ This article is copyright to the author and the blog Park, Welcome to reprint, but without the consent of the author must retain this paragraph, and in the article page obvious location to the original link, otherwise reserves the right to pursue legal responsibility. |
Ylbtech-dbs:ylbtech-3,barcode (Barcode resource System)