The way to Oracle Learning-SQL articles-preliminary data
Start to turn to Oracle and record your learning process.
Let's create some tables first:
-/ create student table create table student (sno varchar2 (10) primary key, sname varchar2 (20), sage number (2), ssex varchar2 (5));-/ create teacher table create table teacher (tno varchar2 (10) primary key,tname varchar2 (20)) -/ create course schedule create table course (cno varchar2 (10), cname varchar2 (20), tno varchar2 (20), constraint pk_course primary key (cno,tno));-/ create course schedule create table sc (sno varchar2 (10), cno varchar2 (10), score number (4jue 2), constraint pk_sc primary key (sno,cno)) -/ Operation / * initialize the data of the student table * / insert into student values ('s001Zhangsan', 23pRO 'male'); insert into student values ('s002Zhisi', 23SCHM 'male'); insert into student values ('s003Zhong' Wu Peng', 25here.' male') Insert into student values ('s004 Zhi Qinqin', 20 'female'); insert into student values ('s005 Zhi' Wang Li', 20 'female'); insert into student values ('s006 Zhi' Li Bo', 21 'male'); insert into student values ('s007 Zhi' Liu Yu', 21 'male'); insert into student values ('s008 Zhi' Xiao Rong', 21 'female'); insert into student values ('s009Zhi' Chen Xiao Xiao', 23 'female') Insert into student values; commit;/* initialization teacher list * * / insert into teacher values ('t001century,' Liu Yang'); insert into teacher values ('t002century,' Chen Yan'); insert into teacher values ('t003mom,' Hu Xing'); commit / * initialize the course schedule * * / insert into course values ('c001'); insert into course values (' c002'); insert into course values ('c003'); insert into course values (' c004'). Insert into course values ('c005'); insert into course values ('c006'); insert into course values ('c007'); insert into course values ('c008'); insert into course values ('c009'); insert into course values ('c009'); insert into course values ('c010); commit (' c010) / * initialize the score sheet * * / insert into sc values (78.9 for c001); insert into sc values (80.9 for c001); insert into sc values (81.9 for c003); insert into sc values (60.9 for c001) Insert into sc values (82.9); insert into sc values (72.9); insert into sc values (81.9); insert into sc values (59')