⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stat.sql

📁 这是用PB6开发的一个POS管理系统
💻 SQL
字号:
/* ============================================================ */
/*   Database name:  SYPOS                                      */
/*   DBMS name:      Microsoft SQL Server 7.x                   */
/*   Created on:     2000-12-7  14:58                           */
/* ============================================================ */

/* ============================================================ */
/*   Table: RetailStat                                          */
/* ============================================================ */
create table RetailStat
(
    deptno      TDept                 not null,
    GroupNo     TGroup                not null,
    ClassNO     TClass                not null,
    TaxRatio    numeric(5,3)          not null,
    RetailMode  char(1)               not null,
    RetailDate  Tdate                 not null,
    Amt         TAmt                  null    ,
    CostAmt     TAmt                  null    ,
    DisAmt      TAmt                  null    ,
    Qty         TQty                  null    
)
go

/* ============================================================ */
/*   Index: index_of_date                                       */
/* ============================================================ */
create index index_of_date on RetailStat (RetailDate)
go

/* ============================================================ */
/*   Index: index_of_group                                      */
/* ============================================================ */
create index index_of_group on RetailStat (GroupNo)
go

/* ============================================================ */
/*   Index: index_of_class                                      */
/* ============================================================ */
create index index_of_class on RetailStat (ClassNO)
go

/* ============================================================ */
/*   Table: VendorRetailStat                                    */
/* ============================================================ */
create table VendorRetailStat
(
    VendorNO    TVendor               not null,
    RetailDate  Tdate                 not null,
    TaxRatio    numeric(5,3)          not null,
    RetailMode  char(1)               not null,
    Amt         TAmt                  null    ,
    CostAmt     TAmt                  null    ,
    DisAmt      TAmt                  null    ,
    Qty         TQty                  null    
)
go

/* ============================================================ */
/*   Index: index_of_date                                       */
/* ============================================================ */
create index index_of_date on VendorRetailStat (RetailDate)
go

/* ============================================================ */
/*   Index: index_of_vendor                                     */
/* ============================================================ */
create index index_of_vendor on VendorRetailStat (VendorNO)
go

/* ============================================================ */
/*   Table: CategoryRetailStat                                  */
/* ============================================================ */
create table CategoryRetailStat
(
    CategoryNo  varchar(8)            not null,
    RetailDate  Tdate                 not null,
    RetailMode  char(1)               null    ,
    TaxRatio    numeric(5,3)          null    ,
    Amt         TAmt                  null    ,
    CostAmt     TAmt                  not null,
    DisAmt      TAmt                  null    ,
    Qty         TQty                  null    
)
go

/* ============================================================ */
/*   Index: index_of_retaildate                                 */
/* ============================================================ */
create index index_of_retaildate on CategoryRetailStat (RetailDate)
go

/* ============================================================ */
/*   Index: index_of_category                                   */
/* ============================================================ */
create index index_of_category on CategoryRetailStat (CategoryNo)
go

/* ============================================================ */
/*   Table: VendorImportStat                                    */
/* ============================================================ */
create table VendorImportStat
(
    VendorNO    TVendor               not null,
    ImportDate  Tdate                 not null,
    Amt         TAmt                  null    ,
    NTaxAmt     TAmt                  null    ,
    Qty         TQty                  null    ,
    constraint PK_ImportstatSum primary key (VendorNO, ImportDate)
)
go

/* ============================================================ */
/*   Index: index_of_date2                                      */
/* ============================================================ */
create index index_of_date2 on VendorImportStat (ImportDate)
go

/* ============================================================ */
/*   Index: index_of_vendor2                                    */
/* ============================================================ */
create index index_of_vendor2 on VendorImportStat (VendorNO)
go

/* ============================================================ */
/*   Table: NewGoodsRetail                                      */
/* ============================================================ */
create table NewGoodsRetail
(
    GoodsNo     TGoods                not null,
    RetailDate  Tdate                 not null,
    Amt         TAmt                  null    ,
    CostAmt     TAmt                  null    ,
    DisAmt      TAmt                  null    ,
    Qty         TQty                  null    ,
    constraint PK_NewGoodsRetail primary key (GoodsNo, RetailDate)
)
go

/* ============================================================ */
/*   Index: index_of_date3                                      */
/* ============================================================ */
create index index_of_date3 on NewGoodsRetail (RetailDate)
go

/* ============================================================ */
/*   Index: index_of_vendor3                                    */
/* ============================================================ */
create index index_of_vendor3 on NewGoodsRetail (GoodsNo)
go

/* ============================================================ */
/*   Table: ImportantGoodsRetail                                */
/* ============================================================ */
create table ImportantGoodsRetail
(
    GoodsNo     TGoods                not null,
    RetailDate  Tdate                 not null,
    Amt         TAmt                  null    ,
    CostAmt     TAmt                  null    ,
    DisAmt      TAmt                  null    ,
    Qty         TQty                  null    ,
    constraint PK_ImportantGoodsRetail primary key (GoodsNo, RetailDate)
)
go

/* ============================================================ */
/*   Index: index_of_date32                                     */
/* ============================================================ */
create index index_of_date32 on ImportantGoodsRetail (RetailDate)
go

