Exemplo de create table
DROP TABLE PROFESSOR CASCADE CONSTRAINT;
DROP TABLE CARGO CASCADE CONSTRAINT;
DROP TABLE DEPTO CASCADE CONSTRAINT;
CREATE TABLE CARGO ( CODIGO NUMBER(2) NOT NULL, DESCRICAO VARCHAR2(20), CONSTRAINT CARGO_PRIMARY_KEY PRIMARY KEY (CODIGO));
INSERT INTO CARGO VALUES (1,'MESTRANDO');
INSERT INTO CARGO VALUES (2,'MESTRE');
INSERT INTO CARGO VALUES (3,'DOUTORANDO');
INSERT INTO CARGO VALUES (4,'DOUTOR');
CREATE TABLE DEPTO ( CODIGO NUMBER(2) NOT NULL, DESCRICAO VARCHAR2(20), CONSTRAINT DEPTO_PRIMARY_KEY PRIMARY KEY (CODIGO));
INSERT INTO DEPTO VALUES (1,'COMPUTACAO');
INSERT INTO DEPTO VALUES (2,'MATEMATICA');
INSERT INTO DEPTO VALUES (3,'SECRETARIADO');
INSERT INTO DEPTO VALUES (4,'ESPECIALIZACAO');
CREATE TABLE PROFESSOR ( CODIGO NUMBER(4) NOT NULL, NOME VARCHAR2(30), NASCIMENTO DATE, SALARIO NUMBER(7,2), CARGO NUMBER(2) NOT NULL, DEPTO NUMBER(2) NOT NULL, CONSTRAINT PROFESSOR_DEPTO_FK FOREIGN KEY (DEPTO) REFERENCES DEPTO (CODIGO), CONSTRAINT PROFESSOR_CARGO_FK FOREIGN KEY (CARGO) REFERENCES CARGO (CODIGO), CONSTRAINT PROFESSOR_CODIGO_PK PRIMARY KEY (CODIGO));
INSERT INTO PROFESSOR VALUES (0001,'ALEX','17-11-1971',1500,1,1);
INSERT INTO PROFESSOR VALUES (0002,'ALMIR','01-05-1971',1500,2,1);
INSERT INTO PROFESSOR VALUES (0003,'BEGOSSO','9-06-1971',1450,3,2);
INSERT INTO PROFESSOR VALUES (0004,'GUTO','2-04-1971',1700,3,2);
INSERT INTO PROFESSOR VALUES (0005,'TALO','28-09-1971',1850,3,1);
INSERT INTO PROFESSOR VALUES (0006,'DOMINGOS','20-02-1971',1600,1,3);
INSERT INTO PROFESSOR VALUES (0007,'OSMAR','8-09-1971',1500,1,1);
INSERT INTO PROFESSOR VALUES (0008,'URSO','3-12-1971',1950,2,1);
INSERT INTO PROFESSOR VALUES (0009,'FABIO','22-02-1971',1350,2,1);
INSERT INTO PROFESSOR VALUES (0010,'DOUGLAS','3-12-1971',2000,1,1);