-- DBMS: bigquery
CREATE TABLE `bigquery-public-data.utility_us.date_greg`
(
  date DATE OPTIONS(description="Date as DATE - CAST('2000-12-31' AS DATE); [1582-10-15, 2199-12-31]"),
  date_str STRING OPTIONS(description="Date as STRING - '20001231'"),
  date_int INT64 OPTIONS(description="Date as INTEGER - 20001231"),
  date_dash STRING OPTIONS(description="Date as STRING - '2000-12-31'"),
  date_slash STRING OPTIONS(description="Date as STRING - '2000/12/31'"),
  day INT64 OPTIONS(description="Day as Integer - [1, 31]"),
  day_abbr STRING OPTIONS(description="Day as 3-letter STRING - [mon, tue, wed, thu, fri, sat, sun]"),
  dow_mon17 INT64 OPTIONS(description="1 = mon, 7 = sun ; https://en.wikipedia.org/wiki/ISO_week_date)"),
  dow_mon06 INT64 OPTIONS(description="0 = mon, 6 = sun"),
  dow_sun17 INT64 OPTIONS(description="1 = sun, 7 = sat"),
  dow_sun06 INT64 OPTIONS(description="0 = sun, 6 = sat"),
  week_mon INT64 OPTIONS(description="Week Number - First Monday - [0, 53]"),
  week_sun INT64 OPTIONS(description="Week Number - First Sunday - [0, 53]"),
  week_iso INT64 OPTIONS(description="Week Number - First Thursday (ISO) - [0, 53] ; https://en.wikipedia.org/wiki/ISO_week_date"),
  month INT64 OPTIONS(description="Month as Integer - [1, 12]"),
  month_abbr STRING OPTIONS(description="Month as 3-letter STRING - [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]"),
  month_first_day DATE OPTIONS(description="First Day of Month as DATE - [2000-01-01, 2000-02-01, 2000-03-01, ..., 2000-12-01]"),
  quarter INT64 OPTIONS(description="Quarter as Integer - [1, 4]"),
  quarter_first_day DATE OPTIONS(description="First Day of Quarter as DATE - [2000-01-01, 2000-04-01, 2000-07-01, 2000-10-01]"),
  half INT64 OPTIONS(description="Half as Integer - [1, 2]"),
  half_first_day DATE OPTIONS(description="First Day of Half as DATE - [2000-01-01, 2000-07-01]"),
  year INT64 OPTIONS(description="Year as Integer - [1, 9999]"),
  year_iso INT64 OPTIONS(description="Year ISO ; https://en.wikipedia.org/wiki/ISO_week_date"),
  year_first_day DATE OPTIONS(description="First Day of Year as DATE - [2000-01-01, 2001-01-01, 2002-01-01, ...]")
);

INSERT INTO `bigquery-public-data.utility_us.date_greg` (date, date_str, date_int, date_dash, date_slash, day, day_abbr, dow_mon17, dow_mon06, dow_sun17, dow_sun06, week_mon, week_sun, week_iso, month, month_abbr, month_first_day, quarter, quarter_first_day, half, half_first_day, year, year_iso, year_first_day) VALUES ('1970-01-12', '19700112', 19700112, '1970-01-12', '1970/01/12', 12, 'mon', 1, 0, 2, 1, 2, 2, 3, 1, 'jan', '1970-01-01', 1, '1970-01-01', 1, '1970-01-01', 1970, 1970, '1970-01-01'), ('1970-01-05', '19700105', 19700105, '1970-01-05', '1970/01/05', 5, 'mon', 1, 0, 2, 1, 1, 1, 2, 1, 'jan', '1970-01-01', 1, '1970-01-01', 1, '1970-01-01', 1970, 1970, '1970-01-01'), ('1970-01-26', '19700126', 19700126, '1970-01-26', '1970/01/26', 26, 'mon', 1, 0, 2, 1, 4, 4, 5, 1, 'jan', '1970-01-01', 1, '1970-01-01', 1, '1970-01-01', 1970, 1970, '1970-01-01'), ('1970-01-19', '19700119', 19700119, '1970-01-19', '1970/01/19', 19, 'mon', 1, 0, 2, 1, 3, 3, 4, 1, 'jan', '1970-01-01', 1, '1970-01-01', 1, '1970-01-01', 1970, 1970, '1970-01-01'), ('1970-02-16', '19700216', 19700216, '1970-02-16', '1970/02/16', 16, 'mon', 1, 0, 2, 1, 7, 7, 8, 2, 'feb', '1970-02-01', 1, '1970-01-01', 1, '1970-01-01', 1970, 1970, '1970-01-01');