/* ============================================================ */
/*   Index: index_of_vendor32                                   */
/* ============================================================ */
create index index_of_vendor32 on ImportantGoodsRetail (GoodsNo)
go

/* ============================================================ */
/*   Table: ImportStat                                          */
/* ============================================================ */
create table ImportStat
(
    DeptNo      Tdept                 not null,
    GroupNo     TGroup                not null,
    ClassNo     TClass                not null,
    ImportDate  Tdate                 not null,
    Amt         TAmt                  null    ,
    NTaxAmt     TAmt                  null    ,
    Qty         TQty                  null    ,
    constraint PK_importstat primary key (DeptNo, GroupNo, ClassNo, ImportDate)
)
go

/* ============================================================ */
/*   Index: index_of_date22                                     */
/* ============================================================ */
create index index_of_date22 on ImportStat (ImportDate)
go

/* ============================================================ */
/*   Index: index_of_vendor22                                   */
/* ============================================================ */
create index index_of_vendor22 on ImportStat (GroupNo)
go

/* ============================================================ */
/*   Table: CategoryImportStat                                  */
/* ============================================================ */
create table CategoryImportStat
(
    CategoryNo  varchar(8)            not null,
    ImportDate  Tdate                 not null,
    Amt         TAmt                  null    ,
    NTaxAmt     TAmt                  null    ,
    Qty         TQty                  null    ,
    constraint PK_CATEGORYIMPORTSTAT primary key (CategoryNo, ImportDate)
)
go

/* ============================================================ */
/*   Index: index_of_date222                                    */
/* ============================================================ */
create index index_of_date222 on CategoryImportStat (ImportDate)
go

/* ============================================================ */
/*   Table: AllocStat                                           */
/* ============================================================ */
create table AllocStat
(
    DeptNo      Tdept                 not null,
    GroupNo     TGroup                not null,
    ClassNo     TClass                not null,
    AlloctDate  Tdate                 not null,
    Amt         TAmt                  null    ,
    NTaxAmt     TAmt                  null    ,
    Qty         TQty                  null    ,
    constraint PK_allocstat primary key (DeptNo, GroupNo, ClassNo, AlloctDate)
)
go

/* ============================================================ */
/*   Index: index_of_date223                                    */
/* ============================================================ */
create index index_of_date223 on AllocStat (AlloctDate)
go

/* ============================================================ */
/*   Index: index_of_vendor223                                  */
/* ============================================================ */
create index index_of_vendor223 on AllocStat (GroupNo)
go

/* ============================================================ */
/*   Table: GoodsAlloc                                          */
/* ============================================================ */
create table GoodsAlloc
(
    GoodsNO     TGoods                not null,
    AlloctDate  Tdate                 not null,
    Amt         TAmt                  null    ,
    NTaxAmt     TAmt                  null    ,
    CostAmt     TAmt                  null    ,
    Qty         TQty                  null    ,
    constraint PK_GOODSALLOC primary key (GoodsNO, AlloctDate)
)
go

/* ============================================================ */
/*   Index: index_of_date2232                                   */
/* ============================================================ */
create index index_of_date2232 on GoodsAlloc (AlloctDate)
go

/* ============================================================ */
/*   Table: GoodsSale                                           */
/* ============================================================ */
create table GoodsSale
(
    GoodsNO     TGoods                not null,
    SaleDate    Tdate                 not null,
    Amt         TAmt                  null    ,
    NTaxAmt     TAmt                  null    ,
    CostAmt     TAmt                  null    ,
    Qty         TQty                  null    ,
    constraint PK_GOODSALe primary key (GoodsNO, SaleDate)
)
go

/* ============================================================ */
/*   Index: index_of_date22322                                  */
/* ============================================================ */
create index index_of_date22322 on GoodsSale (SaleDate)
go

/* ============================================================ */
/*   Table: CustSaleStat                                        */
/* ============================================================ */
create table CustSaleStat
(
    CustNo      TVendor               not null,
    SaleDate    Tdate                 not null,
    Amt         TAmt                  null    ,
    NTaxAmt     TAmt                  null    ,
    Qty         TQty                  null    ,
    constraint PK_RetailSum primary key (CustNo, SaleDate)
)
go

/* ============================================================ */
/*   Index: index_of_date23                                     */
/* ============================================================ */
create index index_of_date23 on CustSaleStat (SaleDate)
go

/* ============================================================ */
/*   Index: index_of_vendor23                                   */
/* ============================================================ */
create index index_of_vendor23 on CustSaleStat (CustNo)
go

/* ============================================================ */
/*   Table: CustStat                                            */
/* ============================================================ */
create table CustStat
(
    DeptNo      Tdept                 not null,
    GroupNo     TGroup                not null,
    ClassNo     TClass                not null,
    SaleDate    Tdate                 not null,
    Amt         TAmt                  null    ,
    NTaxAmt     TAmt                  null    ,
    Qty         TQty                  null    ,
    constraint PK_custstat primary key (DeptNo, GroupNo, ClassNo, SaleDate)
)
go

/* ============================================================ */
/*   Index: index_of_date224                                    */
/* ============================================================ */
create index index_of_date224 on CustStat (SaleDate)
go

/* ============================================================ */
/*   Index: index_of_vendor222                                  */
/* ============================================================ */
create index index_of_vendor222 on CustStat (GroupNo)
go

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -