首页 > 数据库 > mysql教程 > A mysql problem. Help me!

A mysql problem. Help me!

WBOY
发布: 2016-06-06 09:33:30
原创
1013 人浏览过

mysqlsqlschema

why these statements are wrong ?
these statements are auto generated by mysql workbench

-- MySQL Workbench Forward Engineering

SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';


-- Schema SysBaseData



-- Schema SysBaseData


CREATE SCHEMA IF NOT EXISTS SysBaseData DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ;
SHOW WARNINGS;
USE SysBaseData ;


-- Table SysBaseData.Instruments


CREATE TABLE IF NOT EXISTS SysBaseData.Instruments (
InstrumentID CHAR(32) NOT NULL,
ExchangeID CHAR(12) NOT NULL,
InstrumentName CHAR(24) NULL,
PRIMARY KEY (InstrumentID, ExchangeID))
ENGINE = InnoDB;

SHOW WARNINGS;


-- Table SysBaseData.OrdersGroups


CREATE TABLE IF NOT EXISTS SysBaseData.OrdersGroups (
OrderGroup INT NOT NULL,
OrderRef CHAR(16) NOT NULL,
TradingDay DATE NOT NULL,
PRIMARY KEY (OrderRef, TradingDay, OrderGroup))
ENGINE = InnoDB;

SHOW WARNINGS;


-- Table SysBaseData.ErrorOrderRecords


CREATE TABLE IF NOT EXISTS SysBaseData.ErrorOrderRecords (
InstrumentID CHAR(32) NULL,
ExchangeID CHAR(12) NULL,
OrderPriceType CHAR NULL,
Direction CHAR NULL,
LimitPrice CHAR(16) NULL,
VolumeTotalOriginal INT NULL,
ErrorMsg CHAR(255) NULL,
OrderGroup INT NOT NULL,
OrderRef CHAR(16) NOT NULL,
TradingDay DATE NOT NULL,
PRIMARY KEY (TradingDay, OrderRef, OrderGroup),
CONSTRAINT fk_ErrorOrderRecords_1
FOREIGN KEY (TradingDay , OrderRef , OrderGroup)
REFERENCES SysBaseData.OrdersGroups (TradingDay , OrderRef , OrderGroup)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;

SHOW WARNINGS;

SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;

相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板