如何给表字段添加描述信息
Posted 当时年少春衫薄
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了如何给表字段添加描述信息相关的知识,希望对你有一定的参考价值。
-----------创建表空间
create tablespace auctionDB
datafile ‘E:\OracleDB\System_TableSpace\auctionDB.dbf‘
size 10M
Autoextend on
------------删除表空间
drop Tablespace auction
------------删除约束
alter table auctionRecord
drop constraint FK_rec_REF_user;
------------创建约束
create unique index Index_1 on auctionUser (
userName ASC
);
------------删除索引
drop index Index_1;
------------删除表信息
drop table auction cascade constraints;
------------创建表
create table auction (
auctionId number(6) not null,
auctionName nvarchar2(50) not null,
auctionStartPrice number(9,2) not null,
auctionUpset number(9,2) not null,
auctionStartTime TIMESTAMP not null,
auctionEndTime TIMESTAMP not null,
auctionPic BLOB not null,
auctionPicType nvarchar2(20) not null,
auctionDesc nvarchar2(500),
constraint PK_AUCTION primary key (auctionId)
)tablespace auctionDB;
create table auctionRecord (
id number(9) not null,
userId number(6),
auctionId number(6) not null,
auctionTime TIMESTAMP default SYSDATE not null,
auctionPrice number(9,2) not null,
constraint PK_AUCTIONRECORD primary key (id),
constraint FK_rec_REF_user foreign key (userId)
references auctionUser (userId),
constraint FK_rec_REF_AUC foreign key (auctionId)
references auction (auctionId)
)tablespace auctionDB;
------------添加表的描述信息
comment on table auction is
‘拍卖品‘;
comment on column auction.auctionId is
‘拍卖品编号‘;
comment on column auction.auctionName is
‘拍卖品名称‘;
以上是关于如何给表字段添加描述信息的主要内容,如果未能解决你的问题,请参考以下文章
sql server,如何给表和字段添加备注,并更新备注,以及查询备注
在高并发高负载的情况下,如何给表添加字段并设置DEFAULT值?
在高并发高负载的情况下,如何给表添加字段并设置DEFAULT值?