knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(nottshcOpenData)

# Create MySQL connection
# Note, the driver name, here "MySQL ODBC 8.0 ANSI Driver", may differ on your computer
conn_mysql_suce <- connect_mysql(database = "SUCE",
                                 driver = "MySQL ODBC 8.0 ANSI Driver")

1. SQL code used to query data

# Get database (db_) connection for specified date range 
get_px_exp(from = "2020-01-01",
           to = "2020-12-31") %>% 
  dplyr::show_query()

2. SQL code used to tidy data

get_px_exp(from = "2020-01-01",
           to = "2020-12-31") %>% 
  tidy_px_exp() %>% 
  dplyr::show_query()


CDU-data-science-team/nottshcOpenData documentation built on Dec. 17, 2021, 12:53 p.m.