

CREATE TABLE user(
    id int PRIMARY KEY,
    name varchar(30) NOT NULL ,
    forename varchar(30) NOT NULL
);

CREATE TABLE team(
    id int,
    name varchar(30),
    club_name varchar(30),
    PRIMARY KEY (id)
);

CREATE TABLE tactic_group(
    tactic_id int,
    group_id int,
    PRIMARY KEY(tactic_id, group_id),
    FOREIGN KEY (tactic_id) REFERENCES  tactic(id),
    FOREIGN KEY (group_id) REFERENCES team(id)
);

CREATE TABLE member(
    group_id int,
    user_id int,
    is_manager int NOT NULL,
    PRIMARY KEY (group_id, user_id),
    FOREIGN KEY (group_id) REFERENCES team(id),
    FOREIGN KEY (user_id) REFERENCES user(id)
);

CREATE TABLE tactic(
    id int PRIMARY KEY ,
    name varchar(30) NOT NULL,
    file_path varchar NOT NULL,
    owner_id int,
    FOREIGN KEY (owner_id) REFERENCES user(id)
);