博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
sql的注释和联合主键
阅读量:4552 次
发布时间:2019-06-08

本文共 1203 字,大约阅读时间需要 4 分钟。

1.添加注释的sql

comment on table tableName is '表注释';

comment on  column tableName.columnName is '字段注释说明';

comment on table t_cif_ehrlog is 'ehr同步日志表';

comment on column t_cif_ehrlog.id is '流水号';
comment on column t_cif_ehrlog.syn_date is '同步年月(yyyy-mm)';
comment on column t_cif_ehrlog.interface_type is '接口类型(编码)(ehrCompanyImpl 公司信息;ehrDeptImpl 部门信息;ehrPositionImpl 岗位信息;Impl 基本信息;ehrNationalImpl 证件信息;ehrBirthdayImpl 生日信息;ehrPhoneImpl 电话信息;ehrOrganizationImpl 机构信息;)';
comment on column t_cif_ehrlog.create_date is '入库时间(yyyy-mm-dd hh24:mi:ss)';
comment on column t_cif_ehrlog.update_date is '更新时间(yyyy-mm-dd hh24:mi:ss)';
comment on column t_cif_ehrlog.is_success is '状态(0:成功 1:失败)';
comment on column t_cif_ehrlog.error_message is '失败描述';

2.创建联合主键的sql

--ehr同步日志表

CREATE TABLE t_cif_EhrLog
(Id NUMBER not null,
 syn_Date VARCHAR2(20) not null,
 Interface_type VARCHAR2(30) not null,
 create_date DATE not null,
 update_date DATE,
 Is_success VARCHAR2(1) not null,
 error_message VARCHAR2(1000),
 CONSTRAINT PK_SIn
 primary key(syn_Date,Interface_type)
 );

说明:

主键:表中的可以唯一确定一个元组的属性。(通俗的解释就是,主键是可以唯一确定一条记录的列或列的组合)。它的作用是能够准确得定位一条记录。

联合主键也是为了能准确定位表中的唯一记录,一般用于多对多的情况中。

转载于:https://www.cnblogs.com/gfs-windy/p/3919021.html

你可能感兴趣的文章
office很抱歉遇到一些临时服务器问题
查看>>
禁止键盘上的刷新键F5等
查看>>
SAP中对于获取订单的状态
查看>>
oracle PL/SQL块
查看>>
CentOS7集群环境Elastic配置
查看>>
【EXCEL】指定の項目の内容一覧を表示
查看>>
Head first java chapter 4 对象的行为
查看>>
luogu_4503【题解】企鹅QQ 哈希
查看>>
linux 面试
查看>>
Linux:Gentoo系统的安装笔记(三)
查看>>
打开IE窗口并最大化显示
查看>>
Windows API SendMessage 和 PostMessage 内部实现
查看>>
服务器发送邮件出现Could not connect to SMTP host错误 解决办法
查看>>
sklearn.preprocessing.LabelBinarizer
查看>>
C teaching
查看>>
分隔指定内容,提取章节数
查看>>
this point
查看>>
leetcode 30 Substring with Concatenation of All Words
查看>>
验证登录信息是否合法
查看>>
线程池
查看>>