--
-- PostgreSQL database dump
--

-- Dumped from database version 17.4
-- Dumped by pg_dump version 17.4

--
-- Name: hackathon; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.hackathon (
    title text NOT NULL,
    start_date date,
    end_date date,
    description text
);


ALTER TABLE public.hackathon OWNER TO postgres;

--
-- Name: judge; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.judge (
    name text NOT NULL,
    affiliation text,
    "position" text
);


ALTER TABLE public.judge OWNER TO postgres;

--
-- Name: organizer; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.organizer (
    student character(6) NOT NULL,
    hackathon text NOT NULL,
    role text NOT NULL
);


ALTER TABLE public.organizer OWNER TO postgres;

--
-- Name: points; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.points (
    x integer NOT NULL,
    y integer NOT NULL,
    z integer NOT NULL
);


ALTER TABLE public.points OWNER TO postgres;

--
-- Name: project; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.project (
    team text NOT NULL,
    hackathon text NOT NULL,
    title text NOT NULL
);


ALTER TABLE public.project OWNER TO postgres;

--
-- Name: rating; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.rating (
    judge text NOT NULL,
    team text NOT NULL,
    hackathon text NOT NULL,
    project text NOT NULL,
    rating double precision
);


ALTER TABLE public.rating OWNER TO postgres;

--
-- Name: sponsorship; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.sponsorship (
    hackathon text NOT NULL,
    sponsor text NOT NULL,
    amount numeric(10,2)
);


ALTER TABLE public.sponsorship OWNER TO postgres;

--
-- Name: student; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.student (
    uin character(6) NOT NULL,
    name text,
    major text,
    year integer
);


ALTER TABLE public.student OWNER TO postgres;

--
-- Name: student_team; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.student_team (
    teamname text NOT NULL,
    hackathon text NOT NULL,
    student character(6) NOT NULL
);


ALTER TABLE public.student_team OWNER TO postgres;

--
-- Name: team; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.team (
    teamname text NOT NULL,
    hackathon text NOT NULL
);


ALTER TABLE public.team OWNER TO postgres;

--
-- Data for Name: hackathon; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO public.hackathon VALUES ('Sparkhacks 2024', '2024-02-08', '2024-02-11', 'UIC-based event');
INSERT INTO public.hackathon VALUES ('Sparkhacks 2023', '2023-02-01', '2023-02-02', 'UIC-based event');
INSERT INTO public.hackathon VALUES ('Chasehacks 2022', '2022-01-01', '2022-01-02', 'Bank-organized');


--
-- Data for Name: judge; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO public.judge VALUES ('Lazy young prof', 'UIC', 'Assistant Professor');
INSERT INTO public.judge VALUES ('Lazy old prof', 'UIC', 'Full Professor');
INSERT INTO public.judge VALUES ('No morals industry guy', 'UIC', 'Associate Professor');


--
-- Data for Name: organizer; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO public.organizer VALUES ('366666', 'Sparkhacks 2024', 'director');
INSERT INTO public.organizer VALUES ('234242', 'Sparkhacks 2024', 'outreach');
INSERT INTO public.organizer VALUES ('366666', 'Sparkhacks 2023', 'director');
INSERT INTO public.organizer VALUES ('111111', 'Chasehacks 2022', 'director');


