乡、社区的区域编码数据库表结构Sql

-- Create table
create table REGION_CODE
(
PROVINCE CHAR(2) not null,
MUNICIPAL CHAR(2) not null,
COUNTY CHAR(2) not null,
TOWNSHIP CHAR(3) not null,
VILLAGE CHAR(3) not null,
REGION_TYPE CHAR(3) not null,
NAME VARCHAR2(50) not null,
CODE CHAR(15) not null,
REGION_NAME VARCHAR2(50),
ID NUMBER(11),
PID NUMBER(11),
RANK CHAR(1)
)
tablespace USERS
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 7M
minextents 1
maxextents unlimited
);
-- Add comments to the columns
comment on column REGION_CODE.PROVINCE
is '省级地级';
comment on column REGION_CODE.MUNICIPAL
is '地级';
comment on column REGION_CODE.COUNTY
is '县级';
comment on column REGION_CODE.TOWNSHIP
is '乡级';
comment on column REGION_CODE.VILLAGE
is '村级';
comment on column REGION_CODE.REGION_TYPE
is '城乡分类';
comment on column REGION_https://www.360docs.net/doc/518449746.html,
is '名称';
comment on column REGION_CODE.CODE
is '编码';
comment on column REGION_CODE.REGION_NAME
is '区域名称';
comment on column REGION_CODE.ID
is 'ID';
comment on column REGION_CODE.PID
is '父节点ID';
comment on column REGION_CODE.RANK
is '级别';
-- Create/Recreate primary, unique and foreign key constraints
alter table REGION_CODE
add constraint REGION_CODE_PK primary key (CODE)
using index
tablespace USERS
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 2M
minextents 1
maxextents unlimited
);

相关文档
最新文档