Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.52 KB | None | 0 0
  1. -- PostgreSQL database dump
  2. --
  3. SET statement_timeout = 0;
  4. SET lock_timeout = 0;
  5. SET client_encoding = 'UTF8';
  6. SET standard_conforming_strings = on;
  7. SET check_function_bodies = false;
  8. SET client_min_messages = warning;
  9. CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
  10. COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
  11. SET search_path = public, pg_catalog;
  12. SET default_tablespace = '';
  13. SET default_with_oids = false;
  14.  
  15. -- Name: dc; Type: TABLE; Schema: public; Owner: profh; Tablespace:
  16. --
  17. CREATE TABLE dc (
  18. hero_id integer NOT NULL,
  19. name character varying(50),
  20. power character varying(255),
  21. active boolean DEFAULT true
  22. );
  23. ALTER TABLE dc OWNER TO profh;
  24.  
  25. -- Name: dc_hero_id_seq; Type: SEQUENCE; Schema: public; Owner: profh
  26. --
  27. CREATE SEQUENCE dc_hero_id_seq
  28. START WITH 1
  29. INCREMENT BY 1
  30. NO MINVALUE
  31. NO MAXVALUE
  32. CACHE 1;
  33. ALTER TABLE dc_hero_id_seq OWNER TO profh;
  34. ALTER SEQUENCE dc_hero_id_seq OWNED BY dc.hero_id;
  35.  
  36. -- Name: heroes; Type: TABLE; Schema: public; Owner: profh; Tablespace:
  37. --
  38. CREATE TABLE heroes (
  39. hero_id integer NOT NULL,
  40. name character varying(50),
  41. power character varying(255),
  42. active boolean DEFAULT true,
  43. age integer
  44. );
  45. ALTER TABLE heroes OWNER TO profh;
  46.  
  47. -- Name: heroes_hero_id_seq; Type: SEQUENCE; Schema: public; Owner: profh
  48. --
  49. CREATE SEQUENCE heroes_hero_id_seq
  50. START WITH 1
  51. INCREMENT BY 1
  52. NO MINVALUE
  53. NO MAXVALUE
  54. CACHE 1;
  55. ALTER TABLE heroes_hero_id_seq OWNER TO profh;
  56. ALTER SEQUENCE heroes_hero_id_seq OWNED BY heroes.hero_id;
  57.  
  58.  
  59. --
  60. -- Name: identities; Type: TABLE; Schema: public; Owner: profh; Tablespace:
  61. --
  62.  
  63. CREATE TABLE identities (
  64. hero_id integer NOT NULL,
  65. person_id integer NOT NULL
  66. );
  67. ALTER TABLE identities OWNER TO profh;
  68.  
  69. -- Name: marvel; Type: TABLE; Schema: public; Owner: profh; Tablespace:
  70. --
  71.  
  72. CREATE TABLE marvel (
  73. hero_id integer NOT NULL,
  74. name character varying(50),
  75. power character varying(255),
  76. active boolean DEFAULT true
  77. );
  78. ALTER TABLE marvel OWNER TO profh;
  79.  
  80. -- Name: marvel_hero_id_seq; Type: SEQUENCE; Schema: public; Owner: profh
  81. --
  82. CREATE SEQUENCE marvel_hero_id_seq
  83. START WITH 1
  84. INCREMENT BY 1
  85. NO MINVALUE
  86. NO MAXVALUE
  87. CACHE 1;
  88. ALTER TABLE marvel_hero_id_seq OWNER TO profh;
  89. ALTER SEQUENCE marvel_hero_id_seq OWNED BY marvel.hero_id;
  90.  
  91. -- Name: people; Type: TABLE; Schema: public; Owner: profh; Tablespace:
  92. --
  93. CREATE TABLE people (
  94. person_id integer NOT NULL,
  95. first_name character varying(50),
  96. last_name character varying(50),
  97. height integer,
  98. weight integer,
  99. is_male boolean,
  100. active boolean DEFAULT true,
  101. email character varying(50)
  102. );
  103. ALTER TABLE people OWNER TO profh;
  104.  
  105. -- Name: people_person_id_seq; Type: SEQUENCE; Schema: public; Owner: profh
  106. --
  107.  
  108. CREATE SEQUENCE people_person_id_seq
  109. START WITH 1
  110. INCREMENT BY 1
  111. NO MINVALUE
  112. NO MAXVALUE
  113. CACHE 1;
  114. ALTER TABLE people_person_id_seq OWNER TO profh;
  115. ALTER SEQUENCE people_person_id_seq OWNED BY people.person_id;
  116.  
  117. -- Name: victories; Type: TABLE; Schema: public; Owner: profh; Tablespace:
  118. --
  119.  
  120. CREATE TABLE victories (
  121. id integer NOT NULL,
  122. hero_id integer NOT NULL,
  123. major integer DEFAULT 0,
  124. minor integer DEFAULT 0,
  125. for_month date NOT NULL
  126. );
  127. ALTER TABLE victories OWNER TO profh;
  128.  
  129. -- Name: victories_id_seq; Type: SEQUENCE; Schema: public; Owner: profh
  130. --
  131.  
  132. CREATE SEQUENCE victories_id_seq
  133. START WITH 1
  134. INCREMENT BY 1
  135. NO MINVALUE
  136. NO MAXVALUE
  137. CACHE 1;
  138. ALTER TABLE victories_id_seq OWNER TO profh;
  139. ALTER SEQUENCE victories_id_seq OWNED BY victories.id;
  140.  
  141. ALTER TABLE ONLY dc ALTER COLUMN hero_id SET DEFAULT nextval('dc_hero_id_seq'::regclass);
  142. ALTER TABLE ONLY heroes ALTER COLUMN hero_id SET DEFAULT nextval('heroes_hero_id_seq'::regclass);
  143. ALTER TABLE ONLY marvel ALTER COLUMN hero_id SET DEFAULT nextval('marvel_hero_id_seq'::regclass);
  144. ALTER TABLE ONLY people ALTER COLUMN person_id SET DEFAULT nextval('people_person_id_seq'::regclass);
  145. ALTER TABLE ONLY victories ALTER COLUMN id SET DEFAULT nextval('victories_id_seq'::regclass);
  146.  
  147. -- Data for Name: dc; Type: TABLE DATA; Schema: public; Owner: profh
  148. --
  149.  
  150. COPY dc (hero_id, name, power, active) FROM stdin;
  151. 1 Batman None - just totally awesome t
  152. 2 Superman Flies; great strength; xray vision t
  153. 3 Green Lantern Power ring creates solid constructs based on will; flies t
  154. 4 Hawkeye None, but exceptional archer; keen eyesight t
  155. 5 Wonder Woman Enhanced strength; various weapons t
  156. 6 Angel Teleportation; mind control t
  157. 7 Aquaman Breathes underwater; communicates with marine life t
  158. \.
  159.  
  160. SELECT pg_catalog.setval('dc_hero_id_seq', 7, true);
  161.  
  162. -- Data for Name: heroes; Type: TABLE DATA; Schema: public; Owner: profh
  163. --
  164.  
  165. COPY heroes (hero_id, name, power, active, age) FROM stdin;
  166. 2 Superman flys; great strength; xray vision t \N
  167. 3 Green Lantern Power ring creates solid constructs based on will t \N
  168. 4 Wolverine Healing factor; adamantium skelton; retractable claws t \N
  169. 7 Wonder Woman Enhanced strength; various weapons t \N
  170. 8 Storm Control of weather; flys t \N
  171. 9 Shadowcat Can phase between solid objects t \N
  172. 10 Angel Has wings; flys t \N
  173. 11 Archangel Has wings; flys; shoots projectiles from wings t \N
  174. 12 Colossus Superhuman strength; body can turn into solid metal t \N
  175. 13 Aquaman Breathes underwater; communicates with marine life t \N
  176. 14 The Tickerina nigh-invulnerable t 48
  177. 6 Nightcrawler Teleportation; superhuman agility t 37
  178. 5 Spiderman Spider senses; web-slinging t 23
  179. 1 Batman None - just totally awesome t 52
  180. \.
  181.  
  182. SELECT pg_catalog.setval('heroes_hero_id_seq', 14, true);
  183.  
  184. -- Data for Name: identities; Type: TABLE DATA; Schema: public; Owner: profh
  185. --
  186.  
  187. COPY identities (hero_id, person_id) FROM stdin;
  188. 2 1
  189. 3 2
  190. 3 3
  191. 3 4
  192. 1 6
  193. 4 7
  194. 6 8
  195. 11 15
  196. 8 10
  197. 9 13
  198. 10 15
  199. 5 11
  200. 14 9
  201. \.
  202.  
  203. -- Data for Name: marvel; Type: TABLE DATA; Schema: public; Owner: profh
  204. --
  205.  
  206. COPY marvel (hero_id, name, power, active) FROM stdin;
  207. 1 Spiderman Spider senses; web-slinging t
  208. 2 Wolverine Healing factor; adamantium skelton; retractable claws t
  209. 3 Nightcrawler Teleportation; superhuman agility t
  210. 4 Storm Control of weather; flies t
  211. 5 Shadowcat Can phase through solid objects t
  212. 6 Angel Has wings; flies t
  213. 7 Archangel Has wings; flies; shoots projectiles from wings t
  214. 8 Colossus Superhuman strength; body can turn into solid metal t
  215. 9 Hawkeye None, but exceptional archer; keen eyesight t
  216. \.
  217.  
  218. SELECT pg_catalog.setval('marvel_hero_id_seq', 10, true);
  219.  
  220. -- Data for Name: people; Type: TABLE DATA; Schema: public; Owner: profh
  221. --
  222.  
  223. COPY people (person_id, first_name, last_name, height, weight, is_male, active, email) FROM stdin;
  224. 3 Guy Gardner 72 194 t t \N
  225. 4 Kyle Rayner 73 209 t t \N
  226. 7 Logan \N 68 195 t t \N
  227. 8 Kurt Wagner 68 165 t t \N
  228. 14 Elizabeth Braddock 68 165 f t \N
  229. 9 Larry Heimann 76 230 t t profh@cmu.edu
  230. 6 Bruce Wayne 75 230 t t bruce@wayne.net
  231. 11 Peter Parker 70 180 t t ppaker@gmail.com
  232. 1 Clark Kent 76 225 t t clarkk@yahoo.com
  233. 15 Warren Worthington 72 190 t t flyboy@gmail.com
  234. 12 Anna Marie \N 67 160 f t rogue99@gmail.com
  235. 2 Hal Jordan 71 189 t t glearth@yahoo.com
  236. 10 Ororo Munroe 71 180 f t stormy@gmail.com
  237. 13 Kitty Pryde 66 155 f t kpryde@yahoo.com
  238. 5 Dick Greyson 69 168 t t dgreyson@wayne.net
  239. \.
  240.  
  241. SELECT pg_catalog.setval('people_person_id_seq', 15, true);
  242.  
  243. -- Data for Name: victories; Type: TABLE DATA; Schema: public; Owner: profh
  244. --
  245.  
  246. COPY victories (id, hero_id, major, minor, for_month) FROM stdin;
  247. 1 1 1 23 2012-01-01
  248. 2 1 2 16 2012-02-01
  249. 3 1 1 35 2012-03-01
  250. 4 1 0 17 2012-04-01
  251. 5 1 1 24 2012-05-01
  252. 6 1 0 12 2012-06-01
  253. 7 1 3 42 2012-07-01
  254. 8 1 1 19 2012-08-01
  255. 9 2 0 2 2012-01-01
  256. 10 2 1 1 2012-02-01
  257. 12 2 0 0 2012-04-01
  258. 13 2 1 3 2012-05-01
  259. 14 2 0 0 2012-06-01
  260. 15 2 0 0 2012-07-01
  261. 16 2 1 4 2012-08-01
  262. 11 2 0 3 2012-03-01
  263. 17 5 1 12 2012-01-01
  264. 19 5 0 29 2012-03-01
  265. 20 5 2 8 2012-04-01
  266. 21 5 1 17 2012-05-01
  267. 22 5 0 26 2012-06-01
  268. 23 5 1 20 2012-07-01
  269. 24 5 1 16 2012-08-01
  270. 18 5 1 18 2012-02-01
  271. \.
  272.  
  273. SELECT pg_catalog.setval('victories_id_seq', 28, true);
  274.  
  275. ALTER TABLE ONLY dc
  276. ADD CONSTRAINT dc_pkey PRIMARY KEY (hero_id);
  277.  
  278. ALTER TABLE ONLY heroes
  279. ADD CONSTRAINT heroes_pkey PRIMARY KEY (hero_id);
  280.  
  281. ALTER TABLE ONLY identities
  282. ADD CONSTRAINT identities_pkey PRIMARY KEY (hero_id, person_id);
  283.  
  284. ALTER TABLE ONLY marvel
  285. ADD CONSTRAINT marvel_pkey PRIMARY KEY (hero_id);
  286.  
  287. ALTER TABLE ONLY people
  288. ADD CONSTRAINT people_pkey PRIMARY KEY (person_id);
  289.  
  290. ALTER TABLE ONLY victories
  291. ADD CONSTRAINT victories_pkey PRIMARY KEY (id);
  292.  
  293. ALTER TABLE ONLY victories
  294. ADD CONSTRAINT hero_fk FOREIGN KEY (hero_id) REFERENCES heroes(hero_id);
  295.  
  296. REVOKE ALL ON SCHEMA public FROM PUBLIC;
  297. REVOKE ALL ON SCHEMA public FROM profh;
  298. GRANT ALL ON SCHEMA public TO profh;
  299. GRANT ALL ON SCHEMA public TO PUBLIC;
  300.  
  301. -- PostgreSQL database dump complete
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement