Database project for county school
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1233 lines
29 KiB

  1. --
  2. -- PostgreSQL database dump
  3. --
  4. -- Dumped from database version 11.4 (Ubuntu 11.4-1.pgdg18.04+1)
  5. -- Dumped by pg_dump version 11.4 (Ubuntu 11.4-1.pgdg18.04+1)
  6. SET statement_timeout = 0;
  7. SET lock_timeout = 0;
  8. SET idle_in_transaction_session_timeout = 0;
  9. SET client_encoding = 'UTF8';
  10. SET standard_conforming_strings = on;
  11. SELECT pg_catalog.set_config('search_path', '', false);
  12. SET check_function_bodies = false;
  13. SET xmloption = content;
  14. SET client_min_messages = warning;
  15. SET row_security = off;
  16. SET default_tablespace = '';
  17. SET default_with_oids = false;
  18. --
  19. -- Name: actividad; Type: TABLE; Schema: public; Owner: cromer
  20. --
  21. CREATE TABLE public.actividad (
  22. id_actividad integer NOT NULL,
  23. nombre character varying(50) NOT NULL,
  24. cupos smallint,
  25. lugar character varying(20) NOT NULL,
  26. rut_profesor character varying(9) NOT NULL,
  27. CONSTRAINT actividad_cupos_check CHECK ((cupos > 0)),
  28. CONSTRAINT actividad_rut_profesor_check CHECK (((rut_profesor)::text ~ '^[0-9k]+$'::text))
  29. );
  30. ALTER TABLE public.actividad OWNER TO cromer;
  31. --
  32. -- Name: actividad_bloque; Type: TABLE; Schema: public; Owner: cromer
  33. --
  34. CREATE TABLE public.actividad_bloque (
  35. id_actividad integer NOT NULL,
  36. id_bloque integer NOT NULL
  37. );
  38. ALTER TABLE public.actividad_bloque OWNER TO cromer;
  39. --
  40. -- Name: actividad_id_actividad_seq; Type: SEQUENCE; Schema: public; Owner: cromer
  41. --
  42. CREATE SEQUENCE public.actividad_id_actividad_seq
  43. AS integer
  44. START WITH 1
  45. INCREMENT BY 1
  46. NO MINVALUE
  47. NO MAXVALUE
  48. CACHE 1;
  49. ALTER TABLE public.actividad_id_actividad_seq OWNER TO cromer;
  50. --
  51. -- Name: actividad_id_actividad_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: cromer
  52. --
  53. ALTER SEQUENCE public.actividad_id_actividad_seq OWNED BY public.actividad.id_actividad;
  54. --
  55. -- Name: actividad_nivel; Type: TABLE; Schema: public; Owner: cromer
  56. --
  57. CREATE TABLE public.actividad_nivel (
  58. id_actividad integer NOT NULL,
  59. id_nivel integer NOT NULL
  60. );
  61. ALTER TABLE public.actividad_nivel OWNER TO cromer;
  62. --
  63. -- Name: alumno; Type: TABLE; Schema: public; Owner: cromer
  64. --
  65. CREATE TABLE public.alumno (
  66. rut_alumno character varying(9) NOT NULL,
  67. nombres character varying(50) NOT NULL,
  68. apellidos character varying(50) NOT NULL,
  69. direccion character varying(30) NOT NULL,
  70. id_ciudad smallint,
  71. anyo_ingreso smallint,
  72. fecha_nacimiento date NOT NULL,
  73. rut_apoderado character varying(9) NOT NULL,
  74. CONSTRAINT alumno_anyo_ingreso_check CHECK ((anyo_ingreso > 1980)),
  75. CONSTRAINT alumno_fecha_nacimiento_check CHECK ((fecha_nacimiento > '1980-01-01'::date)),
  76. CONSTRAINT alumno_rut_alumno_check CHECK (((rut_alumno)::text ~ '^[0-9k]+$'::text)),
  77. CONSTRAINT alumno_rut_apoderado_check CHECK (((rut_apoderado)::text ~ '^[0-9k]+$'::text))
  78. );
  79. ALTER TABLE public.alumno OWNER TO cromer;
  80. --
  81. -- Name: apoderado; Type: TABLE; Schema: public; Owner: cromer
  82. --
  83. CREATE TABLE public.apoderado (
  84. rut_apoderado character varying(9) NOT NULL,
  85. nombres character varying(50) NOT NULL,
  86. apellidos character varying(50) NOT NULL,
  87. direccion character varying(30) NOT NULL,
  88. id_ciudad smallint,
  89. CONSTRAINT apoderado_rut_apoderado_check CHECK (((rut_apoderado)::text ~ '^[0-9k]+$'::text))
  90. );
  91. ALTER TABLE public.apoderado OWNER TO cromer;
  92. --
  93. -- Name: asignatura; Type: TABLE; Schema: public; Owner: cromer
  94. --
  95. CREATE TABLE public.asignatura (
  96. id_asignatura integer NOT NULL,
  97. nombre character varying(50) NOT NULL,
  98. rut_profesor character varying(9) NOT NULL,
  99. CONSTRAINT asignatura_rut_profesor_check CHECK (((rut_profesor)::text ~ '^[0-9k]+$'::text))
  100. );
  101. ALTER TABLE public.asignatura OWNER TO cromer;
  102. --
  103. -- Name: asignatura_id_asignatura_seq; Type: SEQUENCE; Schema: public; Owner: cromer
  104. --
  105. CREATE SEQUENCE public.asignatura_id_asignatura_seq
  106. AS integer
  107. START WITH 1
  108. INCREMENT BY 1
  109. NO MINVALUE
  110. NO MAXVALUE
  111. CACHE 1;
  112. ALTER TABLE public.asignatura_id_asignatura_seq OWNER TO cromer;
  113. --
  114. -- Name: asignatura_id_asignatura_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: cromer
  115. --
  116. ALTER SEQUENCE public.asignatura_id_asignatura_seq OWNED BY public.asignatura.id_asignatura;
  117. --
  118. -- Name: asistente; Type: TABLE; Schema: public; Owner: cromer
  119. --
  120. CREATE TABLE public.asistente (
  121. rut_profesor character varying(9) NOT NULL,
  122. id_curso character varying(10) NOT NULL,
  123. CONSTRAINT asistente_rut_profesor_check CHECK (((rut_profesor)::text ~ '^[0-9k]+$'::text))
  124. );
  125. ALTER TABLE public.asistente OWNER TO cromer;
  126. --
  127. -- Name: asociado; Type: TABLE; Schema: public; Owner: cromer
  128. --
  129. CREATE TABLE public.asociado (
  130. id_curso character varying(10) NOT NULL,
  131. id_asignatura integer NOT NULL
  132. );
  133. ALTER TABLE public.asociado OWNER TO cromer;
  134. --
  135. -- Name: bloque; Type: TABLE; Schema: public; Owner: cromer
  136. --
  137. CREATE TABLE public.bloque (
  138. id_bloque integer NOT NULL,
  139. descripcion character varying(20) NOT NULL
  140. );
  141. ALTER TABLE public.bloque OWNER TO cromer;
  142. --
  143. -- Name: bloque_id_bloque_seq; Type: SEQUENCE; Schema: public; Owner: cromer
  144. --
  145. CREATE SEQUENCE public.bloque_id_bloque_seq
  146. AS integer
  147. START WITH 1
  148. INCREMENT BY 1
  149. NO MINVALUE
  150. NO MAXVALUE
  151. CACHE 1;
  152. ALTER TABLE public.bloque_id_bloque_seq OWNER TO cromer;
  153. --
  154. -- Name: bloque_id_bloque_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: cromer
  155. --
  156. ALTER SEQUENCE public.bloque_id_bloque_seq OWNED BY public.bloque.id_bloque;
  157. --
  158. -- Name: ciudad; Type: TABLE; Schema: public; Owner: cromer
  159. --
  160. CREATE TABLE public.ciudad (
  161. id_ciudad smallint NOT NULL,
  162. nombre_ciudad character varying(20) NOT NULL,
  163. id_region smallint
  164. );
  165. ALTER TABLE public.ciudad OWNER TO cromer;
  166. --
  167. -- Name: ciudad_id_ciudad_seq; Type: SEQUENCE; Schema: public; Owner: cromer
  168. --
  169. CREATE SEQUENCE public.ciudad_id_ciudad_seq
  170. AS smallint
  171. START WITH 1
  172. INCREMENT BY 1
  173. NO MINVALUE
  174. NO MAXVALUE
  175. CACHE 1;
  176. ALTER TABLE public.ciudad_id_ciudad_seq OWNER TO cromer;
  177. --
  178. -- Name: ciudad_id_ciudad_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: cromer
  179. --
  180. ALTER SEQUENCE public.ciudad_id_ciudad_seq OWNED BY public.ciudad.id_ciudad;
  181. --
  182. -- Name: cursar; Type: TABLE; Schema: public; Owner: cromer
  183. --
  184. CREATE TABLE public.cursar (
  185. rut_alumno character varying(9) NOT NULL,
  186. id_curso character varying(10) NOT NULL,
  187. CONSTRAINT cursar_rut_alumno_check CHECK (((rut_alumno)::text ~ '^[0-9k]+$'::text))
  188. );
  189. ALTER TABLE public.cursar OWNER TO cromer;
  190. --
  191. -- Name: curso; Type: TABLE; Schema: public; Owner: cromer
  192. --
  193. CREATE TABLE public.curso (
  194. id_curso character varying(10) NOT NULL,
  195. nombre character varying(6) NOT NULL,
  196. anyo smallint,
  197. rut_profesor character varying(9) NOT NULL,
  198. CONSTRAINT curso_anyo_check CHECK ((anyo > 1980)),
  199. CONSTRAINT curso_rut_profesor_check CHECK (((rut_profesor)::text ~ '^[0-9k]+$'::text))
  200. );
  201. ALTER TABLE public.curso OWNER TO cromer;
  202. --
  203. -- Name: horario; Type: TABLE; Schema: public; Owner: cromer
  204. --
  205. CREATE TABLE public.horario (
  206. id_asignatura integer NOT NULL,
  207. id_bloque integer NOT NULL,
  208. sala character varying(20) NOT NULL
  209. );
  210. ALTER TABLE public.horario OWNER TO cromer;
  211. --
  212. -- Name: nivel; Type: TABLE; Schema: public; Owner: cromer
  213. --
  214. CREATE TABLE public.nivel (
  215. id_nivel integer NOT NULL,
  216. nombre character varying(20) NOT NULL
  217. );
  218. ALTER TABLE public.nivel OWNER TO cromer;
  219. --
  220. -- Name: nivel_id_nivel_seq; Type: SEQUENCE; Schema: public; Owner: cromer
  221. --
  222. CREATE SEQUENCE public.nivel_id_nivel_seq
  223. AS integer
  224. START WITH 1
  225. INCREMENT BY 1
  226. NO MINVALUE
  227. NO MAXVALUE
  228. CACHE 1;
  229. ALTER TABLE public.nivel_id_nivel_seq OWNER TO cromer;
  230. --
  231. -- Name: nivel_id_nivel_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: cromer
  232. --
  233. ALTER SEQUENCE public.nivel_id_nivel_seq OWNED BY public.nivel.id_nivel;
  234. --
  235. -- Name: participar; Type: TABLE; Schema: public; Owner: cromer
  236. --
  237. CREATE TABLE public.participar (
  238. rut_alumno character varying(9) NOT NULL,
  239. id_actividad integer NOT NULL,
  240. CONSTRAINT participar_rut_alumno_check CHECK (((rut_alumno)::text ~ '^[0-9k]+$'::text))
  241. );
  242. ALTER TABLE public.participar OWNER TO cromer;
  243. --
  244. -- Name: profesor; Type: TABLE; Schema: public; Owner: cromer
  245. --
  246. CREATE TABLE public.profesor (
  247. rut_profesor character varying(9) NOT NULL,
  248. nombres character varying(50) NOT NULL,
  249. apellidos character varying(50) NOT NULL,
  250. direccion character varying(30) NOT NULL,
  251. id_ciudad smallint,
  252. CONSTRAINT profesor_rut_profesor_check CHECK (((rut_profesor)::text ~ '^[0-9k]+$'::text))
  253. );
  254. ALTER TABLE public.profesor OWNER TO cromer;
  255. --
  256. -- Name: region; Type: TABLE; Schema: public; Owner: cromer
  257. --
  258. CREATE TABLE public.region (
  259. id_region smallint NOT NULL,
  260. nombre_region character varying(20) NOT NULL
  261. );
  262. ALTER TABLE public.region OWNER TO cromer;
  263. --
  264. -- Name: region_id_region_seq; Type: SEQUENCE; Schema: public; Owner: cromer
  265. --
  266. CREATE SEQUENCE public.region_id_region_seq
  267. AS smallint
  268. START WITH 1
  269. INCREMENT BY 1
  270. NO MINVALUE
  271. NO MAXVALUE
  272. CACHE 1;
  273. ALTER TABLE public.region_id_region_seq OWNER TO cromer;
  274. --
  275. -- Name: region_id_region_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: cromer
  276. --
  277. ALTER SEQUENCE public.region_id_region_seq OWNED BY public.region.id_region;
  278. --
  279. -- Name: registro; Type: TABLE; Schema: public; Owner: cromer
  280. --
  281. CREATE TABLE public.registro (
  282. rut_alumno character varying(9) NOT NULL,
  283. id_asignatura integer NOT NULL,
  284. nota numeric(2,1),
  285. CONSTRAINT registro_nota_check CHECK (((nota >= 1.0) AND (nota <= 7.0))),
  286. CONSTRAINT registro_rut_alumno_check CHECK (((rut_alumno)::text ~ '^[0-9k]+$'::text))
  287. );
  288. ALTER TABLE public.registro OWNER TO cromer;
  289. --
  290. -- Name: actividad id_actividad; Type: DEFAULT; Schema: public; Owner: cromer
  291. --
  292. ALTER TABLE ONLY public.actividad ALTER COLUMN id_actividad SET DEFAULT nextval('public.actividad_id_actividad_seq'::regclass);
  293. --
  294. -- Name: asignatura id_asignatura; Type: DEFAULT; Schema: public; Owner: cromer
  295. --
  296. ALTER TABLE ONLY public.asignatura ALTER COLUMN id_asignatura SET DEFAULT nextval('public.asignatura_id_asignatura_seq'::regclass);
  297. --
  298. -- Name: bloque id_bloque; Type: DEFAULT; Schema: public; Owner: cromer
  299. --
  300. ALTER TABLE ONLY public.bloque ALTER COLUMN id_bloque SET DEFAULT nextval('public.bloque_id_bloque_seq'::regclass);
  301. --
  302. -- Name: ciudad id_ciudad; Type: DEFAULT; Schema: public; Owner: cromer
  303. --
  304. ALTER TABLE ONLY public.ciudad ALTER COLUMN id_ciudad SET DEFAULT nextval('public.ciudad_id_ciudad_seq'::regclass);
  305. --
  306. -- Name: nivel id_nivel; Type: DEFAULT; Schema: public; Owner: cromer
  307. --
  308. ALTER TABLE ONLY public.nivel ALTER COLUMN id_nivel SET DEFAULT nextval('public.nivel_id_nivel_seq'::regclass);
  309. --
  310. -- Name: region id_region; Type: DEFAULT; Schema: public; Owner: cromer
  311. --
  312. ALTER TABLE ONLY public.region ALTER COLUMN id_region SET DEFAULT nextval('public.region_id_region_seq'::regclass);
  313. --
  314. -- Data for Name: actividad; Type: TABLE DATA; Schema: public; Owner: cromer
  315. --
  316. COPY public.actividad (id_actividad, nombre, cupos, lugar, rut_profesor) FROM stdin;
  317. 1 Quidditch 14 Quidditch field 226174788
  318. 2 Ogre taming 5 The forbidden forest 226779329
  319. 3 Advanced transfiguration 2 Headmaster's office 139414853
  320. 4 Rugby 30 Rugby field 226174788
  321. \.
  322. --
  323. -- Data for Name: actividad_bloque; Type: TABLE DATA; Schema: public; Owner: cromer
  324. --
  325. COPY public.actividad_bloque (id_actividad, id_bloque) FROM stdin;
  326. 1 1
  327. 2 2
  328. 3 3
  329. \.
  330. --
  331. -- Data for Name: actividad_nivel; Type: TABLE DATA; Schema: public; Owner: cromer
  332. --
  333. COPY public.actividad_nivel (id_actividad, id_nivel) FROM stdin;
  334. 1 1
  335. 2 2
  336. 3 3
  337. \.
  338. --
  339. -- Data for Name: alumno; Type: TABLE DATA; Schema: public; Owner: cromer
  340. --
  341. COPY public.alumno (rut_alumno, nombres, apellidos, direccion, id_ciudad, anyo_ingreso, fecha_nacimiento, rut_apoderado) FROM stdin;
  342. 254049492 Isabella Lynn Cromer Chacano 214 Edison Dr. 1 2019 2019-10-04 14592927k
  343. 245191391 Tomas Bunt Avenida San Sebastian 778 2 2018 2010-02-05 192186099
  344. 18028642k Tom Riddle 320 Thomas Jefferson St. 3 2017 2014-12-31 192199859
  345. 22690395k Draco Malfoy 743 Thames Ave. 1 2017 2006-10-04 192199859
  346. 215221350 Victor Krum 9282 Park Way 1 2017 2007-02-12 192199859
  347. 144715179 Pansy Parkinson 339 Mobile Hwy. 1 2017 2008-12-03 192199859
  348. 86210681 Oliver Wood 323 Crane Ave. 1 2017 2007-01-02 192199859
  349. 20084453k Theodore Nott 848 Short Way 1 2017 2006-02-04 192199859
  350. 133765859 Cormac McLaggen 484 9th Ave. 1 2017 2007-01-08 192199859
  351. \.
  352. --
  353. -- Data for Name: apoderado; Type: TABLE DATA; Schema: public; Owner: cromer
  354. --
  355. COPY public.apoderado (rut_apoderado, nombres, apellidos, direccion, id_ciudad) FROM stdin;
  356. 14592927k Christopher Barry Cromer 214 Edison Dr. 1
  357. 192186099 Elia Alejandra Chacano Troncoso Avenida San Sebastian 778 2
  358. 192199859 Jack Johnson 320 Thomas Jefferson St. 3
  359. \.
  360. --
  361. -- Data for Name: asignatura; Type: TABLE DATA; Schema: public; Owner: cromer
  362. --
  363. COPY public.asignatura (id_asignatura, nombre, rut_profesor) FROM stdin;
  364. 1 Transfiguration 226779329
  365. 2 Defense against the dark arts 226174788
  366. 3 Muggle studies 139414853
  367. 4 Potions 226174788
  368. \.
  369. --
  370. -- Data for Name: asistente; Type: TABLE DATA; Schema: public; Owner: cromer
  371. --
  372. COPY public.asistente (rut_profesor, id_curso) FROM stdin;
  373. 139414853 1A-2019
  374. 226174788 2B-2019
  375. \.
  376. --
  377. -- Data for Name: asociado; Type: TABLE DATA; Schema: public; Owner: cromer
  378. --
  379. COPY public.asociado (id_curso, id_asignatura) FROM stdin;
  380. 1A-2019 1
  381. 2B-2019 2
  382. 3C-2019 3
  383. 6A-2018 1
  384. 6A-2018 2
  385. 6A-2018 3
  386. 1A-2018 4
  387. \.
  388. --
  389. -- Data for Name: bloque; Type: TABLE DATA; Schema: public; Owner: cromer
  390. --
  391. COPY public.bloque (id_bloque, descripcion) FROM stdin;
  392. 1 08:10 - 09:30
  393. 2 09:40 - 11:00
  394. 3 11:10 - 12:30
  395. 4 12:40 - 14:00
  396. 5 14:10 - 15:30
  397. 6 15:40 - 17:00
  398. 7 17:10 - 18:30
  399. 8 18:40 - 20:00
  400. \.
  401. --
  402. -- Data for Name: ciudad; Type: TABLE DATA; Schema: public; Owner: cromer
  403. --
  404. COPY public.ciudad (id_ciudad, nombre_ciudad, id_region) FROM stdin;
  405. 1 Pensacola 1
  406. 2 Montgomery 2
  407. 3 Virginia Beach 3
  408. \.
  409. --
  410. -- Data for Name: cursar; Type: TABLE DATA; Schema: public; Owner: cromer
  411. --
  412. COPY public.cursar (rut_alumno, id_curso) FROM stdin;
  413. 254049492 1A-2019
  414. 245191391 2B-2019
  415. 18028642k 3C-2019
  416. 22690395k 6A-2018
  417. 215221350 6A-2018
  418. 144715179 6A-2018
  419. 86210681 2B-2019
  420. 20084453k 2B-2019
  421. 133765859 3C-2019
  422. \.
  423. --
  424. -- Data for Name: curso; Type: TABLE DATA; Schema: public; Owner: cromer
  425. --
  426. COPY public.curso (id_curso, nombre, anyo, rut_profesor) FROM stdin;
  427. 1A-2019 1A 2019 226174788
  428. 2B-2019 2B 2019 226779329
  429. 3C-2019 3C 2019 139414853
  430. 6A-2018 6A 2018 226174788
  431. 1A-2018 1A 2018 226779329
  432. \.
  433. --
  434. -- Data for Name: horario; Type: TABLE DATA; Schema: public; Owner: cromer
  435. --
  436. COPY public.horario (id_asignatura, id_bloque, sala) FROM stdin;
  437. 2 2 301AB
  438. 3 3 102AA
  439. 1 1 203AC
  440. 4 8 105AA
  441. \.
  442. --
  443. -- Data for Name: nivel; Type: TABLE DATA; Schema: public; Owner: cromer
  444. --
  445. COPY public.nivel (id_nivel, nombre) FROM stdin;
  446. 1 Primero
  447. 2 Segundo
  448. 3 Tercero
  449. \.
  450. --
  451. -- Data for Name: participar; Type: TABLE DATA; Schema: public; Owner: cromer
  452. --
  453. COPY public.participar (rut_alumno, id_actividad) FROM stdin;
  454. 254049492 1
  455. 245191391 2
  456. 18028642k 3
  457. 22690395k 1
  458. 215221350 1
  459. 144715179 1
  460. 86210681 1
  461. 20084453k 1
  462. 133765859 1
  463. 22690395k 4
  464. \.
  465. --
  466. -- Data for Name: profesor; Type: TABLE DATA; Schema: public; Owner: cromer
  467. --
  468. COPY public.profesor (rut_profesor, nombres, apellidos, direccion, id_ciudad) FROM stdin;
  469. 226174788 Severus Snape 232 Jackson Ave. 1
  470. 226779329 Minerva McGonagall 333 Nottingham Ln. 2
  471. 139414853 Albus Dumbledore 8450 Sparrow Rd. 3
  472. \.
  473. --
  474. -- Data for Name: region; Type: TABLE DATA; Schema: public; Owner: cromer
  475. --
  476. COPY public.region (id_region, nombre_region) FROM stdin;
  477. 1 Bío Bío
  478. 2 Ñuble
  479. 3 Virginia
  480. \.
  481. --
  482. -- Data for Name: registro; Type: TABLE DATA; Schema: public; Owner: cromer
  483. --
  484. COPY public.registro (rut_alumno, id_asignatura, nota) FROM stdin;
  485. 254049492 1 7.0
  486. 18028642k 3 1.0
  487. 22690395k 4 3.0
  488. 144715179 4 2.0
  489. 245191391 2 4.1
  490. 86210681 4 5.0
  491. \.
  492. --
  493. -- Name: actividad_id_actividad_seq; Type: SEQUENCE SET; Schema: public; Owner: cromer
  494. --
  495. SELECT pg_catalog.setval('public.actividad_id_actividad_seq', 1, false);
  496. --
  497. -- Name: asignatura_id_asignatura_seq; Type: SEQUENCE SET; Schema: public; Owner: cromer
  498. --
  499. SELECT pg_catalog.setval('public.asignatura_id_asignatura_seq', 13, true);
  500. --
  501. -- Name: bloque_id_bloque_seq; Type: SEQUENCE SET; Schema: public; Owner: cromer
  502. --
  503. SELECT pg_catalog.setval('public.bloque_id_bloque_seq', 1, false);
  504. --
  505. -- Name: ciudad_id_ciudad_seq; Type: SEQUENCE SET; Schema: public; Owner: cromer
  506. --
  507. SELECT pg_catalog.setval('public.ciudad_id_ciudad_seq', 1, false);
  508. --
  509. -- Name: nivel_id_nivel_seq; Type: SEQUENCE SET; Schema: public; Owner: cromer
  510. --
  511. SELECT pg_catalog.setval('public.nivel_id_nivel_seq', 1, false);
  512. --
  513. -- Name: region_id_region_seq; Type: SEQUENCE SET; Schema: public; Owner: cromer
  514. --
  515. SELECT pg_catalog.setval('public.region_id_region_seq', 1, false);
  516. --
  517. -- Name: actividad_bloque actividad_bloque_pkey; Type: CONSTRAINT; Schema: public; Owner: cromer
  518. --
  519. ALTER TABLE ONLY public.actividad_bloque
  520. ADD CONSTRAINT actividad_bloque_pkey PRIMARY KEY (id_actividad, id_bloque);
  521. --
  522. -- Name: actividad_nivel actividad_nivel_pkey; Type: CONSTRAINT; Schema: public; Owner: cromer
  523. --
  524. ALTER TABLE ONLY public.actividad_nivel
  525. ADD CONSTRAINT actividad_nivel_pkey PRIMARY KEY (id_actividad, id_nivel);
  526. --
  527. -- Name: actividad actividad_pkey; Type: CONSTRAINT; Schema: public; Owner: cromer
  528. --
  529. ALTER TABLE ONLY public.actividad
  530. ADD CONSTRAINT actividad_pkey PRIMARY KEY (id_actividad);
  531. --
  532. -- Name: alumno alumno_pkey; Type: CONSTRAINT; Schema: public; Owner: cromer
  533. --
  534. ALTER TABLE ONLY public.alumno
  535. ADD CONSTRAINT alumno_pkey PRIMARY KEY (rut_alumno);
  536. --
  537. -- Name: apoderado apoderado_pkey; Type: CONSTRAINT; Schema: public; Owner: cromer
  538. --
  539. ALTER TABLE ONLY public.apoderado
  540. ADD CONSTRAINT apoderado_pkey PRIMARY KEY (rut_apoderado);
  541. --
  542. -- Name: asignatura asignatura_pkey; Type: CONSTRAINT; Schema: public; Owner: cromer
  543. --
  544. ALTER TABLE ONLY public.asignatura
  545. ADD CONSTRAINT asignatura_pkey PRIMARY KEY (id_asignatura);
  546. --
  547. -- Name: asistente asistente_pkey; Type: CONSTRAINT; Schema: public; Owner: cromer
  548. --
  549. ALTER TABLE ONLY public.asistente
  550. ADD CONSTRAINT asistente_pkey PRIMARY KEY (rut_profesor, id_curso);
  551. --
  552. -- Name: asociado asociado_pkey; Type: CONSTRAINT; Schema: public; Owner: cromer
  553. --
  554. ALTER TABLE ONLY public.asociado
  555. ADD CONSTRAINT asociado_pkey PRIMARY KEY (id_curso, id_asignatura);
  556. --
  557. -- Name: bloque bloque_pkey; Type: CONSTRAINT; Schema: public; Owner: cromer
  558. --
  559. ALTER TABLE ONLY public.bloque
  560. ADD CONSTRAINT bloque_pkey PRIMARY KEY (id_bloque);
  561. --
  562. -- Name: ciudad ciudad_pkey; Type: CONSTRAINT; Schema: public; Owner: cromer
  563. --
  564. ALTER TABLE ONLY public.ciudad
  565. ADD CONSTRAINT ciudad_pkey PRIMARY KEY (id_ciudad);
  566. --
  567. -- Name: cursar cursar_pkey; Type: CONSTRAINT; Schema: public; Owner: cromer
  568. --
  569. ALTER TABLE ONLY public.cursar
  570. ADD CONSTRAINT cursar_pkey PRIMARY KEY (rut_alumno, id_curso);
  571. --
  572. -- Name: curso curso_pkey; Type: CONSTRAINT; Schema: public; Owner: cromer
  573. --
  574. ALTER TABLE ONLY public.curso
  575. ADD CONSTRAINT curso_pkey PRIMARY KEY (id_curso);
  576. --
  577. -- Name: horario horario_pkey; Type: CONSTRAINT; Schema: public; Owner: cromer
  578. --
  579. ALTER TABLE ONLY public.horario
  580. ADD CONSTRAINT horario_pkey PRIMARY KEY (id_asignatura, id_bloque);
  581. --
  582. -- Name: nivel nivel_pkey; Type: CONSTRAINT; Schema: public; Owner: cromer
  583. --
  584. ALTER TABLE ONLY public.nivel
  585. ADD CONSTRAINT nivel_pkey PRIMARY KEY (id_nivel);
  586. --
  587. -- Name: participar participar_pkey; Type: CONSTRAINT; Schema: public; Owner: cromer
  588. --
  589. ALTER TABLE ONLY public.participar
  590. ADD CONSTRAINT participar_pkey PRIMARY KEY (rut_alumno, id_actividad);
  591. --
  592. -- Name: profesor profesor_pkey; Type: CONSTRAINT; Schema: public; Owner: cromer
  593. --
  594. ALTER TABLE ONLY public.profesor
  595. ADD CONSTRAINT profesor_pkey PRIMARY KEY (rut_profesor);
  596. --
  597. -- Name: region region_pkey; Type: CONSTRAINT; Schema: public; Owner: cromer
  598. --
  599. ALTER TABLE ONLY public.region
  600. ADD CONSTRAINT region_pkey PRIMARY KEY (id_region);
  601. --
  602. -- Name: registro registro_pkey; Type: CONSTRAINT; Schema: public; Owner: cromer
  603. --
  604. ALTER TABLE ONLY public.registro
  605. ADD CONSTRAINT registro_pkey PRIMARY KEY (rut_alumno, id_asignatura);
  606. --
  607. -- Name: actividad_bloque actividad_bloque_id_actividad_fkey; Type: FK CONSTRAINT; Schema: public; Owner: cromer
  608. --
  609. ALTER TABLE ONLY public.actividad_bloque
  610. ADD CONSTRAINT actividad_bloque_id_actividad_fkey FOREIGN KEY (id_actividad) REFERENCES public.actividad(id_actividad) ON DELETE RESTRICT;
  611. --
  612. -- Name: actividad_bloque actividad_bloque_id_bloque_fkey; Type: FK CONSTRAINT; Schema: public; Owner: cromer
  613. --
  614. ALTER TABLE ONLY public.actividad_bloque
  615. ADD CONSTRAINT actividad_bloque_id_bloque_fkey FOREIGN KEY (id_bloque) REFERENCES public.bloque(id_bloque) ON DELETE RESTRICT;
  616. --
  617. -- Name: actividad_nivel actividad_nivel_id_actividad_fkey; Type: FK CONSTRAINT; Schema: public; Owner: cromer
  618. --
  619. ALTER TABLE ONLY public.actividad_nivel
  620. ADD CONSTRAINT actividad_nivel_id_actividad_fkey FOREIGN KEY (id_actividad) REFERENCES public.actividad(id_actividad) ON DELETE RESTRICT;
  621. --
  622. -- Name: actividad_nivel actividad_nivel_id_nivel_fkey; Type: FK CONSTRAINT; Schema: public; Owner: cromer
  623. --
  624. ALTER TABLE ONLY public.actividad_nivel
  625. ADD CONSTRAINT actividad_nivel_id_nivel_fkey FOREIGN KEY (id_nivel) REFERENCES public.nivel(id_nivel) ON DELETE RESTRICT;
  626. --
  627. -- Name: actividad actividad_rut_profesor_fkey; Type: FK CONSTRAINT; Schema: public; Owner: cromer
  628. --
  629. ALTER TABLE ONLY public.actividad
  630. ADD CONSTRAINT actividad_rut_profesor_fkey FOREIGN KEY (rut_profesor) REFERENCES public.profesor(rut_profesor) ON DELETE RESTRICT;
  631. --
  632. -- Name: alumno alumno_id_ciudad_fkey; Type: FK CONSTRAINT; Schema: public; Owner: cromer
  633. --
  634. ALTER TABLE ONLY public.alumno
  635. ADD CONSTRAINT alumno_id_ciudad_fkey FOREIGN KEY (id_ciudad) REFERENCES public.ciudad(id_ciudad) ON DELETE RESTRICT;
  636. --
  637. -- Name: alumno alumno_rut_apoderado_fkey; Type: FK CONSTRAINT; Schema: public; Owner: cromer
  638. --
  639. ALTER TABLE ONLY public.alumno
  640. ADD CONSTRAINT alumno_rut_apoderado_fkey FOREIGN KEY (rut_apoderado) REFERENCES public.apoderado(rut_apoderado) ON DELETE RESTRICT;
  641. --
  642. -- Name: apoderado apoderado_id_ciudad_fkey; Type: FK CONSTRAINT; Schema: public; Owner: cromer
  643. --
  644. ALTER TABLE ONLY public.apoderado
  645. ADD CONSTRAINT apoderado_id_ciudad_fkey FOREIGN KEY (id_ciudad) REFERENCES public.ciudad(id_ciudad) ON DELETE RESTRICT;
  646. --
  647. -- Name: asignatura asignatura_rut_profesor_fkey; Type: FK CONSTRAINT; Schema: public; Owner: cromer
  648. --
  649. ALTER TABLE ONLY public.asignatura
  650. ADD CONSTRAINT asignatura_rut_profesor_fkey FOREIGN KEY (rut_profesor) REFERENCES public.profesor(rut_profesor) ON DELETE RESTRICT;
  651. --
  652. -- Name: asistente asistente_id_curso_fkey; Type: FK CONSTRAINT; Schema: public; Owner: cromer
  653. --
  654. ALTER TABLE ONLY public.asistente
  655. ADD CONSTRAINT asistente_id_curso_fkey FOREIGN KEY (id_curso) REFERENCES public.curso(id_curso) ON DELETE RESTRICT;
  656. --
  657. -- Name: asistente asistente_rut_profesor_fkey; Type: FK CONSTRAINT; Schema: public; Owner: cromer
  658. --
  659. ALTER TABLE ONLY public.asistente
  660. ADD CONSTRAINT asistente_rut_profesor_fkey FOREIGN KEY (rut_profesor) REFERENCES public.profesor(rut_profesor) ON DELETE RESTRICT;
  661. --
  662. -- Name: asociado asociado_id_asignatura_fkey; Type: FK CONSTRAINT; Schema: public; Owner: cromer
  663. --
  664. ALTER TABLE ONLY public.asociado
  665. ADD CONSTRAINT asociado_id_asignatura_fkey FOREIGN KEY (id_asignatura) REFERENCES public.asignatura(id_asignatura) ON DELETE RESTRICT;
  666. --
  667. -- Name: asociado asociado_id_curso_fkey; Type: FK CONSTRAINT; Schema: public; Owner: cromer
  668. --
  669. ALTER TABLE ONLY public.asociado
  670. ADD CONSTRAINT asociado_id_curso_fkey FOREIGN KEY (id_curso) REFERENCES public.curso(id_curso) ON DELETE RESTRICT;
  671. --
  672. -- Name: ciudad ciudad_id_region_fkey; Type: FK CONSTRAINT; Schema: public; Owner: cromer
  673. --
  674. ALTER TABLE ONLY public.ciudad
  675. ADD CONSTRAINT ciudad_id_region_fkey FOREIGN KEY (id_region) REFERENCES public.region(id_region) ON DELETE RESTRICT;
  676. --
  677. -- Name: cursar cursar_id_curso_fkey; Type: FK CONSTRAINT; Schema: public; Owner: cromer
  678. --
  679. ALTER TABLE ONLY public.cursar
  680. ADD CONSTRAINT cursar_id_curso_fkey FOREIGN KEY (id_curso) REFERENCES public.curso(id_curso) ON DELETE RESTRICT;
  681. --
  682. -- Name: cursar cursar_rut_alumno_fkey; Type: FK CONSTRAINT; Schema: public; Owner: cromer
  683. --
  684. ALTER TABLE ONLY public.cursar
  685. ADD CONSTRAINT cursar_rut_alumno_fkey FOREIGN KEY (rut_alumno) REFERENCES public.alumno(rut_alumno) ON DELETE RESTRICT;
  686. --
  687. -- Name: curso curso_rut_profesor_fkey; Type: FK CONSTRAINT; Schema: public; Owner: cromer
  688. --
  689. ALTER TABLE ONLY public.curso
  690. ADD CONSTRAINT curso_rut_profesor_fkey FOREIGN KEY (rut_profesor) REFERENCES public.profesor(rut_profesor) ON DELETE RESTRICT;
  691. --
  692. -- Name: horario horario_id_asignatura_fkey; Type: FK CONSTRAINT; Schema: public; Owner: cromer
  693. --
  694. ALTER TABLE ONLY public.horario
  695. ADD CONSTRAINT horario_id_asignatura_fkey FOREIGN KEY (id_asignatura) REFERENCES public.asignatura(id_asignatura) ON DELETE RESTRICT;
  696. --
  697. -- Name: horario horario_id_bloque_fkey; Type: FK CONSTRAINT; Schema: public; Owner: cromer
  698. --
  699. ALTER TABLE ONLY public.horario
  700. ADD CONSTRAINT horario_id_bloque_fkey FOREIGN KEY (id_bloque) REFERENCES public.bloque(id_bloque) ON DELETE RESTRICT;
  701. --
  702. -- Name: participar participar_id_actividad_fkey; Type: FK CONSTRAINT; Schema: public; Owner: cromer
  703. --
  704. ALTER TABLE ONLY public.participar
  705. ADD CONSTRAINT participar_id_actividad_fkey FOREIGN KEY (id_actividad) REFERENCES public.actividad(id_actividad) ON DELETE RESTRICT;
  706. --
  707. -- Name: participar participar_rut_alumno_fkey; Type: FK CONSTRAINT; Schema: public; Owner: cromer
  708. --
  709. ALTER TABLE ONLY public.participar
  710. ADD CONSTRAINT participar_rut_alumno_fkey FOREIGN KEY (rut_alumno) REFERENCES public.alumno(rut_alumno) ON DELETE RESTRICT;
  711. --
  712. -- Name: profesor profesor_id_ciudad_fkey; Type: FK CONSTRAINT; Schema: public; Owner: cromer
  713. --
  714. ALTER TABLE ONLY public.profesor
  715. ADD CONSTRAINT profesor_id_ciudad_fkey FOREIGN KEY (id_ciudad) REFERENCES public.ciudad(id_ciudad) ON DELETE RESTRICT;
  716. --
  717. -- Name: registro registro_id_asignatura_fkey; Type: FK CONSTRAINT; Schema: public; Owner: cromer
  718. --
  719. ALTER TABLE ONLY public.registro
  720. ADD CONSTRAINT registro_id_asignatura_fkey FOREIGN KEY (id_asignatura) REFERENCES public.asignatura(id_asignatura) ON DELETE RESTRICT;
  721. --
  722. -- Name: registro registro_rut_alumno_fkey; Type: FK CONSTRAINT; Schema: public; Owner: cromer
  723. --
  724. ALTER TABLE ONLY public.registro
  725. ADD CONSTRAINT registro_rut_alumno_fkey FOREIGN KEY (rut_alumno) REFERENCES public.alumno(rut_alumno) ON DELETE RESTRICT;
  726. --
  727. -- Name: TABLE actividad; Type: ACL; Schema: public; Owner: cromer
  728. --
  729. GRANT ALL ON TABLE public.actividad TO bdd;
  730. --
  731. -- Name: TABLE actividad_bloque; Type: ACL; Schema: public; Owner: cromer
  732. --
  733. GRANT ALL ON TABLE public.actividad_bloque TO bdd;
  734. --
  735. -- Name: SEQUENCE actividad_id_actividad_seq; Type: ACL; Schema: public; Owner: cromer
  736. --
  737. GRANT ALL ON SEQUENCE public.actividad_id_actividad_seq TO bdd;
  738. --
  739. -- Name: TABLE actividad_nivel; Type: ACL; Schema: public; Owner: cromer
  740. --
  741. GRANT ALL ON TABLE public.actividad_nivel TO bdd;
  742. --
  743. -- Name: TABLE alumno; Type: ACL; Schema: public; Owner: cromer
  744. --
  745. GRANT ALL ON TABLE public.alumno TO bdd;
  746. --
  747. -- Name: TABLE apoderado; Type: ACL; Schema: public; Owner: cromer
  748. --
  749. GRANT ALL ON TABLE public.apoderado TO bdd;
  750. --
  751. -- Name: TABLE asignatura; Type: ACL; Schema: public; Owner: cromer
  752. --
  753. GRANT ALL ON TABLE public.asignatura TO bdd;
  754. --
  755. -- Name: SEQUENCE asignatura_id_asignatura_seq; Type: ACL; Schema: public; Owner: cromer
  756. --
  757. GRANT ALL ON SEQUENCE public.asignatura_id_asignatura_seq TO bdd;
  758. --
  759. -- Name: TABLE asistente; Type: ACL; Schema: public; Owner: cromer
  760. --
  761. GRANT ALL ON TABLE public.asistente TO bdd;
  762. --
  763. -- Name: TABLE asociado; Type: ACL; Schema: public; Owner: cromer
  764. --
  765. GRANT ALL ON TABLE public.asociado TO bdd;
  766. --
  767. -- Name: TABLE bloque; Type: ACL; Schema: public; Owner: cromer
  768. --
  769. GRANT ALL ON TABLE public.bloque TO bdd;
  770. --
  771. -- Name: SEQUENCE bloque_id_bloque_seq; Type: ACL; Schema: public; Owner: cromer
  772. --
  773. GRANT ALL ON SEQUENCE public.bloque_id_bloque_seq TO bdd;
  774. --
  775. -- Name: TABLE ciudad; Type: ACL; Schema: public; Owner: cromer
  776. --
  777. GRANT ALL ON TABLE public.ciudad TO bdd;
  778. --
  779. -- Name: SEQUENCE ciudad_id_ciudad_seq; Type: ACL; Schema: public; Owner: cromer
  780. --
  781. GRANT ALL ON SEQUENCE public.ciudad_id_ciudad_seq TO bdd;
  782. --
  783. -- Name: TABLE cursar; Type: ACL; Schema: public; Owner: cromer
  784. --
  785. GRANT ALL ON TABLE public.cursar TO bdd;
  786. --
  787. -- Name: TABLE curso; Type: ACL; Schema: public; Owner: cromer
  788. --
  789. GRANT ALL ON TABLE public.curso TO bdd;
  790. --
  791. -- Name: TABLE horario; Type: ACL; Schema: public; Owner: cromer
  792. --
  793. GRANT ALL ON TABLE public.horario TO bdd;
  794. --
  795. -- Name: TABLE nivel; Type: ACL; Schema: public; Owner: cromer
  796. --
  797. GRANT ALL ON TABLE public.nivel TO bdd;
  798. --
  799. -- Name: SEQUENCE nivel_id_nivel_seq; Type: ACL; Schema: public; Owner: cromer
  800. --
  801. GRANT ALL ON SEQUENCE public.nivel_id_nivel_seq TO bdd;
  802. --
  803. -- Name: TABLE participar; Type: ACL; Schema: public; Owner: cromer
  804. --
  805. GRANT ALL ON TABLE public.participar TO bdd;
  806. --
  807. -- Name: TABLE profesor; Type: ACL; Schema: public; Owner: cromer
  808. --
  809. GRANT ALL ON TABLE public.profesor TO bdd;
  810. --
  811. -- Name: TABLE region; Type: ACL; Schema: public; Owner: cromer
  812. --
  813. GRANT ALL ON TABLE public.region TO bdd;
  814. --
  815. -- Name: SEQUENCE region_id_region_seq; Type: ACL; Schema: public; Owner: cromer
  816. --
  817. GRANT ALL ON SEQUENCE public.region_id_region_seq TO bdd;
  818. --
  819. -- Name: TABLE registro; Type: ACL; Schema: public; Owner: cromer
  820. --
  821. GRANT ALL ON TABLE public.registro TO bdd;
  822. --
  823. -- PostgreSQL database dump complete
  824. --