码迷,mamicode.com
首页 > 数据库 > 详细

mysql设计

时间:2019-11-24 09:54:44      阅读:70      评论:0      收藏:0      [点我收藏+]

标签:color   comm   assets   limit   exp   单位   flag   amount   default   

mysql设计

# 日线行情
CREATE TABLE daily_data (
    ts_code char(9) COMMENT "ts代码",
    trade_date DATE COMMENT "交易日期",
    open FLOAT(10) COMMENT "开盘价",
    close FLOAT(10) COMMENT "收盘价",
    pre_close FLOAT(10) COMMENT "昨收价",
    pct_chg FLOAT(10) COMMENT "涨跌幅",
    amount FLOAT(12) COMMENT "成交额【单位:千元,】"
)ENGINE = INNODB DEFAULT CHARSET = utf8mb4;

# 沪深港通资金流向
CREATE TABLE hsgt_data(
    trade_date DATE COMMENT "交易日期",
    ggt_ss FLOAT(12) COMMENT "港股通【南向资金:沪】"
    ggt_sz FLOAT(12) COMMENT "港股通【南向资金:深】"
    hgt FLOAT(12) COMMENT "沪港通【北向资金:沪】"
    sgt FLOAT(12) COMMENT "深港通【北向资金:深】"
)ENGINE = INNODB DEFAULT CHARSET = utf8mb4;

# 分红送股数据
CREATE TABLE history_dividend_data(
    ts_code CHAR(9) COMMENT "ts代码",
    ann_date DATE COMMENT "预案公告日"
    div_proc CHAR() COMMENT "实施进度"
    stk_div FLOAT() COMMENT "每股送转"
    cash_div FLOAT() COMMENT "每股分红(税后)"
    ex_date DATE COMMENT "除权除息日"
)ENGINE = INNODB DEFAULT CHARSET = utf8mb4;

# 股东人数
CREATE TABLE holder_data(
    ts_code CHAR() COMMENT "ts代码"
    ann_date DATE COMMENT "公告日期"
    holder_num INT() COMMENT "股东人数"
)ENGINE = INNODB DEFAULT CHARSET = utf8mb4;

# 每日涨跌停统计
CREATE TABLE limit_price_data(
    trade_date DATE COMMENT "交易日期"
    ts_code CHAR() COMMENT "股票代码"
    fc_ratio FLOAT() COMMENT "封单金额/日成交金额"
    fd_amount FLOAT() COMMENT "封单金额"
    first_time TIME COMMENT "首次涨停时间"
    last_time TIME COMMENT "最后封板时间"
    open_times INT() COMMENT "打开次数"
    "limit" CHAR() COMMENT "涨跌停"
)ENGINE = INNODB DEFAULT CHARSET = utf8mb4;

# 龙虎榜每日明细
CREATE TABLE top_data(
    trade_date CHAR() COMMENT "交易日期"
    ts_code CHAR() COMMENT "ts代码"
    turnover_rate FLOAT() COMMENT "换手率"
    amount FLOAT() COMMENT "总成交额"
    l_sell FLOAT() COMMENT "龙虎榜卖出额"
    l_buy FLOAT()    COMMENT "龙虎榜买入额"
    l_amount FLOAT() COMMENT "龙虎榜成交额"
    reason CHAR() COMMENT "上榜理由"
)ENGINE = INNODB DEFAULT CHARSET = utf8mb4;

# 龙虎榜机构交易明细
CREATE TABLE yyb_data(
    trade_date DATE COMMENT "交易日期"
    ts_code CHAR() COMMENT "ts代码"
    exalter CHAR() COMMENT "营业部卖出"
    buy FLOAT() COMMENT "买入额"
    sell FLOAT() COMMENT "卖出额"
    net_buy FLOAT() COMMENT "净成交额"
)ENGINE = INNODB DEFAULT CHARSET = utf8mb4;

# 前10大流通股东
CREATE TABLE top10_flowholder_data(
 ts_code CHAR() COMMENT "ts代码"
 ann_date DATE COMMENT "公告日期"
 holder_name CHAR() COMMENT "股东名称"
 hold_amount FLOAT() COMMENT "持有数量"
)ENGINE = INNODB DEFAULT CHARSET = utf8mb4;

# 大宗交易
CREATE block_trade_data(
    ts_code CHAR() COMMENT ""
    trade_date DATE COMMENT ""
    price FLOAT() COMMENT ""
    amount FLOAT() COMMENT ""
    buyer CHAR() COMMENT ""
    seller CHAR() COMMENT ""
)ENGINE = INNODB DEFAULT CHARSET = utf8mb4;

# 每日指标
CREATE TABLE daily_basic_data(
 ts_code
 trade_date
 turnover_rate_f "实际换手率"
 pe "市盈率"
 pb "市净率"
 ps "市销率"
 total_share "总股本"
 flat_share "流通股本"
 free_share "自由流通股本"
 total_mv "总市值"
 circ_mv "流通市值"
)

