-- DBMS: snowflake
CREATE TABLE US_REAL_ESTATE.CYBERSYN.CYBERSYN_DATA_CATALOG (
    LICENSE_URL ARRAY,
    DATA_SOURCE ARRAY,
    TABLE_NAME_PROPER TEXT,
    CREATED_DATE DATE,
    LISTING_NAME ARRAY,
    LAST_UPDATED_TIMESTAMP TIMESTAMP_TZ,
    DESCRIPTION TEXT,
    TABLE_TYPE TEXT,
    SELECT_RELATED_TABLES ARRAY,
    DOCUMENTATION_URL TEXT,
    SHORT_DESCRIPTION TEXT,
    DATA_SOURCE_URL ARRAY,
    ENTITIES ARRAY,
    LISTING_URL ARRAY,
    TABLE_NAME TEXT
);

INSERT INTO "US_REAL_ESTATE"."CYBERSYN"."CYBERSYN_DATA_CATALOG" (LICENSE_URL, DATA_SOURCE, TABLE_NAME_PROPER, CREATED_DATE, LISTING_NAME, LAST_UPDATED_TIMESTAMP, DESCRIPTION, TABLE_TYPE, SELECT_RELATED_TABLES, DOCUMENTATION_URL, SHORT_DESCRIPTION, DATA_SOURCE_URL, ENTITIES, LISTING_URL, TABLE_NAME) VALUES ('[
  "https://permid.org/terms",
  "https://creativecommons.org/licenses/by/4.0/",
  "https://www.sec.gov/privacy#security",
  "https://www.gleif.org/en/meta/terms"
]', '[
  "PermID",
  "US Securities & Exchange Commission (SEC)",
  "Global Legal Entity Identifier Foundation (GLEIF)"
]', 'Company Relationships Point in Time History', '2024-03-21', '[
  "Financials & Economics: Enterprise "
]', '2024-08-24 10:08:57.631000+00:00', 'Tracks history of the company_relationships table with start and end timestamps to indicate row validity periods. 

Current rows have a NULL end timestamp. Updated and deleted rows are time-stamped, including deletion time, in Eastern Time with UTC offset.', 'point-in-time history', '[
  "company_relationships"
]', NULL, NULL, '[
  "https://permid.org/",
  "https://www.sec.gov/edgar/search-and-access",
  "https://www.gleif.org/"
]', '[
  "company_id",
  "related_company_id"
]', '[
  "https://app.snowflake.com/marketplace/listing/GZTSZ290BUX66"
]', 'company_relationships_history'), (NULL, '[
  "Consumer Spending Aggregator"
]', 'Consumer Spending Essentials - Merchant Platform Timeseries', '2024-07-02', '[
  "Consumer Spending Essentials"
]', '2024-08-28 01:39:02.112000+00:00', 'The Consumer Spending Foundation includes projected consumer spending activity nationally in the United States. The card panel is made up of data from nearly 100M credit and debit cards from a number of banks and financial institutions. The data is aggregated and normalized to create a representative panel of activity in the US consumer economy.

Provides historical values for spend across merchants through different platforms, e.g. McDonald''s sales through DoorDash, with breakdowns by demographics (age and income level), purchase channels (online vs. offline) and consumer or merchant location. Geographic estimates range from national estimates for the entire US and go as granular as Core Based Statistical Areas ("CBSAs").

Each row represents a distinct timeseries, date, and value.', 'timeseries', '[
  "geography_index",
  "geography_relationships",
  "calendar_index",
  "merchant_company_relationships"
]', NULL, NULL, NULL, NULL, '[
  "https://app.snowflake.com/marketplace/listing/GZTSZ290BUX3R"
]', 'consumer_spending_essentials_merchant_platform_timeseries'), ('[
  "https://www.federalreserve.gov/disclaimer.htm"
]', '[
  "Federal Reserve"
]', 'Federal Reserve Attributes', '2024-01-08', '[
  "Global Government",
  "Financials & Economics: Enterprise "
]', '2024-08-16 13:16:14.329000+00:00', 'Borrowing patterns, credit card debt, commercial paper, finance companies, industrial production, capacity utilization, assets, liabilities, and net worth in the US, provided by the Fed.

The Federal Reserve, often referred to as the Fed, is the central banking system of the US. The data details (1) Consumer Credit - borrowing patterns, credit card debt, and other forms of consumer loans, (2) Commercial Paper - a short-term debt instrument used by corporations for financing, (3) health and activity of Finance Companies, (4) Industrial Production and Capacity Utilization of the manufacturing sector, and (5) US Financial Accounts - assets, liabilities, and net worth.