--
-- Data for Name: points; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO public.points VALUES (421, 118, 935);
INSERT INTO public.points VALUES (613, 275, 142);
INSERT INTO public.points VALUES (468, 982, 219);
INSERT INTO public.points VALUES (319, 467, 751);
INSERT INTO public.points VALUES (826, 191, 463);
INSERT INTO public.points VALUES (938, 813, 627);
INSERT INTO public.points VALUES (157, 659, 823);
INSERT INTO public.points VALUES (351, 275, 981);
INSERT INTO public.points VALUES (913, 118, 369);
INSERT INTO public.points VALUES (275, 421, 935);
INSERT INTO public.points VALUES (982, 613, 142);
INSERT INTO public.points VALUES (467, 468, 751);
INSERT INTO public.points VALUES (135, 982, 219);
INSERT INTO public.points VALUES (627, 319, 463);
INSERT INTO public.points VALUES (823, 826, 191);
INSERT INTO public.points VALUES (935, 351, 981);
INSERT INTO public.points VALUES (142, 913, 369);
INSERT INTO public.points VALUES (751, 157, 659);
INSERT INTO public.points VALUES (819, 275, 118);
INSERT INTO public.points VALUES (935, 468, 627);
INSERT INTO public.points VALUES (219, 421, 813);
INSERT INTO public.points VALUES (463, 982, 142);
INSERT INTO public.points VALUES (627, 613, 275);
INSERT INTO public.points VALUES (981, 135, 982);
INSERT INTO public.points VALUES (235, 467, 935);
INSERT INTO public.points VALUES (819, 982, 219);
INSERT INTO public.points VALUES (351, 826, 751);
INSERT INTO public.points VALUES (369, 275, 463);
INSERT INTO public.points VALUES (142, 913, 813);
INSERT INTO public.points VALUES (983, 135, 981);
INSERT INTO public.points VALUES (468, 627, 142);
INSERT INTO public.points VALUES (751, 982, 935);
INSERT INTO public.points VALUES (935, 823, 369);
INSERT INTO public.points VALUES (191, 467, 351);
INSERT INTO public.points VALUES (627, 235, 819);
INSERT INTO public.points VALUES (413, 985, 275);
INSERT INTO public.points VALUES (935, 981, 142);
INSERT INTO public.points VALUES (142, 983, 751);
INSERT INTO public.points VALUES (819, 935, 135);
INSERT INTO public.points VALUES (219, 369, 467);
INSERT INTO public.points VALUES (935, 813, 982);
INSERT INTO public.points VALUES (351, 235, 983);
INSERT INTO public.points VALUES (983, 935, 627);
INSERT INTO public.points VALUES (813, 142, 951);


--
-- Data for Name: project; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO public.project VALUES ('The bosses', 'Sparkhacks 2024', 'Boring React Mockup');
INSERT INTO public.project VALUES ('The bosses', 'Sparkhacks 2023', 'Convoluted Haskell Nonsense');
INSERT INTO public.project VALUES ('The bosses', 'Chasehacks 2022', 'Verbose Java Mess');
INSERT INTO public.project VALUES ('The noobs', 'Sparkhacks 2024', 'Too many fancy frameworks');
INSERT INTO public.project VALUES ('Hack On', 'Sparkhacks 2024', 'Static HTML to the Max');
INSERT INTO public.project VALUES ('Hack On', 'Sparkhacks 2023', 'Unnecessary Assembly');


--
-- Data for Name: rating; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO public.rating VALUES ('Lazy young prof', 'The bosses', 'Sparkhacks 2024', 'Boring React Mockup', 2);
INSERT INTO public.rating VALUES ('Lazy old prof', 'The bosses', 'Sparkhacks 2024', 'Boring React Mockup', 5);
INSERT INTO public.rating VALUES ('No morals industry guy', 'The bosses', 'Sparkhacks 2024', 'Boring React Mockup', 3.5);
INSERT INTO public.rating VALUES ('Lazy young prof', 'The bosses', 'Sparkhacks 2023', 'Convoluted Haskell Nonsense', 5);
INSERT INTO public.rating VALUES ('Lazy old prof', 'The bosses', 'Sparkhacks 2023', 'Convoluted Haskell Nonsense', 1);
INSERT INTO public.rating VALUES ('No morals industry guy', 'The bosses', 'Chasehacks 2022', 'Verbose Java Mess', 5);
INSERT INTO public.rating VALUES ('Lazy young prof', 'The bosses', 'Chasehacks 2022', 'Verbose Java Mess', 5);
INSERT INTO public.rating VALUES ('Lazy young prof', 'The noobs', 'Sparkhacks 2024', 'Too many fancy frameworks', 2.5);
INSERT INTO public.rating VALUES ('Lazy old prof', 'The noobs', 'Sparkhacks 2024', 'Too many fancy frameworks', 4);
INSERT INTO public.rating VALUES ('No morals industry guy', 'The noobs', 'Sparkhacks 2024', 'Too many fancy frameworks', 4.5);
INSERT INTO public.rating VALUES ('Lazy young prof', 'Hack On', 'Sparkhacks 2024', 'Static HTML to the Max', 1);
INSERT INTO public.rating VALUES ('Lazy old prof', 'Hack On', 'Sparkhacks 2024', 'Static HTML to the Max', 3);
INSERT INTO public.rating VALUES ('No morals industry guy', 'Hack On', 'Sparkhacks 2024', 'Static HTML to the Max', 1.5);
INSERT INTO public.rating VALUES ('Lazy young prof', 'Hack On', 'Sparkhacks 2023', 'Unnecessary Assembly', 1);
INSERT INTO public.rating VALUES ('Lazy old prof', 'Hack On', 'Sparkhacks 2023', 'Unnecessary Assembly', 5);


