Additions and deletions to the data table 03

In relational database, data are stored in the table, the article explains how additions and deletions to the data table.

1 system, the environment and the premise of restraint

2 operation

  • System Administrator cmd to start a command line
    To start the system administrator cmd
  • Execute the following command
# 在windows命令行下连接scott
sqlplus scott/tiger
# 创建一张表t_user[创建之前先删除];
drop table t_user;
create table t_user(id int,name varchar(20));
# 插入三条记录,并且提交
insert into t_user(id,name) values(1,'zhangli');
insert into t_user(id,name) values(2,'xiaoli');
insert into t_user(id,name) values(3,'wanhe');
# 修改一条记录,将id为3的用户名称修改为jiangsuwanhe
update t_user set name = 'jiangsuwanhe' where id=3;
# 删除一条记录,将id为3的用户删除
delete from t_user where id = 3;
# 截断这张表,即不加日志的删除
truncate table t_user;

Deletions above is changed to the data table.

Guess you like

Origin www.cnblogs.com/alichengxuyuan/p/12577015.html