Provides a wide format breakdown of variables included in the federal_reserve_timeseries table.', 'attributes', '[
  "federal_reserve_timeseries"
]', 'https://docs.cybersyn.com/public-domain-sources/us-federal-reserve', 'Borrowing patterns, credit card debt, commercial paper, finance companies, industrial production, capacity utilization, assets, liabilities, and net worth in the US, provided by the Fed.', '[
  "https://www.federalreserve.gov/data.htm"
]', NULL, '[
  "https://app.snowflake.com/marketplace/listing/GZTSZAS2KGK",
  "https://app.snowflake.com/marketplace/listing/GZTSZ290BUX66"
]', 'federal_reserve_attributes'), ('[
  "https://www.federalreserve.gov/disclaimer.htm"
]', '[
  "Federal Reserve"
]', 'Federal Reserve Timeseries', '2024-01-08', '[
  "Global Government",
  "Financials & Economics: Enterprise "
]', '2024-08-16 13:16:15.634000+00:00', 'Borrowing patterns, credit card debt, commercial paper, finance companies, industrial production, capacity utilization, assets, liabilities, and net worth in the US, provided by the Fed.

The Federal Reserve, often referred to as the Fed, is the central banking system of the US. The data details (1) Consumer Credit - borrowing patterns, credit card debt, and other forms of consumer loans, (2) Commercial Paper - a short-term debt instrument used by corporations for financing, (3) health and activity of Finance Companies, (4) Industrial Production and Capacity Utilization of the manufacturing sector, and (5) US Financial Accounts - assets, liabilities, and net worth.

Provides historical values for each variable collected.

Each row represents a distinct timeseries, date, and value by geographic entity. Each variable is detailed in the federal_reserve_attributes table.', 'timeseries', '[
  "federal_reserve_attributes",
  "geography_index"
]', 'https://docs.cybersyn.com/public-domain-sources/us-federal-reserve', 'Borrowing patterns, credit card debt, commercial paper, finance companies, industrial production, capacity utilization, assets, liabilities, and net worth in the US, provided by the Fed.', '[
  "https://www.federalreserve.gov/data.htm"
]', '[
  "geo_id"
]', '[
  "https://app.snowflake.com/marketplace/listing/GZTSZAS2KGK",
  "https://app.snowflake.com/marketplace/listing/GZTSZ290BUX66"
]', 'federal_reserve_timeseries'), ('[
  "https://www.fhfa.gov/AboutUs/Policies/Pages/Website-Social-Media-Policies.aspx"
]', '[
  "Federal Housing Finance Agency (FHFA)"
]', 'FHFA House Price Index Timeseries', '2023-01-05', '[
  "Finance & Economics",
  "US Real Estate",
  "Financials & Economics: Enterprise "
]', '2024-08-27 14:03:20.088000+00:00', 'House price indexes measuring single-family home price changes in the US since 1975, across various geographic levels and property classifications, provided from the FHFA based on Fannie Mae and Freddie Mac mortgage data.

The Federal Housing Finance Agency (FHFA) provides the House Price Index (HPI), a collection of publicly available price indexes that measure movement of single-family house prices in the US since 1975. The FHFA compiles this data by examining repeat mortgage transactions on single-family properties whose mortgages have been purchased or securitized by Fannie Mae or Freddie Mac, across various geographic levels.

Provides historical values for each variable collected by the FHFA HPI by GEO_ID.

Each row represents a distinct timeseries, date, and value by geographic entity. Each variable is detailed in the fhfa_house_price_attributes table.', 'timeseries', '[
  "fhfa_house_price_attributes",
  "geography_index"
]', 'https://docs.cybersyn.com/public-domain-sources/fhfa', 'House price indexes measuring single-family home price changes in the US since 1975, across various geographic levels and property classifications, provided from the FHFA based on Fannie Mae and Freddie Mac mortgage data.', '[
  "https://www.fhfa.gov/DataTools"
]', '[
  "geo_id"
]', '[
  "https://app.snowflake.com/marketplace/listing/GZTSZAS2KF7",
  "https://app.snowflake.com/marketplace/listing/GZTSZAS2KI6",
  "https://app.snowflake.com/marketplace/listing/GZTSZ290BUX66"
]', 'fhfa_house_price_timeseries');