《实时雨水情数据库表结构与标识符标准》(2005)水情数据库建库脚本

实时雨水情数据库表结构与标识符标准
Standard for Structure and Identifier in Real-time Hydrological Information Database
--------------

        为了推动水情工作的技术进步,统一技术标准,加强科学管理,更加适应防汛抗旱、水资源管理及国民经济建设的需要,为社会提供及时、准确、全面的水情信息,提高水情信息的共享水平,在认真总结实践经验的基础上,按照1989年4月实施的《中华人民共和国标准化法》和2003年3月实施的《水利技术标准编写规定》(SL 1—2002),制定本标准。
本标准主要技术内容包括:
——确立了实时雨水情数据库表结构设计的技术要求;
——规定了实时雨水情数据库表结构标识符命名的基本原则;
——给出了降水、蒸发、河道、水库、闸坝、泵站、潮汐、沙情、冰情、地下水、墒情、特殊水情、水文预报等13大类实时雨水情数据的存储结构。


本标准批准部门:中华人民共和国水利部
本标准主持机构:水利部水文局
本标准解释单位:水利部水文局
本标准主编单位:水利部水利信息中心
本标准参编单位:水利部长江水利委员会水文局
水利部黄河水利委员会水文局
本标准出版、发行单位:中国水利水电出版社
本标准主要起草人: 刘金平  程益联  李根峰  林成华  周新春  陈祖华 程海云  闵要武  王金星  殴阳春  毛学文  张建新  周  励  黄藏青  李学春
本标准审查会议技术负责人:金兴平  赵卫民
本标准体例格式审查人: 牟广丞

 -------------


/* FRNFDR 标准为N(3),应为int型,脚本中为float型 */

/*   use RWDBTEST  */
/*   go            */


create table ST_STBPRP_B
(
    STCD      char(8)                not null,
    STNM      char(30)               null    ,
    RVNM      char(30)               null    ,
    HNNM      char(30)               null    ,
    BSNM      char(30)               null    ,
    LGTD      char(7)                null    ,
    LTTD      char(6)                null    ,
    STLC      char(30)               null    ,
    ADDVCD    char(6)                null    ,
    MDBZ      float                  null    ,
    MDPR      float                  null    ,
    DTMNM     char(16)               null    ,
    DTMEL     float                  null    ,
    STTP      char(2)                null    ,
    DFRTMS    int                    null   
        constraint CKC_DFRTMS_ST_STBPRP check (
            DFRTMS in (0,1,2,4,8,12,24))     ,
    FRITM     char(32)               null    ,
    FRGRD     char(1)                null   
        constraint CKC_FRGRD_ST_STBPRP check (
            FRGRD in ('1','2','3'))          ,
    BGFRYM    char(6)                null    ,
    EDFRYM    char(6)                null    ,
    ADMAUTH   char(10)               not null,
    STBK      char(1)                null    ,
    DRNA      int                    null    ,
    PHCD      char(6)                null 
)

create unique clustered index ST_STBPRP_BI on ST_STBPRP_B (STCD)


create table ST_ST58_B
(
    STCD      char(8)                not null,
    FRSTCD    char(5)                null   
)

create unique clustered index ST_ST58_BI on ST_ST58_B (STCD)


create table ST_RSVRSTRL_B
(
    STCD       char(8)                not null,
    RLSTCD     char(8)                not null,
    IOMRK      char(1)                not null
        constraint CKC_IOMRK_ST_RSVRSTRL check (
            IOMRK in ('I','O','Z'))
)

create unique clustered index ST_RSVRSTRL_BI on ST_RSVRSTRL_B (STCD, RLSTCD, IOMRK)


create table ST_WASRL_B
(
    STCD      char(8)                not null,
    RLSTCD    char(8)                not null,
    RLMRK     char(1)                not null
        constraint CKC_RLMRK_ST_WASRL check (
            RLMRK in ('D','U','L'))
)

create unique clustered index ST_WASRL_BI on ST_WASRL_B (STCD, RLSTCD, RLMRK)


create table ST_RVFCCH_B
(
    STCD      char(8)                not null,
    LDKEL     float                  null    ,
    RDKEL     float                  null    ,
    WRZ       float                  null    ,
    WRQ       float                  null    ,
    GRZ       float                  null    ,
    GRQ       float                  null    ,
    FLPQ      float                  null    ,
    OBHTZ     float                  null    ,
    OBHTZTM   datetime               null    ,
    IVHZ      float                  null    ,
    IVHZTM    datetime               null    ,
    OBMXQ     float                  null    ,
    OBMXQTM   datetime               null    ,
    IVMXQ     float                  null    ,
    IVMXQTM   datetime               null    ,
    HMXS      float                  null    ,
    HMXSTM    datetime               null    ,
    HMXAVV    float                  null    ,
    HMXAVVTM  datetime               null    ,
    HLZ       float                  null    ,
    HLZTM     datetime               null    ,
    HMNQ      float                  null    ,
    HMNQTM    datetime               null   
)

create unique clustered index ST_RVFCCH_BI on ST_RVFCCH_B (STCD)


create table ST_RSVRFCCH_B
(
    STCD       char(8)                not null,
    DAMEL      float                  null    ,
    CKFLZ      float                  null    ,
    DSFLZ      float                  null    ,
    NORMZ      float                  null    ,
    DDZ        float                  null    ,
    ACTZ       float                  null    ,
    TTCP       float                  null    ,
    FLDCP      float                  null    ,
    ACTCP      float                  null    ,
    DDCP       float                  null    ,
    HHRZ       float                  null    ,
    HHRZTM     datetime               null    ,
    HMXINQ     float                  null    ,
    RSTDR      float                  null    ,
    HMXINQTM   datetime               null    ,
    HMXW       float                  null    ,
    HMXWTM     datetime               null    ,
    RHMXOTQ    float                  null    ,
    RHMXOTQTM  datetime               null   
)

