Professional Documents
Culture Documents
FACTURAS
HELADOS
INCLUYEN POSEE
INGREDIENTES
PROV_TEL_FIJO
PROV_TEL_MOVIL
PROVEE
REQUIERE VENDE
VEN_POSEE
VENDEDORES
-- CONSTRAINT carritos_num_car_check CHECK
-- PostgreSQL database dump (((num_car >= 0) AND (num_car <= 99))),
-- CONSTRAINT carritos_para_car_check CHECK
((((para_car)::text = 'Si'::text) OR ((para_car)::text =
SET statement_timeout = 0; 'No'::text)))
SET lock_timeout = 0; );
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false; ALTER TABLE public.carritos OWNER TO postgres;
SET client_min_messages = warning;
--
-- -- Name: facturas; Type: TABLE; Schema: public;
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: postgres; Tablespace:
Owner: --
--
CREATE TABLE facturas (
CREATE EXTENSION IF NOT EXISTS plpgsql WITH num_fac integer NOT NULL,
SCHEMA pg_catalog; fec_fac date NOT NULL,
pago_fac date NOT NULL,
val_neto_fac integer NOT NULL,
-- val_fle_fac integer NOT NULL,
-- Name: EXTENSION plpgsql; Type: COMMENT; iva_fac integer NOT NULL,
Schema: -; Owner: nit_pro character varying(5) NOT NULL
-- );
--
SET search_path = public, pg_catalog; -- Name: facturas_num_fac_seq; Type: SEQUENCE;
Schema: public; Owner: postgres
SET default_tablespace = ''; --
-- --
-- Data for Name: ven_posee; Type: TABLE DATA; -- Name: car_pkey; Type: CONSTRAINT; Schema:
Schema: public; Owner: postgres public; Owner: postgres; Tablespace:
-- --
--
-- Name: inc_pkey; Type: CONSTRAINT; Schema: --
public; Owner: postgres; Tablespace: -- Name: pro_pkey; Type: CONSTRAINT; Schema:
-- public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY incluye
ADD CONSTRAINT inc_pkey PRIMARY KEY ALTER TABLE ONLY proveedores
(num_fac, cod_ing); ADD CONSTRAINT pro_pkey PRIMARY KEY
(nit_pro);
--
-- Name: ing_pkey; Type: CONSTRAINT; Schema: --
public; Owner: postgres; Tablespace: -- Name: provee_pkey; Type: CONSTRAINT;
-- Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY ingredientes
ADD CONSTRAINT ing_pkey PRIMARY KEY ALTER TABLE ONLY provee
(cod_ing); ADD CONSTRAINT provee_pkey PRIMARY KEY
(nit_pro, cod_ing);
--
-- Name: posee_pkey; Type: CONSTRAINT; Schema: --
public; Owner: postgres; Tablespace: -- Name: req_pkey; Type: CONSTRAINT; Schema:
-- public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY posee
ADD CONSTRAINT posee_pkey PRIMARY KEY ALTER TABLE ONLY requiere
(num_car, cod_hel); ADD CONSTRAINT req_pkey PRIMARY KEY
(cod_hel, cod_ing);
--
-- Name: pro_fijo_pkey; Type: CONSTRAINT; --
Schema: public; Owner: postgres; Tablespace: -- Name: ven_pkey; Type: CONSTRAINT; Schema:
-- public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY prov_tel_fijo
ADD CONSTRAINT pro_fijo_pkey PRIMARY KEY ALTER TABLE ONLY vendedores
(nit_pro, tel_fijo); ADD CONSTRAINT ven_pkey PRIMARY KEY
(ced_ven);
ADD CONSTRAINT inc_fkey1 FOREIGN KEY
(num_fac) REFERENCES facturas(num_fac);
--
-- Name: vende_pkey; Type: CONSTRAINT; Schema:
public; Owner: postgres; Tablespace: --
-- -- Name: inc_fkey2; Type: FK CONSTRAINT;
Schema: public; Owner: postgres
ALTER TABLE ONLY vende --
ADD CONSTRAINT vende_pkey PRIMARY KEY
(ced_ven, cod_hel); ALTER TABLE ONLY incluye
ADD CONSTRAINT inc_fkey2 FOREIGN KEY
(cod_ing) REFERENCES ingredientes(cod_ing);
--
-- Name: vp_pkey; Type: CONSTRAINT; Schema:
public; Owner: postgres; Tablespace: --
-- -- Name: posee_fkey1; Type: FK CONSTRAINT;
Schema: public; Owner: postgres
ALTER TABLE ONLY ven_posee --
ADD CONSTRAINT vp_pkey PRIMARY KEY
(ced_ven, num_car, cod_hel); ALTER TABLE ONLY posee
ADD CONSTRAINT posee_fkey1 FOREIGN KEY
(num_car) REFERENCES carritos(num_car);
--
-- Name: car_fkey; Type: FK CONSTRAINT; Schema:
public; Owner: postgres --
-- -- Name: posee_fkey2; Type: FK CONSTRAINT;
Schema: public; Owner: postgres
ALTER TABLE ONLY carritos --
ADD CONSTRAINT car_fkey FOREIGN KEY
(ced_ven) REFERENCES vendedores(ced_ven); ALTER TABLE ONLY posee
ADD CONSTRAINT posee_fkey2 FOREIGN KEY
(cod_hel) REFERENCES helados(cod_hel);
--
-- Name: fac_fkey; Type: FK CONSTRAINT; Schema:
public; Owner: postgres --
-- -- Name: provee_fkey1; Type: FK CONSTRAINT;
Schema: public; Owner: postgres
ALTER TABLE ONLY facturas --
ADD CONSTRAINT fac_fkey FOREIGN KEY
(nit_pro) REFERENCES proveedores(nit_pro); ALTER TABLE ONLY provee
ADD CONSTRAINT provee_fkey1 FOREIGN KEY
(nit_pro) REFERENCES proveedores(nit_pro);
--
-- Name: inc_fkey1; Type: FK CONSTRAINT;
Schema: public; Owner: postgres --
-- -- Name: provee_fkey2; Type: FK CONSTRAINT;
Schema: public; Owner: postgres
ALTER TABLE ONLY incluye --
ALTER TABLE ONLY provee --
ADD CONSTRAINT provee_fkey2 FOREIGN KEY
(cod_ing) REFERENCES ingredientes(cod_ing); ALTER TABLE ONLY ven_posee
ADD CONSTRAINT vp_fkey1 FOREIGN KEY
(ced_ven) REFERENCES vendedores(ced_ven);
--
-- Name: req_fkey1; Type: FK CONSTRAINT;
Schema: public; Owner: postgres --
-- -- Name: vp_fkey2; Type: FK CONSTRAINT; Schema:
public; Owner: postgres
ALTER TABLE ONLY requiere --
ADD CONSTRAINT req_fkey1 FOREIGN KEY
(cod_hel) REFERENCES helados(cod_hel); ALTER TABLE ONLY ven_posee
ADD CONSTRAINT vp_fkey2 FOREIGN KEY
(num_car) REFERENCES carritos(num_car);
--
-- Name: req_fkey2; Type: FK CONSTRAINT;
Schema: public; Owner: postgres --
-- -- Name: vp_fkey3; Type: FK CONSTRAINT; Schema:
public; Owner: postgres
ALTER TABLE ONLY requiere --
ADD CONSTRAINT req_fkey2 FOREIGN KEY
(cod_ing) REFERENCES ingredientes(cod_ing); ALTER TABLE ONLY ven_posee
ADD CONSTRAINT vp_fkey3 FOREIGN KEY
(cod_hel) REFERENCES helados(cod_hel);
--
-- Name: vende_fkey1; Type: FK CONSTRAINT;
Schema: public; Owner: postgres --
-- -- Name: public; Type: ACL; Schema: -; Owner:
postgres
ALTER TABLE ONLY vende --
ADD CONSTRAINT vende_fkey1 FOREIGN KEY
(ced_ven) REFERENCES vendedores(ced_ven); 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;
-- Name: vende_fkey2; Type: FK CONSTRAINT;
Schema: public; Owner: postgres
-- --
-- PostgreSQL database dump complete
ALTER TABLE ONLY vende --
ADD CONSTRAINT vende_fkey2 FOREIGN KEY
(cod_hel) REFERENCES helados(cod_hel);
--
-- Name: vp_fkey1; Type: FK CONSTRAINT; Schema:
public; Owner: postgres
FOGASA
MER FOGASA
DIAGRAMA REFERENCIAL
MODELO RELACIONAL
ANIMALES
CONTRATOS
CONTROL
CRIA
DEPOSITARIOS
FUNCIONARIOS
TELEFONO_DEPOSI
VACUNA
VACUNADORES
VETERINARIOS
--
-- PostgreSQL database dump ALTER TABLE public.animales OWNER TO postgres;
--
--
SET statement_timeout = 0; -- Name: contratos; Type: TABLE; Schema: public;
SET lock_timeout = 0; Owner: postgres; Tablespace:
SET client_encoding = 'UTF8'; --
SET standard_conforming_strings = on;
SET check_function_bodies = false; CREATE TABLE contratos (
SET client_min_messages = warning; num_cto integer NOT NULL,
cant_cab_cto character varying(7) NOT NULL,
-- cant_kg_cto character varying(10) NOT NULL,
-- Name: plpgsql; Type: EXTENSION; Schema: -; ini_cto date NOT NULL,
Owner: valor_ini_cto character varying(10) NOT NULL,
-- id_dep character varying(3) NOT NULL
);
CREATE EXTENSION IF NOT EXISTS plpgsql WITH
SCHEMA pg_catalog;
ALTER TABLE public.contratos OWNER TO postgres;
-- --
-- Name: EXTENSION plpgsql; Type: COMMENT; -- Name: contratos_num_cto_seq; Type:
Schema: -; Owner: SEQUENCE; Schema: public; Owner: postgres
-- --
-- --
-- Name: num_cto; Type: DEFAULT; Schema: public; -- Name: contratos_num_cto_seq; Type:
Owner: postgres SEQUENCE SET; Schema: public; Owner: postgres
-- --
-- --
-- Data for Name: animales; Type: TABLE DATA; -- Data for Name: control; Type: TABLE DATA;
Schema: public; Owner: postgres Schema: public; Owner: postgres
-- --
--
-- Name: public; Type: ACL; Schema: -; Owner:
postgres
--
--
-- PostgreSQL database dump complete
--