1、建表
create table student (
id number(10,0) not null,
uname varchar2(255 char),
pword varchar2(255 char),
primary key (id)
);
2、插入
insert into student values(1,'张三','qweerwe');
insert into student values(2,'李四','asdff');
insert into student values(4,'王五7','ry123');
insert into USERINFODZ(USERNAME,USERPWD,age) values('Z自己56','322',56);
3、查询
全部查询
select * from student;
条件查询
(select * from USERINFODZ where age>15)
4、增加列、删除列
alter table USERINFODZ add agee number(10,0)
alter table USERINFODZ drop column agee
5、查询 like语句
select * from USERINFODZ where username LIKE '%围%'
只有包含“围”
select * from USERINFODZ where username LIKE '围%'
开头是“围”
select * from USERINFODZ where username LIKE '%围'
结束是“围”
6、修改语句
update student set uname='萨拉赫' where uname = '内马尔'
附:
总数:select count * as totalcount from table1
oracle查询总数:select count(*) from student;
求和:select sum(field1) as sumvalue from table1
平均:select avg(field1) as avgvalue from table1
最大:select max(field1) as maxvalue from table1
最小:select min(field1) as minvalue from table1