mysql建表与oracle_mysql和oracle建表语句以及数据类型的区别

1、mysql和oracle建表语句的区别

mysql

DROP TABLE IF EXISTS `order`;

CREATE TABLE `order` (

`id` int(11) NOT NULL AUTO_INCREMENT,

`number` varchar(255) NOT NULL COMMENT '工单编号',

`applicant` varchar(255) NOT NULL COMMENT '工单申请人',

`state` int(1) NOT NULL COMMENT '工单状态',

`count` int(4) NOT NULL COMMENT '个数',

`ctime` varchar(255) NOT NULL,

`depart` varchar(255) NOT NULL COMMENT '部门',

`projectname` varchar(255) NOT NULL COMMENT '项目名称',

PRIMARY KEY (`id`),

UNIQUE KEY `index_id` (`id`)

) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=utf8;

oracle

---创建表

create table ZHANGSAN.ORDER

(

id           NUMBER not null,

number    VARCHAR2(255),

applicant VARCHAR2(255),

state     NUMBER(1),

count     NUMBER(6),

ctime     VARCHAR2(30),

depart    VARCHAR2(255),

projectname  VARCHAR2(255)

)

---为每一行添加注释

comment on column ZHANGSAN.ORDER.number

is '工单编号';

comment on column ZHANGSAN.ORDER.applicant

is '工单申请人';

comment on column ZHANGSAN.ORDER.state

你可能感兴趣的:(mysql建表与oracle)