Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate tsql instructions #208

Merged
merged 4 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions data/instruct_advanced_bigquery.csv
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ car_dealership,bigquery,instructions_cte_join,"WITH salesperson_sales AS (SELECT
Always join sales with cars before using the sales table
Weekend days are Saturday and Sunday
Truncate date to month for aggregation
Last 30 days = CURRENT_DATE - INTERVAL 'some time' to CURRENT_DATE
Last 30 days = CURRENT_DATE - INTERVAL '30 days' to CURRENT_DATE
PMSPS = per month salesperson signups
To get the total sales amount per salesperson, join the salespersons and sales tables, group by salesperson, and sum the sale_price. Always order results with NULLS last.
Truncate date to week for aggregation."
Expand Down Expand Up @@ -89,7 +89,7 @@ car_dealership,bigquery,keywords_aggregate,SELECT COUNT(id) AS TSC FROM car_deal
To calculate the gross profit margin, subtract the total cost from the total revenue, then divide by the total cost and multiply by 100
To ascertain the sales rank of each salesperson, order them by their total sales amount in descending order.
TSC = Total Sales Count."
car_dealership,bigquery,keywords_aggregate,SELECT AVG(sale_price) AS ASP FROM car_dealership.sales WHERE sale_date >= '2023-01-01' AND sale_date <= '2023-03-31';,What is the ASP for sales made in the first quarter of 2023?,ASP = Average Sale Price in the first quarter of 2023.,"Always join sales with cars before using the sales table. ASP = Average Sale Price in the first quarter of 2023. To calculate the average days between sale date and payment received date, join the sales and payments tables To get the list of cars that were sold along with their sale prices, join the cars and sales tables Last 30 days = CURRENT_DATE - INTERVAL 'last month' days to CURRENT_DATE"
car_dealership,bigquery,keywords_aggregate,SELECT AVG(sale_price) AS ASP FROM car_dealership.sales WHERE sale_date >= '2023-01-01' AND sale_date <= '2023-03-31';,What is the ASP for sales made in the first quarter of 2023?,ASP = Average Sale Price in the first quarter of 2023.,"Always join sales with cars before using the sales table. ASP = Average Sale Price in the first quarter of 2023. To calculate the average days between sale date and payment received date, join the sales and payments tables To get the list of cars that were sold along with their sale prices, join the cars and sales tables Last 30 days = CURRENT_DATE - INTERVAL '30 days' to CURRENT_DATE"
car_dealership,bigquery,keywords_ratio,"SELECT salespersons.first_name, salespersons.last_name, AVG(sales.sale_price) AS ASP FROM car_dealership.sales JOIN car_dealership.salespersons ON sales.salesperson_id = salespersons.id GROUP BY salespersons.first_name, salespersons.last_name ORDER BY ASP DESC LIMIT 3;","Who are the top 3 salespersons by ASP? Return their first name, last name and ASP.",ASP (average selling price) = total sales amount / number of sales,"To get the total sales amount per salesperson, join the salespersons and sales tables, group by salesperson, and sum the sale_amount. To calculate the average days between the sale date and payment received date, join the sales and payments_received tables. ASP (average selling price) = total sales amount / number of sales. To get the list of cars that were sold and their sale price, join the cars and sales tables."
car_dealership,bigquery,keywords_ratio,SELECT (SUM(sale_price) - SUM(cars.cost)) / SUM(cars.cost) * 100 AS gpm FROM car_dealership.sales JOIN car_dealership.cars ON sales.car_id = cars.id WHERE EXTRACT(YEAR FROM sale_date) = 2023;,What is the GPM for all car sales in 2023?,GPM (gross profit margin) = (total revenue - total cost) / total cost * 100,"Analyze salesperson activity over a selected period by connecting salespersons with sales records
GPM (gross profit margin) = (total revenue - total cost) / total cost * 100
Expand Down
4 changes: 2 additions & 2 deletions data/instruct_advanced_mysql.csv
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ car_dealership,mysql,instructions_cte_join,"WITH salesperson_sales AS (SELECT s.
Always join sales with cars before using the sales table
Weekend days are Saturday and Sunday
Truncate date to month for aggregation
Last 30 days = CURRENT_DATE - INTERVAL 'some time' to CURRENT_DATE
Last 30 days = CURRENT_DATE - INTERVAL '30 days' to CURRENT_DATE
PMSPS = per month salesperson signups
To get the total sales amount per salesperson, join the salespersons and sales tables, group by salesperson, and sum the sale_price. Always order results with NULLS last.
Truncate date to week for aggregation."
Expand Down Expand Up @@ -89,7 +89,7 @@ car_dealership,mysql,keywords_aggregate,SELECT COUNT(id) AS TSC FROM sales WHERE
To calculate the gross profit margin, subtract the total cost from the total revenue, then divide by the total cost and multiply by 100
To ascertain the sales rank of each salesperson, order them by their total sales amount in descending order.
TSC = Total Sales Count."
car_dealership,mysql,keywords_aggregate,SELECT AVG(sale_price) AS ASP FROM sales WHERE sale_date >= '2023-01-01' AND sale_date <= '2023-03-31';,What is the ASP for sales made in the first quarter of 2023?,ASP = Average Sale Price in the first quarter of 2023.,"Always join sales with cars before using the sales table. ASP = Average Sale Price in the first quarter of 2023. To calculate the average days between sale date and payment received date, join the sales and payments tables To get the list of cars that were sold along with their sale prices, join the cars and sales tables Last 30 days = CURRENT_DATE - INTERVAL 'last month' days to CURRENT_DATE"
car_dealership,mysql,keywords_aggregate,SELECT AVG(sale_price) AS ASP FROM sales WHERE sale_date >= '2023-01-01' AND sale_date <= '2023-03-31';,What is the ASP for sales made in the first quarter of 2023?,ASP = Average Sale Price in the first quarter of 2023.,"Always join sales with cars before using the sales table. ASP = Average Sale Price in the first quarter of 2023. To calculate the average days between sale date and payment received date, join the sales and payments tables To get the list of cars that were sold along with their sale prices, join the cars and sales tables Last 30 days = CURRENT_DATE - INTERVAL '30 days' to CURRENT_DATE"
car_dealership,mysql,keywords_ratio,"SELECT salespersons.first_name, salespersons.last_name, AVG(sales.sale_price) AS ASP FROM sales JOIN salespersons ON sales.salesperson_id = salespersons.id GROUP BY salespersons.first_name, salespersons.last_name ORDER BY ASP DESC LIMIT 3;","Who are the top 3 salespersons by ASP? Return their first name, last name and ASP.",ASP (average selling price) = total sales amount / number of sales,"To get the total sales amount per salesperson, join the salespersons and sales tables, group by salesperson, and sum the sale_amount. To calculate the average days between the sale date and payment received date, join the sales and payments_received tables. ASP (average selling price) = total sales amount / number of sales. To get the list of cars that were sold and their sale price, join the cars and sales tables."
car_dealership,mysql,keywords_ratio,SELECT (SUM(sale_price) - SUM(cars.cost)) / SUM(cars.cost) * 100 AS gpm FROM sales JOIN cars ON sales.car_id = cars.id WHERE EXTRACT(YEAR FROM sale_date) = 2023;,What is the GPM for all car sales in 2023?,GPM (gross profit margin) = (total revenue - total cost) / total cost * 100,"Analyze salesperson activity over a selected period by connecting salespersons with sales records
GPM (gross profit margin) = (total revenue - total cost) / total cost * 100
Expand Down
4 changes: 2 additions & 2 deletions data/instruct_advanced_postgres.csv
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ car_dealership,instructions_cte_join,"Who are the top 5 salespersons by total sa
Always join sales with cars before using the sales table
Weekend days are Saturday and Sunday
Truncate date to month for aggregation
Last 30 days = CURRENT_DATE - INTERVAL 'some time' to CURRENT_DATE
Last 30 days = CURRENT_DATE - INTERVAL '30 days' to CURRENT_DATE
PMSPS = per month salesperson signups
To get the total sales amount per salesperson, join the salespersons and sales tables, group by salesperson, and sum the sale_price. Always order results with NULLS last.
Truncate date to week for aggregation."
Expand Down Expand Up @@ -89,7 +89,7 @@ car_dealership,keywords_aggregate,"What is the TSC in the past 7 days, inclusive
To calculate the gross profit margin, subtract the total cost from the total revenue, then divide by the total cost and multiply by 100
To ascertain the sales rank of each salesperson, order them by their total sales amount in descending order.
TSC = Total Sales Count."
car_dealership,keywords_aggregate,What is the ASP for sales made in the first quarter of 2023?,ASP = Average Sale Price in the first quarter of 2023.,SELECT AVG(sale_price) AS ASP FROM sales WHERE sale_date >= '2023-01-01' AND sale_date <= '2023-03-31',"Always join sales with cars before using the sales table. ASP = Average Sale Price in the first quarter of 2023. To calculate the average days between sale date and payment received date, join the sales and payments tables To get the list of cars that were sold along with their sale prices, join the cars and sales tables Last 30 days = CURRENT_DATE - INTERVAL 'last month' days to CURRENT_DATE"
car_dealership,keywords_aggregate,What is the ASP for sales made in the first quarter of 2023?,ASP = Average Sale Price in the first quarter of 2023.,SELECT AVG(sale_price) AS ASP FROM sales WHERE sale_date >= '2023-01-01' AND sale_date <= '2023-03-31',"Always join sales with cars before using the sales table. ASP = Average Sale Price in the first quarter of 2023. To calculate the average days between sale date and payment received date, join the sales and payments tables To get the list of cars that were sold along with their sale prices, join the cars and sales tables Last 30 days = CURRENT_DATE - INTERVAL '30 days' to CURRENT_DATE"
car_dealership,keywords_ratio,"Who are the top 3 salespersons by ASP? Return their first name, last name and ASP.",ASP (average selling price) = total sales amount / number of sales,"SELECT salespersons.first_name, salespersons.last_name, AVG(sales.sale_price) AS ASP FROM sales JOIN salespersons ON sales.salesperson_id = salespersons.id GROUP BY salespersons.first_name, salespersons.last_name ORDER BY ASP DESC NULLS LAST LIMIT 3","To get the total sales amount per salesperson, join the salespersons and sales tables, group by salesperson, and sum the sale_amount. To calculate the average days between the sale date and payment received date, join the sales and payments_received tables. ASP (average selling price) = total sales amount / number of sales. To get the list of cars that were sold and their sale price, join the cars and sales tables."
car_dealership,keywords_ratio,What is the GPM for all car sales in 2023?,GPM (gross profit margin) = (total revenue - total cost) / total cost * 100,SELECT (SUM(sale_price) - SUM(cars.cost)) / SUM(cars.cost) * 100 AS gpm FROM sales JOIN cars ON sales.car_id = cars.id WHERE EXTRACT(YEAR FROM sale_date) = 2023,"Analyze salesperson activity over a selected period by connecting salespersons with sales records
GPM (gross profit margin) = (total revenue - total cost) / total cost * 100
Expand Down
4 changes: 2 additions & 2 deletions data/instruct_advanced_sqlite.csv
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ car_dealership,sqlite,instructions_cte_join,"WITH salesperson_sales AS (SELECT s
Always join sales with cars before using the sales table
Weekend days are Saturday and Sunday
Truncate date to month for aggregation
Last 30 days = DATE('now', -'some time') to DATE('now')
Last 30 days = DATE('now', '-30 days') to DATE('now')
PMSPS = per month salesperson signups
To get the total sales amount per salesperson, join the salespersons and sales tables, group by salesperson, and sum the sale_price. Always order results with NULLS last.
Truncate date to week for aggregation."
Expand Down Expand Up @@ -89,7 +89,7 @@ car_dealership,sqlite,keywords_aggregate,"SELECT COUNT(id) AS TSC FROM sales WHE
To calculate the gross profit margin, subtract the total cost from the total revenue, then divide by the total cost and multiply by 100
To ascertain the sales rank of each salesperson, order them by their total sales amount in descending order.
TSC = Total Sales Count."
car_dealership,sqlite,keywords_aggregate,SELECT AVG(sale_price) AS ASP FROM sales WHERE sale_date >= '2023-01-01' AND sale_date <= '2023-03-31';,What is the ASP for sales made in the first quarter of 2023?,ASP = Average Sale Price in the first quarter of 2023.,"Always join sales with cars before using the sales table. ASP = Average Sale Price in the first quarter of 2023. To calculate the average days between sale date and payment received date, join the sales and payments tables To get the list of cars that were sold along with their sale prices, join the cars and sales tables Last 30 days = DATE('now', -'last month') days to DATE('now')"
car_dealership,sqlite,keywords_aggregate,SELECT AVG(sale_price) AS ASP FROM sales WHERE sale_date >= '2023-01-01' AND sale_date <= '2023-03-31';,What is the ASP for sales made in the first quarter of 2023?,ASP = Average Sale Price in the first quarter of 2023.,"Always join sales with cars before using the sales table. ASP = Average Sale Price in the first quarter of 2023. To calculate the average days between sale date and payment received date, join the sales and payments tables To get the list of cars that were sold along with their sale prices, join the cars and sales tables Last 30 days = DATE('now', -'30 days') to DATE('now')"
car_dealership,sqlite,keywords_ratio,"SELECT salespersons.first_name, salespersons.last_name, AVG(sales.sale_price) AS ASP FROM sales JOIN salespersons ON sales.salesperson_id = salespersons.id GROUP BY salespersons.first_name, salespersons.last_name ORDER BY ASP DESC LIMIT 3;","Who are the top 3 salespersons by ASP? Return their first name, last name and ASP.",ASP (average selling price) = total sales amount / number of sales,"To get the total sales amount per salesperson, join the salespersons and sales tables, group by salesperson, and sum the sale_amount. To calculate the average days between the sale date and payment received date, join the sales and payments_received tables. ASP (average selling price) = total sales amount / number of sales. To get the list of cars that were sold and their sale price, join the cars and sales tables."
car_dealership,sqlite,keywords_ratio,"SELECT (SUM(sale_price) - SUM(cars.cost)) / SUM(cars.cost) * 100 AS gpm FROM sales JOIN cars ON sales.car_id = cars.id WHERE strftime('%Y', sale_date) = '2023';",What is the GPM for all car sales in 2023?,GPM (gross profit margin) = (total revenue - total cost) / total cost * 100,"Analyze salesperson activity over a selected period by connecting salespersons with sales records
GPM (gross profit margin) = (total revenue - total cost) / total cost * 100
Expand Down
Loading
Loading