数据操作语言DML
操作数据库时注意数据库的完整性
insert into students
values(1001,1011,'张三','男',26-12月-1989','计算机');
insert into teachers(teacher_id,name,department_id)
values(10001,'张三',101);
insert into students_computer
(select * from student
where specialty='计算机');
update students set dob='16-12月-1989'
where student_id=1019;
delete from students
where specialty='计算机应用';
truncate table students;
事物控制语言TC
将DML作为一个单元来处理,事物开始时加表锁和行锁,commit或rollback后撤销
当执行DDL,DCL,退出sql.plus时自动提交.
insert into departments values(111,'地球物理','x号教学楼');
commit;
update departments set address='5号教学楼'
where departments_id=104;
rollback;
只读事务:set transaction read only;
顺序事务(获取瞬时数据,仍然可以DML):set transaction isolation level serializable;