// chessmaster
// classement
// partie
// evolution`
// membres
// elo_affectation


CREATE TABLE `chess_master_2022` (
  `id` int(11) NOT NULL,
  `blanc` varchar(30) NOT NULL DEFAULT '',
  `noir` varchar(30) NOT NULL DEFAULT '',
  `gagnant` varchar(30) NOT NULL DEFAULT '',
  `date` int(11) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE IF NOT EXISTS `chess_classement_2022` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `joueur` varchar(30) NOT NULL DEFAULT '',
  `elo` int(11) NOT NULL DEFAULT '0',
  `initial` int(11) NOT NULL DEFAULT '0',
  `parties` int(11) NOT NULL DEFAULT '0',
  `prior` int(11) NOT NULL DEFAULT '0',
  `bonus` int(11) NOT NULL DEFAULT '0',
  `oldrating` int(11) NOT NULL DEFAULT '0',
  `gcount` int(11) NOT NULL DEFAULT '0',
  `wins` int(11) NOT NULL DEFAULT '0',
  `losses` int(11) NOT NULL DEFAULT '0',
  `draws` int(11) NOT NULL DEFAULT '0',
  `active` int(11) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1

INSERT INTO `chess_classement_2022` (`id`, `joueur`, `elo`, `initial`, `parties`, `prior`, `bonus`, `oldrating`, `gcount`, `wins`, `losses`, `draws`, `active`) VALUES
(1, 'AlvaroM', 1400, 1400, 0, 0, 0, 1400, 0, 0, 0, 0, 1),
(2, 'DamienB', 1400, 1400, 0, 0, 0, 1400, 0, 0, 0, 0, 1),
(3, 'EmileM', 1400, 1400, 0, 0, 0, 1400, 0, 0, 0, 0, 1),
(4, 'FranckV', 1400, 1400, 0, 0, 0, 1400, 0, 0, 0, 0, 1),
(5, 'HenriqueF', 1400, 1400, 0, 0, 0, 1400, 0, 0, 0, 0, 1),
(6, 'PatrickA', 1400, 1400, 0, 0, 0, 1400, 0, 0, 0, 0, 1),
(7, 'PhilippeA', 1400, 1400, 0, 0, 0, 1400, 0, 0, 0, 0, 1),
(8, 'RemyS', 1400, 1400, 0, 0, 0, 1400, 0, 0, 0, 0, 1),
(9, 'StephaneR', 1400, 1400, 0, 0, 0, 1400, 0, 0, 0, 0, 1);


CREATE TABLE IF NOT EXISTS `chess_elo_affectation_2022` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `joueur` varchar(30) NOT NULL DEFAULT '',
  `elo` int(11) NOT NULL DEFAULT '0',
   PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


INSERT INTO `chess_elo_affectation_2022` (`id`, `joueur`, `elo`) VALUES
('1','AlvaroM', 1400),
('2','DamienB', 1400),
('3','EmileM', 1400),
('4','FranckV', 1400),
('5','HenriqueF', 1400),
('6','PatrickA', 1400),
('7','PhilippeA', 1400),
('8','RemyS', 1400),
('9','StephaneR', 1400);


CREATE TABLE IF NOT EXISTS `chess_evolution_2022` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `playerID` int(11) DEFAULT NULL,
  `rating` int(11) DEFAULT NULL,
  `date` int(11) DEFAULT NULL,
    PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


CREATE TABLE IF NOT EXISTS `chess_parties_2022` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `w_playerID` int(11) DEFAULT NULL,
  `w_name` varchar(30) NOT NULL DEFAULT '',
  `b_playerID` int(11) DEFAULT NULL,
  `b_name` varchar(30) NOT NULL DEFAULT '',
  `w_brating` int(11) DEFAULT NULL,
  `w_arating` int(11) DEFAULT NULL,
  `b_brating` int(11) DEFAULT NULL,
  `b_arating` int(11) DEFAULT NULL,
  `result` int(11) DEFAULT NULL,
  `date` int(11) DEFAULT NULL,
   PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;