CREATE DATABASE konyvjelzok;
USE konyvjelzok;

CREATE TABLE felhasznalo (
  felhasznaloi_nev VARCHAR(16) NOT NULL PRIMARY KEY,
  jlsz CHAR(40) NOT NULL,
  email VARCHAR(100) NOT NULL
);

CREATE TABLE konyvjelzo (
  felhasznaloi_nev VARCHAR(16) NOT NULL,
  kj_URL VARCHAR(255) NOT NULL,
  INDEX (felhasznaloi_nev),
  INDEX (kj_URL),
  PRIMARY KEY(felhasznaloi_nev, kj_URL)
);

GRANT SELECT, INSERT, UPDATE, DELETE
ON konyvjelzok.*
TO kj_felhasznalo@localhost IDENTIFIED BY 'jelszo';
