{"id":15002986,"url":"https://github.com/serzhyale/sql_calendar","last_synced_at":"2026-02-07T03:02:16.063Z","repository":{"id":208311922,"uuid":"719332977","full_name":"SerZhyAle/sql_calendar","owner":"SerZhyAle","description":"Calendar for MySQL, Microsoft SQL, Oracle, Postgres (dates, hours, weeks, months, quarters, years)","archived":false,"fork":false,"pushed_at":"2024-03-26T12:13:26.000Z","size":11957,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T10:30:04.587Z","etag":null,"topics":["calendar","dates","hours","mariadb-mysql","months","mssql","mssql-database","mysql","oracle","oracle-database","postgres","quarters","sql","weeks"],"latest_commit_sha":null,"homepage":"","language":"PLpgSQL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SerZhyAle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-16T00:13:16.000Z","updated_at":"2023-11-25T20:36:22.000Z","dependencies_parsed_at":"2025-03-23T10:36:39.257Z","dependency_job_id":null,"html_url":"https://github.com/SerZhyAle/sql_calendar","commit_stats":null,"previous_names":["serzhyale/sql_calendar"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/SerZhyAle/sql_calendar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SerZhyAle%2Fsql_calendar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SerZhyAle%2Fsql_calendar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SerZhyAle%2Fsql_calendar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SerZhyAle%2Fsql_calendar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SerZhyAle","download_url":"https://codeload.github.com/SerZhyAle/sql_calendar/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SerZhyAle%2Fsql_calendar/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266948247,"owners_count":24010896,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-25T02:00:09.625Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["calendar","dates","hours","mariadb-mysql","months","mssql","mssql-database","mysql","oracle","oracle-database","postgres","quarters","sql","weeks"],"created_at":"2024-09-24T18:54:35.985Z","updated_at":"2026-02-07T03:02:16.034Z","avatar_url":"https://github.com/SerZhyAle.png","language":"PLpgSQL","readme":"# sql_calendar\n\n### Physical **Calendar** for \n## - *MySQL (MariaDB)*  \n## - *Microsoft SQL*\n## - *Oracle SQL*  \n## - *Postgres SQL*\n## - *Snowflake*\n## - *As CSV table files (just to import)*\n### Hours, Dates, Weeks, Months, Quarters, Years\n\n--- \nThe solution for enterprise applications. Calendar with already calculated fields for grouping and filtering date-time aggregated stored data.  \nIn this package code for:\n\nThe tables:\n- **calendar_dates**\n- **calendar_hours**\n\nThe views:\n- **calendar_weeks**\n- **calendar_months**\n- **calendar_quarters**\n- **calendar_years**\n\nFast physical JOIN entity for any calendar-related aggregarions.\n#### You can check the file *sql_calendar_csv_files.zip* with resulted csv files.\n\n---\n ## **calendar_dates** (68 columns)  \n The table points to each date in the period.\n Main fields can be key to dimensions in aggregated tables: *date* (date YYYY-MM-DD) and *date8* (int YYYYMMDD).  \n But all known other versions are presented. \n\n The idea is to have a real table with already calculated information and use it in joining any daily aggregations. \n Columns **year_week** or **week_begin**, **year_month2**, **year_quarter**, **year** - pointing its views. \n\n---\n ## **calendar_hours** (38 columns)  \n The table points to each hour for every date in the period.\n \n The idea is to have a real table with already calculated information to use in joining any hourly aggregations.  \n Main fields can be key to dimensions in aggregated tables: *date_hour* (char(13) YYYY-MM-DD HH) and *date_hour10* (int YYYYMMDDHH).  \n Column **date** pointing table *calendar_dates*. Column **year_month2** - pointing its view.  \n \n Also can help to join data with hours in different timezones.\n In this example, the table stores information about UTC hours for CET. To aggregate UTC-stored data for CET calendar dates.  \n The fields **date_hour_cet** (char(13) YYYY-MM-DD HH) and **date_hour_cet10** (int YYYYMMDDHH) can be key to dimensions in aggregated tables.   \n Columns date_cet, year_month2_cet - pointing CET timezone.  \n \n#### Also presented 3 short versions of this table for fast indexing for usage in big data selections.\n\n---\n\n ## **calendar_weeks** (28 columns)  \n The view to aggregate daily-presented data by its weeks.\n The main field can be key to dimensions in aggregated tables: *year_week* (char(7) YYYY/WW)\n\n---\n\n ## **calendar_months** (29 columns)  \n The view to aggregate daily-presented data by its calendar months.\n The main field can be key to dimensions in aggregated tables: *year_month2* (char(7) YYYY-MM)\n\n---\n\n ## **calendar_quarters** (16 columns)  \n The view to aggregate daily/monthly-presented data by its calendar quarters.\n The main field can be key to dimensions in aggregated tables: *year_quarter* (char(6) YYYY-Q)\n\n---\n\n ## **calendar_years** (16 columns)  \n The view to aggregate daily/monthly-presented data by its calendar year.\n The main field can be key to dimensions in aggregated tables: *year* (YYYY)\n\n---\n\nPlease choose the solution folder for your SQL version and pay attention to the details written in comments in the code files (.sql)\n--- \n/*\n sza(c)\n */\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserzhyale%2Fsql_calendar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserzhyale%2Fsql_calendar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserzhyale%2Fsql_calendar/lists"}