1、创建数据库:
1 -- Create table 2 create table SCHOOL 3 ( 4 studentno VARCHAR2(40) not null, 5 name VARCHAR2(10), 6 age NUMBER, 7 classname VARCHAR2(40) 8 ) 9 tablespace ABC 10 pctfree 10 11 initrans 1 12 maxtrans 255 13 storage 14 ( 15 initial 64K 16 next 8K 17 minextents 1 18 maxextents unlimited 19 ); 20 -- Add comments to the columns 21 comment on column SCHOOL.studentno 22 is '学号'; 23 comment on column SCHOOL.name 24 is '姓名'; 25 comment on column SCHOOL.age 26 is '年龄'; 27 comment on column SCHOOL.classname 28 is '班级';
2、插入数据:
1 insert into school values ('201623801','小王',21,'238'); 2 insert into school values ('201623802','小李',21,'238'); 3 insert into school values ('201623803','小赵',21,'238'); 4 insert into school values ('201623804','小钱',22,'238'); 5 insert into school values ('201623805','小孙',22,'238'); 6 insert into school values ('201623806','小周',22,'238'); 7 insert into school values ('201623807','小吴',23,'238'); 8 insert into school values ('201623808','小王',23,'238');