SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;


CREATE TABLE IF NOT EXISTS `country` (
  `ID` varchar(30) DEFAULT NULL,
  `ISO2CODE` varchar(3) DEFAULT NULL,
  `NAME` varchar(60) DEFAULT NULL,
  `REGION` varchar(30) DEFAULT NULL,
  `ADMINREGION` varchar(30) DEFAULT NULL,
  `INCOMELEVEL` varchar(30) DEFAULT NULL,
  `LENDINGTYPE` varchar(30) DEFAULT NULL,
  `CAPITALCITY` varchar(70) DEFAULT NULL,
  `LONGITUDE` varchar(30) DEFAULT NULL,
  `LATITUDE` varchar(30) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE IF NOT EXISTS `dloadedIndicators` (
  `INDICATORID` varchar(30) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE IF NOT EXISTS `incomelevel` (
  `ID` varchar(30) DEFAULT NULL,
  `CODE` varchar(30) DEFAULT NULL,
  `NAME` varchar(250) DEFAULT NULL,
  `NOTE` varchar(4000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE IF NOT EXISTS `indicator` (
  `ID` varchar(30) DEFAULT NULL,
  `NAME` varchar(250) DEFAULT NULL,
  `SOURCE` varchar(30) DEFAULT NULL,
  `SOURCENOTE` varchar(4000) DEFAULT NULL,
  `SOURCEORG` varchar(4000) DEFAULT NULL,
  `TOPICS` varchar(30) DEFAULT NULL,
  `LASTREFRESH` date DEFAULT NULL,
  KEY `indicator_pk` (`ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE IF NOT EXISTS `indicatorValue` (
  `INDICATORID` varchar(30) DEFAULT NULL,
  `COUNTRYID` varchar(5) DEFAULT NULL,
  `COUNTRYNAME` varchar(60) DEFAULT NULL,
  `DATE` varchar(30) DEFAULT NULL,
  `DATA_VALUE` double(20,5) DEFAULT NULL,
  `DATA_DECIMAL` int(8) DEFAULT NULL,
  KEY `iv_pk` (`INDICATORID`,`COUNTRYID`,`DATE`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE IF NOT EXISTS `lendingtype` (
  `ID` varchar(30) DEFAULT NULL,
  `CODE` varchar(30) DEFAULT NULL,
  `NAME` varchar(250) DEFAULT NULL,
  `NOTE` varchar(250) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE IF NOT EXISTS `region` (
  `ID` varchar(30) DEFAULT NULL,
  `CODE` varchar(30) DEFAULT NULL,
  `NAME` varchar(250) DEFAULT NULL,
  `NOTE` varchar(4000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE IF NOT EXISTS `source` (
  `ID` varchar(30) DEFAULT NULL,
  `CODE` varchar(30) DEFAULT NULL,
  `NAME` varchar(250) DEFAULT NULL,
  `NOTE` varchar(4000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE IF NOT EXISTS `topic` (
  `ID` varchar(30) DEFAULT NULL,
  `CODE` varchar(30) DEFAULT NULL,
  `NAME` varchar(250) DEFAULT NULL,
  `NOTE` varchar(4000) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
