Skip to content

Instantly share code, notes, and snippets.

@chanmix51
Created April 24, 2015 12:14
Show Gist options
  • Save chanmix51/4b649bdcdcac50ba40f4 to your computer and use it in GitHub Desktop.
Save chanmix51/4b649bdcdcac50ba40f4 to your computer and use it in GitHub Desktop.
CREATE TABLE department (
department_id serial NOT NULL,
name character varying NOT NULL,
department_parent_id integer
);
COPY department (department_id, name, department_parent_id) FROM stdin;
1 my_company \N
2 direction 1
3 administrative 1
4 sales 3
5 marketing 3
6 production 1
7 dba 6
8 support 6
9 developer 6
\.
SELECT pg_catalog.setval('department_department_id_seq', 9, true);
ALTER TABLE ONLY department
ADD CONSTRAINT department_pkey PRIMARY KEY (department_id);
ALTER TABLE ONLY department
ADD CONSTRAINT department_department_parent_id_fkey FOREIGN KEY (department_parent_id) REFERENCES department(department_id);
CREATE TABLE employee (
employee_id serial NOT NULL,
name character varying,
department_id integer NOT NULL,
birthdate timestamp with time zone NOT NULL
);
COPY employee (employee_id, name, department_id, birthdate) FROM stdin;
1 Mrs. Bette Feil Sr. 2 1971-10-13 00:35:04+00
2 Mrs. Shaylee Rempel 9 1984-12-13 08:43:28+00
3 Vicente Runte 7 1995-11-05 23:25:00+00
4 Dr. Cathrine Bayer 7 1956-05-13 22:16:15+00
5 Prof. Kristina Will 9 1972-07-05 16:58:28+00
6 Miss Amina Rath II 9 1973-08-02 09:42:56+00
7 Mr. Maximillian Hills PhD 5 1970-03-07 18:24:53+00
8 Prof. Judson Purdy 9 1969-06-17 07:42:52+00
9 Miss Bonita Kris 7 1965-12-04 16:26:57+00
10 Emmett Pfeffer 2 1965-08-10 19:12:27+00
11 Zachariah Kling 9 1990-10-27 22:15:56+00
12 Breanne Friesen 2 1966-07-11 22:07:48+00
13 Reinhold Von 2 1968-04-29 17:12:32+00
14 Janiya Barrows 4 1968-12-05 21:58:42+00
15 Prof. Tristian Kozey PhD 9 1968-10-25 12:40:14+00
16 Austin Ledner 2 1955-08-03 17:26:35+00
17 Nadia Davis 2 1992-05-11 10:02:01+00
18 Miss Ilene Toy 9 1989-04-13 06:05:03+00
19 Prof. Aaron Turner I 4 1971-03-21 18:13:01+00
20 Raven Stokes Jr. 2 1985-02-14 00:16:22+00
21 Irving Jast 5 1957-07-22 22:42:19+00
22 Isabell Wilderman 8 1968-11-26 09:49:30+00
23 Albertha Satterfield 2 1955-12-02 15:07:24+00
24 Queenie Abbott MD 5 1961-03-24 04:49:00+00
25 Ozella Kautzer 9 1968-07-14 01:31:46+00
26 Mr. Bernardo Spencer 7 1984-01-11 08:08:15+00
27 Mr. Keaton Schulist 7 1957-09-07 15:46:23+00
28 Dr. Hassan Batz 9 1992-08-10 16:40:03+00
29 Wallace Bradtke 4 1969-12-17 11:23:49+00
30 Alexandrine Brekke 9 1956-05-27 06:50:12+00
31 Brannon Kuphal Sr. 4 1958-02-01 12:44:29+00
32 Miss Alysson Stiedemann 9 1989-11-12 18:49:54+00
33 Rickey Johnson 5 1969-11-02 19:08:44+00
34 Abagail West 8 1967-04-28 20:13:58+00
35 Ted Huel 7 1958-11-12 05:57:51+00
36 Mr. Michel Kihn 7 1990-09-02 21:38:28+00
37 Abe Rippin 4 1995-06-19 22:23:30+00
38 Mark Kilback 2 1968-10-20 15:28:42+00
39 Alba Boehm 4 1964-05-12 03:00:34+00
40 Sylvester O'Keefe 5 1985-10-26 17:34:37+00
41 Angela Tromp 8 1986-09-30 04:40:47+00
42 Prof. Raegan Larkin 5 1986-02-24 15:40:56+00
43 Dr. Gilda Schiller 9 1989-04-16 02:08:21+00
44 Dr. Alfredo Wolf 2 1969-02-10 16:08:36+00
45 Stanton Rolfson 8 1964-06-26 02:42:04+00
46 Arlene Toy 5 1993-08-25 18:53:06+00
47 Ms. Lisette Torphy V 5 1966-09-01 08:46:53+00
48 Billie Beier 5 1962-04-25 16:32:35+00
49 Margaretta Brakus 4 1984-12-11 14:23:42+00
50 Tessie Wisozk 5 1984-07-22 21:12:13+00
51 Mrs. Harmony Ebert 8 1992-07-11 17:32:54+00
52 Sheila Schamberger 5 1992-03-24 00:07:44+00
53 Gloria Rolfson 5 1975-11-07 14:46:37+00
54 Carlos Cruickshank 2 1971-08-26 09:33:10+00
55 Dr. Davion Wunsch 7 1980-07-04 01:14:31+00
56 Dr. Ursula Davis II 7 1995-01-07 17:18:17+00
57 Chadrick Lueilwitz 7 1966-07-20 17:04:49+00
58 Duncan Kohler 4 1961-09-11 00:33:25+00
59 Mrs. Wanda Zieme 8 1977-10-03 23:52:51+00
60 Prof. Esteban Hayes I 7 1975-03-15 16:52:45+00
61 Amara Hettinger 9 1958-09-06 20:43:41+00
62 Elian Miller 2 1985-05-14 06:25:19+00
63 Dr. Lamar Jakubowski Jr. 7 1957-02-23 02:44:38+00
64 Dr. Alford Schimmel 4 1960-07-12 08:47:43+00
65 Kevin Zulauf III 5 1956-08-11 15:09:26+00
66 Charity Pollich 9 1962-11-04 16:24:19+00
67 Afton Kuhn 8 1956-11-11 18:24:17+00
68 Prof. Ellis Abbott IV 9 1995-09-30 11:16:34+00
69 Prof. Ariel Homenick V 7 1956-07-02 02:26:05+00
70 Dr. Loraine Gaylord 5 1976-11-02 09:08:15+00
71 Mrs. Adah Raynor IV 4 1965-08-11 15:52:43+00
72 Dr. Randy Bechtelar Jr. 5 1969-07-19 22:00:50+00
73 Tressa Bashirian 8 1966-02-07 17:24:15+00
74 Bernadette Boyle 8 1971-11-24 02:06:54+00
75 Evelyn Fay 8 1986-07-18 00:59:32+00
76 Janessa Stanton 5 1986-08-31 05:52:27+00
77 Tina Mitchell DVM 4 1986-11-19 21:18:40+00
78 Faustino Ziemann IV 5 1972-08-20 13:43:58+00
79 Casandra Kiehn 8 1980-01-09 06:31:27+00
80 Ms. Mozell Schamberger I 9 1995-12-29 18:46:02+00
81 Bridgette Blanda 8 1975-02-28 14:26:29+00
82 Howard Feeney 8 1970-03-14 17:49:22+00
83 Ahmad Greenfelder 7 1984-09-13 23:26:20+00
84 Desmond Stroman Jr. 4 1992-08-10 02:29:35+00
85 Mr. Rick Bechtelar I 5 1968-08-01 04:04:58+00
86 Beatrice Gleason 9 1989-02-13 08:04:19+00
87 Madalyn Boyer 8 1989-10-07 01:12:27+00
88 Kaleb Emmerich 2 1978-09-07 20:29:17+00
89 Prof. Cathy Bechtelar MD 7 1981-02-20 12:21:33+00
90 Winifred Marquardt 9 1960-02-23 10:48:34+00
91 Moshe Leuschke Jr. 4 1981-09-30 21:03:42+00
92 Carolina Ebert IV 4 1955-08-29 04:39:07+00
93 Erick Lockman PhD 2 1967-06-29 06:32:29+00
94 Destinee Lindgren 4 1981-10-25 14:04:23+00
95 Nikita Donnelly 8 1971-09-20 10:37:21+00
96 Davion Pollich 9 1964-12-15 02:14:29+00
97 Mona Nolan 9 1959-06-01 23:14:06+00
98 Suzanne Kihn 2 1968-05-28 02:45:06+00
99 Diana Reinger II 4 1970-10-13 23:03:25+00
100 Jackson Turcotte 8 1977-08-12 18:53:18+00
101 Prof. Odell Batz 3 1971-04-17 01:55:15+00
102 Annalise Lakin 1 1955-09-18 08:50:03+00
103 Alvis Keeling 1 1971-12-16 00:31:42+00
104 Estevan Connelly Jr. 6 1970-06-03 09:48:59+00
105 Mr. Howard Crona 6 1969-05-28 10:08:10+00
106 Dr. Alexzander Cassin 3 1988-04-26 12:26:14+00
107 Dr. Billy Langworth 3 1969-12-26 21:00:59+00
108 Prof. Ubaldo Konopelski I 1 1962-11-14 15:28:50+00
109 Birdie Cassin 6 1968-06-05 14:31:57+00
110 Reilly Rice 3 1961-10-13 19:38:34+00
\.
SELECT pg_catalog.setval('employee_employee_id_seq', 110, true);
ALTER TABLE ONLY employee
ADD CONSTRAINT employee_pkey PRIMARY KEY (employee_id);
ALTER TABLE ONLY employee
ADD CONSTRAINT employee_department_id_fkey FOREIGN KEY (department_id) REFERENCES department(department_id);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment