{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

assgn2_creat_db2

# assgn2_creat_db2 - Course SE 4M03 Student Franek F Student...

This preview shows pages 1–2. Sign up to view the full content.

-- Course: SE 4M03 -- Student: Franek F. -- Student No: 0000000 CONNECT TO SE4M03; CREATE TABLE EMPLOYEE ( EMPLOYEENO CHAR(6) NOT NULL, PRIMARY KEY (EMPLOYEENO), CHECK (('0' <= SUBSTR(EMPLOYEENO,1,1) AND SUBSTR(EMPLOYEENO,1,1) <= '9') AND ('0' <= SUBSTR(EMPLOYEENO,2,1) AND SUBSTR(EMPLOYEENO,2,1) <= '9') AND ('0' <= SUBSTR(EMPLOYEENO,3,1) AND SUBSTR(EMPLOYEENO,3,1) <= '9') AND ('0' <= SUBSTR(EMPLOYEENO,4,1) AND SUBSTR(EMPLOYEENO,4,1) <= '9') AND ('0' <= SUBSTR(EMPLOYEENO,5,1) AND SUBSTR(EMPLOYEENO,5,1) <= '9') AND ('0' <= SUBSTR(EMPLOYEENO,6,1) AND SUBSTR(EMPLOYEENO,6,1) <= '9')) ); CREATE TABLE MANAGER ( EMPLOYEENO CHAR(6) NOT NULL, PRIMARY KEY (EMPLOYEENO), FOREIGN KEY (EMPLOYEENO) REFERENCES EMPLOYEE ); CREATE TABLE WORKER ( EMPLOYEENO CHAR(6) NOT NULL, MANAGERNO CHAR(6) NOT NULL, PRIMARY KEY (EMPLOYEENO), FOREIGN KEY (EMPLOYEENO) REFERENCES EMPLOYEE, FOREIGN KEY (MANAGERNO) REFERENCES MANAGER(EMPLOYEENO) ); CREATE TABLE HASPHONE ( EMPLOYEENO CHAR(6) NOT NULL, AREA_CODE CHAR(3) NOT NULL, NUMBER CHAR(6) NOT NULL, PRIMARY KEY (EMPLOYEENO,AREA_CODE,NUMBER), FOREIGN KEY (EMPLOYEENO) REFERENCES EMPLOYEE, CHECK (('0' <= SUBSTR(AREA_CODE,1) AND SUBSTR(AREA_CODE,1) <= '9') AND ('0' <= SUBSTR(AREA_CODE,2,1) AND SUBSTR(AREA_CODE,2,1) <= '9') AND ('0' <= SUBSTR(AREA_CODE,3,1) AND SUBSTR(AREA_CODE,3,1) <= '9')),

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 3

assgn2_creat_db2 - Course SE 4M03 Student Franek F Student...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online