text: DROP TABLE IF EXISTS player;
  DROP TABLE IF EXISTS item;
  DROP TABLE IF EXISTS player_item;
  DROP TABLE IF EXISTS pokemon;
  DROP TABLE IF EXISTS poke_type;
  DROP TABLE IF EXISTS player_pokemon;
  DROP TABLE IF EXISTS attack_category;
  DROP TABLE IF EXISTS pokemon_level_attack;
  DROP TABLE IF EXISTS player_pokemon_attack;
  DROP TABLE IF EXISTS attack;
  DROP TABLE IF EXISTS player_pokedex;
  DROP TABLE IF EXISTS pokemon_evolution;
  DROP TABLE IF EXISTS pokeball;
  DROP TABLE IF EXISTS stone;
  DROP TABLE IF EXISTS heal_item;
  DROP TABLE IF EXISTS type_multiplier;
  
  CREATE TABLE player (
  	player_id INT NOT NULL PRIMARY KEY, -- discord user id NOT user tag (tag editable with discord nitro)
  	got_starter INT NOT NULL DEFAULT 0,
  	money INTEGER NOT NULL DEFAULT 0
  );
  
  CREATE TABLE item (
  	item_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
  	item_name TEXT NOT NULL,
  	shop_price INTEGER, -- nulls allowed for items not purchasable in shops
  	resell_price INTEGER NOT NULL
  );
  
  CREATE TABLE pokeball (
  	item_id INTEGER NOT NULL PRIMARY KEY,
  	catch_multiplier REAL NOT NULL,
  	FOREIGN KEY (item_id) REFERENCES item(item_id)
  );
  
  CREATE TABLE stone (
  	item_id INTEGER NOT NULL PRIMARY KEY,
  	FOREIGN KEY (item_id) REFERENCES item(item_id)
  );
  
  CREATE TABLE heal_item (
  	item_id INTEGER NOT NULL PRIMARY KEY,
  	healing_amount INT NOT NULL DEFAULT 0,
  	FOREIGN KEY (item_id) REFERENCES item(item_id)
  );
  
  -- basically the inventories of all players
  CREATE TABLE player_item (
  	player_id INT NOT NULL,
  	item_id INT NOT NULL,
  	amount INT NOT NULL DEFAULT 0,
  	PRIMARY KEY (player_id,item_id),
  	FOREIGN KEY (player_id) REFERENCES player(player_id),
  	FOREIGN KEY (item_id) REFERENCES item(item_id)
  );
  
  CREATE TABLE poke_type( -- type is a sql keyword => poke_type
  	type_id INT NOT NULL PRIMARY KEY,
  	type_name TEXT NOT NULL
  );
  
  CREATE TABLE pokemon (
  	pokedex_id INT NOT NULL PRIMARY KEY,
  	starter INT NOT NULL DEFAULT 0,
  	pokemon_name TEXT NOT NULL,
  	legendary INT NOT NULL DEFAULT 0,
  	poke_type INT NOT NULL,
  	base_hp INT NOT NULL,
  	base_attack INT NOT NULL,
  	base_defense INT NOT NULL,
  	base_sp_attk INT NOT NULL,
  	base_sp_def INT NOT NULL,
  	speed INT NOT NULL,
  	catch_rate  INT NOT NULL DEFAULT 100,
  	FOREIGN KEY (poke_type) REFERENCES poke_type(type_id)
  );
  
  CREATE TABLE player_pokemon (
  	player_pokemon_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
  	player_id INT NOT NULL,
  	pokemon INT NOT NULL,
  	xp INT NOT NULL DEFAULT 0,
  	pokemon_level INT NOT NULL DEFAULT 1,
  	team_position INT DEFAULT NULL,
  	current_hp INT NOT NULL,
  	FOREIGN KEY (player_id) REFERENCES player(player_id),
  	FOREIGN KEY (pokemon) REFERENCES pokemon(pokedex_id)
  );
  
  CREATE TABLE attack_category (
  	attack_category_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
  	attack_category_name TEXT NOT NULL
  );
  
  CREATE TABLE attack (
  	attack_id INT NOT NULL PRIMARY KEY,
  	poke_type INT NOT NULL,
  	attack_category INT NOT NULL,
  	attack_name TEXT NOT NULL,
  	power_points INT ,
  	attack_power INT , -- power might be a keyword
  	accuracy INT DEFAULT 100,
  	FOREIGN KEY (poke_type) REFERENCES poke_type(type_id),
  	FOREIGN KEY (attack_category) REFERENCES attack_category(attack_category_id)
  );
  
  CREATE TABLE player_pokemon_attack (
  	player_pokemon_id INT NOT NULL,
  	attack_id INT NOT NULL,
  	PRIMARY KEY (player_pokemon_id,attack_id),
  	FOREIGN KEY (player_pokemon_id) REFERENCES player_pokemon(player_pokemon_id),
  	FOREIGN KEY (attack_id) REFERENCES attack(attack_id)
  );
  
  CREATE TABLE pokemon_level_attack (
  	pokemon_level_attack_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
  	pokemon INT NOT NULL,
  	pokemon_level INT     ,
  	attack INT NOT NULL,
  	FOREIGN KEY (pokemon) REFERENCES pokemon(pokedex_id),
  	FOREIGN KEY (attack) REFERENCES attack(attack_id)
  );
  
  CREATE TABLE player_pokedex (
  	player_id INT NOT NULL,
  	pokemon INT NOT NULL,
  	PRIMARY KEY (player_id,pokemon),
  	FOREIGN KEY (pokemon) REFERENCES pokemon(pokedex_id),
  	FOREIGN KEY (player_id) REFERENCES player(player_id)
  );
  
  CREATE TABLE pokemon_evolution (
  	from_pokemon INT NOT NULL,
  	to_pokemon INT NOT NULL,
  	pokemon_level INT,
  	item INT,
  	PRIMARY KEY (from_pokemon,to_pokemon),
  	FOREIGN KEY (from_pokemon) REFERENCES pokemon(pokedex_id),
  	FOREIGN KEY (to_pokemon) REFERENCES pokemon(pokedex_id)
  );
  
  CREATE TABLE type_multiplier
  (
      attack     INTEGER NOT NULL,
      defense    INTEGER NOT NULL,
      multiplier FLOAT   NOT NULL,
      PRIMARY KEY (attack, defense),
      FOREIGN KEY (attack) REFERENCES poke_type (type_id),
      FOREIGN KEY (defense) REFERENCES poke_type (type_id)
  );