You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: training_data/similarweb/questions.json
+9-9
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
[
2
2
{
3
-
"question":"what are the year on year total visits on Tesla and ford from 2018 to 2023 ? Convert varchar to date using to date fucntion , Plot a line chart ",
3
+
"question":"what are the year on year total visits on Tesla and ford from 2018 to 2023 ? Convert varchar to date using to date function , Plot a line chart ",
4
4
"answer":"SELECT company_name,\r\n extract(year\r\nFROM to_date(date, 'YYYY-MM-DD')) as year, sum(total_visits) as total_visits\r\nFROM s__p_500_by_domain_and_aggregated_by_tickers_sample.datafeeds.sp_500\r\nWHERE (company_name ilike '%Tesla%'\r\n or company_name = 'Ford')\r\n and to_date(date, 'YYYY-MM-DD') between '2018-01-01'\r\n and '2023-12-31'\r\nGROUP BY company_name, extract(year\r\nFROM to_date(date, 'YYYY-MM-DD'))\r\nORDER BY company_name, year;"
"question":"what are the year on year total visits on ebay and amazon from 2018 to 2021? Convert varchar to date using to date fucntion , Plot a line chart ",
55
+
"question":"what are the year on year total visits on ebay and amazon from 2018 to 2021? Convert varchar to date using to date function , Plot a line chart ",
56
56
"answer":"SELECT company_name,\n extract(year\nFROM to_date(date, 'YYYY-MM-DD')) as year, sum(total_visits) as total_visits\nFROM s__p_500_by_domain_and_aggregated_by_tickers_sample.datafeeds.sp_500\nWHERE (company_name ilike '%ebay%'\n or company_name ilike '%amazon%')\n and to_date(date, 'YYYY-MM-DD') between '2018-01-01'\n and '2021-12-31'\nGROUP BY company_name, extract(year\nFROM to_date(date, 'YYYY-MM-DD'))\nORDER BY company_name, year;"
57
57
},
58
58
{
@@ -120,7 +120,7 @@
120
120
"answer":"```\r\nSELECT DATE,\r\n SUM(CASE WHEN DOMAIN = 'google.com' THEN TOTAL_VISITS ELSE 0 END) AS GOOGLE_VISITS,\r\n SUM(CASE WHEN DOMAIN = 'bing.com' THEN TOTAL_VISITS ELSE 0 END) AS BING_VISITS\r\nFROM S__P_500_BY_DOMAIN_AND_AGGREGATED_BY_TICKERS_SAMPLE.DATAFEEDS.SP_500\r\nWHERE DOMAIN IN ('google.com', 'bing.com')\r\nGROUP BY DATE\r\nORDER BY DATE ASC\r\n```"
121
121
},
122
122
{
123
-
"question":"what are the year on year total visits on Tesla and general mills from 2018 to 2021 ? Convert varchar to date using to date fucntion , Plot a line chart ",
123
+
"question":"what are the year on year total visits on Tesla and general mills from 2018 to 2021 ? Convert varchar to date using to date function , Plot a line chart ",
124
124
"answer":"SELECT company_name,\n extract(year\nFROM to_date(date, 'YYYY-MM-DD')) as year, sum(total_visits) as total_visits\nFROM s__p_500_by_domain_and_aggregated_by_tickers_sample.datafeeds.sp_500\nWHERE (company_name ilike '%tesla%'\n or company_name ilike '%general mills%')\n and to_date(date, 'YYYY-MM-DD') between '2018-01-01'\n and '2021-12-31'\nGROUP BY company_name, extract(year\nFROM to_date(date, 'YYYY-MM-DD'))\nORDER BY company_name, year;"
125
125
},
126
126
{
@@ -192,7 +192,7 @@
192
192
"answer":"SELECT company_name,\r\n sum(total_visits) as visits\r\nFROM s__p_500_by_domain_and_aggregated_by_tickers_sample.datafeeds.sp_500\r\nWHERE to_date(date, 'YYYY-MM-DD') between '2021-01-01'\r\n and '2021-12-31'\r\nGROUP BY company_name\r\nORDER BY visits desc limit 5;"
193
193
},
194
194
{
195
-
"question":"what are the year on year total visits on ebay and amazon from 2018 to 2023 ? Convert varchar to date using to date fucntion , Plot a line chart ",
195
+
"question":"what are the year on year total visits on ebay and amazon from 2018 to 2023 ? Convert varchar to date using to date function , Plot a line chart ",
196
196
"answer":"SELECT company_name,\n extract(year\nFROM to_date(date, 'YYYY-MM-DD')) as year, sum(total_visits) as total_visits\nFROM s__p_500_by_domain_and_aggregated_by_tickers_sample.datafeeds.sp_500\nWHERE (company_name ilike '%ebay%'\n or company_name ilike '%amazon%')\n and to_date(date, 'YYYY-MM-DD') between '2018-01-01'\n and '2023-12-31'\nGROUP BY company_name, extract(year\nFROM to_date(date, 'YYYY-MM-DD'))\nORDER BY company_name, year;"
197
197
},
198
198
{
@@ -204,7 +204,7 @@
204
204
"answer":"SELECT domain,\r\n sum(total_visits) as total_visits\r\nFROM s__p_500_by_domain_and_aggregated_by_tickers_sample.datafeeds.sp_500\r\nWHERE date in ('2021-11-26', '2021-11-26')\r\nGROUP BY domain\r\nORDER BY total_visits desc"
205
205
},
206
206
{
207
-
"question":"what are the year on year total visits on Tesla and ford from 2018 to 2021 ? Convert varchar to date using to date fucntion , Plot a line chart ",
207
+
"question":"what are the year on year total visits on Tesla and ford from 2018 to 2021 ? Convert varchar to date using to date function , Plot a line chart ",
208
208
"answer":"SELECT company_name,\r\n extract(year\r\nFROM to_date(date, 'YYYY-MM-DD')) as year, sum(total_visits) as total_visits\r\nFROM s__p_500_by_domain_and_aggregated_by_tickers_sample.datafeeds.sp_500\r\nWHERE (company_name ilike '%tesla%'\r\n or company_name = 'Ford')\r\n and to_date(date, 'YYYY-MM-DD') between '2018-01-01'\r\n and '2021-12-31'\r\nGROUP BY company_name, extract(year\r\nFROM to_date(date, 'YYYY-MM-DD'))\r\nORDER BY company_name, year;"
209
209
},
210
210
{
@@ -264,7 +264,7 @@
264
264
"answer":"```\nSELECT DOMAIN, ROUND(AVG(TOTAL_AVG_VISIT_DURATION),2) AS AVG_DURATION \nFROM S__P_500_BY_DOMAIN_AND_AGGREGATED_BY_TICKERS_SAMPLE.DATAFEEDS.SP_500 \nGROUP BY DOMAIN \nORDER BY SUM(TOTAL_VISITS) DESC \nLIMIT 100\n```"
265
265
},
266
266
{
267
-
"question":"what are the year on year total visits on Tesla and general mills from 2018 to 2023 ? Convert varchar to date using to date fucntion",
267
+
"question":"what are the year on year total visits on Tesla and general mills from 2018 to 2023 ? Convert varchar to date using to date function",
268
268
"answer":"SELECT company_name,\n extract(year\nFROM to_date(date, 'YYYY-MM-DD')) as year, sum(total_visits) as total_visits\nFROM s__p_500_by_domain_and_aggregated_by_tickers_sample.datafeeds.sp_500\nWHERE (company_name ilike '%tesla%'\n or company_name ilike '%general mills%')\n and to_date(date, 'YYYY-MM-DD') between '2018-01-01'\n and '2023-12-31'\nGROUP BY company_name, extract(year\nFROM to_date(date, 'YYYY-MM-DD'))\nORDER BY company_name, year;"
269
269
},
270
270
{
@@ -284,7 +284,7 @@
284
284
"answer":"SELECT sum(mobile_visits) as mobile_visits\nFROM s__p_500_by_domain_and_aggregated_by_tickers_sample.datafeeds.sp_500\nWHERE company_name ilike '%google%'\n and to_date(date, 'YYYY-MM-DD') between '2010-12-31'\n and '2021-01-01';"
285
285
},
286
286
{
287
-
"question":"what are the year on year total visits on Coca Coal and Pepsi from 2018 to 2021 ? Convert varchar to date using to date fucntion",
287
+
"question":"what are the year on year total visits on Coca Coal and Pepsi from 2018 to 2021 ? Convert varchar to date using to date function",
288
288
"answer":"SELECT company_name,\n extract(year\nFROM to_date(date, 'YYYY-MM-DD')) as year, sum(total_visits) as total_visits\nFROM s__p_500_by_domain_and_aggregated_by_tickers_sample.datafeeds.sp_500\nWHERE (company_name ilike '%coca-cola%'\n or company_name ilike '%pepsi%')\n and to_date(date, 'YYYY-MM-DD') between '2018-01-01'\n and '2021-12-31'\nGROUP BY company_name, extract(year\nFROM to_date(date, 'YYYY-MM-DD'))\nORDER BY company_name, year;"
289
289
},
290
290
{
@@ -336,7 +336,7 @@
336
336
"answer":"SELECT year,\r\n mobile_visits - lag(mobile_visits,\r\n 1) OVER (ORDER BY year) as mobile_visits_growth,\r\n round((mobile_visits - lag(mobile_visits, 1) OVER (ORDER BY year)) * 100.0 \/ nullif(lag(mobile_visits, 1) OVER (ORDER BY year), 0),\r\n 2) as mobile_visits_growth_percentage\r\nFROM (SELECT date_trunc('year', to_date(date, 'YYYY-MM-DD')) as year,\r\n sum(mobile_visits) as mobile_visits\r\n FROM s__p_500_by_domain_and_aggregated_by_tickers_sample.datafeeds.sp_500\r\n WHERE company_name ilike '%alphabet%'\r\n and to_date(date, 'YYYY-MM-DD') between '2010-01-01'\r\n and '2021-12-31'\r\n GROUP BY date_trunc('year', to_date(date, 'YYYY-MM-DD'))) subquery\r\nORDER BY year"
337
337
},
338
338
{
339
-
"question":"what are the year on year total visits on Tesla and general mills from 2018 to 2021 ? Convert varchar to date using to date fucntion",
339
+
"question":"what are the year on year total visits on Tesla and general mills from 2018 to 2021 ? Convert varchar to date using to date function",
340
340
"answer":"SELECT company_name,\n extract(year\nFROM to_date(date, 'YYYY-MM-DD')) as year, sum(total_visits) as total_visits\nFROM s__p_500_by_domain_and_aggregated_by_tickers_sample.datafeeds.sp_500\nWHERE (company_name ilike '%tesla%'\n or company_name ilike '%general mills%')\n and to_date(date, 'YYYY-MM-DD') between '2018-01-01'\n and '2021-12-31'\nGROUP BY company_name, extract(year\nFROM to_date(date, 'YYYY-MM-DD'))\nORDER BY company_name, year;"
341
341
},
342
342
{
@@ -347,4 +347,4 @@
347
347
"question":"What is the percentage change in domains which had the highest mobile traffic between 2022 and 2021?",
348
348
"answer":"with mobile_visits as (SELECT domain,\n sum(case when date between '2021-11-01' and\n '2021-11-30' then mobile_visits\n else 0 end) as mobile_visits_2021,\n sum(case when date between '2022-11-01' and\n '2022-11-30' then mobile_visits\n else 0 end) as mobile_visits_2022\n FROM s__p_500_by_domain_and_aggregated_by_tickers_sample.datafeeds.sp_500\n GROUP BY domain), top_domains as (SELECT domain,\n mobile_visits_2021,\n mobile_visits_2022,\n rank() OVER (ORDER BY mobile_visits_2022 desc) as rank_2022,\n rank() OVER (ORDER BY mobile_visits_2021 desc) as rank_2021\n FROM mobile_visits)\nSELECT top 10 t.domain,\n round((t.mobile_visits_2022 - t.mobile_visits_2021) \/ t.mobile_visits_2021 * 100,\n 2) as mobile_traffic_percentage_change\nFROM top_domains t\nWHERE t.rank_2022 <= 10\n and t.rank_2021 <= 10\nORDER BY mobile_traffic_percentage_change desc"
0 commit comments