`

全国行政区域数据库(地市数据库)

 
阅读更多
创建表格:

-- Create table

create table WEBSITE_AREA
(
  area_id    NUMBER(18) not null,
  area_name  VARCHAR2(50) not null,
  parent_id  NUMBER(18) not null,
  area_level NUMBER(3) not null,
  status     NUMBER(1) default 1 not null
);

-- Add comments to the columns
comment on column WEBSITE_AREA.area_id is '区域编号';
comment on column WEBSITE_AREA.area_name is '区域名称';
comment on column WEBSITE_AREA.parent_id is '父级编号';
comment on column WEBSITE_AREA.area_level is '区域等级(1省/2市/3区县)';
comment on column WEBSITE_AREA.status is '状态(1可用/0不可用)';


-- Create/Recreate primary, unique and foreign key constraints

alter table WEBSITE_AREA add constraint PK_WEBSITE_AREA primary key (AREA_ID);
alter table WEBSITE_AREA add constraint UK_WEBSITE_AREA unique (AREA_ID, PARENT_ID);

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics