-- Table definitions for the tournament project.
--
-- Put your SQL 'create table' statements in this file; also 'create view'
-- statements if you choose to use it.
--
-- You can write comments in this file by starting them with two dashes, like
-- these lines here.

create table players (
	id		serial	PRIMARY KEY,
	name	text
);

create table match (
	id		serial	PRIMARY KEY,
	winner	integer	REFERENCES players (id),
	loser	integer	REFERENCES players (id)
);
-- Table definitions for the tournament project.
--
-- Put your SQL 'create table' statements in this file; also 'create view'
-- statements if you choose to use it.
--
-- You can write comments in this file by starting them with two dashes, like
-- these lines here.

DROP DATABASE IF EXISTS tournament;

CREATE DATABASE tournament;

\c tournament

create table players (
	id		serial	PRIMARY KEY,
	name	text
);

create table match (
	id		serial	PRIMARY KEY,
	winner	integer	REFERENCES players (id),
	loser	integer	REFERENCES players (id)
);
Add database creation and connection
Add database creation and connection
