Vous êtes sur la page 1sur 7

--

-- PostgreSQL database dump


--
-- Dumped from database version 9.2.3
-- Dumped by pg_dump version 9.2.3
-- Started on 2014-05-26 16:42:11
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
--
-- TOC entry 176 (class 3079 OID 11727)
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
--
-- TOC entry 1977 (class 0 OID 0)
-- Dependencies: 176
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
SET search_path = public, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- TOC entry 168 (class 1259 OID 16640)
-- Name: cidade; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE cidade (
cod_cidade integer NOT NULL,
cidade character varying(60)
);
ALTER TABLE public.cidade OWNER TO postgres;
--
-- TOC entry 169 (class 1259 OID 16643)
-- Name: departamento; Type: TABLE; Schema: public; Owner: postgres; Tablespace:

--
CREATE TABLE departamento (
cod_departamento integer NOT NULL,
departamento character varying(60),
datainicio timestamp with time zone,
cod_empregado integer,
cod_cidade integer
);
ALTER TABLE public.departamento OWNER TO postgres;
--
-- TOC entry 170 (class 1259 OID 16646)
-- Name: dependente; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE dependente (
cod_empregado integer NOT NULL,
cod_dependente integer NOT NULL,
nomedep character varying(60),
sexodep character varying(1),
datanascdep timestamp with time zone,
tipodep character varying(1)
);
ALTER TABLE public.dependente OWNER TO postgres;
--
-- TOC entry 171 (class 1259 OID 16649)
-- Name: empregado; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE empregado (
cod_empregado integer NOT NULL,
nomeinic character varying(20),
nomeint character varying(1),
nomefin character varying(20),
datanasc timestamp with time zone,
endereco character varying(60),
sexo character varying(1),
salario numeric(11,2),
cod_departamento integer,
cod_empregado_sup integer
);
ALTER TABLE public.empregado OWNER TO postgres;
--
-- TOC entry 172 (class 1259 OID 16652)
-- Name: empregadoprojeto; Type: TABLE; Schema: public; Owner: postgres; Tablesp
ace:
--
CREATE TABLE empregadoprojeto (
cod_empregado integer NOT NULL,
cod_projeto integer NOT NULL,
horas integer
);
ALTER TABLE public.empregadoprojeto OWNER TO postgres;
--
-- TOC entry 173 (class 1259 OID 16655)
-- Name: projeto; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE projeto (
cod_projeto integer NOT NULL,
nomeprojeto character varying(60),
cod_departamento integer
);
ALTER TABLE public.projeto OWNER TO postgres;
--
-- TOC entry 1964 (class 0 OID 16640)
-- Dependencies: 168
-- Data for Name: cidade; Type: TABLE DATA; Schema: public; Owner: postgres
--
INSERT INTO cidade VALUES (1, 'Campo Grande');
INSERT INTO cidade VALUES (2, 'Dourados');
INSERT INTO cidade VALUES (3, 'Corumb');
INSERT INTO cidade VALUES (4, 'Trs Lagoas');
INSERT INTO cidade VALUES (5, 'Ponta Por');
INSERT INTO cidade VALUES (6, 'Rio Verde');
INSERT INTO cidade VALUES (7, 'Porto Murtinho');
INSERT INTO cidade VALUES (8, 'Bonito');
INSERT INTO cidade VALUES (9, 'Paranaba');
INSERT INTO cidade VALUES (10, 'Cassilndia');
--
-- TOC entry 1965 (class 0 OID 16643)
-- Dependencies: 169
-- Data for Name: departamento; Type: TABLE DATA; Schema: public; Owner: postgre
s
--
INSERT INTO departamento VALUES (1, 'Administrativo', '2001-04-05 00:00:00-04',
4, 1);
INSERT INTO departamento VALUES (2, 'Financeiro', '2002-07-01 00:00:00-04', 5, 1
);
INSERT INTO departamento VALUES (3, 'Pesquisa', '1999-06-04 00:00:00-04', 2, 2);
INSERT INTO departamento VALUES (4, 'Informtica', '2000-06-06 00:00:00-04', 10, 2)
;
INSERT INTO departamento VALUES (5, 'Gerncia de projetos', '1998-09-03 00:00:00-04
', 6, 1);
--
-- TOC entry 1966 (class 0 OID 16646)
-- Dependencies: 170
-- Data for Name: dependente; Type: TABLE DATA; Schema: public; Owner: postgres
--
INSERT INTO dependente VALUES (1, 1, 'Alice', 'F', '1995-05-04 00:00:00-04', 'E'
);
INSERT INTO dependente VALUES (1, 2, 'Telmo', 'M', '1998-05-04 00:00:00-04', 'F'
);
INSERT INTO dependente VALUES (1, 3, 'Jane', 'F', '1979-06-06 00:00:00-04', 'F')
;
INSERT INTO dependente VALUES (3, 1, 'Franco', 'M', '1995-05-04 00:00:00-04', 'F
');
INSERT INTO dependente VALUES (3, 2, 'Francisca', 'F', '1998-05-04 00:00:00-04',
'E');
INSERT INTO dependente VALUES (8, 1, 'Renata', 'F', '1986-06-01 00:00:00-04', 'E
');
INSERT INTO dependente VALUES (8, 2, 'Junior', 'M', '1979-06-06 00:00:00-04', 'F
');
--
-- TOC entry 1967 (class 0 OID 16649)
-- Dependencies: 171
-- Data for Name: empregado; Type: TABLE DATA; Schema: public; Owner: postgres
--
INSERT INTO empregado VALUES (1, 'Joo', 'B', 'Silva', '1967-09-05 00:00:00-04', 'C
armo, 33', 'M', 3000.00, 3, 3);
INSERT INTO empregado VALUES (2, 'Alice', 'J', 'Zeus', '1970-04-01 00:00:00-04',
'Flores, 78', 'F', 2500.00, 3, 3);
INSERT INTO empregado VALUES (3, 'Franco', 'L', 'Rocha', '1960-02-05 00:00:00-04
', 'Rios, 98', 'M', 4000.00, 1, 5);
INSERT INTO empregado VALUES (4, 'Mario', 'P', 'Costa', '1975-07-12 00:00:00-04'
, 'Ipe, 123', 'M', 3800.00, 1, 5);
INSERT INTO empregado VALUES (5, 'Jorge', 'A', 'Ferreira', '1965-01-08 00:00:00-
04', 'Largo, 45', 'M', 2500.00, 2, NULL);
INSERT INTO empregado VALUES (6, 'Ana', 'M', 'Santos', '1990-01-01 00:00:00-03',
'Arcos, 23', 'F', 5500.00, 5, 8);
INSERT INTO empregado VALUES (7, 'Joice', 'V', 'Neves', '1978-03-04 00:00:00-04'
, 'Flora, 12', 'F', 4300.00, 4, 3);
INSERT INTO empregado VALUES (8, 'Luiz', 'R', 'Ribeiro', '1985-09-07 00:00:00-04
', 'Madeira, 234', 'M', 4800.00, 1, 5);
INSERT INTO empregado VALUES (9, 'Rose', 'L', 'Martinho', '1981-09-08 00:00:00-0
4', '15 de novembro, 7234', 'F', 3000.00, 3, 8);
INSERT INTO empregado VALUES (10, 'Mauricio', 'J', 'Penteado', '1970-04-05 00:00
:00-04', 'Vinte de dois de maio, 172', 'M', 1500.00, 4, 3);
--
-- TOC entry 1968 (class 0 OID 16652)
-- Dependencies: 172
-- Data for Name: empregadoprojeto; Type: TABLE DATA; Schema: public; Owner: pos
tgres
--
INSERT INTO empregadoprojeto VALUES (2, 1, 32);
INSERT INTO empregadoprojeto VALUES (3, 1, 10);
INSERT INTO empregadoprojeto VALUES (5, 1, 7);
INSERT INTO empregadoprojeto VALUES (5, 4, 15);
INSERT INTO empregadoprojeto VALUES (6, 2, 26);
INSERT INTO empregadoprojeto VALUES (7, 2, 10);
INSERT INTO empregadoprojeto VALUES (8, 4, 19);
--
-- TOC entry 1969 (class 0 OID 16655)
-- Dependencies: 173
-- Data for Name: projeto; Type: TABLE DATA; Schema: public; Owner: postgres
--
INSERT INTO projeto VALUES (1, 'Informatizao', 4);
INSERT INTO projeto VALUES (2, 'Reengenharia', 1);
INSERT INTO projeto VALUES (3, 'ProdutoX', 2);
INSERT INTO projeto VALUES (4, 'ProdutoY', 3);
INSERT INTO projeto VALUES (5, 'ProdutoZ', 2);
INSERT INTO projeto VALUES (6, 'Novidades', 4);
--
-- TOC entry 1945 (class 2606 OID 16659)
-- Name: Cidade_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablesp
ace:
--
ALTER TABLE ONLY cidade
ADD CONSTRAINT "Cidade_pkey" PRIMARY KEY (cod_cidade);
--
-- TOC entry 1947 (class 2606 OID 16661)
-- Name: Departamento_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; T
ablespace:
--
ALTER TABLE ONLY departamento
ADD CONSTRAINT "Departamento_pkey" PRIMARY KEY (cod_departamento);
--
-- TOC entry 1949 (class 2606 OID 16663)
-- Name: Dependente_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tab
lespace:
--
ALTER TABLE ONLY dependente
ADD CONSTRAINT "Dependente_pkey" PRIMARY KEY (cod_empregado, cod_dependente)
;
--
-- TOC entry 1954 (class 2606 OID 16665)
-- Name: EmpregadoProjeto_pkey; Type: CONSTRAINT; Schema: public; Owner: postgre
s; Tablespace:
--
ALTER TABLE ONLY empregadoprojeto
ADD CONSTRAINT "EmpregadoProjeto_pkey" PRIMARY KEY (cod_empregado, cod_proje
to);
--
-- TOC entry 1951 (class 2606 OID 16667)
-- Name: Empregado_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tabl
espace:
--
ALTER TABLE ONLY empregado
ADD CONSTRAINT "Empregado_pkey" PRIMARY KEY (cod_empregado);
--
-- TOC entry 1956 (class 2606 OID 16669)
-- Name: Projeto_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tables
pace:
--
ALTER TABLE ONLY projeto
ADD CONSTRAINT "Projeto_pkey" PRIMARY KEY (cod_projeto);
--
-- TOC entry 1952 (class 1259 OID 16670)
-- Name: fki_Empregado_CodSupDepartamento_fkey; Type: INDEX; Schema: public; Own
er: postgres; Tablespace:
--
CREATE INDEX "fki_Empregado_CodSupDepartamento_fkey" ON empregado USING btree (c
od_empregado_sup);
--
-- TOC entry 1957 (class 2606 OID 16671)
-- Name: Departamento_CodCidade_fkey; Type: FK CONSTRAINT; Schema: public; Owner
: postgres
--
ALTER TABLE ONLY departamento
ADD CONSTRAINT "Departamento_CodCidade_fkey" FOREIGN KEY (cod_cidade) REFERE
NCES cidade(cod_cidade);
--
-- TOC entry 1958 (class 2606 OID 16676)
-- Name: Dependente_CodEmpregado_fkey; Type: FK CONSTRAINT; Schema: public; Owne
r: postgres
--
ALTER TABLE ONLY dependente
ADD CONSTRAINT "Dependente_CodEmpregado_fkey" FOREIGN KEY (cod_empregado) RE
FERENCES empregado(cod_empregado);
--
-- TOC entry 1961 (class 2606 OID 16681)
-- Name: EmpregadoProjeto_CodEmpregado_fkey; Type: FK CONSTRAINT; Schema: public
; Owner: postgres
--
ALTER TABLE ONLY empregadoprojeto
ADD CONSTRAINT "EmpregadoProjeto_CodEmpregado_fkey" FOREIGN KEY (cod_emprega
do) REFERENCES empregado(cod_empregado);
--
-- TOC entry 1962 (class 2606 OID 16686)
-- Name: EmpregadoProjeto_CodProjeto_fkey; Type: FK CONSTRAINT; Schema: public;
Owner: postgres
--
ALTER TABLE ONLY empregadoprojeto
ADD CONSTRAINT "EmpregadoProjeto_CodProjeto_fkey" FOREIGN KEY (cod_projeto)
REFERENCES projeto(cod_projeto);
--
-- TOC entry 1959 (class 2606 OID 16691)
-- Name: Empregado_CodDepartamento_fkey; Type: FK CONSTRAINT; Schema: public; Ow
ner: postgres
--
ALTER TABLE ONLY empregado
ADD CONSTRAINT "Empregado_CodDepartamento_fkey" FOREIGN KEY (cod_departament
o) REFERENCES departamento(cod_departamento);
--
-- TOC entry 1960 (class 2606 OID 16696)
-- Name: Empregado_CodSupDepartamento_fkey; Type: FK CONSTRAINT; Schema: public;
Owner: postgres
--
ALTER TABLE ONLY empregado
ADD CONSTRAINT "Empregado_CodSupDepartamento_fkey" FOREIGN KEY (cod_empregad
o_sup) REFERENCES empregado(cod_empregado);
--
-- TOC entry 1963 (class 2606 OID 16706)
-- Name: projeto_cod_departamento_fkey; Type: FK CONSTRAINT; Schema: public; Own
er: postgres
--
ALTER TABLE ONLY projeto
ADD CONSTRAINT projeto_cod_departamento_fkey FOREIGN KEY (cod_departamento)
REFERENCES departamento(cod_departamento);
--
-- TOC entry 1976 (class 0 OID 0)
-- Dependencies: 5
-- Name: public; Type: ACL; Schema: -; Owner: postgres
--
REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC;
-- Completed on 2014-05-26 16:42:12
--
-- PostgreSQL database dump complete
--

Vous aimerez peut-être aussi