create database agendax;

create table logs (time timestamp, message VARCHAR(255));
create table agenda (agent VARCHAR(20), day int, hour int);
create table agents (id serial PRIMARY KEY, name VARCHAR(20));


grant all privileges on database agendax to root;
grant all privileges on database agendax to tonio;
grant all privileges on database agendax to user1;

grant all privileges on table logs to root, tonio, user1;
grant all privileges on table agenda to root, tonio, user1;
grant all privileges on table agents to root, tonio, user1;

INSERT INTO agents (name) VALUES ('toto');
INSERT INTO agents (name) VALUES ('titi');
INSERT INTO agents (name) VALUES ('tutu');

