Banco de Dados Oracle
Por: guxavo • 20/6/2017 • Resenha • 1.202 Palavras (5 Páginas) • 361 Visualizações
/*******************************************************************
* Deletando as tabelas *
********************************************************************/
Drop Table MOVIMENTOS;
Drop Table CORRENTISTAS;
/*******************************************************************
* 01) A) Criacao da tabela de correntistas *
********************************************************************/
CREATE TABLE CORRENTISTAS
(CODIGOC INTEGER NOT NULL PRIMARY KEY,
NOME VARCHAR(40) NOT NULL,
SEXO CHAR(1) NOT NULL CHECK ( SEXO IN ('M', 'F')),
FONE VARCHAR(14) NOT NULL,
DATAN DATE NOT NULL,
SALDO NUMBER(15,2) NOT NULL)
TABLESPACE DCTBS01;
/*******************************************************************
* B) Criacao da tabela de Movimentos *
********************************************************************/
CREATE TABLE MOVIMENTOS
(CODIGOC INTEGER NOT NULL,
CODIGOM INTEGER NOT NULL,
VALOR NUMBER(15,2) NOT NULL,
MOVI CHAR(1) NOT NULL CHECK ( MOVI IN ('D', 'C')),
PRIMARY KEY (CODIGOC,CODIGOM),
FOREIGN KEY (CODIGOC) REFERENCES
CORRENTISTAS(CODIGOC) ON DELETE CASCADE)
TABLESPACE DCTBS01;
/*******************************************************************
* 02) A) Carga da tabela de correntistas *
********************************************************************/
Insert into CORRENTISTAS values (01,'Abner Farias Souza ', 'M','(35)-2552-1231', '12/12/1977',0.00);
Insert into CORRENTISTAS values (02,'Aline de Souza', 'F','(19)-1211-1333', '10/02/1980',0.00);
Insert into CORRENTISTAS values (03,'Bruno Pereira Zamarco', 'M','(35)-3551-5001', '11/10/2001',0.00);
Insert into CORRENTISTAS values (04,'Camila Pio Ferreira','F', '(35)-3551-5001','11/12/1976',0.00);
Insert into CORRENTISTAS values (05,'Carina Francismara da Silva', 'F','(35)-3551-5001', '01/01/1975',0.00);
Insert into CORRENTISTAS values (06,'Daniela Cristiane Souza', 'F' , '(35)-3551-5001', '01/11/1976',0.00);
Insert into CORRENTISTAS values (07,'Flavia Rodrigues Silva', 'F' , '(35)-3551-5001', '27/12/1966',0.00);
Insert into CORRENTISTAS values (08,'Haroldo Thales Silva de Lima', 'M','(35)-3551-5001', '01/12/1976',0.00);
Insert into CORRENTISTAS values (09,'Ian de Andrade Coelho', 'M' , '(35)-3551-5001', '18/04/1959', 0.00);
Insert into CORRENTISTAS values (10,'Jakson Douglas Bueno', 'M' , '(35)-3551-5001', '01/12/1976', 0.00);
Insert into CORRENTISTAS values (11,'Janaina Aparecida Fidelis', 'F' , '(35)-3551-5001', '17/10/1980',0.00);
Insert into CORRENTISTAS values (12,'Liliane Oliveira do Nascimento', 'F' , '(35)-3551-5001','01/12/1976', 0.00);
Insert into CORRENTISTAS values (13,'Maria Luiza Lino', 'F' , '(35)-3551-5001', '10/07/1981', 0.00);
Insert into CORRENTISTAS values (14,'Ronaldo Garcia dos Anjos', 'M' , '(35)-3551-5001', '01/12/1976',0.00);
Insert into CORRENTISTAS values (15,'Samuel Augusto da Silva', 'M' , '(35)-3551-5001', '13/12/1976', 0.00);
/*******************************************************************
* B) Carga da tabela de Movimentos
...