一、实验目的
熟悉数据库的数据更新操作,能够使用 SQL 语句对数据库进行数据的增加、删除、修改、操作。
二、实验内容和要求
针对自建数据库 test 设计单行插入、批量插入、修改和删除数据操作,理解和掌握 insert、delete 和 update 语法结构的各个组成成分,结合嵌套 SQL 子查询,分别设计几种不同形式的语句,并调试通过。
三、实验步骤
- 给供应商表插入一条记录,每列的值要给的合理。
insert into supplier values (0,'XXX','天津市北辰区西平道5340号',40,151******55,0.00,NULL);
- 新建一个顾客表(customernew),把所有中国籍顾客的信息插入到顾客表。
create table customernew as select *from customer where nationkey in (select nationkey from nation where nation.name = '中国');