# 财务指标
CREATE TABLE fina_index_data(
    ts_code
    end_date "报告期"
    eps "基本每股收益"
    capital_rese_ps "每股资本公积"
    undist_profit_ps "每股未分配利润"
    profit_dedt "扣除非经常性损益后的净利润"
    op_income "经营活动净收益"
    bps "每股净资产"
    roic "投入资本回报率"
    debt_to_assets "资产负债率"
    turn_days "营业周期"
    dt_netprofit_yoy "扣非净利润同比增长率"
    rd_exp "研发费用"
    update_flag "更新标识"
)

 

# 日线行情CREATE TABLE daily_data (ts_code char(9) COMMENT "ts代码",trade_date DATE COMMENT "交易日期",open FLOAT(10) COMMENT "开盘价",close FLOAT(10) COMMENT "收盘价",pre_close FLOAT(10) COMMENT "昨收价",pct_chg FLOAT(10) COMMENT "涨跌幅",amount FLOAT(12) COMMENT "成交额【单位:千元,】")ENGINE = INNODB DEFAULT CHARSET = utf8mb4;
# 沪深港通资金流向CREATE TABLE hsgt_data(trade_date DATE COMMENT "交易日期",ggt_ss FLOAT(12) COMMENT "港股通【南向资金:沪】"ggt_sz FLOAT(12) COMMENT "港股通【南向资金:深】"hgt FLOAT(12) COMMENT "沪港通【北向资金:沪】"sgt FLOAT(12) COMMENT "深港通【北向资金:深】")ENGINE = INNODB DEFAULT CHARSET = utf8mb4;
# 分红送股数据CREATE TABLE history_dividend_data(ts_code CHAR(9) COMMENT "ts代码",ann_date DATE COMMENT "预案公告日"div_proc CHAR() COMMENT "实施进度"stk_div FLOAT() COMMENT "每股送转"cash_div FLOAT() COMMENT "每股分红(税后)"ex_date DATE COMMENT "除权除息日")ENGINE = INNODB DEFAULT CHARSET = utf8mb4;
# 股东人数CREATE TABLE holder_data(ts_code CHAR() COMMENT "ts代码"ann_date DATE COMMENT "公告日期"holder_num INT() COMMENT "股东人数")ENGINE = INNODB DEFAULT CHARSET = utf8mb4;
# 每日涨跌停统计CREATE TABLE limit_price_data(trade_date DATE COMMENT "交易日期"ts_code CHAR() COMMENT "股票代码"fc_ratio FLOAT() COMMENT "封单金额/日成交金额"fd_amount FLOAT() COMMENT "封单金额"first_time TIME COMMENT "首次涨停时间"last_time TIME COMMENT "最后封板时间"open_times INT() COMMENT "打开次数""limit" CHAR() COMMENT "涨跌停")ENGINE = INNODB DEFAULT CHARSET = utf8mb4;
# 龙虎榜每日明细CREATE TABLE top_data(trade_date CHAR() COMMENT "交易日期"ts_code CHAR() COMMENT "ts代码"turnover_rate FLOAT() COMMENT "换手率"amount FLOAT() COMMENT "总成交额"l_sell FLOAT() COMMENT "龙虎榜卖出额"l_buy FLOAT()COMMENT "龙虎榜买入额"l_amount FLOAT() COMMENT "龙虎榜成交额"reason CHAR() COMMENT "上榜理由")ENGINE = INNODB DEFAULT CHARSET = utf8mb4;
# 龙虎榜机构交易明细CREATE TABLE yyb_data(trade_date DATE COMMENT "交易日期"ts_code CHAR() COMMENT "ts代码"exalter CHAR() COMMENT "营业部卖出"buy FLOAT() COMMENT "买入额"sell FLOAT() COMMENT "卖出额"net_buy FLOAT() COMMENT "净成交额")ENGINE = INNODB DEFAULT CHARSET = utf8mb4;
# 前10大流通股东CREATE TABLE top10_flowholder_data( ts_code CHAR() COMMENT "ts代码" ann_date DATE COMMENT "公告日期" holder_name CHAR() COMMENT "股东名称" hold_amount FLOAT() COMMENT "持有数量")ENGINE = INNODB DEFAULT CHARSET = utf8mb4;
# 大宗交易CREATE block_trade_data(ts_code CHAR() COMMENT ""trade_date DATE COMMENT ""price FLOAT() COMMENT ""amount FLOAT() COMMENT ""buyer CHAR() COMMENT ""seller CHAR() COMMENT "")ENGINE = INNODB DEFAULT CHARSET = utf8mb4;
# 每日指标CREATE TABLE daily_basic_data( ts_code trade_date turnover_rate_f "实际换手率" pe "市盈率" pb "市净率" ps "市销率" total_share "总股本" flat_share "流通股本" free_share "自由流通股本" total_mv "总市值" circ_mv "流通市值")
# 财务指标CREATE TABLE fina_index_data(ts_codeend_date "报告期"eps "基本每股收益"capital_rese_ps "每股资本公积"undist_profit_ps "每股未分配利润"profit_dedt "扣除非经常性损益后的净利润"op_income "经营活动净收益"bps "每股净资产"roic "投入资本回报率"debt_to_assets "资产负债率"turn_days "营业周期"dt_netprofit_yoy "扣非净利润同比增长率"rd_exp "研发费用"update_flag "更新标识")

mysql设计

标签:color   comm   assets   limit   exp   单位   flag   amount   default   

原文地址:https://www.cnblogs.com/Iceredtea/p/11921185.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!