Created
May 25, 2020 17:45
-
-
Save farmdawgnation/7b53c5d418bbfbaf4b8d680ec47fdf92 to your computer and use it in GitHub Desktop.
Scripts in use for my personal CV19 Dashboards
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TODO: Update paths for your specific environment | |
SET sql_mode = ''; | |
USE covid19_data; | |
TRUNCATE covidtracking_daily_raw; | |
LOAD DATA LOCAL INFILE '/path/to/csvs/covidtracking_daily.csv' INTO TABLE covidtracking_daily_raw FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' IGNORE 1 LINES; | |
TRUNCATE covidtracking_daily; | |
INSERT INTO covidtracking_daily SELECT * FROM covidtracking_daily_view; | |
TRUNCATE nyt_us_counties_raw; | |
LOAD DATA LOCAL INFILE '/path/to/csvs/nyt_us_counties.csv' INTO TABLE nyt_us_counties_raw FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' IGNORE 1 LINES; | |
TRUNCATE nyt_us_counties; | |
INSERT INTO nyt_us_counties SELECT * FROM nyt_us_counties_view; | |
TRUNCATE rt_live; | |
LOAD DATA LOCAL INFILE '/path/to/csvs/rt.csv' INTO TABLE rt_live FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' IGNORE 1 LINES; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- MySQL dump 10.13 Distrib 8.0.19, for osx10.15 (x86_64) | |
-- | |
-- Host: localhost Database: covid19_data | |
-- ------------------------------------------------------ | |
-- Server version 8.0.19 | |
/*!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 */; | |
/*!50503 SET NAMES utf8mb4 */; | |
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; | |
/*!40103 SET TIME_ZONE='+00:00' */; | |
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; | |
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; | |
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; | |
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; | |
-- | |
-- Table structure for table `covidtracking_daily` | |
-- | |
DROP TABLE IF EXISTS `covidtracking_daily`; | |
/*!40101 SET @saved_cs_client = @@character_set_client */; | |
/*!50503 SET character_set_client = utf8mb4 */; | |
CREATE TABLE `covidtracking_daily` ( | |
`date` date DEFAULT NULL, | |
`state` varchar(255) DEFAULT NULL, | |
`positive` int DEFAULT NULL, | |
`negative` int DEFAULT NULL, | |
`pending` int DEFAULT NULL, | |
`hospitalizedCurrently` int DEFAULT NULL, | |
`hospitalizedCumulative` int DEFAULT NULL, | |
`inIcuCurrently` int DEFAULT NULL, | |
`inIcuCumulative` int DEFAULT NULL, | |
`onVentilatorCurrently` int DEFAULT NULL, | |
`onVentilatorCumulative` int DEFAULT NULL, | |
`recovered` int DEFAULT NULL, | |
`dataQualityGrade` varchar(255) DEFAULT NULL, | |
`dateChecked` varchar(255) DEFAULT NULL, | |
`death` int DEFAULT NULL, | |
`hospitalized` int DEFAULT NULL, | |
`deathIncrease` int DEFAULT NULL, | |
`negativeIncrease` int DEFAULT NULL, | |
`positiveIncrease` int DEFAULT NULL, | |
`totalTestResultsIncrease` int DEFAULT NULL, | |
`totalTestResults` int DEFAULT NULL, | |
KEY `idx_covidtracking_daily_state` (`state`), | |
KEY `idx_covidtracking_daily_date_state` (`date`,`state`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
/*!40101 SET character_set_client = @saved_cs_client */; | |
-- | |
-- Table structure for table `covidtracking_daily_raw` | |
-- | |
DROP TABLE IF EXISTS `covidtracking_daily_raw`; | |
/*!40101 SET @saved_cs_client = @@character_set_client */; | |
/*!50503 SET character_set_client = utf8mb4 */; | |
CREATE TABLE `covidtracking_daily_raw` ( | |
`date` text, | |
`state` text, | |
`positive` text, | |
`negative` text, | |
`pending` text, | |
`hospitalizedCurrently` text, | |
`hospitalizedCumulative` text, | |
`inIcuCurrently` text, | |
`inIcuCumulative` text, | |
`onVentilatorCurrently` text, | |
`onVentilatorCumulative` text, | |
`recovered` text, | |
`dataQualityGrade` text, | |
`lastUpdateEt` text, | |
`hash` text, | |
`dateChecked` text, | |
`death` text, | |
`hospitalized` text, | |
`total` text, | |
`totalTestResults` text, | |
`posNeg` text, | |
`fips` text, | |
`deathIncrease` text, | |
`hospitalizedIncrease` text, | |
`negativeIncrease` text, | |
`positiveIncrease` text, | |
`totalTestResultsIncrease` text | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
/*!40101 SET character_set_client = @saved_cs_client */; | |
-- | |
-- Temporary view structure for view `covidtracking_daily_view` | |
-- | |
DROP TABLE IF EXISTS `covidtracking_daily_view`; | |
/*!50001 DROP VIEW IF EXISTS `covidtracking_daily_view`*/; | |
SET @saved_cs_client = @@character_set_client; | |
/*!50503 SET character_set_client = utf8mb4 */; | |
/*!50001 CREATE VIEW `covidtracking_daily_view` AS SELECT | |
1 AS `date`, | |
1 AS `state`, | |
1 AS `positive`, | |
1 AS `negative`, | |
1 AS `pending`, | |
1 AS `hospitalizedCurrently`, | |
1 AS `hospitalizedCumulative`, | |
1 AS `inIcuCurrently`, | |
1 AS `inIcuCumulative`, | |
1 AS `onVentilatorCurrently`, | |
1 AS `onVentilatorCumulative`, | |
1 AS `recovered`, | |
1 AS `dataQualityGrade`, | |
1 AS `dateChecked`, | |
1 AS `death`, | |
1 AS `hospitalized`, | |
1 AS `deathIncrease`, | |
1 AS `negativeIncrease`, | |
1 AS `positiveIncrease`, | |
1 AS `totalTestResultsIncrease`, | |
1 AS `totalTestResults`*/; | |
SET character_set_client = @saved_cs_client; | |
-- | |
-- Table structure for table `ga_county_population_2019` | |
-- | |
DROP TABLE IF EXISTS `ga_county_population_2019`; | |
/*!40101 SET @saved_cs_client = @@character_set_client */; | |
/*!50503 SET character_set_client = utf8mb4 */; | |
CREATE TABLE `ga_county_population_2019` ( | |
`County` text, | |
`Population` int DEFAULT NULL | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
/*!40101 SET character_set_client = @saved_cs_client */; | |
-- | |
-- Table structure for table `nationwide_population_data` | |
-- | |
DROP TABLE IF EXISTS `nationwide_population_data`; | |
/*!40101 SET @saved_cs_client = @@character_set_client */; | |
/*!50503 SET character_set_client = utf8mb4 */; | |
CREATE TABLE `nationwide_population_data` ( | |
`SUMLEV` text, | |
`REGION` int DEFAULT NULL, | |
`DIVISION` int DEFAULT NULL, | |
`STATE` text, | |
`NAME` text, | |
`CENSUS2010POP` int DEFAULT NULL, | |
`ESTIMATESBASE2010` int DEFAULT NULL, | |
`POPESTIMATE2010` int DEFAULT NULL, | |
`POPESTIMATE2011` int DEFAULT NULL, | |
`POPESTIMATE2012` int DEFAULT NULL, | |
`POPESTIMATE2013` int DEFAULT NULL, | |
`POPESTIMATE2014` int DEFAULT NULL, | |
`POPESTIMATE2015` int DEFAULT NULL, | |
`POPESTIMATE2016` int DEFAULT NULL, | |
`POPESTIMATE2017` int DEFAULT NULL, | |
`POPESTIMATE2018` int DEFAULT NULL, | |
`POPESTIMATE2019` int DEFAULT NULL, | |
`NPOPCHG_2010` int DEFAULT NULL, | |
`NPOPCHG_2011` int DEFAULT NULL, | |
`NPOPCHG_2012` int DEFAULT NULL, | |
`NPOPCHG_2013` int DEFAULT NULL, | |
`NPOPCHG_2014` int DEFAULT NULL, | |
`NPOPCHG_2015` int DEFAULT NULL, | |
`NPOPCHG_2016` int DEFAULT NULL, | |
`NPOPCHG_2017` int DEFAULT NULL, | |
`NPOPCHG_2018` int DEFAULT NULL, | |
`NPOPCHG_2019` int DEFAULT NULL, | |
`BIRTHS2010` int DEFAULT NULL, | |
`BIRTHS2011` int DEFAULT NULL, | |
`BIRTHS2012` int DEFAULT NULL, | |
`BIRTHS2013` int DEFAULT NULL, | |
`BIRTHS2014` int DEFAULT NULL, | |
`BIRTHS2015` int DEFAULT NULL, | |
`BIRTHS2016` int DEFAULT NULL, | |
`BIRTHS2017` int DEFAULT NULL, | |
`BIRTHS2018` int DEFAULT NULL, | |
`BIRTHS2019` int DEFAULT NULL, | |
`DEATHS2010` int DEFAULT NULL, | |
`DEATHS2011` int DEFAULT NULL, | |
`DEATHS2012` int DEFAULT NULL, | |
`DEATHS2013` int DEFAULT NULL, | |
`DEATHS2014` int DEFAULT NULL, | |
`DEATHS2015` int DEFAULT NULL, | |
`DEATHS2016` int DEFAULT NULL, | |
`DEATHS2017` int DEFAULT NULL, | |
`DEATHS2018` int DEFAULT NULL, | |
`DEATHS2019` int DEFAULT NULL, | |
`NATURALINC2010` int DEFAULT NULL, | |
`NATURALINC2011` int DEFAULT NULL, | |
`NATURALINC2012` int DEFAULT NULL, | |
`NATURALINC2013` int DEFAULT NULL, | |
`NATURALINC2014` int DEFAULT NULL, | |
`NATURALINC2015` int DEFAULT NULL, | |
`NATURALINC2016` int DEFAULT NULL, | |
`NATURALINC2017` int DEFAULT NULL, | |
`NATURALINC2018` int DEFAULT NULL, | |
`NATURALINC2019` int DEFAULT NULL, | |
`INTERNATIONALMIG2010` int DEFAULT NULL, | |
`INTERNATIONALMIG2011` int DEFAULT NULL, | |
`INTERNATIONALMIG2012` int DEFAULT NULL, | |
`INTERNATIONALMIG2013` int DEFAULT NULL, | |
`INTERNATIONALMIG2014` int DEFAULT NULL, | |
`INTERNATIONALMIG2015` int DEFAULT NULL, | |
`INTERNATIONALMIG2016` int DEFAULT NULL, | |
`INTERNATIONALMIG2017` int DEFAULT NULL, | |
`INTERNATIONALMIG2018` int DEFAULT NULL, | |
`INTERNATIONALMIG2019` int DEFAULT NULL, | |
`DOMESTICMIG2010` int DEFAULT NULL, | |
`DOMESTICMIG2011` int DEFAULT NULL, | |
`DOMESTICMIG2012` int DEFAULT NULL, | |
`DOMESTICMIG2013` int DEFAULT NULL, | |
`DOMESTICMIG2014` int DEFAULT NULL, | |
`DOMESTICMIG2015` int DEFAULT NULL, | |
`DOMESTICMIG2016` int DEFAULT NULL, | |
`DOMESTICMIG2017` int DEFAULT NULL, | |
`DOMESTICMIG2018` int DEFAULT NULL, | |
`DOMESTICMIG2019` int DEFAULT NULL, | |
`NETMIG2010` int DEFAULT NULL, | |
`NETMIG2011` int DEFAULT NULL, | |
`NETMIG2012` int DEFAULT NULL, | |
`NETMIG2013` int DEFAULT NULL, | |
`NETMIG2014` int DEFAULT NULL, | |
`NETMIG2015` int DEFAULT NULL, | |
`NETMIG2016` int DEFAULT NULL, | |
`NETMIG2017` int DEFAULT NULL, | |
`NETMIG2018` int DEFAULT NULL, | |
`NETMIG2019` int DEFAULT NULL, | |
`RESIDUAL2010` int DEFAULT NULL, | |
`RESIDUAL2011` int DEFAULT NULL, | |
`RESIDUAL2012` int DEFAULT NULL, | |
`RESIDUAL2013` int DEFAULT NULL, | |
`RESIDUAL2014` int DEFAULT NULL, | |
`RESIDUAL2015` int DEFAULT NULL, | |
`RESIDUAL2016` int DEFAULT NULL, | |
`RESIDUAL2017` int DEFAULT NULL, | |
`RESIDUAL2018` int DEFAULT NULL, | |
`RESIDUAL2019` int DEFAULT NULL, | |
`RBIRTH2011` double DEFAULT NULL, | |
`RBIRTH2012` double DEFAULT NULL, | |
`RBIRTH2013` double DEFAULT NULL, | |
`RBIRTH2014` double DEFAULT NULL, | |
`RBIRTH2015` double DEFAULT NULL, | |
`RBIRTH2016` double DEFAULT NULL, | |
`RBIRTH2017` double DEFAULT NULL, | |
`RBIRTH2018` double DEFAULT NULL, | |
`RBIRTH2019` double DEFAULT NULL, | |
`RDEATH2011` double DEFAULT NULL, | |
`RDEATH2012` double DEFAULT NULL, | |
`RDEATH2013` double DEFAULT NULL, | |
`RDEATH2014` double DEFAULT NULL, | |
`RDEATH2015` double DEFAULT NULL, | |
`RDEATH2016` double DEFAULT NULL, | |
`RDEATH2017` double DEFAULT NULL, | |
`RDEATH2018` double DEFAULT NULL, | |
`RDEATH2019` double DEFAULT NULL, | |
`RNATURALINC2011` double DEFAULT NULL, | |
`RNATURALINC2012` double DEFAULT NULL, | |
`RNATURALINC2013` double DEFAULT NULL, | |
`RNATURALINC2014` double DEFAULT NULL, | |
`RNATURALINC2015` double DEFAULT NULL, | |
`RNATURALINC2016` double DEFAULT NULL, | |
`RNATURALINC2017` double DEFAULT NULL, | |
`RNATURALINC2018` double DEFAULT NULL, | |
`RNATURALINC2019` double DEFAULT NULL, | |
`RINTERNATIONALMIG2011` double DEFAULT NULL, | |
`RINTERNATIONALMIG2012` double DEFAULT NULL, | |
`RINTERNATIONALMIG2013` double DEFAULT NULL, | |
`RINTERNATIONALMIG2014` double DEFAULT NULL, | |
`RINTERNATIONALMIG2015` double DEFAULT NULL, | |
`RINTERNATIONALMIG2016` double DEFAULT NULL, | |
`RINTERNATIONALMIG2017` double DEFAULT NULL, | |
`RINTERNATIONALMIG2018` double DEFAULT NULL, | |
`RINTERNATIONALMIG2019` double DEFAULT NULL, | |
`RDOMESTICMIG2011` double DEFAULT NULL, | |
`RDOMESTICMIG2012` double DEFAULT NULL, | |
`RDOMESTICMIG2013` double DEFAULT NULL, | |
`RDOMESTICMIG2014` double DEFAULT NULL, | |
`RDOMESTICMIG2015` double DEFAULT NULL, | |
`RDOMESTICMIG2016` double DEFAULT NULL, | |
`RDOMESTICMIG2017` double DEFAULT NULL, | |
`RDOMESTICMIG2018` double DEFAULT NULL, | |
`RDOMESTICMIG2019` double DEFAULT NULL, | |
`RNETMIG2011` double DEFAULT NULL, | |
`RNETMIG2012` double DEFAULT NULL, | |
`RNETMIG2013` double DEFAULT NULL, | |
`RNETMIG2014` double DEFAULT NULL, | |
`RNETMIG2015` double DEFAULT NULL, | |
`RNETMIG2016` double DEFAULT NULL, | |
`RNETMIG2017` double DEFAULT NULL, | |
`RNETMIG2018` double DEFAULT NULL, | |
`RNETMIG2019` double DEFAULT NULL | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
/*!40101 SET character_set_client = @saved_cs_client */; | |
-- | |
-- Table structure for table `nyt_us_counties` | |
-- | |
DROP TABLE IF EXISTS `nyt_us_counties`; | |
/*!40101 SET @saved_cs_client = @@character_set_client */; | |
/*!50503 SET character_set_client = utf8mb4 */; | |
CREATE TABLE `nyt_us_counties` ( | |
`date` date DEFAULT NULL, | |
`county` varchar(255) DEFAULT NULL, | |
`state` varchar(255) DEFAULT NULL, | |
`cases` int DEFAULT NULL, | |
`deaths` int DEFAULT NULL, | |
KEY `idx_nyt_us_counties_date` (`date`), | |
KEY `idx_nyt_us_counties_county_state` (`county`,`state`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
/*!40101 SET character_set_client = @saved_cs_client */; | |
-- | |
-- Table structure for table `nyt_us_counties_raw` | |
-- | |
DROP TABLE IF EXISTS `nyt_us_counties_raw`; | |
/*!40101 SET @saved_cs_client = @@character_set_client */; | |
/*!50503 SET character_set_client = utf8mb4 */; | |
CREATE TABLE `nyt_us_counties_raw` ( | |
`date` text, | |
`county` text, | |
`state` text, | |
`fips` text, | |
`cases` text, | |
`deaths` text, | |
KEY `county_and_state` (`county`(64),`state`(64)), | |
KEY `date` (`date`(10)) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
/*!40101 SET character_set_client = @saved_cs_client */; | |
-- | |
-- Temporary view structure for view `nyt_us_counties_view` | |
-- | |
DROP TABLE IF EXISTS `nyt_us_counties_view`; | |
/*!50001 DROP VIEW IF EXISTS `nyt_us_counties_view`*/; | |
SET @saved_cs_client = @@character_set_client; | |
/*!50503 SET character_set_client = utf8mb4 */; | |
/*!50001 CREATE VIEW `nyt_us_counties_view` AS SELECT | |
1 AS `date`, | |
1 AS `county`, | |
1 AS `state`, | |
1 AS `cases`, | |
1 AS `deaths`*/; | |
SET character_set_client = @saved_cs_client; | |
-- | |
-- Table structure for table `rt_live` | |
-- | |
DROP TABLE IF EXISTS `rt_live`; | |
/*!40101 SET @saved_cs_client = @@character_set_client */; | |
/*!50503 SET character_set_client = utf8mb4 */; | |
CREATE TABLE `rt_live` ( | |
`date` date NOT NULL, | |
`region` varchar(45) NOT NULL, | |
`mean` float DEFAULT NULL, | |
`median` float DEFAULT NULL, | |
`lower_90` float DEFAULT NULL, | |
`upper_90` float DEFAULT NULL, | |
`lower_50` float DEFAULT NULL, | |
`upper_50` float DEFAULT NULL, | |
`new_cases` float DEFAULT NULL, | |
PRIMARY KEY (`date`,`region`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
/*!40101 SET character_set_client = @saved_cs_client */; | |
-- | |
-- Table structure for table `sc_county_population_2019` | |
-- | |
DROP TABLE IF EXISTS `sc_county_population_2019`; | |
/*!40101 SET @saved_cs_client = @@character_set_client */; | |
/*!50503 SET character_set_client = utf8mb4 */; | |
CREATE TABLE `sc_county_population_2019` ( | |
`County` text, | |
`Population` int DEFAULT NULL | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
/*!40101 SET character_set_client = @saved_cs_client */; | |
-- | |
-- Table structure for table `state_codes` | |
-- | |
DROP TABLE IF EXISTS `state_codes`; | |
/*!40101 SET @saved_cs_client = @@character_set_client */; | |
/*!50503 SET character_set_client = utf8mb4 */; | |
CREATE TABLE `state_codes` ( | |
`State` text, | |
`Abbrev` text, | |
`Code` text | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
/*!40101 SET character_set_client = @saved_cs_client */; | |
-- | |
-- Final view structure for view `covidtracking_daily_view` | |
-- | |
/*!50001 DROP VIEW IF EXISTS `covidtracking_daily_view`*/; | |
/*!50001 SET @saved_cs_client = @@character_set_client */; | |
/*!50001 SET @saved_cs_results = @@character_set_results */; | |
/*!50001 SET @saved_col_connection = @@collation_connection */; | |
/*!50001 SET character_set_client = utf8mb4 */; | |
/*!50001 SET character_set_results = utf8mb4 */; | |
/*!50001 SET collation_connection = utf8mb4_0900_ai_ci */; | |
/*!50001 CREATE ALGORITHM=UNDEFINED */ | |
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ | |
/*!50001 VIEW `covidtracking_daily_view` AS select str_to_date(`covidtracking_daily_raw`.`date`,'%Y%m%d') AS `date`,`covidtracking_daily_raw`.`state` AS `state`,cast(`covidtracking_daily_raw`.`positive` as signed) AS `positive`,cast(`covidtracking_daily_raw`.`negative` as signed) AS `negative`,cast(`covidtracking_daily_raw`.`pending` as signed) AS `pending`,cast(`covidtracking_daily_raw`.`hospitalizedCurrently` as signed) AS `hospitalizedCurrently`,cast(`covidtracking_daily_raw`.`hospitalizedCumulative` as signed) AS `hospitalizedCumulative`,cast(`covidtracking_daily_raw`.`inIcuCurrently` as signed) AS `inIcuCurrently`,cast(`covidtracking_daily_raw`.`inIcuCumulative` as signed) AS `inIcuCumulative`,cast(`covidtracking_daily_raw`.`onVentilatorCurrently` as signed) AS `onVentilatorCurrently`,cast(`covidtracking_daily_raw`.`onVentilatorCumulative` as signed) AS `onVentilatorCumulative`,cast(`covidtracking_daily_raw`.`recovered` as signed) AS `recovered`,`covidtracking_daily_raw`.`dataQualityGrade` AS `dataQualityGrade`,`covidtracking_daily_raw`.`dateChecked` AS `dateChecked`,cast(`covidtracking_daily_raw`.`death` as signed) AS `death`,cast(`covidtracking_daily_raw`.`hospitalized` as signed) AS `hospitalized`,cast(`covidtracking_daily_raw`.`deathIncrease` as signed) AS `deathIncrease`,cast(`covidtracking_daily_raw`.`negativeIncrease` as signed) AS `negativeIncrease`,cast(`covidtracking_daily_raw`.`positiveIncrease` as signed) AS `positiveIncrease`,cast(`covidtracking_daily_raw`.`totalTestResultsIncrease` as signed) AS `totalTestResultsIncrease`,cast(`covidtracking_daily_raw`.`totalTestResults` as signed) AS `totalTestResults` from `covidtracking_daily_raw` */; | |
/*!50001 SET character_set_client = @saved_cs_client */; | |
/*!50001 SET character_set_results = @saved_cs_results */; | |
/*!50001 SET collation_connection = @saved_col_connection */; | |
-- | |
-- Final view structure for view `nyt_us_counties_view` | |
-- | |
/*!50001 DROP VIEW IF EXISTS `nyt_us_counties_view`*/; | |
/*!50001 SET @saved_cs_client = @@character_set_client */; | |
/*!50001 SET @saved_cs_results = @@character_set_results */; | |
/*!50001 SET @saved_col_connection = @@collation_connection */; | |
/*!50001 SET character_set_client = utf8mb4 */; | |
/*!50001 SET character_set_results = utf8mb4 */; | |
/*!50001 SET collation_connection = utf8mb4_0900_ai_ci */; | |
/*!50001 CREATE ALGORITHM=UNDEFINED */ | |
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ | |
/*!50001 VIEW `nyt_us_counties_view` AS select str_to_date(`nyt_us_counties_raw`.`date`,'%Y-%m-%d') AS `date`,`nyt_us_counties_raw`.`county` AS `county`,`nyt_us_counties_raw`.`state` AS `state`,cast(`nyt_us_counties_raw`.`cases` as signed) AS `cases`,cast(`nyt_us_counties_raw`.`deaths` as signed) AS `deaths` from `nyt_us_counties_raw` */; | |
/*!50001 SET character_set_client = @saved_cs_client */; | |
/*!50001 SET character_set_results = @saved_cs_results */; | |
/*!50001 SET collation_connection = @saved_col_connection */; | |
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; | |
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; | |
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; | |
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; | |
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; | |
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; | |
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; | |
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; | |
-- Dump completed on 2020-05-25 13:41:35 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
wget -O nyt_us_counties.csv https://raw.githubusercontent.com/nytimes/covid-19-data/master/us-counties.csv | |
wget -O covidtracking_daily.csv https://covidtracking.com/api/v1/states/daily.csv | |
wget -O rt.csv https://d14wlfuexuxgcm.cloudfront.net/covid/rt.csv | |
mysql -uroot covid19_data < load_csvs.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment