CREATE TABLE CATEGORIA(ID INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 0)  NOT NULL PRIMARY KEY,NOME VARCHAR(20) NOT NULL,DESCONTO DECIMAL(5,2) NOT NULL,PARCELAS INTEGER NOT NULL)
CREATE TABLE CLIENTE(ID INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 0)  NOT NULL PRIMARY KEY,NOME VARCHAR(40) NOT NULL,EMAIL VARCHAR(30),SEXO CHAR(1),LOGRADOURO VARCHAR(40) NOT NULL,NUMERO INTEGER NOT NULL,COMPLEMENTO VARCHAR(15),BAIRRO VARCHAR(20) NOT NULL,MUNICIPIO VARCHAR(30) NOT NULL,CATEGORIA INTEGER,CONSTRAINT SYS_FK_1 FOREIGN KEY(CATEGORIA) REFERENCES CATEGORIA(ID))
CREATE TABLE TELEFONES_CLIENTE(CLIENTE INTEGER NOT NULL,NUMERO VARCHAR(14) NOT NULL,CONSTRAINT SYS_PK_TELEFONES_CLIENTE PRIMARY KEY(CLIENTE,NUMERO),CONSTRAINT SYS_FK_4 FOREIGN KEY(CLIENTE) REFERENCES CLIENTE(ID))
CREATE USER SA PASSWORD "" ADMIN
SET WRITE_DELAY 60
INSERT INTO CATEGORIA VALUES(0,'Standard',0,3)
INSERT INTO CATEGORIA VALUES(1,'Premium',10,5)
INSERT INTO CATEGORIA VALUES(2,'VIP',25,12)
INSERT INTO CATEGORIA VALUES(5,'Inadimplente',0.0,0)
INSERT INTO CLIENTE VALUES(0,'Clark Kent','ckent@dailyplanet.com','M','Clinton St.',344,'ap 3B','Midtown','Metropolis',1)
INSERT INTO CLIENTE VALUES(1,'Bruce Wayne','bruce@playboy.com','M','Estrada da Caverna',321,NULL,'Rocha do Morcego','Gothan City',2)
INSERT INTO CLIENTE VALUES(2,'Dick Grayson','robin@highschool.com','M','Estrada da Caverna',321,NULL,'Rocha do Morcego','Gothan City',0)
INSERT INTO CLIENTE VALUES(3,'Barbara Gordon','bartgirl@aol.com','F','Beco do Crime',58,'ap 202','Centro','Gothan City',1)
INSERT INTO CLIENTE VALUES(4,'Alfred Pennyworth','alfred@gmail.com','M','Estrada da Caverna',321,'anexo','Rocha do Morcego','Gothan City',0)
INSERT INTO CLIENTE VALUES(9,'Peter Parker','pp@arachne.net','M','5th Avenue',171,NULL,'Queens','New York',5)
INSERT INTO CLIENTE VALUES(10,'May Parker','may@marvel.com','F','5th Avenue',171,NULL,'Queens','New York',0)
INSERT INTO TELEFONES_CLIENTE VALUES(0,'1122-3344')
INSERT INTO TELEFONES_CLIENTE VALUES(0,'1234-5678')
INSERT INTO TELEFONES_CLIENTE VALUES(9,'5555-1234')
INSERT INTO TELEFONES_CLIENTE VALUES(10,'5555-1234')