create unique clustered index ST_RSVRFCCH_BI on ST_RSVRFCCH_B (STCD)


create table ST_RSVRFSR_B
(
    STCD        char(8)                not null,
    ACTYR       int                    not null,
    BGMD        char(4)                not null,
    EDMD        char(4)                null    ,
    FSLTDZ      float                  null    ,
    FSTP        char(1)                null
        constraint CKC_FSTP_ST_RSVRFSR check (
            FSTP in ('0','1','2','3'))
)

create unique clustered index ST_RSVRFSR_BI on ST_RSVRFSR_B (STCD, ACTYR, BGMD)


create table ST_FSDR_B
(
    UPSTCD       char(8)                not null,
    DWSTCD       char(8)                not null,
    RCHLEN       int                    null    ,
    SFTQ         float                  null    ,
    QMGN         int                    not null,
    MNTRTM       float                  null    ,
    MXTRTM       float                  null    ,
    AVTRTM       float                  null   
)

create unique clustered index ST_FSDR_BI on ST_FSDR_B (UPSTCD, DWSTCD, QMGN)


create table ST_ZQRL_B
(
    STCD        char(8)                not null,
    BGTM        datetime               not null,
    PTNO        int                    not null,
    Z           float                  not null,
    Q           float                  not null
)

create unique clustered index ST_ZQRL_BI on ST_ZQRL_B (STCD, BGTM, PTNO)


create table ST_ZQRLSYN_B
(
    STCD       char(8)                not null,
    YR         int                    not null, 
    PTNO       int                    not null,
    Z          float                  not null,
    Q          float                  not null   
)

create unique clustered index ST_ZQRLSYN_BI on ST_ZQRLSYN_B (STCD, YR, PTNO)


create table ST_ZVARL_B
(
    STCD      char(8)                not null,
    MSTM      datetime               not null,
    RZ        float                  not null,
    W         float                  null    ,
    WSFA      int                    null   
)

create unique clustered index ST_ZVARL_BI on ST_ZVARL_B (STCD, MSTM, RZ)


create table ST_ZQFRAR_B
(
    STCD       char(8)                not null,
    TPCYR      int                    not null,
    RCINT      int                    not null,
    Q          float                  null    ,
    Z          float                  null    ,
    W1         float                  null    ,
    W3         float                  null    ,
    W5         float                  null    ,
    W7         float                  null    ,
    W10        float                  null    ,
    W15        float                  null    ,
    W30        float                  null    ,
    W60        float                  null   
)

create unique clustered index ST_ZQFRAR_BI on ST_ZQFRAR_B (STCD, TPCYR, RCINT)


create table ST_FRAPAR_B
(
    STCD       char(8)                not null,
    TPCYR      int                    not null,
    AVRG       float                  not null,
    VARTP      char(3)                not null
        constraint CKC_VARTP_ST_FRAPAR check (
            VARTP in ('Z','Q','W1','W3','W5','W7','W10','W15','W30','W60')),
    CV         float                  not null,
    CS         float                  not null,
    BGYR       int                    not null,
    EDYR       int                    not null,
    SPNUM      int                    not null
)

create unique clustered index ST_FRAPAR_BI on ST_FRAPAR_B (STCD, TPCYR, VARTP)


create table ST_MYAVSRI_B
(
    STCD      char(8)                not null,
    SRNO      char(4)                not null,
    ACTFLG    char(1)                null   
         constraint CKC_ACTFLG_ST_MYAVSRI check (
            ACTFLG in ('','0','1')),
    BGYR      int                    null    ,
    EDYR      int                    null    ,
    STTYRNUM  int                    null   
)

create unique clustered index ST_MYAVSRI_BI on ST_MYAVSRI_B (STCD, SRNO)


create table ST_RSVRMYAV_B
(
    STCD      char(8)                not null,
    SRNO      char(4)                not null,
    MTHDY     char(4)                not null,
    MYRAVW    float                  null      
)

create unique clustered index ST_RSVRMYAV_BI on ST_RSVRMYAV_B (STCD, SRNO, MTHDY)


create table ST_PDMMYAV_B
(
    STCD      char(8)                not null,
    SRNO      char(4)                not null,
    MNTH      int                    not null
        constraint CKC_MNTH_ST_PDMMYAV check (
            MNTH between 1 and 12),
    PRDTP     int                    not null
        constraint CKC_PRDTP_ST_PDMMYAV check (
            PRDTP in (1,2,3,4)),
    MYAVP     float                  null      
)

create unique clustered index ST_PDMMYAV_BI on ST_PDMMYAV_B (STCD, SRNO, MNTH, PRDTP)


create table ST_RVSECT_B
(
    STCD       char(8)                not null,
    MSTM       datetime               not null,
    VTNO       char(4)                not null,
    DI         float                  not null,
    ZB         float                  not null   
)

create unique clustered index ST_RVSECT_BI on ST_RVSECT_B (STCD,MSTM,VTNO)


create table ST_INSTCD_B
(
    RLSINSTCD char(8)                not null,
    INSTNM    char(40)               null    ,
    ADMAUTH   char(10)               null  
)

create unique clustered index ST_INSTCD_BI on ST_INSTCD_B (RLSINSTCD)


/* REAL_TIME TABLE */

create table ST_PPTN_R
(
    STCD      char(8)                not null,
    TM        datetime               not null,
    DRP       float                  null    ,
    INTV      float                  null    ,
    PDR       float                  null    ,
    DYP       float                  null    ,
    WTH       char(1)                null   
        constraint CKC_WTH_ST_PPTN_1 che

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值