,这是与MySQL区别的一点。所以用于mysql的.sql文件,用oracle打开可能会报错
oracle中 select
commit
oracle中的事务需要手动commit提交
在Oracle中,
COMMIT
语句提交当前事务的所有更改。发出提交后,其他用户将能够看到您的更改。
rollback
rollback是与commit对应的
是undo
已提交了的事务不能rollback
Oracle中的引号和反引号`
Oracle中没有反引号`,使用会报错的
Oracle中不能这么写
CREATE TABLE `ACTIVILLAGE` ( `CODEVILLAGE` number(11) , `NUMACTIVITY` number(11) , `PRICEACTIVITY` number(11) ); 需要这么写 CREATE TABLE ACTIVILLAGE ( CODEVILLAGE number(11) , NUMACTIVITY number(11) , PRICEACTIVITY number(11) );
否则会报错的
只有在字符串字段的时候可以用''引号引起来,但是也必须是单引号,用双引号也会报错
数据导入
@c:/HM1_db.sql;
查看数据表
select TABLE_NAME from user_tables;
select sysdate from dual;
显示系统时间
建表
create table student( stuno number(4), sname varchar2(20), incard varchar2(18), age number(3), sex char(2) );
删除表
drop table student;
插入数据
insert into student values(0316,'hxx','123',20,'M');
查询数据
select * from student;
修改数据
update student set sname='hxx1' where stuno='0316'; commit;
删除数据
delete from student where sname='hxx1';
查询
可以这么写
from employees e, job_grades j
select employee_id, last_name,salary,grade_level from employees e, job_grades j where e.salary between j.lowest_sal and j.highest_sal
查看索引
查看该表的所有索引
SELECT * FROM ALL_INDEXES WHERE TABLE_NAME='ARTIST';
clustered factor也在这
查看该表的所有索引列
就是在这个表上的哪个列建立了索引
SELECT * FROM all_ind_columns WHERE TABLE_NAME='ARTIST';
alter table COUNTRY nologging;
最小化日志产生的数量
Oracle数据库命令
最新推荐文章于 2024-07-01 11:18:54 发布