日期:2014-05-16 浏览次数:20515 次
/*create table STUBASEINFO(ID NUMBER(10) CONSTRAINT STUBINFO_id_pk PRIMARY KEY, STUID NUMBER(8) NOT NULL UNIQUE, STUNAME VARCHAR2(20) NOT NULL, SEX NUMBER DEFAULT 1 NOT NULL, PHONE VARCHAR2(13), MOBILE VARCHAR2(11), ADDR VARCHAR2(100), EMAIL VARCHAR(100), FLAG NUMBER DEFAULT 1 NOT NULL, OPRTIME DATE DEFAULT SYSDATE ); comment on column STUBASEINFO.STUID is '学号与学生履历表中的学号一对一'; comment on column STUBASEINFO.FLAG is '学生的状态信息' */ /* create table STURESUME(ID NUMBER(10) CONSTRAINT STURESUME_id_pk PRIMARY KEY, STUID NUMBER(8) NOT NULL UNIQUE, EXPERIENCEONE VARCHAR2(200), EXPERIENCETWO VARCHAR2(200), EXPERIENCETH VARCHAR2(200), EXPERIENCEFOUR VARCHAR2(200), EXPERIENCEFIVE VARCHAR2(200), OPRTIME DATE DEFAULT SYSDATE); COMMENT ON TABLE STURESUME IS '学生履历记录表'; COMMENT ON COLUMN STURESUME.STUID IS '学号与stubaseinfo表中一对一关系'; COMMENT ON COLUMN STURESUME.EXPERIENCEONE IS '第一个工作经验或是取得的成就'; COMMENT ON COLUMN STURESUME.OPRTIME IS '操作时间'; */ ---给两表增加序列 --CREATE SEQUENCE STUBASEINFO_ID increment by 1; --CREATE SEQUENCE STURESUME_ID increment by 1; ---给两表新增一条数据信息(测试) INSERT INTO STUBASEINFO(ID,STUID,STUNAME,SEX,MOBILE,ADDR) Values(STUBASEINFO_ID.nextval,'01080001','赵敏敏',0,'13912345678','杭州市西湖区'); INSERT INTO STURESUME(ID,STUID,EXPERIENCEONE,EXPERIENCETWO) VALUES(STURESUME_ID.NEXTVAL,'01080001','取得数据库工程师证','学生管理系统开发');