Dataset Preview
The dataset viewer should be available soon. Please retry later.
source string | license string | prompt string | response string | messages list |
|---|---|---|---|---|
gretel-text2sql | Apache | [forestry] What is the total volume of timber sold by each salesperson, sorted by salesperson? | ```sql
SELECT salesperson_id, name, SUM(volume) as total_volume FROM timber_sales JOIN salesperson ON timber_sales.salesperson_id = salesperson.salesperson_id GROUP BY salesperson_id, name ORDER BY total_volume DESC;
``` | [
{
"role": "user",
"content": "[forestry] What is the total volume of timber sold by each salesperson, sorted by salesperson?"
},
{
"role": "assistant",
"content": "```sql\nSELECT salesperson_id, name, SUM(volume) as total_volume FROM timber_sales JOIN salesperson ON timber_sales.salesperson_id =... |
gretel-text2sql | Apache | [defense industry] List all the unique equipment types and their corresponding total maintenance frequency from the equipment_maintenance table. | ```sql
SELECT equipment_type, SUM(maintenance_frequency) AS total_maintenance_frequency FROM equipment_maintenance GROUP BY equipment_type;
``` | [
{
"role": "user",
"content": "[defense industry] List all the unique equipment types and their corresponding total maintenance frequency from the equipment_maintenance table."
},
{
"role": "assistant",
"content": "```sql\nSELECT equipment_type, SUM(maintenance_frequency) AS total_maintenance_fre... |
gretel-text2sql | Apache | [marine biology] How many marine species are found in the Southern Ocean? | ```sql
SELECT COUNT(*) FROM marine_species WHERE location = 'Southern Ocean';
``` | [
{
"role": "user",
"content": "[marine biology] How many marine species are found in the Southern Ocean?"
},
{
"role": "assistant",
"content": "```sql\nSELECT COUNT(*) FROM marine_species WHERE location = 'Southern Ocean';\n```"
}
] |
gretel-text2sql | Apache | [financial services] What is the total trade value and average price for each trader and stock in the trade_history table? | ```sql
SELECT trader_id, stock, SUM(price * quantity) as total_trade_value, AVG(price) as avg_price FROM trade_history GROUP BY trader_id, stock;
``` | [
{
"role": "user",
"content": "[financial services] What is the total trade value and average price for each trader and stock in the trade_history table?"
},
{
"role": "assistant",
"content": "```sql\nSELECT trader_id, stock, SUM(price * quantity) as total_trade_value, AVG(price) as avg_price FRO... |
gretel-text2sql | Apache | [energy] Find the energy efficiency upgrades with the highest cost and their types. | ```sql
SELECT type, cost FROM (SELECT type, cost, ROW_NUMBER() OVER (ORDER BY cost DESC) as rn FROM upgrades) sub WHERE rn = 1;
``` | [
{
"role": "user",
"content": "[energy] Find the energy efficiency upgrades with the highest cost and their types."
},
{
"role": "assistant",
"content": "```sql\nSELECT type, cost FROM (SELECT type, cost, ROW_NUMBER() OVER (ORDER BY cost DESC) as rn FROM upgrades) sub WHERE rn = 1;\n```"
}
] |
gretel-text2sql | Apache | [defense operations] What is the total spending on humanitarian assistance by the European Union in the last 3 years? | ```sql
SELECT SUM(spending) FROM defense.eu_humanitarian_assistance WHERE year BETWEEN 2019 AND 2021;
``` | [
{
"role": "user",
"content": "[defense operations] What is the total spending on humanitarian assistance by the European Union in the last 3 years?"
},
{
"role": "assistant",
"content": "```sql\nSELECT SUM(spending) FROM defense.eu_humanitarian_assistance WHERE year BETWEEN 2019 AND 2021;\n```"
... |
gretel-text2sql | Apache | [aquaculture] What is the average water temperature for each fish species in February? | ```sql
SELECT SpeciesName, AVG(WaterTemp) as AvgTemp FROM SpeciesWaterTemp INNER JOIN FishSpecies ON SpeciesWaterTemp.SpeciesID = FishSpecies.SpeciesID WHERE MONTH(Date) = 2 GROUP BY SpeciesName;
``` | [
{
"role": "user",
"content": "[aquaculture] What is the average water temperature for each fish species in February?"
},
{
"role": "assistant",
"content": "```sql\nSELECT SpeciesName, AVG(WaterTemp) as AvgTemp FROM SpeciesWaterTemp INNER JOIN FishSpecies ON SpeciesWaterTemp.SpeciesID = FishSpeci... |
gretel-text2sql | Apache | [nonprofit operations] Delete a program's outcome data | ```sql
DELETE FROM Program_Outcomes WHERE program_id = 1002;
``` | [
{
"role": "user",
"content": "[nonprofit operations] Delete a program's outcome data"
},
{
"role": "assistant",
"content": "```sql\nDELETE FROM Program_Outcomes WHERE program_id = 1002;\n```"
}
] |
gretel-text2sql | Apache | [public transportation] Find the total fare collected from passengers on 'Green Line' buses | ```sql
SELECT SUM(fare) FROM bus_routes WHERE route_name = 'Green Line';
``` | [
{
"role": "user",
"content": "[public transportation] Find the total fare collected from passengers on 'Green Line' buses"
},
{
"role": "assistant",
"content": "```sql\nSELECT SUM(fare) FROM bus_routes WHERE route_name = 'Green Line';\n```"
}
] |
gretel-text2sql | Apache | [real estate] What is the average property size in inclusive housing areas? | ```sql
SELECT AVG(Property_Size) FROM Inclusive_Housing WHERE Inclusive = 'Yes';
``` | [
{
"role": "user",
"content": "[real estate] What is the average property size in inclusive housing areas?"
},
{
"role": "assistant",
"content": "```sql\nSELECT AVG(Property_Size) FROM Inclusive_Housing WHERE Inclusive = 'Yes';\n```"
}
] |
gretel-text2sql | Apache | [rural health] What is the average income of farmers in each district in India? | ```sql
SELECT d.name, AVG(f.income) FROM farmers_india f JOIN districts_india d ON f.district_id = d.id GROUP BY d.name;
``` | [
{
"role": "user",
"content": "[rural health] What is the average income of farmers in each district in India?"
},
{
"role": "assistant",
"content": "```sql\nSELECT d.name, AVG(f.income) FROM farmers_india f JOIN districts_india d ON f.district_id = d.id GROUP BY d.name;\n```"
}
] |
gretel-text2sql | Apache | [marine biology] What is the average sea surface temperature in the Pacific Ocean per year? | ```sql
SELECT AVG(temperature) FROM (SELECT temperature FROM Ocean WHERE region = 'Pacific' GROUP BY temperature, YEAR(STR_TO_DATE(region, '%Y'))) AS PacificAverage;
``` | [
{
"role": "user",
"content": "[marine biology] What is the average sea surface temperature in the Pacific Ocean per year?"
},
{
"role": "assistant",
"content": "```sql\nSELECT AVG(temperature) FROM (SELECT temperature FROM Ocean WHERE region = 'Pacific' GROUP BY temperature, YEAR(STR_TO_DATE(reg... |
gretel-text2sql | Apache | [sustainable infrastructure] Update the end date of carbon offset initiative 'Initiative 1' in Australia to '2025-12-31'. | ```sql
UPDATE carbon_offsets SET end_date = '2025-12-31' WHERE initiative_name = 'Initiative 1' AND country = 'Australia';
``` | [
{
"role": "user",
"content": "[sustainable infrastructure] Update the end date of carbon offset initiative 'Initiative 1' in Australia to '2025-12-31'."
},
{
"role": "assistant",
"content": "```sql\nUPDATE carbon_offsets SET end_date = '2025-12-31' WHERE initiative_name = 'Initiative 1' AND coun... |
gretel-text2sql | Apache | [beauty industry] Which regions have the highest and lowest sustainability metrics for products? | ```sql
SELECT region, MAX(sustainability_metrics.carbon_footprint) as max_carbon_footprint, MAX(sustainability_metrics.water_usage) as max_water_usage, MAX(sustainability_metrics.waste_generation) as max_waste_generation FROM sustainability_metrics JOIN products ON sustainability_metrics.product_id = products.product_i... | [
{
"role": "user",
"content": "[beauty industry] Which regions have the highest and lowest sustainability metrics for products?"
},
{
"role": "assistant",
"content": "```sql\nSELECT region, MAX(sustainability_metrics.carbon_footprint) as max_carbon_footprint, MAX(sustainability_metrics.water_usag... |
gretel-text2sql | Apache | [automotive] Remove the 'vehicle_safety_testing' table and its records | ```sql
DROP TABLE vehicle_safety_testing;
``` | [
{
"role": "user",
"content": "[automotive] Remove the 'vehicle_safety_testing' table and its records"
},
{
"role": "assistant",
"content": "```sql\nDROP TABLE vehicle_safety_testing;\n```"
}
] |
gretel-text2sql | Apache | [marine biology] Show the conservation status of marine mammals and birds by year. | ```sql
SELECT animal_group, conservation_status, year, COUNT(*) FROM combined GROUP BY animal_group, conservation_status, year;
``` | [
{
"role": "user",
"content": "[marine biology] Show the conservation status of marine mammals and birds by year."
},
{
"role": "assistant",
"content": "```sql\nSELECT animal_group, conservation_status, year, COUNT(*) FROM combined GROUP BY animal_group, conservation_status, year;\n```"
}
] |
gretel-text2sql | Apache | [defense security] What are the names and types of military bases located in 'California'? | ```sql
SELECT base_name, base_type FROM Armed_Forces WHERE base_location = 'California';
``` | [
{
"role": "user",
"content": "[defense security] What are the names and types of military bases located in 'California'?"
},
{
"role": "assistant",
"content": "```sql\nSELECT base_name, base_type FROM Armed_Forces WHERE base_location = 'California';\n```"
}
] |
gretel-text2sql | Apache | [arts operations and management] What is the total value of artworks for each artist in the 'artists_valuation' table? | ```sql
SELECT a.name, SUM(av.valuation) AS total_valuation FROM artist a JOIN artists_valuation av ON a.id = av.artist_id GROUP BY a.id, a.name;
``` | [
{
"role": "user",
"content": "[arts operations and management] What is the total value of artworks for each artist in the 'artists_valuation' table?"
},
{
"role": "assistant",
"content": "```sql\nSELECT a.name, SUM(av.valuation) AS total_valuation FROM artist a JOIN artists_valuation av ON a.id ... |
gretel-text2sql | Apache | [biotechnology] List startups that received funding for biosensor development | ```sql
SELECT s.name FROM startups s JOIN funding f ON s.id = f.startup_id WHERE s.domain = 'Biosensors' AND f.purpose = 'Biosensor Development';
``` | [
{
"role": "user",
"content": "[biotechnology] List startups that received funding for biosensor development"
},
{
"role": "assistant",
"content": "```sql\nSELECT s.name FROM startups s JOIN funding f ON s.id = f.startup_id WHERE s.domain = 'Biosensors' AND f.purpose = 'Biosensor Development';\n`... |
gretel-text2sql | Apache | [defense operations] What is the total amount of humanitarian assistance provided by non-governmental organizations (NGOs) to countries in Africa in the last 5 years? | ```sql
SELECT SUM(Amount) AS TotalAssistance, Country FROM HumanitarianAssistance WHERE Organization NOT IN ('Government', 'Military') AND Year BETWEEN 2016 AND 2020 GROUP BY Country;
``` | [
{
"role": "user",
"content": "[defense operations] What is the total amount of humanitarian assistance provided by non-governmental organizations (NGOs) to countries in Africa in the last 5 years?"
},
{
"role": "assistant",
"content": "```sql\nSELECT SUM(Amount) AS TotalAssistance, Country FROM ... |
gretel-text2sql | Apache | [automotive] What is the total number of autonomous driving research papers published by country in the past year? | ```sql
SELECT Country, COUNT(*) as Total_Papers FROM ResearchPapers WHERE PublishedDate >= DATE_SUB(CURRENT_DATE, INTERVAL 1 YEAR) AND Author LIKE '%autonomous%' GROUP BY Country;
``` | [
{
"role": "user",
"content": "[automotive] What is the total number of autonomous driving research papers published by country in the past year?"
},
{
"role": "assistant",
"content": "```sql\nSELECT Country, COUNT(*) as Total_Papers FROM ResearchPapers WHERE PublishedDate >= DATE_SUB(CURRENT_DAT... |
gretel-text2sql | Apache | [cybersecurity] What are the unique combinations of security incident types and their corresponding statuses in the incident_responses table, excluding any records with 'In Progress' status? | ```sql
SELECT incident, status FROM incident_responses WHERE status != 'In Progress' GROUP BY incident, status;
``` | [
{
"role": "user",
"content": "[cybersecurity] What are the unique combinations of security incident types and their corresponding statuses in the incident_responses table, excluding any records with 'In Progress' status?"
},
{
"role": "assistant",
"content": "```sql\nSELECT incident, status FROM... |
gretel-text2sql | Apache | [biotechnology] What is the maximum number of genetic research projects in Japan per year? | ```sql
SELECT YEAR(start_date) AS year, MAX(COUNT(*)) AS projects_count FROM genetic.projects GROUP BY year;
``` | [
{
"role": "user",
"content": "[biotechnology] What is the maximum number of genetic research projects in Japan per year?"
},
{
"role": "assistant",
"content": "```sql\nSELECT YEAR(start_date) AS year, MAX(COUNT(*)) AS projects_count FROM genetic.projects GROUP BY year;\n```"
}
] |
gretel-text2sql | Apache | [construction] How many construction projects were completed each month in 2020 and 2021? | ```sql
SELECT YEAR(start_date) AS year, MONTH(start_date) AS month, COUNT(*) AS projects FROM project_timeline WHERE end_date IS NOT NULL GROUP BY year, month;
``` | [
{
"role": "user",
"content": "[construction] How many construction projects were completed each month in 2020 and 2021?"
},
{
"role": "assistant",
"content": "```sql\nSELECT YEAR(start_date) AS year, MONTH(start_date) AS month, COUNT(*) AS projects FROM project_timeline WHERE end_date IS NOT NUL... |
gretel-text2sql | Apache | [construction] What is the average labor cost per worker per week in the 'LaborStatistics' table? | ```sql
SELECT AVG(hourlyRate * hoursWorked * 5) AS AverageLaborCost FROM LaborStatistics;
``` | [
{
"role": "user",
"content": "[construction] What is the average labor cost per worker per week in the 'LaborStatistics' table?"
},
{
"role": "assistant",
"content": "```sql\nSELECT AVG(hourlyRate * hoursWorked * 5) AS AverageLaborCost FROM LaborStatistics;\n```"
}
] |
gretel-text2sql | Apache | [agriculture] List all food justice organizations in Africa, along with the number of projects they have implemented. | ```sql
SELECT org_name, num_projects FROM food_justice_orgs WHERE country = 'Africa';
``` | [
{
"role": "user",
"content": "[agriculture] List all food justice organizations in Africa, along with the number of projects they have implemented."
},
{
"role": "assistant",
"content": "```sql\nSELECT org_name, num_projects FROM food_justice_orgs WHERE country = 'Africa';\n```"
}
] |
gretel-text2sql | Apache | [wildlife conservation] Retrieve the names and species of all animals that weigh more than 500 kg | ```sql
SELECT name, species FROM animals WHERE weight > 500;
``` | [
{
"role": "user",
"content": "[wildlife conservation] Retrieve the names and species of all animals that weigh more than 500 kg"
},
{
"role": "assistant",
"content": "```sql\nSELECT name, species FROM animals WHERE weight > 500;\n```"
}
] |
gretel-text2sql | Apache | [hospitality technology] Identify hotels with the highest virtual tour engagement in the APAC region in Q1 2022 | ```sql
SELECT hotel_name, q1_2022_views FROM virtual_tour_stats WHERE region = 'APAC' ORDER BY q1_2022_views DESC LIMIT 5;
``` | [
{
"role": "user",
"content": "[hospitality technology] Identify hotels with the highest virtual tour engagement in the APAC region in Q1 2022"
},
{
"role": "assistant",
"content": "```sql\nSELECT hotel_name, q1_2022_views FROM virtual_tour_stats WHERE region = 'APAC' ORDER BY q1_2022_views DESC ... |
gretel-text2sql | Apache | [cybersecurity] What are the common cybersecurity policies across all departments, according to our Policy Analysis database? | ```sql
SELECT policy FROM PolicyAnalysis GROUP BY policy HAVING COUNT(DISTINCT department) = (SELECT COUNT(DISTINCT department) FROM PolicyAnalysis);
``` | [
{
"role": "user",
"content": "[cybersecurity] What are the common cybersecurity policies across all departments, according to our Policy Analysis database?"
},
{
"role": "assistant",
"content": "```sql\nSELECT policy FROM PolicyAnalysis GROUP BY policy HAVING COUNT(DISTINCT department) = (SELECT... |
gretel-text2sql | Apache | [venture capital] How many companies were founded by women in the San Francisco Bay Area? | ```sql
SELECT COUNT(*) FROM companies WHERE city='San Francisco' AND state='CA' AND founder_gender='female';
``` | [
{
"role": "user",
"content": "[venture capital] How many companies were founded by women in the San Francisco Bay Area?"
},
{
"role": "assistant",
"content": "```sql\nSELECT COUNT(*) FROM companies WHERE city='San Francisco' AND state='CA' AND founder_gender='female';\n```"
}
] |
gretel-text2sql | Apache | [finance] What was the total value of socially responsible loans issued to women in H2 2021? | ```sql
SELECT SUM(value) FROM socially_responsible_loans WHERE client_gender = 'female' AND date BETWEEN '2021-07-01' AND '2021-12-31';
``` | [
{
"role": "user",
"content": "[finance] What was the total value of socially responsible loans issued to women in H2 2021?"
},
{
"role": "assistant",
"content": "```sql\nSELECT SUM(value) FROM socially_responsible_loans WHERE client_gender = 'female' AND date BETWEEN '2021-07-01' AND '2021-12-31... |
gretel-text2sql | Apache | [space] What is the maximum distance of all satellites from the Earth's surface, organized by country of origin? | ```sql
SELECT country_of_origin, MAX(avg_distance) FROM satellites GROUP BY country_of_origin;
``` | [
{
"role": "user",
"content": "[space] What is the maximum distance of all satellites from the Earth's surface, organized by country of origin?"
},
{
"role": "assistant",
"content": "```sql\nSELECT country_of_origin, MAX(avg_distance) FROM satellites GROUP BY country_of_origin;\n```"
}
] |
gretel-text2sql | Apache | [telecommunications] What is the total data usage for mobile customers in the city of Toronto for the year 2022? | ```sql
SELECT SUM(data_usage) FROM mobile_usage WHERE city = 'Toronto' AND year = 2022;
``` | [
{
"role": "user",
"content": "[telecommunications] What is the total data usage for mobile customers in the city of Toronto for the year 2022?"
},
{
"role": "assistant",
"content": "```sql\nSELECT SUM(data_usage) FROM mobile_usage WHERE city = 'Toronto' AND year = 2022;\n```"
}
] |
gretel-text2sql | Apache | [maritime] What is the maximum cargo weight for VesselC? | ```sql
SELECT max_cargo_weight FROM vessels WHERE name = 'VesselC';
``` | [
{
"role": "user",
"content": "[maritime] What is the maximum cargo weight for VesselC?"
},
{
"role": "assistant",
"content": "```sql\nSELECT max_cargo_weight FROM vessels WHERE name = 'VesselC';\n```"
}
] |
gretel-text2sql | Apache | [healthcare] What is the minimum cultural competency score by worker? | ```sql
SELECT worker_id, MIN(score) FROM worker_scores;
``` | [
{
"role": "user",
"content": "[healthcare] What is the minimum cultural competency score by worker?"
},
{
"role": "assistant",
"content": "```sql\nSELECT worker_id, MIN(score) FROM worker_scores;\n```"
}
] |
gretel-text2sql | Apache | [cybersecurity] What is the total number of security incidents that have occurred in each region in the past year? | ```sql
SELECT region, SUM(incidents) as total_incidents FROM incident_region WHERE incident_date > DATE(NOW()) - INTERVAL 365 DATE GROUP BY region;
``` | [
{
"role": "user",
"content": "[cybersecurity] What is the total number of security incidents that have occurred in each region in the past year?"
},
{
"role": "assistant",
"content": "```sql\nSELECT region, SUM(incidents) as total_incidents FROM incident_region WHERE incident_date > DATE(NOW()) ... |
gretel-text2sql | Apache | [defense operations] Show all records in the defense_diplomacy table where the participant_country is 'China' or 'India' | ```sql
SELECT * FROM defense_diplomacy WHERE participant_country IN ('China', 'India');
``` | [
{
"role": "user",
"content": "[defense operations] Show all records in the defense_diplomacy table where the participant_country is 'China' or 'India'"
},
{
"role": "assistant",
"content": "```sql\nSELECT * FROM defense_diplomacy WHERE participant_country IN ('China', 'India');\n```"
}
] |
gretel-text2sql | Apache | [defense security] What was the total number of military personnel in the United States in 2018, 2019, and 2020? | ```sql
SELECT SUM(personnel) FROM us_military_personnel WHERE year IN (2018, 2019, 2020);
``` | [
{
"role": "user",
"content": "[defense security] What was the total number of military personnel in the United States in 2018, 2019, and 2020?"
},
{
"role": "assistant",
"content": "```sql\nSELECT SUM(personnel) FROM us_military_personnel WHERE year IN (2018, 2019, 2020);\n```"
}
] |
gretel-text2sql | Apache | [justice] What is the name and age of the youngest inmate in the prison table? | ```sql
SELECT name, age FROM prison ORDER BY age LIMIT 1;
``` | [
{
"role": "user",
"content": "[justice] What is the name and age of the youngest inmate in the prison table?"
},
{
"role": "assistant",
"content": "```sql\nSELECT name, age FROM prison ORDER BY age LIMIT 1;\n```"
}
] |
gretel-text2sql | Apache | [tourism] What is the average hotel star rating for hotels in Japan and South Korea? | ```sql
SELECT AVG(stars) FROM hotel_ratings WHERE country IN ('Japan', 'South Korea');
``` | [
{
"role": "user",
"content": "[tourism] What is the average hotel star rating for hotels in Japan and South Korea?"
},
{
"role": "assistant",
"content": "```sql\nSELECT AVG(stars) FROM hotel_ratings WHERE country IN ('Japan', 'South Korea');\n```"
}
] |
gretel-text2sql | Apache | [media] What is the total word count for articles in each language per week? | ```sql
SELECT language, DATE_TRUNC('week', publish_date) as week, SUM(word_count) as total_word_count FROM Articles GROUP BY language, week ORDER BY week;
``` | [
{
"role": "user",
"content": "[media] What is the total word count for articles in each language per week?"
},
{
"role": "assistant",
"content": "```sql\nSELECT language, DATE_TRUNC('week', publish_date) as week, SUM(word_count) as total_word_count FROM Articles GROUP BY language, week ORDER BY ... |
gretel-text2sql | Apache | [public health] What is the average age of patients who received a flu shot in California, grouped by county? | ```sql
SELECT v.county, AVG(p.age) as avg_age FROM vaccinations v INNER JOIN patients p ON v.patient_id = p.patient_id WHERE vaccine = 'Flu' AND county = 'California' GROUP BY v.county;
``` | [
{
"role": "user",
"content": "[public health] What is the average age of patients who received a flu shot in California, grouped by county?"
},
{
"role": "assistant",
"content": "```sql\nSELECT v.county, AVG(p.age) as avg_age FROM vaccinations v INNER JOIN patients p ON v.patient_id = p.patient_... |
gretel-text2sql | Apache | [automotive] What was the highest horsepower vehicle at the 2021 Geneva Motor Show? | ```sql
SELECT make, model, MAX(horsepower) FROM geneva_motor_show WHERE year = 2021;
``` | [
{
"role": "user",
"content": "[automotive] What was the highest horsepower vehicle at the 2021 Geneva Motor Show?"
},
{
"role": "assistant",
"content": "```sql\nSELECT make, model, MAX(horsepower) FROM geneva_motor_show WHERE year = 2021;\n```"
}
] |
gretel-text2sql | Apache | [rural development] What is the number of economic diversification initiatives in tourism and their total budget for the last 3 years? | ```sql
SELECT category, start_year, COUNT(*), SUM(budget) FROM economic_diversification WHERE start_year >= 2019 GROUP BY category, start_year;
``` | [
{
"role": "user",
"content": "[rural development] What is the number of economic diversification initiatives in tourism and their total budget for the last 3 years?"
},
{
"role": "assistant",
"content": "```sql\nSELECT category, start_year, COUNT(*), SUM(budget) FROM economic_diversification WHE... |
gretel-text2sql | Apache | [automotive] Which electric vehicle models have a safety rating above 4.5? | ```sql
SELECT Model FROM VehicleModels WHERE SafetyRating > 4.5;
``` | [
{
"role": "user",
"content": "[automotive] Which electric vehicle models have a safety rating above 4.5?"
},
{
"role": "assistant",
"content": "```sql\nSELECT Model FROM VehicleModels WHERE SafetyRating > 4.5;\n```"
}
] |
gretel-text2sql | Apache | [sports entertainment] How many athletes have participated in wellbeing programs in each sport in the last year, and which sport had the most participants? | ```sql
SELECT sport, COUNT(DISTINCT athlete_id) AS participants FROM wellbeing_programs WHERE program_date >= DATE_SUB(CURDATE(), INTERVAL 1 YEAR) GROUP BY sport ORDER BY participants DESC;
``` | [
{
"role": "user",
"content": "[sports entertainment] How many athletes have participated in wellbeing programs in each sport in the last year, and which sport had the most participants?"
},
{
"role": "assistant",
"content": "```sql\nSELECT sport, COUNT(DISTINCT athlete_id) AS participants FROM w... |
gretel-text2sql | Apache | [space] What is the total number of space missions led by women? | ```sql
SELECT COUNT(*) FROM space_missions WHERE leader IN (SELECT name FROM astronauts WHERE gender = 'Female');
``` | [
{
"role": "user",
"content": "[space] What is the total number of space missions led by women?"
},
{
"role": "assistant",
"content": "```sql\nSELECT COUNT(*) FROM space_missions WHERE leader IN (SELECT name FROM astronauts WHERE gender = 'Female');\n```"
}
] |
gretel-text2sql | Apache | [public safety] What is the average response time for fires in Boston? | ```sql
SELECT AVG(response_time) FROM boston_emergency_response WHERE incident_type = 'Fire';
``` | [
{
"role": "user",
"content": "[public safety] What is the average response time for fires in Boston?"
},
{
"role": "assistant",
"content": "```sql\nSELECT AVG(response_time) FROM boston_emergency_response WHERE incident_type = 'Fire';\n```"
}
] |
gretel-text2sql | Apache | [retail] What is the percentage of products that are made from recycled materials? | ```sql
SELECT (COUNT(*) * 100.0 / (SELECT COUNT(*) FROM products)) as percentage FROM products WHERE is_recycled = TRUE;
``` | [
{
"role": "user",
"content": "[retail] What is the percentage of products that are made from recycled materials?"
},
{
"role": "assistant",
"content": "```sql\nSELECT (COUNT(*) * 100.0 / (SELECT COUNT(*) FROM products)) as percentage FROM products WHERE is_recycled = TRUE;\n```"
}
] |
gretel-text2sql | Apache | [real estate] List property co-owners in New York City who have not implemented accessibility features. | ```sql
SELECT CoOwners.CoOwnerID, Properties.City FROM CoOwners INNER JOIN Properties ON CoOwners.PropertyID = Properties.PropertyID WHERE Properties.City = 'New York City' AND Properties.Accessibility = 'No';
``` | [
{
"role": "user",
"content": "[real estate] List property co-owners in New York City who have not implemented accessibility features."
},
{
"role": "assistant",
"content": "```sql\nSELECT CoOwners.CoOwnerID, Properties.City FROM CoOwners INNER JOIN Properties ON CoOwners.PropertyID = Properties.... |
gretel-text2sql | Apache | [ethical fashion] What is the total revenue generated by brands that have a circular business model, in the year 2020? | ```sql
SELECT SUM(revenue) FROM BrandRevenue WHERE circular_model = TRUE AND year = 2020;
``` | [
{
"role": "user",
"content": "[ethical fashion] What is the total revenue generated by brands that have a circular business model, in the year 2020?"
},
{
"role": "assistant",
"content": "```sql\nSELECT SUM(revenue) FROM BrandRevenue WHERE circular_model = TRUE AND year = 2020;\n```"
}
] |
gretel-text2sql | Apache | [automotive] Which autonomous vehicles have the highest safety ratings in the 'auto_show' table? | ```sql
SELECT vehicle_name, safety_rating FROM (SELECT vehicle_name, safety_rating, RANK() OVER (ORDER BY safety_rating DESC) as safety_rank FROM auto_show WHERE vehicle_name LIKE '%Autonomous%') AS auton_ranks WHERE safety_rank = 1;
``` | [
{
"role": "user",
"content": "[automotive] Which autonomous vehicles have the highest safety ratings in the 'auto_show' table?"
},
{
"role": "assistant",
"content": "```sql\nSELECT vehicle_name, safety_rating FROM (SELECT vehicle_name, safety_rating, RANK() OVER (ORDER BY safety_rating DESC) as ... |
gretel-text2sql | Apache | [restaurant operations] What is the average food safety inspection score for restaurants located in 'Westwood'? | ```sql
SELECT AVG(I.InspectionScore) as AvgInspectionScore FROM Restaurants R INNER JOIN Inspections I ON R.RestaurantID = I.RestaurantID WHERE R.Region = 'Westwood';
``` | [
{
"role": "user",
"content": "[restaurant operations] What is the average food safety inspection score for restaurants located in 'Westwood'?"
},
{
"role": "assistant",
"content": "```sql\nSELECT AVG(I.InspectionScore) as AvgInspectionScore FROM Restaurants R INNER JOIN Inspections I ON R.Restau... |
gretel-text2sql | Apache | [public health] How many hospitals are there in each state in the United States? | ```sql
SELECT State, COUNT(*) FROM Hospitals GROUP BY State;
``` | [
{
"role": "user",
"content": "[public health] How many hospitals are there in each state in the United States?"
},
{
"role": "assistant",
"content": "```sql\nSELECT State, COUNT(*) FROM Hospitals GROUP BY State;\n```"
}
] |
gretel-text2sql | Apache | [wildlife conservation] What are the names and habitats of all animals that are part of an education program in the 'Americas' region? | ```sql
SELECT a.name, h.name FROM Animals a INNER JOIN AnimalEducation ae ON a.id = ae.animal_id INNER JOIN EducationPrograms e ON ae.program_id = e.id INNER JOIN Coordinators c ON e.coordinator_id = c.id INNER JOIN Habitat h ON a.habitat_id = h.id WHERE c.region = 'Americas';
``` | [
{
"role": "user",
"content": "[wildlife conservation] What are the names and habitats of all animals that are part of an education program in the 'Americas' region?"
},
{
"role": "assistant",
"content": "```sql\nSELECT a.name, h.name FROM Animals a INNER JOIN AnimalEducation ae ON a.id = ae.anim... |
gretel-text2sql | Apache | [defense contractors] List defense projects that started in 2019 and their associated risks, if any. | ```sql
SELECT project_name, risk_level FROM DefenseProjects WHERE start_date >= '2019-01-01' AND start_date <= '2019-12-31' AND risk_level IS NOT NULL;
``` | [
{
"role": "user",
"content": "[defense contractors] List defense projects that started in 2019 and their associated risks, if any."
},
{
"role": "assistant",
"content": "```sql\nSELECT project_name, risk_level FROM DefenseProjects WHERE start_date >= '2019-01-01' AND start_date <= '2019-12-31' A... |
gretel-text2sql | Apache | [waste management] What is the total waste generation in the textile category for each country in 2021?' | ```sql
SELECT country, SUM(amount) as total_textile_waste FROM textile_waste WHERE year = 2021 GROUP BY country;
``` | [
{
"role": "user",
"content": "[waste management] What is the total waste generation in the textile category for each country in 2021?'"
},
{
"role": "assistant",
"content": "```sql\nSELECT country, SUM(amount) as total_textile_waste FROM textile_waste WHERE year = 2021 GROUP BY country;\n```"
... |
gretel-text2sql | Apache | [defense industry] How many military equipment maintenance requests were there in January 2020? | ```sql
SELECT COUNT(*) FROM maintenance_requests WHERE date BETWEEN '2020-01-01' AND '2020-01-31' AND type = 'equipment';
``` | [
{
"role": "user",
"content": "[defense industry] How many military equipment maintenance requests were there in January 2020?"
},
{
"role": "assistant",
"content": "```sql\nSELECT COUNT(*) FROM maintenance_requests WHERE date BETWEEN '2020-01-01' AND '2020-01-31' AND type = 'equipment';\n```"
... |
gretel-text2sql | Apache | [chemicals] List all the suppliers and their contact information who have not supplied any raw materials in the last 6 months. | ```sql
SELECT Suppliers.* FROM Suppliers LEFT JOIN (SELECT supplier_id FROM Raw_Materials WHERE supply_date >= DATE_SUB(CURDATE(), INTERVAL 6 MONTH) GROUP BY supplier_id) AS RM ON Suppliers.supplier_id = RM.supplier_id WHERE RM.supplier_id IS NULL;
``` | [
{
"role": "user",
"content": "[chemicals] List all the suppliers and their contact information who have not supplied any raw materials in the last 6 months."
},
{
"role": "assistant",
"content": "```sql\nSELECT Suppliers.* FROM Suppliers LEFT JOIN (SELECT supplier_id FROM Raw_Materials WHERE sup... |
gretel-text2sql | Apache | [philanthropy] What is the total donation amount by region? | ```sql
SELECT Region, SUM(AmountDonated) as TotalDonated FROM Donors GROUP BY Region;
``` | [
{
"role": "user",
"content": "[philanthropy] What is the total donation amount by region?"
},
{
"role": "assistant",
"content": "```sql\nSELECT Region, SUM(AmountDonated) as TotalDonated FROM Donors GROUP BY Region;\n```"
}
] |
gretel-text2sql | Apache | [space] Display the names of all satellites launched before 2010 | ```sql
SELECT name FROM satellites WHERE launch_date < '2010-01-01';
``` | [
{
"role": "user",
"content": "[space] Display the names of all satellites launched before 2010"
},
{
"role": "assistant",
"content": "```sql\nSELECT name FROM satellites WHERE launch_date < '2010-01-01';\n```"
}
] |
gretel-text2sql | Apache | [hospitality technology] Count the number of unique users who engaged with virtual tours in 'January'? | ```sql
SELECT COUNT(DISTINCT user_id) FROM user_activity WHERE EXTRACT(MONTH FROM activity_date) = 1;
``` | [
{
"role": "user",
"content": "[hospitality technology] Count the number of unique users who engaged with virtual tours in 'January'?"
},
{
"role": "assistant",
"content": "```sql\nSELECT COUNT(DISTINCT user_id) FROM user_activity WHERE EXTRACT(MONTH FROM activity_date) = 1;\n```"
}
] |
gretel-text2sql | Apache | [gaming technology] What is the average age of players who use VR in France? | ```sql
SELECT AVG(Age) FROM Players JOIN VRUsers ON Players.PlayerID = VRUsers.PlayerID WHERE Country = 'France';
``` | [
{
"role": "user",
"content": "[gaming technology] What is the average age of players who use VR in France?"
},
{
"role": "assistant",
"content": "```sql\nSELECT AVG(Age) FROM Players JOIN VRUsers ON Players.PlayerID = VRUsers.PlayerID WHERE Country = 'France';\n```"
}
] |
gretel-text2sql | Apache | [wildlife conservation] Calculate the total population of animals in North American conservation programs | ```sql
SELECT SUM(animal_populations.population) FROM conservation_programs INNER JOIN animal_populations ON conservation_programs.id = animal_populations.program_id WHERE conservation_programs.location = 'USA' OR conservation_programs.location = 'Canada';
``` | [
{
"role": "user",
"content": "[wildlife conservation] Calculate the total population of animals in North American conservation programs"
},
{
"role": "assistant",
"content": "```sql\nSELECT SUM(animal_populations.population) FROM conservation_programs INNER JOIN animal_populations ON conservatio... |
gretel-text2sql | Apache | [forestry] How many tree species in the temperate rainforest have a DBH greater than 50 cm? | ```sql
SELECT COUNT(DISTINCT species) FROM trees JOIN biomes ON trees.biome_id = biomes.biome_id WHERE trees.dbh > 50.0 AND biomes.name = 'Temperate Rainforest';
``` | [
{
"role": "user",
"content": "[forestry] How many tree species in the temperate rainforest have a DBH greater than 50 cm?"
},
{
"role": "assistant",
"content": "```sql\nSELECT COUNT(DISTINCT species) FROM trees JOIN biomes ON trees.biome_id = biomes.biome_id WHERE trees.dbh > 50.0 AND biomes.nam... |
gretel-text2sql | Apache | [ethical fashion] What is the total quantity of cotton sourced from the United States by brands that have committed to fair labor practices? | ```sql
SELECT SUM(quantity) FROM cotton_source WHERE country = 'USA' AND brand IN (SELECT brand FROM fair_labor WHERE commitment = 'yes');
``` | [
{
"role": "user",
"content": "[ethical fashion] What is the total quantity of cotton sourced from the United States by brands that have committed to fair labor practices?"
},
{
"role": "assistant",
"content": "```sql\nSELECT SUM(quantity) FROM cotton_source WHERE country = 'USA' AND brand IN (SE... |
gretel-text2sql | Apache | [media] Find the title and genre of the top 3 movies with the highest ratings from studios based in Italy, ordered by ratings in descending order. | ```sql
SELECT title, genre FROM (SELECT title, genre, studio, rating, ROW_NUMBER() OVER (PARTITION BY studio ORDER BY rating DESC) as rank FROM movies WHERE studio LIKE '%Italy%') subquery WHERE rank <= 3 ORDER BY rating DESC;
``` | [
{
"role": "user",
"content": "[media] Find the title and genre of the top 3 movies with the highest ratings from studios based in Italy, ordered by ratings in descending order."
},
{
"role": "assistant",
"content": "```sql\nSELECT title, genre FROM (SELECT title, genre, studio, rating, ROW_NUMBE... |
gretel-text2sql | Apache | [oceanography] List the top 3 marine species with the highest population growth rate. | ```sql
SELECT name, growth_rate FROM (SELECT name, growth_rate, ROW_NUMBER() OVER (ORDER BY growth_rate DESC) rn FROM marine_species) t WHERE rn <= 3;
``` | [
{
"role": "user",
"content": "[oceanography] List the top 3 marine species with the highest population growth rate."
},
{
"role": "assistant",
"content": "```sql\nSELECT name, growth_rate FROM (SELECT name, growth_rate, ROW_NUMBER() OVER (ORDER BY growth_rate DESC) rn FROM marine_species) t WHER... |
gretel-text2sql | Apache | [sustainable infrastructure] What is the minimum energy production of wind turbines installed in China after 2016? | ```sql
SELECT MIN(energy_production) FROM wind_turbines WHERE installation_year > 2016 AND country = 'China';
``` | [
{
"role": "user",
"content": "[sustainable infrastructure] What is the minimum energy production of wind turbines installed in China after 2016?"
},
{
"role": "assistant",
"content": "```sql\nSELECT MIN(energy_production) FROM wind_turbines WHERE installation_year > 2016 AND country = 'China';\n... |
gretel-text2sql | Apache | [government policy] Insert a new record into the "Legislation" table with the ID of 4, a description of "Climate Change Act", and a status of "Draft" | ```sql
INSERT INTO Legislation (ID, Description, Status) VALUES (4, 'Climate Change Act', 'Draft');
``` | [
{
"role": "user",
"content": "[government policy] Insert a new record into the \"Legislation\" table with the ID of 4, a description of \"Climate Change Act\", and a status of \"Draft\""
},
{
"role": "assistant",
"content": "```sql\nINSERT INTO Legislation (ID, Description, Status) VALUES (4, 'C... |
gretel-text2sql | Apache | [philanthropy] What is the total donation amount from donors aged 40 and above? | ```sql
SELECT SUM(DonationAmount) FROM Donors WHERE Age >= 40;
``` | [
{
"role": "user",
"content": "[philanthropy] What is the total donation amount from donors aged 40 and above?"
},
{
"role": "assistant",
"content": "```sql\nSELECT SUM(DonationAmount) FROM Donors WHERE Age >= 40;\n```"
}
] |
gretel-text2sql | Apache | [food industry] How many times has there been a recall of organic chicken products in the US in the last 2 years? | ```sql
SELECT COUNT(*) FROM recalls WHERE product LIKE 'Organic Chicken%' AND date BETWEEN '2020-01-01' AND '2022-12-31';
``` | [
{
"role": "user",
"content": "[food industry] How many times has there been a recall of organic chicken products in the US in the last 2 years?"
},
{
"role": "assistant",
"content": "```sql\nSELECT COUNT(*) FROM recalls WHERE product LIKE 'Organic Chicken%' AND date BETWEEN '2020-01-01' AND '202... |
gretel-text2sql | Apache | [defense security] What is the total number of military personnel involved in cybersecurity operations in Asia? | ```sql
SELECT SUM(Personnel) FROM MilitaryCyberOps WHERE Region = 'Asia';
``` | [
{
"role": "user",
"content": "[defense security] What is the total number of military personnel involved in cybersecurity operations in Asia?"
},
{
"role": "assistant",
"content": "```sql\nSELECT SUM(Personnel) FROM MilitaryCyberOps WHERE Region = 'Asia';\n```"
}
] |
gretel-text2sql | Apache | [mining operations] Display total resources extracted and the respective extraction dates for 'gold' and 'silver' resources from the 'resource_extraction' table. | ```sql
SELECT resource_type, SUM(quantity) as total_quantity, extraction_date FROM resource_extraction WHERE resource_type IN ('gold', 'silver') GROUP BY resource_type, extraction_date;
``` | [
{
"role": "user",
"content": "[mining operations] Display total resources extracted and the respective extraction dates for 'gold' and 'silver' resources from the 'resource_extraction' table."
},
{
"role": "assistant",
"content": "```sql\nSELECT resource_type, SUM(quantity) as total_quantity, ex... |
gretel-text2sql | Apache | [civil engineering] What is the name, height, and number of stories for all buildings in the city of New York with more than 50 floors? | ```sql
SELECT name, height, num_stories FROM Buildings WHERE city = 'New York' AND num_stories > 50;
``` | [
{
"role": "user",
"content": "[civil engineering] What is the name, height, and number of stories for all buildings in the city of New York with more than 50 floors?"
},
{
"role": "assistant",
"content": "```sql\nSELECT name, height, num_stories FROM Buildings WHERE city = 'New York' AND num_sto... |
gretel-text2sql | Apache | [manufacturing] Count the number of factories in the "renewable energy" sector that have more than 50 employees. | ```sql
SELECT COUNT(*) FROM factories WHERE sector = 'renewable energy' HAVING employee_count > 50;
``` | [
{
"role": "user",
"content": "[manufacturing] Count the number of factories in the \"renewable energy\" sector that have more than 50 employees."
},
{
"role": "assistant",
"content": "```sql\nSELECT COUNT(*) FROM factories WHERE sector = 'renewable energy' HAVING employee_count > 50;\n```"
}
] |
gretel-text2sql | Apache | [sports entertainment] How many sports_events took place in '2019' with a ticket sales count greater than 50000? | ```sql
SELECT COUNT(*) FROM sports_events WHERE year = 2019 AND tickets_sold > 50000;
``` | [
{
"role": "user",
"content": "[sports entertainment] How many sports_events took place in '2019' with a ticket sales count greater than 50000?"
},
{
"role": "assistant",
"content": "```sql\nSELECT COUNT(*) FROM sports_events WHERE year = 2019 AND tickets_sold > 50000;\n```"
}
] |
gretel-text2sql | Apache | [startups] Show the total funding amount for companies with female founders | ```sql
SELECT SUM(fr.funding_amount) FROM companies c INNER JOIN funding_rounds fr ON c.company_id = fr.company_id WHERE c.founder_gender = 'Female';
``` | [
{
"role": "user",
"content": "[startups] Show the total funding amount for companies with female founders"
},
{
"role": "assistant",
"content": "```sql\nSELECT SUM(fr.funding_amount) FROM companies c INNER JOIN funding_rounds fr ON c.company_id = fr.company_id WHERE c.founder_gender = 'Female';\... |
gretel-text2sql | Apache | [automotive] What are the vehicle safety testing organizations that operate in the UK and France? | ```sql
SELECT name FROM SafetyOrgs WHERE country IN ('UK', 'France');
``` | [
{
"role": "user",
"content": "[automotive] What are the vehicle safety testing organizations that operate in the UK and France?"
},
{
"role": "assistant",
"content": "```sql\nSELECT name FROM SafetyOrgs WHERE country IN ('UK', 'France');\n```"
}
] |
gretel-text2sql | Apache | [defense operations] Delete all humanitarian assistance missions conducted by Kenya in 2018. | ```sql
DELETE FROM humanitarian_assistance WHERE country_id = (SELECT id FROM country WHERE name = 'Kenya') AND year = 2018;
``` | [
{
"role": "user",
"content": "[defense operations] Delete all humanitarian assistance missions conducted by Kenya in 2018."
},
{
"role": "assistant",
"content": "```sql\nDELETE FROM humanitarian_assistance WHERE country_id = (SELECT id FROM country WHERE name = 'Kenya') AND year = 2018;\n```"
... |
gretel-text2sql | Apache | [real estate] Count the number of wheelchair-accessible properties in New York with a listing price above $800,000. | ```sql
SELECT COUNT(*) FROM properties WHERE city = 'New York' AND listing_price > 800000 AND wheelchair_accessible = true;
``` | [
{
"role": "user",
"content": "[real estate] Count the number of wheelchair-accessible properties in New York with a listing price above $800,000."
},
{
"role": "assistant",
"content": "```sql\nSELECT COUNT(*) FROM properties WHERE city = 'New York' AND listing_price > 800000 AND wheelchair_acces... |
gretel-text2sql | Apache | [food industry] What is the minimum serving size of gluten-free meals available in convenience stores? | ```sql
SELECT MIN(serving_size) FROM MealTypes WHERE meal_type = 'Gluten-free' AND store_type = 'Convenience Store';
``` | [
{
"role": "user",
"content": "[food industry] What is the minimum serving size of gluten-free meals available in convenience stores?"
},
{
"role": "assistant",
"content": "```sql\nSELECT MIN(serving_size) FROM MealTypes WHERE meal_type = 'Gluten-free' AND store_type = 'Convenience Store';\n```"
... |
gretel-text2sql | Apache | [construction] Which sustainable practices were used in the 'Structural Engineering' department that cost over $10,000? | ```sql
SELECT SustainablePractices.PracticeName FROM SustainablePractices WHERE SustainablePractices.Department = 'Structural Engineering' AND SustainablePractices.Cost > 10000.00;
``` | [
{
"role": "user",
"content": "[construction] Which sustainable practices were used in the 'Structural Engineering' department that cost over $10,000?"
},
{
"role": "assistant",
"content": "```sql\nSELECT SustainablePractices.PracticeName FROM SustainablePractices WHERE SustainablePractices.Depar... |
gretel-text2sql | Apache | [government services] Add a new policy impact record to the "PolicyImpact" table | ```sql
INSERT INTO PolicyImpact (ID, Policy, Impact, StartDate, EndDate) VALUES (3001, 'Body Cameras for Police Officers', 'Reduction in use-of-force incidents by 25%', '2021-01-01', '2022-12-31');
``` | [
{
"role": "user",
"content": "[government services] Add a new policy impact record to the \"PolicyImpact\" table"
},
{
"role": "assistant",
"content": "```sql\nINSERT INTO PolicyImpact (ID, Policy, Impact, StartDate, EndDate) VALUES (3001, 'Body Cameras for Police Officers', 'Reduction in use-of... |
gretel-text2sql | Apache | [public transportation] What was the average fare collected on weekdays in February 2021 for the 'Red Line'? | ```sql
SELECT AVG(fare) FROM red_line WHERE route_id = 102 AND EXTRACT(DAY FROM date) BETWEEN 2 AND 6 AND EXTRACT(MONTH FROM date) = 2;
``` | [
{
"role": "user",
"content": "[public transportation] What was the average fare collected on weekdays in February 2021 for the 'Red Line'?"
},
{
"role": "assistant",
"content": "```sql\nSELECT AVG(fare) FROM red_line WHERE route_id = 102 AND EXTRACT(DAY FROM date) BETWEEN 2 AND 6 AND EXTRACT(MON... |
gretel-text2sql | Apache | [entertainment industry] Get the average production budget for Action and Drama movies released between 2000 and 2010. | ```sql
SELECT AVG(production_budget) FROM movies WHERE genre IN ('Action', 'Drama') AND release_year BETWEEN 2000 AND 2010;
``` | [
{
"role": "user",
"content": "[entertainment industry] Get the average production budget for Action and Drama movies released between 2000 and 2010."
},
{
"role": "assistant",
"content": "```sql\nSELECT AVG(production_budget) FROM movies WHERE genre IN ('Action', 'Drama') AND release_year BETWEE... |
gretel-text2sql | Apache | [chemicals] What is the maximum production capacity of any tank in the Eastern region? | ```sql
SELECT MAX(capacity) FROM Production WHERE location = 'Eastern';
``` | [
{
"role": "user",
"content": "[chemicals] What is the maximum production capacity of any tank in the Eastern region?"
},
{
"role": "assistant",
"content": "```sql\nSELECT MAX(capacity) FROM Production WHERE location = 'Eastern';\n```"
}
] |
gretel-text2sql | Apache | [oil and gas] List all the fields, including the ones without production, with their corresponding production rate | ```sql
SELECT f.field_id, f.field_name, fp.production_rate FROM fields f LEFT JOIN fields_production fp ON f.field_id = fp.field_id;
``` | [
{
"role": "user",
"content": "[oil and gas] List all the fields, including the ones without production, with their corresponding production rate"
},
{
"role": "assistant",
"content": "```sql\nSELECT f.field_id, f.field_name, fp.production_rate FROM fields f LEFT JOIN fields_production fp ON f.fi... |
gretel-text2sql | Apache | [restaurant operations] Identify the menu items that were 86'ed (ran out) before 5pm on a specific day for the 'Gourmet Greens' restaurant. | ```sql
SELECT name FROM menu_items WHERE restaurant_id = 3 AND available_time < '17:00:00' GROUP BY name HAVING SUM(available) = 0;
``` | [
{
"role": "user",
"content": "[restaurant operations] Identify the menu items that were 86'ed (ran out) before 5pm on a specific day for the 'Gourmet Greens' restaurant."
},
{
"role": "assistant",
"content": "```sql\nSELECT name FROM menu_items WHERE restaurant_id = 3 AND available_time < '17:00... |
gretel-text2sql | Apache | [rare earth elements] Which REEs were produced in Australia in 2020? | ```sql
SELECT DISTINCT REE FROM production WHERE country = 'Australia' AND year = 2020;
``` | [
{
"role": "user",
"content": "[rare earth elements] Which REEs were produced in Australia in 2020?"
},
{
"role": "assistant",
"content": "```sql\nSELECT DISTINCT REE FROM production WHERE country = 'Australia' AND year = 2020;\n```"
}
] |
gretel-text2sql | Apache | [healthcare] Show cultural competency training records for community health workers | ```sql
SELECT CulturalCompetencyTraining.TrainingID, CulturalCompetencyTraining.MHW_ID, CulturalCompetencyTraining.TrainingName, CulturalCompetencyTraining.TrainingDate, CommunityHealthWorker.Name FROM CulturalCompetencyTraining INNER JOIN CommunityHealthWorker ON CulturalCompetencyTraining.MHW_ID = CommunityHealthWork... | [
{
"role": "user",
"content": "[healthcare] Show cultural competency training records for community health workers"
},
{
"role": "assistant",
"content": "```sql\nSELECT CulturalCompetencyTraining.TrainingID, CulturalCompetencyTraining.MHW_ID, CulturalCompetencyTraining.TrainingName, CulturalCompe... |
gretel-text2sql | Apache | [defense industry] Calculate the percentage of defense contracts awarded to companies in California | ```sql
SELECT state, (COUNT(*)::FLOAT / (SELECT COUNT(*) FROM contract_states)) * 100 AS percentage FROM contract_states GROUP BY state;
``` | [
{
"role": "user",
"content": "[defense industry] Calculate the percentage of defense contracts awarded to companies in California"
},
{
"role": "assistant",
"content": "```sql\nSELECT state, (COUNT(*)::FLOAT / (SELECT COUNT(*) FROM contract_states)) * 100 AS percentage FROM contract_states GROUP... |
gretel-text2sql | Apache | [transportation] Find the average speed of electric vehicles in New York and London? | ```sql
SELECT AVG(speed) FROM vehicle_speed WHERE type = 'electric' AND city IN ('New York', 'London');
``` | [
{
"role": "user",
"content": "[transportation] Find the average speed of electric vehicles in New York and London?"
},
{
"role": "assistant",
"content": "```sql\nSELECT AVG(speed) FROM vehicle_speed WHERE type = 'electric' AND city IN ('New York', 'London');\n```"
}
] |
gretel-text2sql | Apache | [fine arts] What are the top 10 artists with the highest number of artworks? | ```sql
SELECT a.name, COUNT(*) as artworks_count FROM Artists a JOIN Artworks aw ON a.id = aw.artist_id GROUP BY a.name ORDER BY artworks_count DESC LIMIT 10;
``` | [
{
"role": "user",
"content": "[fine arts] What are the top 10 artists with the highest number of artworks?"
},
{
"role": "assistant",
"content": "```sql\nSELECT a.name, COUNT(*) as artworks_count FROM Artists a JOIN Artworks aw ON a.id = aw.artist_id GROUP BY a.name ORDER BY artworks_count DESC ... |
gretel-text2sql | Apache | [water resources] What is the total water consumption by industrial customers in Texas and Oklahoma? | ```sql
SELECT SUM(water_consumption) FROM industrial_customers WHERE location IN ('Texas', 'Oklahoma');
``` | [
{
"role": "user",
"content": "[water resources] What is the total water consumption by industrial customers in Texas and Oklahoma?"
},
{
"role": "assistant",
"content": "```sql\nSELECT SUM(water_consumption) FROM industrial_customers WHERE location IN ('Texas', 'Oklahoma');\n```"
}
] |
gretel-text2sql | Apache | [disability services] List the programs and their budgets for mobility accommodations. | ```sql
SELECT Program, Budget FROM Programs WHERE Type = 'Mobility';
``` | [
{
"role": "user",
"content": "[disability services] List the programs and their budgets for mobility accommodations."
},
{
"role": "assistant",
"content": "```sql\nSELECT Program, Budget FROM Programs WHERE Type = 'Mobility';\n```"
}
] |
gretel-text2sql | Apache | [space exploration] List the space missions that have had astronauts from both the US and Canada. | ```sql
SELECT mission_name FROM SpaceMissions WHERE astronaut_nationality IN ('US', 'Canada') GROUP BY mission_name HAVING COUNT(DISTINCT astronaut_nationality) = 2;
``` | [
{
"role": "user",
"content": "[space exploration] List the space missions that have had astronauts from both the US and Canada."
},
{
"role": "assistant",
"content": "```sql\nSELECT mission_name FROM SpaceMissions WHERE astronaut_nationality IN ('US', 'Canada') GROUP BY mission_name HAVING COUNT... |
gretel-text2sql | Apache | [oceans] What is the average depth of all marine protected areas in the world? | ```sql
SELECT AVG(avg_depth) FROM marine_protected_areas;
``` | [
{
"role": "user",
"content": "[oceans] What is the average depth of all marine protected areas in the world?"
},
{
"role": "assistant",
"content": "```sql\nSELECT AVG(avg_depth) FROM marine_protected_areas;\n```"
}
] |
gretel-text2sql | Apache | [oil and gas] Calculate the total production in the Southern region by oil and gas type | ```sql
SELECT type, SUM(quantity) as total_production FROM production WHERE region = 'Southern' GROUP BY type;
``` | [
{
"role": "user",
"content": "[oil and gas] Calculate the total production in the Southern region by oil and gas type"
},
{
"role": "assistant",
"content": "```sql\nSELECT type, SUM(quantity) as total_production FROM production WHERE region = 'Southern' GROUP BY type;\n```"
}
] |
gretel-text2sql | Apache | [energy] How many electric vehicles are there in China and Japan? | ```sql
SELECT SUM(num_vehicles) FROM electric_vehicles WHERE country IN ('China', 'Japan');
``` | [
{
"role": "user",
"content": "[energy] How many electric vehicles are there in China and Japan?"
},
{
"role": "assistant",
"content": "```sql\nSELECT SUM(num_vehicles) FROM electric_vehicles WHERE country IN ('China', 'Japan');\n```"
}
] |
End of preview.
No dataset card yet
- Downloads last month
- 1,540