Oracle增删改查sql语句--创建表空间
create tablespace waterboss基本的增删改查语句
datafile 'd:\waterboss.dbf'
size 100m
autoextend on
next 10m
--创建⽤户
create user wateruser
identified by011220
default tablespace waterboss
--给⽤户赋予dba权限
grant dba to wateruser
create table t_owners
(
id number primary key,
name varchar2(30),
addressid number,
housenumber varchar2(30),
watermeter varchar2(30),
adddate date,
ownertypeid number
);
create table t_ownertype
(
id number primary key,
name varchar2(30)
)
create table t_pricetable
(
id number primary key,
price number(10,2),
ownertypeid number,
minnum number(10,2),
maxnum number(10,2)
)
create table t_area
(
id number primary key,
name varchar2(30)
)
create table t_operator
(
id number primary key,
name varchar2(30)
)
create table t_address
(
id number primary key,
name varchar2(30),
areaid number,
operatorid number
)
create table t_account
(
id number primary key,
ownerid number,
ownertypeid number,
areaid number,
year char(4),
month char(4),
num0 number,
num1 number,
usenum number,
meteruserid number,
meterdate date,
money number(10,2),
isfee char(1),
feedate date,
feeuserid number
)
insert into t_ownertype(id,name) values(1,'居民');
commit;
insert into t_owners values(1,'张三丰',1,'1-1','123456',sysdate,1); commit;
insert into t_ownertype values(3,'企业');
commit;
update t_owners set adddate=adddate-8where id=1; commit;
delete from t_owners where id=1;
commit;
truncate table t_ownertype

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。