Employee database

From PostgreSQL_wiki
Revision as of 16:29, 6 November 2025 by Martin (talk | contribs)
Jump to: navigation, search

Create an employee database and import the dump below.

--
-- PostgreSQL database dump
--

\restrict KS0MIlBFQRINWhkidIFA2hbIKzzLs5VwEun8gZSMhmoPZXVbbEJhWY8U7gtIf9c

-- Dumped from database version 11.22 (Debian 11.22-0+deb10u2)
-- Dumped by pg_dump version 15.14 (Debian 15.14-0+deb12u1)

SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', , false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;

--
-- Name: employee; Type: SCHEMA; Schema: -; Owner: postgres
--

CREATE SCHEMA employee;


ALTER SCHEMA employee OWNER TO postgres;

--
-- Name: public; Type: SCHEMA; Schema: -; Owner: postgres
--

-- *not* creating schema, since initdb creates it


ALTER SCHEMA public OWNER TO postgres;

SET default_tablespace = ;

--
-- Name: emptable; Type: TABLE; Schema: employee; Owner: postgres
--

CREATE TABLE employee.emptable (
    eno integer,
    lname character varying(10),
    fname character varying(10),
    street character varying(20),
    city character varying(15),
    st character varying(2),
    zip character varying(5),
    dept character varying(4),
    payrate numeric(13,2),
    com numeric(3,2),
    miscdata character varying(128),
    dnum1 numeric(4,2),
    dnum2 numeric(4,2),
    dnum3 numeric(4,2)
);


ALTER TABLE employee.emptable OWNER TO postgres;

--
-- Data for Name: emptable; Type: TABLE DATA; Schema: employee; Owner: postgres
--

COPY employee.emptable (eno, lname, fname, street, city, st, zip, dept, payrate, com, miscdata, dnum1, dnum2, dnum3) FROM stdin;
123     Doe     John    123, Nowhere Lane       Noplace NA      00100   DEP1    200.00  1.23    abcd1234        0.00    22.33   33.44
456     Smith   Jane    456, Someplace Rd.      Somewhere       NA      00111   DEP2    130.00  3.45    defg5678hijk    55.66   0.00    99.11
789     Smith2  Jane2   789, Someplace 2 Rd.    Someplace Else  NA      00123   DEP3    230.00  4.56    98005678hijk    12.34   45.67   0.00
\.


--
-- Name: SCHEMA employee; Type: ACL; Schema: -; Owner: postgres
--

GRANT USAGE ON SCHEMA employee TO gix_admin;
GRANT USAGE ON SCHEMA employee TO gix_user;


--
-- Name: SCHEMA public; Type: ACL; Schema: -; Owner: postgres
--

REVOKE USAGE ON SCHEMA public FROM PUBLIC;
GRANT ALL ON SCHEMA public TO PUBLIC;


--
-- Name: TABLE emptable; Type: ACL; Schema: employee; Owner: postgres
--

GRANT ALL ON TABLE employee.emptable TO gix_admin;
GRANT ALL ON TABLE employee.emptable TO gix_user;


--
-- Name: DEFAULT PRIVILEGES FOR SCHEMAS; Type: DEFAULT ACL; Schema: -; Owner: gix_admin
--

ALTER DEFAULT PRIVILEGES FOR ROLE gix_admin REVOKE ALL ON SCHEMAS  FROM gix_admin;
ALTER DEFAULT PRIVILEGES FOR ROLE gix_admin GRANT ALL ON SCHEMAS  TO gix_admin WITH GRANT OPTION;


--
-- Name: DEFAULT PRIVILEGES FOR SCHEMAS; Type: DEFAULT ACL; Schema: -; Owner: gix_user
--

ALTER DEFAULT PRIVILEGES FOR ROLE gix_user REVOKE ALL ON SCHEMAS  FROM gix_user;
ALTER DEFAULT PRIVILEGES FOR ROLE gix_user GRANT ALL ON SCHEMAS  TO gix_user WITH GRANT OPTION;


--
-- PostgreSQL database dump complete
--

\unrestrict KS0MIlBFQRINWhkidIFA2hbIKzzLs5VwEun8gZSMhmoPZXVbbEJhWY8U7gtIf9c


Terug naar: GixSQL