1、建立两张表进行存储过程深入学习
create table STUDENT ( USER_ID VARCHAR2(64), STUDENT_NAME VARCHAR2(64), AGE NUMBER(2), STUDENT_ID VARCHAR2(64), MOBILE VARCHAR2(64) ); create table STUDENT_INFO ( STUDENT_ID VARCHAR2(64), HOBBY VARCHAR2(64), HEIGHT NUMBER(3,2), WEIGHT NUMBER(4,2) );
STUDENT_INFO表中STUDENT_ID字段关联STUDENT表
2、往两个表中分别插入数据
insert into STUDENT values('001','karen',29,'s2012090501','15506060606');
insert into STUDENT values('002','huge',30,'s2012090502','15506070607');
insert into STUDENT_INFO values('s2012090501','诗词',1.63,65.00);
insert into STUDENT_INFO values('s2012090502','足球',1.72,57.00);
3、再创建两个STUDENT和STUDENT_INFO对应的临时表STUDENT_TEMP和STUDENT_INFO_TEMP
create table STUDENT_TEMP ( USER_ID VARCHAR2(64), STUDENT_NAME VARCHAR2(64), AGE NUMBER(2), STUDENT_ID VARCHAR2(64), MOBILE VARCHAR2(64) ); create table STUDENT_INFO_TEMP ( STUDENT_ID VARCHAR2(64), HOBBY VARCHAR2(64), HEIGHT NUMBER(3,2), WEIGHT NUMBER(4,2) );
4、一共四张表