--
-- Data for Name: sponsorship; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO public.sponsorship VALUES ('Sparkhacks 2024', 'UIC', 3500.00);
INSERT INTO public.sponsorship VALUES ('Sparkhacks 2024', 'Chase', 500.00);
INSERT INTO public.sponsorship VALUES ('Sparkhacks 2024', 'Oracle', 10000.00);
INSERT INTO public.sponsorship VALUES ('Sparkhacks 2023', 'UIC', 4500.00);
INSERT INTO public.sponsorship VALUES ('Chasehacks 2022', 'Chase', 20000.00);
INSERT INTO public.sponsorship VALUES ('Chasehacks 2022', 'UIC', 250.00);


--
-- Data for Name: student; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO public.student VALUES ('111111', 'Peter', 'CS', 1);
INSERT INTO public.student VALUES ('112333', 'Bob', 'CS', 2);
INSERT INTO public.student VALUES ('443223', 'Alice', 'EE', 3);
INSERT INTO public.student VALUES ('234242', 'Veeta', 'CS', 2);
INSERT INTO public.student VALUES ('366666', 'Fauly', 'CS', 6);
INSERT INTO public.student VALUES ('554344', 'Rufus', 'BIO', 2);
INSERT INTO public.student VALUES ('777777', 'Gertrud', 'CS', 1);
INSERT INTO public.student VALUES ('888333', 'Gertrud', 'CS', 2);


--
-- Data for Name: student_team; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO public.student_team VALUES ('The bosses', 'Sparkhacks 2024', '366666');
INSERT INTO public.student_team VALUES ('The bosses', 'Sparkhacks 2024', '443223');
INSERT INTO public.student_team VALUES ('The bosses', 'Sparkhacks 2023', '366666');
INSERT INTO public.student_team VALUES ('The bosses', 'Sparkhacks 2023', '443223');
INSERT INTO public.student_team VALUES ('The bosses', 'Chasehacks 2022', '366666');
INSERT INTO public.student_team VALUES ('The bosses', 'Chasehacks 2022', '443223');
INSERT INTO public.student_team VALUES ('The bosses', 'Sparkhacks 2024', '111111');
INSERT INTO public.student_team VALUES ('The noobs', 'Sparkhacks 2024', '777777');
INSERT INTO public.student_team VALUES ('The noobs', 'Sparkhacks 2024', '554344');
INSERT INTO public.student_team VALUES ('The noobs', 'Sparkhacks 2024', '443223');
INSERT INTO public.student_team VALUES ('Hack On', 'Sparkhacks 2024', '234242');
INSERT INTO public.student_team VALUES ('Hack On', 'Sparkhacks 2024', '112333');
INSERT INTO public.student_team VALUES ('Hack On', 'Sparkhacks 2023', '234242');
INSERT INTO public.student_team VALUES ('Hack On', 'Sparkhacks 2023', '112333');


