SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';

DROP DATABASE IF EXISTS MedicareProvider;

CREATE DATABASE MedicareProvider;

USE `MedicareProvider` ;

CREATE TABLE IF NOT EXISTS `MedicareProvider`.`Inpatient` (
  `ID` INT NOT NULL AUTO_INCREMENT,
  `DRGDef` VARCHAR(200) NULL DEFAULT NULL,
  `ProviderID` INT(10) NULL DEFAULT NULL,
  `ProviderName` VARCHAR(100) NULL DEFAULT NULL,
  `ProviderStreetAddr` VARCHAR(50) NULL DEFAULT NULL,
  `ProviderCity` VARCHAR(20) NULL DEFAULT NULL,
  `ProviderState` VARCHAR(2) NULL DEFAULT NULL,
  `ProviderZipCode` INT(5) NULL DEFAULT NULL,
  `HRRDesc` VARCHAR(50) NULL DEFAULT NULL,
  `TotalDischarge` INT(5) NULL DEFAULT NULL,
  `AveCoverCharge` DECIMAL(10,4) NULL DEFAULT NULL,
  `AvgTotalPayment` DECIMAL(10,4) NULL DEFAULT NULL,
  `AvgMedicarePayment` DECIMAL(10,4) NULL DEFAULT NULL,
  `ProviderYear` VARCHAR(4) NULL DEFAULT NULL,
  PRIMARY KEY (`ID`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = latin1;


CREATE TABLE IF NOT EXISTS `MedicareProvider`.`Outpatient` (
  `ID` INT NOT NULL AUTO_INCREMENT,
  `APC` VARCHAR(200) NULL DEFAULT NULL,
  `ProviderID` INT(10) NULL DEFAULT NULL,
  `ProviderName` VARCHAR(100) NULL DEFAULT NULL,
  `ProviderStreetAddr` VARCHAR(50) NULL DEFAULT NULL,
  `ProviderCity` VARCHAR(20) NULL DEFAULT NULL,
  `ProviderState` VARCHAR(2) NULL DEFAULT NULL,
  `ProviderZipCode` INT(5) NULL DEFAULT NULL,
  `HRRDesc` VARCHAR(50) NULL DEFAULT NULL,
  `OutpatientServices` INT(5) NULL DEFAULT NULL,
  `AveEstSubCharge` DECIMAL(10,4) NULL DEFAULT NULL,
  `AvgTotalPayment` DECIMAL(10,4) NULL DEFAULT NULL,
  `ProviderYear` VARCHAR(4) NULL DEFAULT NULL,
  PRIMARY KEY (`ID`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = latin1;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;