employee.sql
上传用户:jishiqi_cj
上传日期:2022-08-08
资源大小:24765k
文件大小:1k
- DROP TABLE dep CASCADE CONSTRAINTS;
- CREATE TABLE dep(
- id NUMBER PRIMARY KEY,
- depname VARCHAR2 (40) NOT NULL
- );
- DROP TABLE emp CASCADE CONSTRAINTS;
- CREATE TABLE emp(
- id NUMBER PRIMARY KEY,
- name VARCHAR2 (20) NOT NULL,
- sex VARCHAR2 (2) NOT NULL,
- birthday VARCHAR2 (20) NOT NULL,
- telephone VARCHAR2 (20) NOT NULL,
- depid NUMBER NOT NULL
- REFERENCES dep(id) ON DELETE CASCADE,
- duty VARCHAR2 (40) NOT NULL,
- degree VARCHAR2 (20) NULL,
- experience VARCHAR2 (500) NULL
- );
- DROP TABLE interuser CASCADE CONSTRAINTS;
- CREATE TABLE interuser(
- username VARCHAR2 (20) NOT NULL PRIMARY KEY,
- password VARCHAR2 (20) NOT NULL,
- grade VARCHAR2 (20) NOT NULL,
- empid NUMBER NOT NULL
- REFERENCES emp(id) ON DELETE CASCADE
- );
- DROP TABLE note CASCADE CONSTRAINTS;
- CREATE TABLE note (
- id NUMBER PRIMARY KEY,
- title VARCHAR2(100) NOT NULL,
- content VARCHAR2(2000) NOT NULL,
- talker VARCHAR2(20) NOT NULL,
- time DATE NOT NULL
- );
- insert into dep values(1,'市场部');
- insert into dep values(2,'教学部');
- insert into emp values(1,'张三','男','1970-10-10','66666666',1,'经理','学士','');
- insert into emp values(2,'李四','男','1980-10-10','88666666',2,'员工','硕士','');
- insert into interuser values('manager','manager','1',1);
- insert into interuser values('aa','aa','0',2);