--
-- Data for Name: team; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO public.team VALUES ('The bosses', 'Sparkhacks 2024');
INSERT INTO public.team VALUES ('The bosses', 'Sparkhacks 2023');
INSERT INTO public.team VALUES ('The bosses', 'Chasehacks 2022');
INSERT INTO public.team VALUES ('The noobs', 'Sparkhacks 2024');
INSERT INTO public.team VALUES ('Hack On', 'Sparkhacks 2024');
INSERT INTO public.team VALUES ('Hack On', 'Sparkhacks 2023');


--
-- Name: hackathon hackathon_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.hackathon
    ADD CONSTRAINT hackathon_pkey PRIMARY KEY (title);


--
-- Name: judge judge_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.judge
    ADD CONSTRAINT judge_pkey PRIMARY KEY (name);


--
-- Name: organizer organizer_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.organizer
    ADD CONSTRAINT organizer_pkey PRIMARY KEY (student, hackathon, role);


--
-- Name: points points_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.points
    ADD CONSTRAINT points_pkey PRIMARY KEY (x, y, z);


--
-- Name: project project_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.project
    ADD CONSTRAINT project_pkey PRIMARY KEY (team, hackathon, title);


--
-- Name: rating rating_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.rating
    ADD CONSTRAINT rating_pkey PRIMARY KEY (judge, team, hackathon, project);


--
-- Name: sponsorship sponsorship_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sponsorship
    ADD CONSTRAINT sponsorship_pkey PRIMARY KEY (hackathon, sponsor);


--
-- Name: student student_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.student
    ADD CONSTRAINT student_pkey PRIMARY KEY (uin);


--
-- Name: student_team student_team_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.student_team
    ADD CONSTRAINT student_team_pkey PRIMARY KEY (teamname, hackathon, student);


--
-- Name: team team_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.team
    ADD CONSTRAINT team_pkey PRIMARY KEY (teamname, hackathon);


--
-- Name: organizer organizer_hackathon_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.organizer
    ADD CONSTRAINT organizer_hackathon_fkey FOREIGN KEY (hackathon) REFERENCES public.hackathon(title);


--
-- Name: organizer organizer_student_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.organizer
    ADD CONSTRAINT organizer_student_fkey FOREIGN KEY (student) REFERENCES public.student(uin) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: project project_hackathon_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.project
    ADD CONSTRAINT project_hackathon_fkey FOREIGN KEY (hackathon) REFERENCES public.hackathon(title);


--
-- Name: project project_team_hackathon_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.project
    ADD CONSTRAINT project_team_hackathon_fkey FOREIGN KEY (team, hackathon) REFERENCES public.team(teamname, hackathon) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: rating rating_judge_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.rating
    ADD CONSTRAINT rating_judge_fkey FOREIGN KEY (judge) REFERENCES public.judge(name) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: rating rating_team_hackathon_project_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.rating
    ADD CONSTRAINT rating_team_hackathon_project_fkey FOREIGN KEY (team, hackathon, project) REFERENCES public.project(team, hackathon, title) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: sponsorship sponsorship_hackathon_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sponsorship
    ADD CONSTRAINT sponsorship_hackathon_fkey FOREIGN KEY (hackathon) REFERENCES public.hackathon(title) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: student_team student_team_student_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.student_team
    ADD CONSTRAINT student_team_student_fkey FOREIGN KEY (student) REFERENCES public.student(uin);


--
-- Name: student_team student_team_teamname_hackathon_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.student_team
    ADD CONSTRAINT student_team_teamname_hackathon_fkey FOREIGN KEY (teamname, hackathon) REFERENCES public.team(teamname, hackathon);


--
-- Name: team team_hackathon_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.team
    ADD CONSTRAINT team_hackathon_fkey FOREIGN KEY (hackathon) REFERENCES public.hackathon(title) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- PostgreSQL database dump complete
--
