[
	{
		"database": "gharchive_dev",
		"table": "github_events",
		"col_names": [
			"id",
			"type",
			"created_at",
			"repo_id",
			"repo_name",
			"actor_id",
			"actor_login",
			"actor_location",
			"language",
			"additions",
			"deletions",
			"action",
			"number",
			"commit_id",
			"comment_id",
			"org_login",
			"org_id",
			"state",
			"closed_at",
			"comments",
			"pr_merged_at",
			"pr_merged",
			"pr_changed_files",
			"pr_review_comments",
			"pr_or_issue_id",
			"event_day",
			"event_month",
			"author_association",
			"event_year",
			"push_size",
			"push_distinct_size"
		],
		"questions": [
			"what's the best repo",
			"show me the SQL to get current DAY of this MONTH",
			"How many issues did I created in pingcap/tidb in last three months",
			"Which companies contribute the most to Kubernetes?",
			"How many repo were written by js",
			"How many contributors in @pingcap/tidb",
			"Top 10 developers from PingCAP who contributes most of PRs in the past year",
			"how many repos are written in Python?",
			"find the most popular repo from github_events",
			"find how many developer come from US",
			"latest commit TIME",
			"get the total count of events",
			"get the number of rows in event table",
			"Top 10 developers from PingCAP who contributes most of PRs in the past year",
			"give me sql to find how many repo were written by python",
			"sql function to get current time",
			"which repo has the most actor ",
			"which pr in @pingcap/tidb has the most comments",
			"what day is the day that @pingcap/tidb has the most commits",
			"which repo has the most unmerged pr",
			"what is the most popular language in the past year",
			"which repo has the most open issues",
			"what language is the most popular in repo @pingcap/tikv",
			"I would like to know how many languages appear in pingcap/tidb and what they all are",
			"Which user has given the most pr comments",
			"Which repo has the most commits in the past year",
			"who created the most pr in US",
			"how many closed pr in pingcap/tidb in the past year",
			"are there any repo that has more than 1000 commits in the past year",
			"how many pr closed at christmas last year",
			"who created more than 500 pr",
			"show the top 10 contributors",
			"get all repo id and name ",
			"get all repo id and name and sort it",
			"get all repo id and name and remove replication",
			"get all repo names include 'golang'",
			"find who commits in at least 2 repo",
			"find who commits in at least 2 repo in the same day",
			"how many commiter from US",
			"get all repos that have active commits from 2014 to 2022",
			"which repo has most issues",
			"get all type",
			"list 10 commiter that have more than 500 prs",
			"list 10 commiter that have more than 500 prs , and order them by id",
			"list all org",
			"list all org and sort them by the frequency of using python",
			"create table name test in database gharchive_dev, including one filed num ",
			"get all collaborator that has more prs than owner",
			"who contribute to tiDB and kubernetes as the same time",
			"who contribute to tiDB and kubernetes as the same time, please use join not or",
			"get current time in utc+8",
			"list the pr amount of each month of 2020 , and sort it.",
			"who create most prs in weekend, list 10 of them",
			"Top languages in the open source world over the past four years",
			"Geographic distribution of developer behavior",
			"Ranking of back-end programming languages",
			"Developer behavior distribution on weekdays and weekends",
			"which actor only had actions in 2014",
			"the company who has most number of developers",
			"the repo which earned most stars in 2021",
			"the most numebr of push per day for a developer",
			"the most active developer in repo pingcap/tidb",
			"list 5 pr has most comments",
			"Distribution of the number of events in the first and second half of each month",
			"how many actor only submit prs in golang",
			"how many front-end developers in org pingcap",
			"how many prs in pingcap/tidb have been reverted"
		],
		"answers": [
			"\nSELECT repo_name, SUM(additions) AS total_additions, SUM(deletions) AS total_deletions\nFROM github_events\nGROUP BY repo_name\nORDER BY total_additions DESC, total_deletions ASC;",
			"\nSELECT DAY(CURDATE()) AS 'Current Day';",
			"\nSELECT COUNT(*) \nFROM github_events \nWHERE type = 'IssuesEvent' \nAND repo_name = 'pingcap/tidb' \nAND actor_login = '\u003cyour_username\u003e' \nAND created_at \u003e DATE_SUB(NOW(), INTERVAL 3 MONTH);",
			"\nSELECT org_login, COUNT(*) AS contributions\nFROM github_events\nWHERE repo_name = 'Kubernetes'\nGROUP BY org_login\nORDER BY contributions DESC;",
			"\nSELECT COUNT(*) \nFROM github_events \nWHERE language = 'js';",
			"\nSELECT COUNT(DISTINCT actor_login) \nFROM github_events \nWHERE repo_name = '@pingcap/tidb';",
			"\nSELECT actor_login, COUNT(*) AS total_prs \nFROM github_events \nWHERE org_login = 'PingCAP' \nAND type = 'PullRequestEvent' \nAND event_year = YEAR(CURDATE()) \nGROUP BY actor_login \nORDER BY total_prs DESC \nLIMIT 10;",
			"\nSELECT COUNT(*) \nFROM github_events \nWHERE language = 'Python';",
			"\nSELECT repo_name, COUNT(*) AS popularity \nFROM github_events \nGROUP BY repo_name \nORDER BY popularity DESC \nLIMIT 1;",
			"\nSELECT COUNT(*) \nFROM github_events \nWHERE actor_location LIKE '%US%';",
			"\nSELECT MAX(created_at) \nFROM github_events;",
			"\nSELECT COUNT(*) FROM github_events;",
			"\nSELECT COUNT(*) FROM github_events;",
			"\nSELECT actor_login, COUNT(*) AS total_prs \nFROM github_events \nWHERE org_login = 'PingCAP' \nAND type = 'PullRequestEvent' \nAND event_year = YEAR(CURDATE()) \nGROUP BY actor_login \nORDER BY total_prs DESC \nLIMIT 10;",
			"\nSELECT COUNT(*) \nFROM github_events \nWHERE language = 'Python';",
			"\nSELECT CURRENT_TIMESTAMP();",
			"\nSELECT repo_name, COUNT(actor_id) AS actor_count\nFROM github_events\nGROUP BY repo_name\nORDER BY actor_count DESC\nLIMIT 1;",
			"\nSELECT pr_or_issue_id, comments \nFROM github_events \nWHERE repo_name = '@pingcap/tidb' \nORDER BY comments DESC \nLIMIT 1;",
			"\nSELECT event_day, COUNT(*) AS commit_count\nFROM github_events\nWHERE repo_name = '@pingcap/tidb'\nGROUP BY event_day\nORDER BY commit_count DESC\nLIMIT 1;",
			"\nSELECT repo_name, COUNT(*) AS unmerged_pr\nFROM github_events\nWHERE pr_merged = 0\nGROUP BY repo_name\nORDER BY unmerged_pr DESC;",
			"\nSELECT language, COUNT(*) AS language_count\nFROM github_events\nWHERE event_year = YEAR(CURDATE())\nGROUP BY language\nORDER BY language_count DESC\nLIMIT 1;",
			"\nSELECT repo_name, COUNT(*) AS open_issues\nFROM github_events\nWHERE type = 'IssuesEvent' AND state = 'open'\nGROUP BY repo_name\nORDER BY open_issues DESC;",
			"\nSELECT language, COUNT(*) AS count\nFROM github_events\nWHERE repo_name = '@pingcap/tikv'\nGROUP BY language\nORDER BY count DESC\nLIMIT 1;",
			"\nSELECT DISTINCT language \nFROM github_events \nWHERE repo_name = 'pingcap/tidb';",
			"\nSELECT actor_login, COUNT(*) AS pr_comment_count\nFROM github_events\nWHERE comment_id IS NOT NULL\nGROUP BY actor_login\nORDER BY pr_comment_count DESC\nLIMIT 1;",
			"\nSELECT repo_name, COUNT(*) AS commits_count\nFROM github_events\nWHERE event_year = YEAR(CURDATE())\nGROUP BY repo_name\nORDER BY commits_count DESC\nLIMIT 1;",
			"\nSELECT actor_login, COUNT(*) AS pr_count\nFROM github_events\nWHERE actor_location LIKE '%US%'\nAND type = 'PullRequestEvent'\nGROUP BY actor_login\nORDER BY pr_count DESC;",
			"\nSELECT COUNT(*) \nFROM github_events \nWHERE type = 'PullRequestEvent' \nAND repo_name = 'pingcap/tidb' \nAND state = 'closed' \nAND event_year = YEAR(CURDATE()) - 1;",
			"\nSELECT COUNT(*) \nFROM github_events \nWHERE type = 'Commit' \nAND event_year = YEAR(CURDATE()) \nGROUP BY repo_id \nHAVING COUNT(*) \u003e 1000;",
			"\nSELECT COUNT(*) \nFROM github_events \nWHERE type = 'PullRequestEvent' \nAND closed_at LIKE '%12-25%' \nAND event_year = 2019;",
			"\nSELECT actor_login \nFROM github_events \nWHERE type = 'PullRequestEvent' \nGROUP BY actor_login \nHAVING COUNT(*) \u003e 500;",
			"\nSELECT actor_login, COUNT(*) AS contributions \nFROM github_events \nGROUP BY actor_login \nORDER BY contributions DESC \nLIMIT 10;",
			"\nSELECT repo_id, repo_name FROM github_events;",
			"\nSELECT repo_id, repo_name\nFROM github_events\nORDER BY repo_id ASC;",
			"\nSELECT DISTINCT repo_id, repo_name \nFROM github_events;",
			"\nSELECT repo_name \nFROM github_events \nWHERE repo_name LIKE '%golang%';",
			"\nSELECT actor_login\nFROM github_events\nGROUP BY actor_login\nHAVING COUNT(DISTINCT repo_name) \u003e= 2;",
			"\nSELECT actor_login\nFROM github_events\nGROUP BY actor_login, event_day\nHAVING COUNT(DISTINCT repo_name) \u003e= 2;",
			"\nSELECT COUNT(*) \nFROM github_events \nWHERE actor_location LIKE '%US%';",
			"\nSELECT repo_name \nFROM github_events \nWHERE created_at BETWEEN '2014-01-01' AND '2022-12-31' \nAND type = 'CommitCommentEvent'; \n",
			"\nSELECT repo_name, COUNT(*) AS issue_count\nFROM github_events\nWHERE type = 'IssuesEvent'\nGROUP BY repo_name\nORDER BY issue_count DESC;",
			"\nSELECT type FROM github_events;",
			"\nSELECT actor_login, COUNT(*) AS pr_count\nFROM github_events\nWHERE type = 'PullRequestEvent'\nGROUP BY actor_login\nHAVING pr_count \u003e 500\nLIMIT 10;",
			"\nSELECT actor_login, COUNT(*) AS pr_count \nFROM github_events \nWHERE type = 'PullRequestEvent' \nGROUP BY actor_login \nHAVING pr_count \u003e 500 \nORDER BY actor_login \nLIMIT 10;",
			"\nSELECT DISTINCT org_login \nFROM github_events;",
			"\nSELECT org_login, COUNT(*) AS frequency\nFROM github_events\nWHERE language = 'Python'\nGROUP BY org_login\nORDER BY frequency DESC;",
			"\nCREATE TABLE gharchive_dev.test (num INT);",
			"\nSELECT actor_login, COUNT(*) AS pr_count\nFROM github_events\nWHERE type = 'PullRequestEvent'\nGROUP BY actor_login\nHAVING pr_count \u003e (SELECT COUNT(*)\n                    FROM github_events\n                    WHERE type = 'PullRequestEvent'\n                    AND actor_login = 'owner');",
			"\nSELECT actor_login \nFROM github_events \nWHERE repo_name IN ('tiDB', 'kubernetes') \nGROUP BY actor_login \nHAVING COUNT(DISTINCT repo_name) = 2;",
			"\nSELECT actor_login \nFROM github_events \nWHERE (repo_name = 'tiDB' OR repo_name = 'kubernetes') \nGROUP BY actor_login \nHAVING COUNT(*) = 2;",
			"\nSELECT CONVERT_TZ(NOW(), 'UTC', '+08:00');",
			"\nSELECT event_month, COUNT(*) AS pr_amount\nFROM github_events\nWHERE event_year = 2020\nAND type = 'PullRequestEvent'\nGROUP BY event_month\nORDER BY pr_amount DESC;",
			"\nSELECT actor_login, COUNT(*) AS total_prs\nFROM github_events\nWHERE type = 'PullRequestEvent'\nAND (DAYOFWEEK(created_at) = 6 OR DAYOFWEEK(created_at) = 7)\nGROUP BY actor_login\nORDER BY total_prs DESC\nLIMIT 10;",
			"\nSELECT language, COUNT(*) AS language_count\nFROM github_events\nWHERE event_year \u003e= 2016\nGROUP BY language\nORDER BY language_count DESC;",
			"\nSELECT actor_location, COUNT(*) AS count\nFROM github_events\nGROUP BY actor_location;",
			"\nSELECT language, COUNT(*) AS language_count\nFROM github_events\nWHERE type = 'PushEvent'\nGROUP BY language\nORDER BY language_count DESC;",
			"\nSELECT \n    CASE \n        WHEN DAYOFWEEK(created_at) IN (1,7) THEN 'Weekend'\n        ELSE 'Weekday'\n    END AS Day_Type,\n    COUNT(*) AS Count\nFROM github_events\nGROUP BY Day_Type;",
			"\nSELECT actor_login \nFROM github_events \nWHERE event_year = 2014;",
			"\nSELECT org_login, COUNT(*) AS num_developers\nFROM github_events\nGROUP BY org_login\nORDER BY num_developers DESC\nLIMIT 1;",
			"\nSELECT repo_name, SUM(stars) AS total_stars\nFROM github_events\nWHERE event_year = 2021\nGROUP BY repo_name\nORDER BY total_stars DESC;",
			"\nSELECT actor_login, COUNT(*) AS push_count, MAX(event_day) AS push_day\nFROM github_events\nWHERE type = 'PushEvent'\nGROUP BY actor_login\nORDER BY push_count DESC;",
			"\nSELECT actor_login, COUNT(*) AS total_events \nFROM github_events \nWHERE repo_name = 'pingcap/tidb' \nGROUP BY actor_login \nORDER BY total_events DESC \nLIMIT 1;",
			"\nSELECT pr_or_issue_id, comments\nFROM github_events\nORDER BY comments DESC\nLIMIT 5;",
			"\nSELECT \n    COUNT(*) AS event_count, \n    CASE \n        WHEN DAY(created_at) \u003c= 15 THEN 'First Half' \n        ELSE 'Second Half' \n    END AS half_month \nFROM github_events \nGROUP BY MONTH(created_at), half_month;",
			"\nSELECT COUNT(*) \nFROM github_events \nWHERE type = 'PullRequestEvent' \nAND language = 'Golang' \nAND action = 'submitted';",
			"\nSELECT COUNT(*) \nFROM github_events \nWHERE org_login = 'pingcap' \nAND language = 'front-end';",
			"\nSELECT COUNT(*) \nFROM github_events \nWHERE repo_name = 'pingcap/tidb' \nAND action = 'reverted';"
		]
	}
]