Query the Data Delivery Network
Query the DDNThe easiest way to query any data on Splitgraph is via the "Data Delivery Network" (DDN). The DDN is a single endpoint that speaks the PostgreSQL wire protocol. Any Splitgraph user can connect to it at data.splitgraph.com:5432
and query any version of over 40,000 datasets that are hosted or proxied by Splitgraph.
For example, you can query the places_county_data_gis_friendly_format_2024
table in this repository, by referencing it like:
"cdc-gov/places-county-data-gis-friendly-format-2024-i46a-9kgh:latest"."places_county_data_gis_friendly_format_2024"
or in a full query, like:
SELECT
":id", -- Socrata column ID
"emotionspt_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of lack of social and emotional support among adults
"emotionspt_adjprev", -- Model-based estimate for age-adjusted prevalence of lack of social and emotional support among adults, 2022
"emotionspt_crude95ci", -- Estimated confidence interval for crude prevalence of lack of social and emotional support among adults
"emotionspt_crudeprev", -- Model-based estimate for crude prevalence of lack of social and emotional support among adults, 2022
"lacktrpt_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of lack of reliable transportation in the past 12 months among adults
"lacktrpt_adjprev", -- Model-based estimate for age-adjusted prevalence of lack of reliable transportation in the past 12 months among adults, 2022
"lacktrpt_crude95ci", -- Estimated confidence interval for crude prevalence of lack of reliable transportation in the past 12 months among adults
"lacktrpt_crudeprev", -- Model-based estimate for crude prevalence of lack of reliable transportation in the past 12 months among adults, 2022
"shututility_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of utility services threat in the past 12 months among adults
"shututility_adjprev", -- Model-based estimate for age-adjusted prevalence of utility services threat in the past 12 months among adults, 2022
"shututility_crude95ci", -- Estimated confidence interval for crude prevalence of utility services threat in the past 12 months among adults
"housinsecu_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of housing insecurity in the past 12 months among adults
"housinsecu_adjprev", -- Model-based estimate for age-adjusted prevalence of housing insecurity in the past 12 months among adults, 2022
"housinsecu_crude95ci", -- Estimated confidence interval for crude prevalence of housing insecurity in the past 12 months among adults
"housinsecu_crudeprev", -- Model-based estimate for crude prevalence of housing insecurity in the past 12 months among adults, 2022
"foodinsecu_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of food insecurity in the past 12 months among adults
"foodinsecu_adjprev", -- Model-based estimate for age-adjusted prevalence of food insecurity in the past 12 months among adults, 2022
"foodinsecu_crude95ci", -- Estimated confidence interval for crude prevalence of food insecurity in the past 12 months among adults
"foodinsecu_crudeprev", -- Model-based estimate for crude prevalence of food insecurity in the past 12 months among adults, 2022
"foodstamp_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of received food stamps in the past 12 months among adults
"foodstamp_adjprev", -- Model-based estimate for age-adjusted prevalence of received food stamps in the past 12 months among adults, 2022
"foodstamp_crude95ci", -- Estimated confidence interval for crude prevalence of received food stamps in the past 12 months among adults
"foodstamp_crudeprev", -- Model-based estimate for crude prevalence of received food stamps in the past 12 months among adults, 2022
"isolation_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of feeling socially isolated among adults
"isolation_adjprev", -- Model-based estimate for age-adjusted prevalence of feeling socially isolated among adults, 2022
"isolation_crude95ci", -- Estimated confidence interval for crude prevalence of feeling socially isolated among adults
"isolation_crudeprev", -- Model-based estimate for crude prevalence of feeling socially isolated among adults, 2022
"disability_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of any disability among adults
"disability_adjprev", -- Model-based estimate for age-adjusted prevalence of any disability among adults, 2022
"disability_crude95ci", -- Estimated confidence interval for crude prevalence of any disability among adults
"disability_crudeprev", -- Model-based estimate for crude prevalence of any disability among adults, 2022
"indeplive_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of independent living disability among adults
"indeplive_adjprev", -- Model-based estimate for age-adjusted prevalence of independent living disability among adults, 2022
"indeplive_crude95ci", -- Estimated confidence interval for crude prevalence of independent living disability among adults
"indeplive_crudeprev", -- Model-based estimate for crude prevalence of independent living disability among adults, 2022
"selfcare_adjprev", -- Model-based estimate for age-adjusted prevalence of self-care disability among adults, 2022
"selfcare_crude95ci", -- Estimated confidence interval for crude prevalence of self-care disability among adults
"selfcare_crudeprev", -- Model-based estimate for crude prevalence of self-care disability among adults, 2022
"mobility_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of mobility disability among adults
"mobility_crude95ci", -- Estimated confidence interval for crude prevalence of mobility disability among adults
"cognition_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of cognitive disability among adults
"cognition_adjprev", -- Model-based estimate for age-adjusted prevalence of cognitive disability among adults, 2022
"cognition_crude95ci", -- Estimated confidence interval for crude prevalence of cognitive disability among adults
"cognition_crudeprev", -- Model-based estimate for crude prevalence of cognitive disability among adults, 2022
"vision_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of vision disability among adults
"vision_adjprev", -- Model-based estimate for age-adjusted prevalence of vision disability among adults, 2022
"vision_crude95ci", -- Estimated confidence interval for crude prevalence of vision disability among adults
"vision_crudeprev", -- Model-based estimate for crude prevalence of vision disability among adults, 2022
"hearing_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of hearing disability among adults
"hearing_adjprev", -- Model-based estimate for age-adjusted prevalence of hearing disability among adults, 2022
"hearing_crude95ci", -- Estimated confidence interval for crude prevalence of hearing disability among adults
"hearing_crudeprev", -- Model-based estimate for crude prevalence of hearing disability among adults, 2022
"teethlost_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of all teeth lost among adults aged >=65 years
"teethlost_adjprev", -- Model-based estimate for age-adjusted prevalence of all teeth lost among adults aged >=65 years, 2022
"teethlost_crude95ci", -- Estimated confidence interval for crude prevalence of all teeth lost among adults aged >=65 years
"stroke_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of stroke among adults
"stroke_adjprev", -- Model-based estimate for age-adjusted prevalence of stroke among adults, 2022
"stroke_crude95ci", -- Estimated confidence interval for crude prevalence of stroke among adults
"sleep_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of short sleep duration among adults
"sleep_adjprev", -- Model-based estimate for age-adjusted prevalence of short sleep duration among adults, 2022
"sleep_crude95ci", -- Estimated confidence interval for crude prevalence of short sleep duration among adults
"sleep_crudeprev", -- Model-based estimate for crude prevalence of short sleep duration among adults, 2022
"phlth_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of frequent physical distress among adults
"phlth_adjprev", -- Model-based estimate for age-adjusted prevalence of frequent physical distress among adults, 2022
"phlth_crude95ci", -- Estimated confidence interval for crude prevalence of frequent physical distress among adults
"phlth_crudeprev", -- Model-based estimate for crude prevalence of frequent physical distress among adults, 2022
"obesity_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of obesity among adults
"obesity_adjprev", -- Model-based estimate for age-adjusted prevalence of obesity among adults, 2022
"obesity_crude95ci", -- Estimated confidence interval for crude prevalence of obesity among adults
"obesity_crudeprev", -- Model-based estimate for crude prevalence of obesity among adults, 2022
"mhlth_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of frequent mental distress among adults
"mhlth_adjprev", -- Model-based estimate for age-adjusted prevalence of frequent mental distress among adults, 2022
"mhlth_crude95ci", -- Estimated confidence interval for crude prevalence of frequent mental distress among adults
"mhlth_crudeprev", -- Model-based estimate for crude prevalence of frequent mental distress among adults, 2022
"mammouse_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of mammography use among women aged 50–74 years
"mammouse_adjprev", -- Model-based estimate for age-adjusted prevalence of mammography use among women aged 50–74 years, 2022
"mammouse_crude95ci", -- Estimated confidence interval for crude prevalence of mammography use among women aged 50–74 years
"mammouse_crudeprev", -- Model-based estimate for crude prevalence of mammography use among women aged 50–74 years, 2022
"lpa_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of no leisure-time physical activity among adults
"lpa_adjprev", -- Model-based estimate for age-adjusted prevalence of no leisure-time physical activity among adults, 2022
"lpa_crude95ci", -- Estimated confidence interval for crude prevalence of no leisure-time physical activity among adults
"lpa_crudeprev", -- Model-based estimate for crude prevalence of no leisure-time physical activity among adults, 2022
"highchol_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of high cholesterol among adults who have ever been screened
"highchol_adjprev", -- Model-based estimate for age-adjusted prevalence of high cholesterol among adults who have ever been screened, 2021
"highchol_crude95ci", -- Estimated confidence interval for crude prevalence of high cholesterol among adults who have ever been screened
"highchol_crudeprev", -- Model-based estimate for crude prevalence of high cholesterol among adults who have ever been screened, 2021
"ghlth_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of fair or poor health among adults
"ghlth_adjprev", -- Model-based estimate for age-adjusted prevalence of fair or poor health among adults, 2022
"ghlth_crude95ci", -- Estimated confidence interval for crude prevalence of fair or poor health among adults
"diabetes_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of diagnosed diabetes among adults
"diabetes_adjprev", -- Model-based estimate for age-adjusted prevalence of diagnosed diabetes among adults, 2022
"diabetes_crude95ci", -- Estimated confidence interval for crude prevalence of diagnosed diabetes among adults
"diabetes_crudeprev", -- Model-based estimate for crude prevalence of diagnosed diabetes among adults, 2022
"depression_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of depression among adults, 2022
"depression_adjprev", -- Model-based estimate for age-adjusted prevalence of depression among adults, 2022
"depression_crude95ci", -- Estimated confidence interval for crude prevalence of depression among adults
"depression_crudeprev", -- Model-based estimate for crude prevalence of depression among adults, 2022
"dental_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of visited dentist or dental clinic in the past year among adults
"dental_adjprev", -- Model-based estimate for age-adjusted prevalence of visited dentist or dental clinic in the past year among adults, 2022
"dental_crude95ci", -- Estimated confidence interval for crude prevalence of visited dentist or dental clinic in the past year among adults
"dental_crudeprev", -- Model-based estimate for crude prevalence of visited dentist or dental clinic in the past year among adults, 2022
"csmoking_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of current cigarette smoking among adults
"csmoking_adjprev", -- Model-based estimate for age-adjusted prevalence of current cigarette smoking among adults, 2022
"csmoking_crude95ci", -- Estimated confidence interval for crude prevalence of current cigarette smoking among adults
"csmoking_crudeprev", -- Model-based estimate for crude prevalence of current cigarette smoking among adults, 2022
"copd_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of chronic obstructive pulmonary disease among adults
"copd_adjprev", -- Model-based estimate for age-adjusted prevalence of chronic obstructive pulmonary disease among adults, 2022
"copd_crude95ci", -- Estimated confidence interval for crude prevalence of chronic obstructive pulmonary disease among adults
"copd_crudeprev", -- Model-based estimate for crude prevalence of chronic obstructive pulmonary disease among adults, 2022
"colon_screen_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of colorectal cancer screening among adults aged 45–75 years
"colon_screen_adjprev", -- Model-based estimate for age-adjusted prevalence of colorectal cancer screening among adults aged 45–75 years, 2022
"colon_screen_crude95ci", -- Estimated confidence interval for crude prevalence of colorectal cancer screening among adults aged 45–75 years
"colon_screen_crudeprev", -- Model-based estimate for crude prevalence of colorectal cancer screening among adults aged 45–75 years, 2022
"cholscreen_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of cholesterol screening within the past 5 years among adults
"cholscreen_adjprev", -- Model-based estimate for age-adjusted prevalence of cholesterol screening within the past 5 years among adults, 2021
"cholscreen_crude95ci", -- Estimated confidence interval for crude prevalence of cholesterol screening within the past 5 years among adults
"cholscreen_crudeprev", -- Model-based estimate for crude prevalence of cholesterol screening within the past 5 years among adults, 2021
"checkup_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of routine checkup within the past year among adults
"checkup_adjprev", -- Model-based estimate for age-adjusted prevalence of routine checkup within the past year among adults, 2022
"checkup_crude95ci", -- Estimated confidence interval for crude prevalence of routine checkup within the past year among adults
"checkup_crudeprev", -- Model-based estimate for crude prevalence of routine checkup within the past year among adults, 2022
"chd_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of coronary heart disease among adults
"chd_crude95ci", -- Estimated confidence interval for crude prevalence of coronary heart disease among adults
"chd_crudeprev", -- Model-based estimate for crude prevalence of coronary heart disease among adults, 2022
"casthma_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of current asthma among adults
"casthma_adjprev", -- Model-based estimate for age-adjusted prevalence of current asthma among adults, 2022
"casthma_crude95ci", -- Estimated confidence interval for crude prevalence of current asthma among adults
"casthma_crudeprev", -- Model-based estimate for crude prevalence of current asthma among adults, 2022
"cancer_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of cancer (non-skin) or melanoma among adults
"cancer_adjprev", -- Model-based estimate for age-adjusted prevalence of cancer (non-skin) or melanoma among adults, 2022
"cancer_crude95ci", -- Estimated confidence interval for crude prevalence of cancer (non-skin) or melanoma among adults
"bpmed_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of taking medicine to control high blood pressure among adults with high blood pressure
"bpmed_adjprev", -- Model-based estimate for age-adjusted prevalence of taking medicine to control high blood pressure among adults with high blood pressure, 2021
"bpmed_crude95ci", -- Estimated confidence interval for crude prevalence of taking medicine to control high blood pressure among adults with high blood pressure
"bpmed_crudeprev", -- Model-based estimate for crude prevalence of taking medicine to control high blood pressure among adults with high blood pressure, 2021
"bphigh_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of high blood pressure among adults
"bphigh_adjprev", -- Model-based estimate for age-adjusted prevalence of high blood pressure among adults, 2021
"bphigh_crude95ci", -- Estimated confidence interval for crude prevalence of high blood pressure among adults
"binge_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of binge drinking among adults
"binge_adjprev", -- Model-based estimate for age-adjusted prevalence of binge drinking among adults, 2022
"binge_crude95ci", -- Estimated confidence interval for crude prevalence of binge drinking among adults
"binge_crudeprev", -- Model-based estimate for crude prevalence of binge drinking among adults, 2022
"arthritis_adj95ci", -- Estimated confidence interval for age-adjusted prevalence estimate of arthritis among adults
"arthritis_crude95ci", -- Estimated confidence interval for crude prevalence of arthritis among adults
"arthritis_crudeprev", -- Model-based estimate for crude prevalence of arthritis among adults, 2022
"access2_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of lack of health insurance among adults aged 18-64 years
"access2_adjprev", -- Model-based estimate for age-adjusted prevalence of lack of health insurance among adults aged 18-64 years, 2022
"access2_crude95ci", -- Estimated confidence interval for crude prevalence of lack of health insurance among adults aged 18-64 years
"access2_crudeprev", -- Model-based estimate for crude prevalence of current lack of health insurance among adults aged 18-64 years, 2022
"totalpop18plus", -- Total population estimate 18 and plus of 2022
"totalpopulation", -- Total population estimate of 2022
"countyfips", -- County FIPS code
"countyname", -- County name
"statedesc", -- State name
"stateabbr", -- State abbreviation
"shututility_crudeprev", -- Model-based estimate for crude prevalence of utility services threat in the past 12 months among adults, 2022
"teethlost_crudeprev", -- Model-based estimate for crude prevalence of all teeth lost among adults aged >=65 years, 2022
"mobility_crudeprev", -- Model-based estimate for crude prevalence of mobility disability among adults, 2022
"mobility_adjprev", -- Model-based estimate for age-adjusted prevalence of mobility disability among adults, 2022
"ghlth_crudeprev", -- Model-based estimate for crude prevalence of fair or poor health among adults, 2022
":@computed_region_skr5_azej", -- This column was automatically created in order to record in what polygon from the dataset 'Counties' (skr5-azej) the point in column 'geolocation' is located. This enables the creation of region maps (choropleths) in the visualization canvas and data lens.
"geolocation", -- Latitude, Longitude of city centroid (Format: Point(Longitude Latitude))
"selfcare_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of self-care disability among adults
"stroke_crudeprev", -- Model-based estimate for crude prevalence of stroke among adults, 2022
"chd_adjprev", -- Model-based estimate for age-adjusted prevalence of coronary heart disease among adults, 2022
"cancer_crudeprev", -- Model-based estimate for crude prevalence of cancer (non-skin) or melanoma among adults, 2022
"bphigh_crudeprev", -- Model-based estimate for crude prevalence of high blood pressure among adults, 2021
"arthritis_adjprev" -- Model-based estimate for age-adjusted prevalence of arthritis among adults, 2022
FROM
"cdc-gov/places-county-data-gis-friendly-format-2024-i46a-9kgh:latest"."places_county_data_gis_friendly_format_2024"
LIMIT 100;
Connecting to the DDN is easy. All you need is an existing SQL client that can connect to Postgres. As long as you have a SQL client ready, you'll be able to query cdc-gov/places-county-data-gis-friendly-format-2024-i46a-9kgh
with SQL in under 60 seconds.
Query Your Local Engine
bash -c "$(curl -sL https://github.com/splitgraph/splitgraph/releases/latest/download/install.sh)"
Read the installation docs.
Splitgraph Cloud is built around Splitgraph Core (GitHub), which includes a local Splitgraph Engine packaged as a Docker image. Splitgraph Cloud is basically a scaled-up version of that local Engine. When you query the Data Delivery Network or the REST API, we mount the relevant datasets in an Engine on our servers and execute your query on it.
It's possible to run this engine locally. You'll need a Mac, Windows or Linux system to install sgr
, and a Docker installation to run the engine. You don't need to know how to actually use Docker; sgr
can manage the image, container and volume for you.
There are a few ways to ingest data into the local engine.
For external repositories, the Splitgraph Engine can "mount" upstream data sources by using sgr mount
. This feature is built around Postgres Foreign Data Wrappers (FDW). You can write custom "mount handlers" for any upstream data source. For an example, we blogged about making a custom mount handler for HackerNews stories.
For hosted datasets (like this repository), where the author has pushed Splitgraph Images to the repository, you can "clone" and/or "checkout" the data using sgr clone
and sgr checkout
.
Cloning Data
Because cdc-gov/places-county-data-gis-friendly-format-2024-i46a-9kgh:latest
is a Splitgraph Image, you can clone the data from Spltgraph Cloud to your local engine, where you can query it like any other Postgres database, using any of your existing tools.
First, install Splitgraph if you haven't already.
Clone the metadata with sgr clone
This will be quick, and does not download the actual data.
sgr clone cdc-gov/places-county-data-gis-friendly-format-2024-i46a-9kgh
Checkout the data
Once you've cloned the data, you need to "checkout" the tag that you want. For example, to checkout the latest
tag:
sgr checkout cdc-gov/places-county-data-gis-friendly-format-2024-i46a-9kgh:latest
This will download all the objects for the latest
tag of cdc-gov/places-county-data-gis-friendly-format-2024-i46a-9kgh
and load them into the Splitgraph Engine. Depending on your connection speed and the size of the data, you will need to wait for the checkout to complete. Once it's complete, you will be able to query the data like you would any other Postgres database.
Alternatively, use "layered checkout" to avoid downloading all the data
The data in cdc-gov/places-county-data-gis-friendly-format-2024-i46a-9kgh:latest
is 0 bytes. If this is too big to download all at once, or perhaps you only need to query a subset of it, you can use a layered checkout.:
sgr checkout --layered cdc-gov/places-county-data-gis-friendly-format-2024-i46a-9kgh:latest
This will not download all the data, but it will create a schema comprised of foreign tables, that you can query as you would any other data. Splitgraph will lazily download the required objects as you query the data. In some cases, this might be faster or more efficient than a regular checkout.
Read the layered querying documentation to learn about when and why you might want to use layered queries.
Query the data with your existing tools
Once you've loaded the data into your local Splitgraph Engine, you can query it with any of your existing tools. As far as they're concerned, cdc-gov/places-county-data-gis-friendly-format-2024-i46a-9kgh
is just another Postgres schema.