instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
How many items were sold in each region in the last month? | CREATE TABLE sales (sale_id INT,product_id INT,quantity INT,sale_date DATE); INSERT INTO sales (sale_id,product_id,quantity,sale_date) VALUES (1,1,3,'2022-01-05'),(2,2,1,'2022-01-07'); CREATE TABLE product (product_id INT,product_name TEXT,region_id INT); INSERT INTO product (product_id,product_name,region_id) VALUES (... | SELECT r.region_name, SUM(s.quantity) as total_sold FROM sales s JOIN product p ON s.product_id = p.product_id JOIN region r ON p.region_id = r.region_id WHERE s.sale_date >= DATE_SUB(CURRENT_DATE, INTERVAL 1 MONTH) GROUP BY r.region_name; |
Which countries have a coastline along the Indian Ocean and have enacted policies for marine conservation? | CREATE TABLE countries (id INT,name VARCHAR(255),coastline VARCHAR(50),policies VARCHAR(255)); INSERT INTO countries (id,name,coastline,policies) VALUES (1,'India','Indian Ocean','Yes'),(2,'China','Pacific Ocean','No'); | SELECT name FROM countries WHERE coastline = 'Indian Ocean' AND policies = 'Yes'; |
Find the number of labor violations in each country and the total fine amount. | CREATE TABLE labor_violations (violation_id INT,country VARCHAR(20),fine DECIMAL(10,2)); | SELECT country, COUNT(*), SUM(fine) FROM labor_violations GROUP BY country; |
Total quantity of food items from local farms | CREATE TABLE LocalFarm (FarmID INT,IsLocal BOOLEAN); INSERT INTO LocalFarm (FarmID,IsLocal) VALUES (1,TRUE),(2,FALSE),(3,TRUE); | SELECT SUM(i.Quantity) FROM FoodItem f INNER JOIN LocalFarm l ON f.FarmID = l.FarmID INNER JOIN Inventory i ON f.ItemID = i.ItemID WHERE l.IsLocal = TRUE; |
What is the total duration of public meetings in 'government_meetings' table, excluding meetings with a duration less than 1 hour? | CREATE TABLE government_meetings (meeting_id INT,duration INT); | SELECT SUM(duration) FROM government_meetings WHERE duration >= 60; |
List all unique minerals extracted by 'company C'. | CREATE SCHEMA if not exists mining;CREATE TABLE mining.extraction (id INT,company STRING,mineral STRING,tons INT);INSERT INTO mining.extraction (id,company,mineral,tons) VALUES (1,'company C','mineral X',900),(2,'company C','mineral Y',1100); | SELECT DISTINCT mineral FROM mining.extraction WHERE company = 'company C'; |
Find users who have not received any likes on their posts and are from a country other than the US. | CREATE TABLE users (id INT,name VARCHAR(50),country VARCHAR(2),followers INT); INSERT INTO users (id,name,country,followers) VALUES (1,'Alice','US',1000),(2,'Bob','JP',500),(3,'Charlie','CA',1500),(4,'David','MX',200),(5,'Eve','DE',800); CREATE TABLE posts (id INT,user_id INT,timestamp DATETIME,likes INT); INSERT INTO ... | SELECT users.name FROM users LEFT JOIN posts ON users.id = posts.user_id WHERE users.country != 'US' AND posts.likes = 0; |
What is the average cost of accommodations per student? | CREATE TABLE Accommodations(student_id INT,accommodation_id INT,cost DECIMAL(5,2)); | SELECT AVG(cost) FROM Accommodations; |
What are the names of forests in India and their respective annual harvest volumes, if any, and the carbon sequestration amounts for each year? | CREATE TABLE Forests (Fid INT PRIMARY KEY,Name VARCHAR(50),Country VARCHAR(50),Area FLOAT); CREATE TABLE Carbon (Cid INT PRIMARY KEY,Fid INT,Year INT,Sequestration FLOAT,FOREIGN KEY (Fid) REFERENCES Forests(Fid)); CREATE TABLE Harvest (Hid INT PRIMARY KEY,Fid INT,Year INT,Volume INT,FOREIGN KEY (Fid) REFERENCES Forests... | SELECT Forests.Name, Carbon.Year, SUM(Carbon.Sequestration), Harvest.Volume FROM Forests FULL OUTER JOIN Carbon ON Forests.Fid = Carbon.Fid LEFT JOIN Harvest ON Forests.Fid = Harvest.Fid WHERE Forests.Country = 'India' GROUP BY Carbon.Year, Harvest.Volume, Forests.Name; |
Which menu items have the highest cost for each restaurant category? | CREATE SCHEMA FoodService;CREATE TABLE MenuItems (menu_item_id INT,restaurant_id INT,name VARCHAR(50),cost FLOAT); INSERT INTO MenuItems (menu_item_id,restaurant_id,name,cost) VALUES (1,1,'Seafood Risotto',20.00),(2,1,'Caesar Salad',12.00),(3,2,'Chicken Shawarma',15.00),(4,2,'Falafel Plate',10.00); | SELECT restaurant_id, name, MAX(cost) as highest_cost FROM MenuItems GROUP BY restaurant_id; |
Find the number of graduate students enrolled in each department, excluding those enrolled in the 'Computer Science' department. | CREATE TABLE graduate_students (id INT,department VARCHAR(20),enrollment_status VARCHAR(10)); INSERT INTO graduate_students (id,department,enrollment_status) VALUES (1,'Computer Science','Enrolled'),(2,'Physics','Enrolled'),(3,'Mathematics','Not Enrolled'); | SELECT department, COUNT(*) as enrollment_count FROM graduate_students WHERE department != 'Computer Science' GROUP BY department; |
Insert new data into the 'public_transportation' table | CREATE TABLE public_transportation (id INT,city VARCHAR(50),type VARCHAR(50),passengers INT); | INSERT INTO public_transportation (id, city, type, passengers) VALUES (1, 'New York', 'Subway', 5000); |
Insert a new record into the 'incidents' table with the following details: 'incident_id' as 6, 'animal_id' as 4, 'location_id' as 3, 'incident_date' as '2022-02-22', 'incident_type' as 'Injury' | CREATE TABLE incidents (incident_id INT PRIMARY KEY,animal_id INT,location_id INT,incident_date DATE,incident_type VARCHAR(50)); | INSERT INTO incidents (incident_id, animal_id, location_id, incident_date, incident_type) VALUES (6, 4, 3, '2022-02-22', 'Injury'); |
Find the average calorie count and total fat for vegan dishes served at 'Fresh Harvest'. | CREATE TABLE vegan_dishes (dish_id INT,name VARCHAR(50),calorie_count INT,total_fat DECIMAL(3,2)); INSERT INTO vegan_dishes VALUES (1,'Vegan Lasagna',450,15.5); INSERT INTO vegan_dishes VALUES (2,'Quinoa Stir Fry',350,10.5); CREATE TABLE served_here (dish_id INT,location VARCHAR(50)); INSERT INTO served_here VALUES (1,... | SELECT AVG(vd.calorie_count), AVG(vd.total_fat) FROM vegan_dishes vd JOIN served_here sh ON vd.dish_id = sh.dish_id WHERE sh.location = 'Fresh Harvest'; |
List all national security threats in the threats table that have a severity level of "High". | CREATE TABLE threats (name TEXT,description TEXT,severity TEXT); INSERT INTO threats (name,description,severity) VALUES ('Cyber Terrorism','Attacks on critical infrastructure.','High'),('Nuclear Proliferation','Spread of nuclear weapons.','Medium'),('Climate Change','Environmental degradation and instability.','Low'); | SELECT name FROM threats WHERE severity = 'High'; |
What is the maximum number of vaccines administered in a day in New York? | CREATE TABLE Vaccinations (VaccinationID INT,Date DATE,VaccinesAdministered INT); INSERT INTO Vaccinations (VaccinationID,Date,VaccinesAdministered) VALUES (1,'2021-08-01',5000); INSERT INTO Vaccinations (VaccinationID,Date,VaccinesAdministered) VALUES (2,'2021-08-02',5500); | SELECT MAX(VaccinesAdministered) FROM Vaccinations WHERE Date BETWEEN '2021-08-01' AND '2021-08-31'; |
What is the total number of medical equipment items in rural health centers in Mexico and Colombia that were purchased in the last 5 years? | CREATE TABLE medical_equipment (country VARCHAR(20),center_name VARCHAR(50),purchase_date DATE); INSERT INTO medical_equipment (country,center_name,purchase_date) VALUES ('Mexico','Center Z','2018-01-01'),('Mexico','Center AA','2019-01-01'),('Colombia','Center BB','2020-01-01'),('Colombia','Center CC','2021-01-01'); | SELECT country, COUNT(*) FROM medical_equipment WHERE purchase_date >= DATEADD(year, -5, CURRENT_DATE) GROUP BY country; |
What is the total mass of space debris by type? | CREATE TABLE space_debris (debris_id INT,name VARCHAR(255),type VARCHAR(255),mass FLOAT); INSERT INTO space_debris (debris_id,name,type,mass) VALUES (1,'Defunct Satellite','Satellite',1500.0); | SELECT type, SUM(mass) as total_mass FROM space_debris GROUP BY type; |
Which cybersecurity incidents were reported in the last 6 months from the 'cyber_incidents' table? | CREATE TABLE cyber_incidents (id INT,incident_date DATE,incident_type VARCHAR(255)); | SELECT * FROM cyber_incidents WHERE incident_date >= DATE(NOW()) - INTERVAL 6 MONTH; |
What is the average game purchase price for games released in 2018? | CREATE TABLE games (game_id INT,game_name TEXT,game_category TEXT,game_purchase_price FLOAT,release_year INT); INSERT INTO games (game_id,game_name,game_category,game_purchase_price,release_year) VALUES (1,'Game A','Role-playing',49.99,2018),(2,'Game B','Action',59.99,2019),(3,'Game C','Role-playing',54.99,2018),(4,'Ga... | SELECT AVG(game_purchase_price) as avg_price FROM games WHERE release_year = 2018; |
What is the total number of fish harvested from each country in the year 2022? | CREATE TABLE harvest (harvest_id INT,country VARCHAR(20),year INT,species VARCHAR(20),quantity INT); INSERT INTO harvest VALUES (1,'Norway',2022,'Salmon',10000),(2,'Chile',2022,'Tilapia',8000),(3,'Norway',2021,'Salmon',12000),(4,'China',2022,'Carp',15000); | SELECT country, COUNT(*) AS 'Total Harvested' FROM harvest WHERE year = 2022 GROUP BY country; |
How many community development projects were completed in Africa between 2015 and 2018? | CREATE TABLE projects (id INT,location VARCHAR(50),completion_date DATE); INSERT INTO projects (id,location,completion_date) VALUES (1,'Kenya','2015-05-01'),(2,'Nigeria','2017-12-31'),(3,'Ghana','2016-08-15'),(4,'Uganda','2018-09-05'),(5,'Tanzania','2014-11-23'); | SELECT COUNT(*) FROM projects WHERE location LIKE 'Africa%' AND completion_date BETWEEN '2015-01-01' AND '2018-12-31'; |
List the top 3 customers with the highest total spend on international shipments in the last quarter of 2020, along with the total spent by each customer. | CREATE SCHEMA IF NOT EXISTS logistics;CREATE TABLE IF NOT EXISTS customers (customer_id INT,customer_name VARCHAR(50));CREATE TABLE IF NOT EXISTS shipments (shipment_id INT,customer_id INT,shipment_date DATE,shipment_type VARCHAR(20),revenue DECIMAL(10,2));INSERT INTO customers (customer_id,customer_name) VALUES (1,'Ac... | SELECT customer_name, SUM(revenue) AS total_spent FROM logistics.customers c JOIN logistics.shipments s ON c.customer_id = s.customer_id WHERE shipment_type = 'international' AND QUARTER(shipment_date) = 4 GROUP BY customer_name ORDER BY total_spent DESC LIMIT 3; |
Delete all records from the military_tech table that are no longer active. | CREATE TABLE military_tech (id INT,name VARCHAR(255),country VARCHAR(255),status VARCHAR(255));INSERT INTO military_tech (id,name,country,status) VALUES (1,'F-35','USA','active'),(2,'Abrams M1','USA','inactive'),(3,'Javelin','USA','active'); | DELETE FROM military_tech WHERE status != 'active'; |
What's the average ESG score for companies in the 'finance' and 'technology' sectors? | CREATE TABLE companies_esg_2 (id INT,sector VARCHAR(20),ESG_score FLOAT); INSERT INTO companies_esg_2 (id,sector,ESG_score) VALUES (1,'technology',72.5),(2,'finance',80.2),(3,'technology',76.1); | SELECT sector, AVG(ESG_score) FROM companies_esg_2 WHERE sector IN ('finance', 'technology') GROUP BY sector; |
Identify the wells that were decommissioned in 2021 | CREATE TABLE if not exists decommissioned_well (well_id INT,well_name TEXT,decommission_year INT); INSERT INTO decommissioned_well (well_id,well_name,decommission_year) VALUES (1,'Well A',2021),(2,'Well D',2020),(3,'Well E',2021); | SELECT well_name FROM decommissioned_well WHERE decommission_year = 2021; |
What is the total revenue for music festivals in Europe in 2022? | CREATE TABLE Festivals (region VARCHAR(20),year INT,revenue DECIMAL(5,2)); INSERT INTO Festivals (region,year,revenue) VALUES ('Europe',2022,500000.00),('Europe',2022,750000.00),('US',2022,800000.00); | SELECT SUM(revenue) FROM Festivals WHERE region = 'Europe' AND year = 2022; |
What is the total amount of gold produced by the mining operations in the state of Nevada last year? | CREATE TABLE gold_production (id INT,name TEXT,location TEXT,timestamp TIMESTAMP,gold_produced FLOAT); INSERT INTO gold_production (id,name,location,timestamp,gold_produced) VALUES (1,'Golden Eagle Mine','Nevada','2021-01-01 12:00:00',1200); | SELECT SUM(gold_produced) FROM gold_production WHERE location = 'Nevada' AND EXTRACT(YEAR FROM timestamp) = EXTRACT(YEAR FROM CURRENT_DATE) - 1; |
Create a table named 'ocean_health_metrics' | CREATE TABLE ocean_health_indicators (indicator_id INT PRIMARY KEY,indicator_name VARCHAR(255)); | CREATE TABLE ocean_health_metrics (metric_id INT PRIMARY KEY, location_id INT, indicator_id INT, year INT, value FLOAT, FOREIGN KEY (location_id) REFERENCES farm_locations(location_id), FOREIGN KEY (indicator_id) REFERENCES ocean_health_indicators(indicator_id)); |
How many volunteers engaged in each program, having more than 20 participants? | CREATE TABLE Volunteers (id INT,volunteer_name TEXT,program TEXT,participation_date DATE); INSERT INTO Volunteers (id,volunteer_name,program,participation_date) VALUES (1,'Alice','Feed the Hungry','2022-01-01'),(2,'Bob','Tutor Kids','2022-01-02'); | SELECT program, COUNT(*) FROM Volunteers GROUP BY program HAVING COUNT(*) > 20; |
What is the average number of union members per month in the 'education' schema for the year '2022'? | CREATE TABLE union_members (id INT,date DATE,industry VARCHAR(255),member_count INT); INSERT INTO union_members (id,date,industry,member_count) VALUES (1,'2022-01-01','education',500),(2,'2022-02-01','education',550),(3,'2022-03-01','education',600); | SELECT AVG(member_count) FROM union_members WHERE industry = 'education' AND date BETWEEN '2022-01-01' AND '2022-12-31'; |
List the 'case_id' and 'case_type' for cases in the 'AccessToJustice' table where the 'case_type' starts with 'c' | CREATE TABLE AccessToJustice (case_id INT,case_type VARCHAR(10)); INSERT INTO AccessToJustice (case_id,case_type) VALUES (1,'civil'),(2,'criminal'),(3,'constitutional'); | SELECT case_id, case_type FROM AccessToJustice WHERE case_type LIKE 'c%'; |
How many climate finance projects were initiated by public investors in 2019? | CREATE TABLE climate_finance_projects (id INT,investor_type VARCHAR(50),year INT,project_count INT); INSERT INTO climate_finance_projects (id,investor_type,year,project_count) VALUES (1,'Private Investor',2020,10); INSERT INTO climate_finance_projects (id,investor_type,year,project_count) VALUES (2,'Public Investor',20... | SELECT project_count FROM climate_finance_projects WHERE investor_type = 'Public Investor' AND year = 2019; |
What is the average monthly salary of workers in the 'manufacturing' sector, excluding those earning below the minimum wage? | CREATE TABLE if not exists workers (id INT PRIMARY KEY,sector VARCHAR(255),monthly_salary DECIMAL(10,2)); INSERT INTO workers (id,sector,monthly_salary) VALUES (1,'manufacturing',2500.00),(2,'manufacturing',3000.50),(3,'manufacturing',1800.00); | SELECT AVG(monthly_salary) FROM workers WHERE monthly_salary > (SELECT MIN(monthly_salary) FROM workers WHERE sector = 'manufacturing') AND sector = 'manufacturing'; |
What is the average claim amount and number of claims for policyholders who are female and have a policy type of 'Homeowners'? | CREATE TABLE Policyholders (Id INT PRIMARY KEY,FirstName VARCHAR(50),LastName VARCHAR(50),Age INT,Gender VARCHAR(10)); CREATE TABLE Policies (Id INT PRIMARY KEY,PolicyholderId INT,PolicyType VARCHAR(50),CoverageAmount DECIMAL(10,2),FOREIGN KEY (PolicyholderId) REFERENCES Policyholders(Id)); CREATE TABLE Claims (Id INT ... | SELECT P.Gender, PL.PolicyType, AVG(C.ClaimAmount) as AverageClaimAmount, COUNT(C.Id) as NumberOfClaims FROM Policyholders P JOIN Policies PL ON P.Id = PL.PolicyholderId JOIN Claims C ON PL.Id = C.PolicyId WHERE P.Gender = 'Female' AND PL.PolicyType = 'Homeowners' GROUP BY P.Gender, PL.PolicyType ORDER BY AverageClaimA... |
Find the change in deep-sea species count per year. | CREATE TABLE deep_sea_species (year INT,species_count INT); INSERT INTO deep_sea_species (year,species_count) VALUES (2010,1200),(2011,1215),(2012,1250),(2013,1275),(2014,1300),(2015,1320); | SELECT year, species_count, LAG(species_count) OVER(ORDER BY year) as previous_year_count, species_count - LAG(species_count) OVER(ORDER BY year) as change FROM deep_sea_species; |
List the names of vessels and their maximum cargo capacity that have visited ports in Asia in 2019. | CREATE TABLE Vessels (id INT,name VARCHAR(255),capacity INT,last_port VARCHAR(255),last_visited DATETIME); INSERT INTO Vessels (id,name,capacity,last_port,last_visited) VALUES (1,'Sea Titan',15000,'Hong Kong','2019-03-05 14:30:00'),(2,'Ocean Wave',12000,'Tokyo','2019-11-12 09:00:00'); CREATE VIEW Ports AS SELECT DISTIN... | SELECT name, capacity FROM Vessels V JOIN Ports P ON V.last_port = P.port WHERE YEAR(last_visited) = 2019 AND FIND_IN_SET(last_port, (SELECT GROUP_CONCAT(port) FROM Ports WHERE port LIKE '%Asia%')) > 0; |
Count the number of construction projects in the Midwest that used over 1000 hours of labor? | CREATE TABLE Projects (id INT,region VARCHAR(255),labor_hours INT); INSERT INTO Projects (id,region,labor_hours) VALUES (1,'Midwest',1200),(2,'Northeast',1500),(3,'Midwest',1300); | SELECT COUNT(*) FROM Projects WHERE region = 'Midwest' AND labor_hours > 1000; |
Delete records of workouts with a duration less than 10 minutes for all members from the 'Workouts' table | CREATE TABLE Workouts (WorkoutID INT,MemberID INT,Duration INT,MembershipType VARCHAR(20)); | DELETE FROM Workouts WHERE Duration < 10; |
What is the average age of community health workers in the 'NY' and 'CA' regions? | CREATE TABLE CommunityHealthWorkers (WorkerID INT,Age INT,Region VARCHAR(2)); INSERT INTO CommunityHealthWorkers (WorkerID,Age,Region) VALUES (1,35,'NY'),(2,40,'CA'),(3,45,'NY'),(4,50,'CA'); | SELECT AVG(Age) FROM CommunityHealthWorkers WHERE Region IN ('NY', 'CA'); |
Identify cities with smart city technology adoption in India. | CREATE TABLE smart_cities (id INT,country VARCHAR(255),city VARCHAR(255),technology VARCHAR(255)); INSERT INTO smart_cities (id,country,city,technology) VALUES (1,'India','Bangalore','smart grids'),(2,'India','Mumbai','smart transportation'),(3,'USA','New York','smart buildings'); | SELECT DISTINCT city FROM smart_cities WHERE country = 'India'; |
What is the average number of citations per publication in the 'Journal of Data Science'? | CREATE TABLE Publications (ID INT,Journal VARCHAR(50),Year INT,CitationCount INT); INSERT INTO Publications (ID,Journal,Year,CitationCount) VALUES (1,'Journal of Data Science',2020,50),(2,'Journal of Machine Learning',2019,40); | SELECT AVG(CitationCount) FROM Publications WHERE Journal = 'Journal of Data Science'; |
Update crop yield for a specific farm | CREATE TABLE crop_yield (id INT PRIMARY KEY,farm_id INT,crop VARCHAR(50),yield INT,year INT); INSERT INTO crop_yield (id,farm_id,crop,yield,year) VALUES (2,2,'Soybeans',150,2021); | UPDATE crop_yield SET yield = 160 WHERE farm_id = 2 AND crop = 'Soybeans'; |
Compare safety records of vessels with 100+ crew members and those with < 50 | CREATE TABLE SAFETY_RECORDS (id INT,vessel_name VARCHAR(50),crew_size INT,accidents INT); | SELECT '100+ crew members' AS category, AVG(accidents) FROM SAFETY_RECORDS WHERE crew_size >= 100 UNION ALL SELECT 'Less than 50 crew members', AVG(accidents) FROM SAFETY_RECORDS WHERE crew_size < 50; |
What is the total income by gender for microfinance clients in Kenya? | CREATE TABLE microfinance_clients (id INT,name VARCHAR(50),gender VARCHAR(10),income FLOAT); INSERT INTO microfinance_clients (id,name,gender,income) VALUES (1,'John Doe','Male',5000.00),(2,'Jane Doe','Female',6000.00); | SELECT gender, SUM(income) as total_income FROM microfinance_clients WHERE country = 'Kenya' GROUP BY gender; |
How many tons of seafood were imported by Japan from Australia in 2019? | CREATE TABLE seafood_exports (id INT,export_date DATE,export_country VARCHAR(50),import_country VARCHAR(50),quantity INT,unit_type VARCHAR(10)); INSERT INTO seafood_exports (id,export_date,export_country,import_country,quantity,unit_type) VALUES (1,'2019-01-01','Japan','Australia',500,'ton'),(2,'2019-01-02','Canada','U... | SELECT SUM(quantity) FROM seafood_exports WHERE export_country = 'Australia' AND import_country = 'Japan' AND EXTRACT(YEAR FROM export_date) = 2019; |
Insert new records for visitors from India, Pakistan, and Bangladesh into the visitors table | CREATE TABLE visitors (id INT,age INT,gender TEXT,country TEXT); | INSERT INTO visitors (id, age, gender, country) VALUES (6001, 30, 'Male', 'India'), (6002, 22, 'Female', 'Pakistan'), (6003, 40, 'Male', 'Bangladesh'); |
Which countries source the most ingredients for cosmetics in the database? | CREATE TABLE Ingredient (id INT,product VARCHAR(255),ingredient VARCHAR(255),sourcing_country VARCHAR(255)); INSERT INTO Ingredient (id,product,ingredient,sourcing_country) VALUES (1,'Lush Soak Stimulant Bath Bomb','Sodium Bicarbonate','England'),(2,'The Body Shop Born Lippy Strawberry Lip Balm','Caprylic/Capric Trigly... | SELECT sourcing_country, COUNT(DISTINCT product) as product_count FROM Ingredient GROUP BY sourcing_country ORDER BY product_count DESC; |
Show the number of public transportation trips by hour for a specific date | CREATE TABLE trip (trip_id INT,trip_time TIMESTAMP); | SELECT HOUR(trip_time) AS hour, COUNT(*) AS trips FROM trip WHERE trip_time BETWEEN '2022-06-01 00:00:00' AND '2022-06-02 00:00:00' GROUP BY hour; |
Determine the total number of volunteers and total hours spent per age group, from the 'Volunteer_Age' table, grouped by Age_Group. | CREATE TABLE Volunteer_Age (VolunteerID INT,Age INT,Age_Group VARCHAR(50)); | SELECT Age_Group, COUNT(*) AS Number_Of_Volunteers, SUM(Hours) AS Total_Hours_Spent FROM Volunteer_Age JOIN (SELECT VolunteerID, YEAR(CURDATE()) - YEAR(Birth_Date) AS Age FROM Volunteers) AS Age_Table ON Volunteer_Age.VolunteerID = Age_Table.VolunteerID GROUP BY Age_Group; |
What is the average price of items in each menu category? | CREATE TABLE menu_items (item_name VARCHAR(50),menu_category VARCHAR(50),price DECIMAL(5,2)); INSERT INTO menu_items (item_name,menu_category,price) VALUES ('Garden Salad','Appetizers',7.50),('Margherita Pizza','Entrees',12.00),('Cheeseburger','Entrees',10.00),('Chocolate Cake','Desserts',8.00); | SELECT menu_category, AVG(price) FROM menu_items GROUP BY menu_category; |
How many unique donors have there been in each cause area? | CREATE TABLE unique_donors (donor_id INT,cause_area VARCHAR(20),donation_date DATE); INSERT INTO unique_donors (donor_id,cause_area,donation_date) VALUES (1,'Arts','2020-01-01'),(2,'Education','2020-02-01'),(3,'Arts','2020-03-01'),(4,'Health','2019-01-01'),(5,'Health','2020-01-01'); | SELECT cause_area, COUNT(DISTINCT donor_id) AS unique_donors FROM unique_donors GROUP BY cause_area; |
What is the average age of ceramic artifacts from 'Site E'? | CREATE TABLE artifacts (artifact_id INT,site_id INT,artifact_type TEXT,age INT); INSERT INTO artifacts (artifact_id,site_id,artifact_type,age) VALUES (1,5,'ceramic',80),(2,1,'wooden',30),(3,2,'metal',50),(4,3,'ceramic',90),(5,3,'pottery',60),(6,4,'stone',70),(7,5,'stone',85),(8,5,'ceramic',75); | SELECT AVG(age) as avg_age FROM artifacts WHERE site_id = 5 AND artifact_type = 'ceramic'; |
Insert a new record into the 'habitat_preservation' table | CREATE TABLE habitat_preservation (id INT PRIMARY KEY,location VARCHAR(50),size_acres FLOAT,preservation_status VARCHAR(50),protected_species VARCHAR(50)); | INSERT INTO habitat_preservation (id, location, size_acres, preservation_status, protected_species) VALUES (1, 'Amazon Rainforest', 21000000.0, 'Vulnerable', 'Jaguar'); |
List all records from the table "coral_reefs" | CREATE TABLE coral_reefs (id INT PRIMARY KEY,name VARCHAR(255),location VARCHAR(255),status VARCHAR(255)); INSERT INTO coral_reefs (id,name,location,status) VALUES (1,'Great Barrier Reef','Australia','Vulnerable'); | SELECT * FROM coral_reefs; |
Add new community health worker record for Georgia | CREATE TABLE community_health_workers (chw_id INT,state VARCHAR(2),name VARCHAR(50),certification_date DATE); | INSERT INTO community_health_workers (chw_id, state, name, certification_date) VALUES (987, 'GA', 'Nia White', '2022-06-10'); |
What is the maximum height of all dams in the province of Quebec that were constructed after the year 2000? | CREATE TABLE dam (id INT,name TEXT,province TEXT,construction_year INT,height FLOAT); INSERT INTO dam (id,name,province,construction_year,height) VALUES (1,'Dam A','Quebec',2005,50.3); INSERT INTO dam (id,name,province,construction_year,height) VALUES (2,'Dam B','Quebec',1995,60.2); | SELECT MAX(height) FROM dam WHERE province = 'Quebec' AND construction_year > 2000; |
What is the total transaction value for each month of the year 2022? | CREATE TABLE transactions (transaction_id INT,transaction_date DATE,transaction_category VARCHAR(255),transaction_value DECIMAL(10,2)); INSERT INTO transactions (transaction_id,transaction_date,transaction_category,transaction_value) VALUES (1,'2022-01-02','Food',75.00),(2,'2022-02-05','Electronics',350.00),(3,'2022-03... | SELECT YEAR(transaction_date) as year, MONTH(transaction_date) as month, SUM(transaction_value) as total_value FROM transactions WHERE transaction_date BETWEEN '2022-01-01' AND '2022-12-31' GROUP BY year, month; |
How many sustainable tourism packages are available in Canada and Mexico? | CREATE TABLE sustainable_tours (package_id INT,package_name VARCHAR(255),country VARCHAR(255),available INT); INSERT INTO sustainable_tours (package_id,package_name,country,available) VALUES (1,'Sustainable Tour Vancouver','Canada',20); INSERT INTO sustainable_tours (package_id,package_name,country,available) VALUES (2... | SELECT country, SUM(available) FROM sustainable_tours GROUP BY country; |
Which ingredients are used in more than 50% of the products? | CREATE TABLE ingredients (ingredient_id INT PRIMARY KEY,ingredient_name VARCHAR(50)); CREATE TABLE product_ingredients (product_id INT,ingredient_id INT,PRIMARY KEY (product_id,ingredient_id),FOREIGN KEY (product_id) REFERENCES products(product_id),FOREIGN KEY (ingredient_id) REFERENCES ingredients(ingredient_id)); CRE... | SELECT ingredient_name, COUNT(*) as product_count FROM product_ingredients GROUP BY ingredient_id HAVING product_count > (SELECT COUNT(*) * 0.5 FROM products); |
What is the average attendance at events for each event type? | CREATE TABLE EventTypes (EventTypeID INT,EventTypeName VARCHAR(50)); CREATE TABLE EventAttendance (EventID INT,EventTypeID INT,Attendees INT); INSERT INTO EventTypes (EventTypeID,EventTypeName) VALUES (1,'Concert'),(2,'Play'),(3,'Workshop'); INSERT INTO EventAttendance (EventID,EventTypeID,Attendees) VALUES (1,1,50),(2... | SELECT et.EventTypeName, AVG(ea.Attendees) as AvgAttendance FROM EventTypes et INNER JOIN EventAttendance ea ON et.EventTypeID = ea.EventTypeID GROUP BY et.EventTypeName; |
What is the total water consumption in the agriculture sector in Canada? | CREATE TABLE agriculture_sector (id INT,country VARCHAR(20),water_consumption FLOAT); INSERT INTO agriculture_sector (id,country,water_consumption) VALUES (1,'Canada',1200),(2,'Canada',1500),(3,'Canada',1800); | SELECT SUM(water_consumption) FROM agriculture_sector WHERE country = 'Canada'; |
What is the average speed limit for public transportation in Sydney, Australia? | CREATE TABLE public_transportation_speeds (city VARCHAR(30),country VARCHAR(30),speed_limit DECIMAL(5,2)); INSERT INTO public_transportation_speeds VALUES ('Sydney','Australia',60.00); | SELECT AVG(speed_limit) FROM public_transportation_speeds WHERE city = 'Sydney' AND country = 'Australia'; |
What is the maximum distance from Earth for any exoplanet? | CREATE TABLE exoplanets (id INT,name VARCHAR(50),distance_from_earth FLOAT); | SELECT MAX(distance_from_earth) FROM exoplanets; |
How many whale sightings have been reported in the Arctic? | CREATE TABLE whale_sightings (sighting_id INT,species TEXT,location TEXT,year INT); | SELECT COUNT(*) FROM whale_sightings WHERE location LIKE '%Arctic%'; |
What is the total quantity of items shipped from each country to Africa? | CREATE TABLE Shipment (id INT,source_country VARCHAR(255),destination_continent VARCHAR(255),quantity INT); INSERT INTO Shipment (id,source_country,destination_continent,quantity) VALUES (1,'Egypt','Africa',500),(2,'South Africa','Africa',300),(3,'Nigeria','Africa',200),(4,'Kenya','Africa',100); | SELECT source_country, SUM(quantity) FROM Shipment WHERE destination_continent = 'Africa' GROUP BY source_country |
Delete all excavation sites that started after '2010-01-01' from the 'excavation_sites' table. | CREATE TABLE excavation_sites (id INT,site_name VARCHAR(50),country VARCHAR(50),start_date DATE,end_date DATE); | DELETE FROM excavation_sites WHERE start_date > '2010-01-01'; |
What is the total revenue for each product category in the last month? | CREATE TABLE sales (sale_id INT,product_id INT,sale_date DATE,revenue INT); INSERT INTO sales (sale_id,product_id,sale_date,revenue) VALUES (1,1,'2022-01-01',1000),(2,2,'2022-01-02',500),(3,1,'2022-01-03',1500); | SELECT p.category, SUM(s.revenue) FROM sales s INNER JOIN products p ON s.product_id = p.product_id WHERE s.sale_date >= DATEADD(month, -1, GETDATE()) GROUP BY p.category; |
Show all climate mitigation projects from 'Africa' in the 'mitigation_projects' table | CREATE TABLE mitigation_projects (id INT PRIMARY KEY,name VARCHAR(255),location VARCHAR(255),description TEXT,start_date DATE,end_date DATE,budget FLOAT); INSERT INTO mitigation_projects (id,name,location,description,start_date,end_date,budget) VALUES (1,'Solar Farm Installation','Kenya','Installation of solar panels',... | SELECT * FROM mitigation_projects WHERE location LIKE 'Africa%'; |
What is the maximum speed recorded for a shared electric bicycle in Berlin, Germany? | CREATE TABLE shared_ebikes (ebike_id INT,ride_id INT,trip_start_time TIMESTAMP,trip_end_time TIMESTAMP,start_location TEXT,end_location TEXT,city TEXT,max_speed DECIMAL); | SELECT MAX(max_speed) FROM shared_ebikes WHERE city = 'Berlin'; |
Which defense contracts were awarded in the last 6 months and have a value greater than $10 million? | CREATE TABLE DefenseContracts (contract_id INT,date DATE,value FLOAT); INSERT INTO DefenseContracts (contract_id,date,value) VALUES (1,'2022-01-01',15000000),(2,'2022-02-01',5000000),(3,'2022-03-01',20000000); | SELECT contract_id, date, value FROM DefenseContracts WHERE date >= NOW() - INTERVAL 6 MONTH AND value > 10000000; |
Find the number of fans who attended games for each team in the last month? | CREATE TABLE fans (fan_id INT,team_name VARCHAR(50),game_date DATE); CREATE TABLE teams (team_name VARCHAR(50),team_city VARCHAR(50)); INSERT INTO fans (fan_id,team_name,game_date) VALUES (1,'Red Sox','2022-06-01'),(2,'Yankees','2022-06-02'); INSERT INTO teams (team_name,team_city) VALUES ('Red Sox','Boston'),('Yankees... | SELECT team_name, COUNT(*) as game_attendance FROM fans INNER JOIN teams ON fans.team_name = teams.team_name WHERE game_date >= DATEADD(month, -1, GETDATE()) GROUP BY team_name; |
What is the water usage of 'Ethical Supplies'? | CREATE TABLE suppliers (id INT PRIMARY KEY,name VARCHAR(100)); INSERT INTO suppliers (id,name) VALUES (1,'Ethical Supplies'); CREATE TABLE sustainability_reports (id INT PRIMARY KEY,company_id INT,year INT,water_usage INT); INSERT INTO sustainability_reports (id,company_id,year,water_usage) VALUES (1,1,2021,3000); | SELECT sr.water_usage FROM suppliers s INNER JOIN sustainability_reports sr ON s.id = sr.company_id WHERE s.name = 'Ethical Supplies'; |
List the number of publications for faculty members in the 'Computer Science' department who have received research grants. | CREATE TABLE faculty (id INT,name VARCHAR(50),department VARCHAR(20)); CREATE TABLE research_grants (faculty_id INT,grant_amount DECIMAL(10,2)); CREATE TABLE publications (id INT,faculty_id INT,title VARCHAR(50)); INSERT INTO faculty (id,name,department) VALUES (1,'Alex Brown','Computer Science'),(2,'Rachel Green','Bio... | SELECT COUNT(*) as num_publications FROM faculty f JOIN research_grants rg ON f.id = rg.faculty_id JOIN publications p ON f.id = p.faculty_id WHERE f.department = 'Computer Science'; |
What is the average amount of donations made per donor from India in the year 2018? | CREATE TABLE donations (id INT,donor_id INT,donor_country TEXT,donation_date DATE,donation_amount DECIMAL); INSERT INTO donations (id,donor_id,donor_country,donation_date,donation_amount) VALUES (1,1,'India','2018-01-01',50.00),(2,2,'India','2018-01-01',25.00),(3,3,'India','2018-12-31',75.00),(4,4,'India','2018-03-15',... | SELECT AVG(donation_amount) FROM donations WHERE donor_country = 'India' AND YEAR(donation_date) = 2018; |
What is the average life expectancy in Canada? | CREATE TABLE life_expectancy (country VARCHAR(50),year INT,expectancy DECIMAL(3,1)); | SELECT AVG(expectancy) FROM life_expectancy WHERE country = 'Canada'; |
Find the total carbon credits earned by renewable energy companies in France. | CREATE TABLE carbon_credits (company_name VARCHAR(30),country VARCHAR(20),credits NUMERIC(10,2)); INSERT INTO carbon_credits (company_name,country,credits) VALUES ('CompanyA','France',1200.5),('CompanyB','France',950.0),('CompanyC','France',800.2),('CompanyD','France',700.0); | SELECT SUM(credits) FROM carbon_credits WHERE country = 'France'; |
Find the mining operations that have a high environmental impact score and also a high number of employees. | CREATE TABLE mining_operations (id INT,name VARCHAR(50),num_employees INT,environmental_impact_score INT); | SELECT name FROM mining_operations WHERE num_employees > (SELECT AVG(num_employees) FROM mining_operations) AND environmental_impact_score > (SELECT AVG(environmental_impact_score) FROM mining_operations); |
What is the total number of medical procedures and their respective categories in low-income areas of Mississippi? | CREATE TABLE medical_procedures(id INT,name TEXT,location TEXT,category TEXT); INSERT INTO medical_procedures(id,name,location,category) VALUES (1,'Procedure A','Mississippi Low-Income','Preventative'),(2,'Procedure B','Mississippi Low-Income','Diagnostic'),(3,'Procedure C','Mississippi High-Income','Surgical'),(4,'Pro... | SELECT COUNT(*) as procedure_count, category FROM medical_procedures WHERE location = 'Mississippi Low-Income' GROUP BY category; |
What is the minimum soil moisture level recorded for each farm in the past year? | CREATE TABLE farm_soil_moisture (farm_id INTEGER,date DATE,moisture INTEGER); | SELECT farm_id, MIN(moisture) as min_moisture FROM farm_soil_moisture WHERE date >= DATEADD(year, -1, GETDATE()) GROUP BY farm_id; |
What is the sum of plastic packaging weights for products in the Retail table? | CREATE TABLE Retail (product_id INT,product_name TEXT,packaging_weight DECIMAL); INSERT INTO Retail (product_id,product_name,packaging_weight) VALUES (201,'Shampoo',0.12); INSERT INTO Retail (product_id,product_name,packaging_weight) VALUES (202,'Lotion',0.05); INSERT INTO Retail (product_id,product_name,packaging_weig... | SELECT SUM(packaging_weight) FROM Retail WHERE packaging_material = 'plastic'; |
How many network devices were installed per country? | CREATE TABLE network_devices (device_id INT,country VARCHAR(50)); | SELECT country, COUNT(device_id) FROM network_devices GROUP BY country; |
How many artworks were sold by each artist in 2020? | CREATE TABLE ArtWorkSales (artworkID INT,artistID INT,saleDate DATE); CREATE TABLE Artists (artistID INT,artistName VARCHAR(50)); | SELECT a.artistName, COUNT(*) as artwork_count FROM ArtWorkSales aws JOIN Artists a ON aws.artistID = a.artistID WHERE YEAR(aws.saleDate) = 2020 GROUP BY a.artistName; |
What is the total number of military vehicles sold by ACME Corp to the African region in the year 2022? | CREATE TABLE Military_Equipment_Sales (supplier VARCHAR(255),region VARCHAR(255),equipment VARCHAR(255),quantity INT,sale_year INT); | SELECT SUM(quantity) FROM Military_Equipment_Sales WHERE supplier = 'ACME Corp' AND region = 'Africa' AND sale_year = 2022; |
What are the total waste generation metrics for each city in the region 'North East', including the recycling rates, in descending order of waste generation? | CREATE TABLE cities (city_name VARCHAR(50),region VARCHAR(50),waste_generation INT,recycling_rate FLOAT); INSERT INTO cities (city_name,region,waste_generation,recycling_rate) VALUES ('CityA','North East',5000,0.3),('CityB','North East',3000,0.25),('CityC','North East',7000,0.4); | SELECT city_name, waste_generation, recycling_rate FROM cities WHERE region = 'North East' ORDER BY waste_generation DESC; |
What is the average word count of articles that were published in 2020? | CREATE TABLE Articles (id INT,publication_date DATE,word_count INT); INSERT INTO Articles (id,publication_date,word_count) VALUES (1,'2020-01-01',500),(2,'2020-02-02',700),(3,'2019-12-31',300),(4,'2020-05-05',600); | SELECT AVG(word_count) as avg_word_count FROM Articles WHERE YEAR(publication_date) = 2020; |
What is the average depth of all marine protected areas in the Pacific region, grouped by conservation status?" | CREATE TABLE marine_protected_areas (area_name VARCHAR(255),region VARCHAR(255),avg_depth FLOAT,conservation_status VARCHAR(255)); INSERT INTO marine_protected_areas (area_name,region,avg_depth,conservation_status) VALUES ('Galapagos Marine Reserve','Pacific',200,'Fully Protected'),('Great Barrier Reef','Pacific',100,'... | SELECT conservation_status, AVG(avg_depth) as avg_depth FROM marine_protected_areas WHERE region = 'Pacific' GROUP BY conservation_status; |
What is the total gas production in the Gulf of Mexico for each year? | CREATE TABLE gas_production (year INT,region VARCHAR(255),gas_quantity INT); INSERT INTO gas_production (year,region,gas_quantity) VALUES (2015,'Gulf of Mexico',1230000),(2016,'Gulf of Mexico',1500000),(2017,'Gulf of Mexico',1750000),(2018,'Gulf of Mexico',1900000),(2019,'Gulf of Mexico',2100000); | SELECT year, SUM(gas_quantity) FROM gas_production WHERE region = 'Gulf of Mexico' GROUP BY year; |
What are the top 3 countries with the highest number of security incidents in the past year? | CREATE TABLE incidents (incident_id INT PRIMARY KEY,incident_date TIMESTAMP,region VARCHAR(50)); | SELECT region, COUNT(*) as incident_count FROM incidents WHERE incident_date >= NOW() - INTERVAL 1 YEAR GROUP BY region ORDER BY incident_count DESC LIMIT 3; |
What is the total number of military equipment sales for each defense contractor in the Asia-Pacific region, grouped by country and displayed in descending order of sales volume? | CREATE TABLE defense_contractors (id INT,name VARCHAR(255),region VARCHAR(255)); INSERT INTO defense_contractors (id,name,region) VALUES (1,'Lockheed Martin','Asia-Pacific'),(2,'Boeing','Asia-Pacific'),(3,'Raytheon','North America'); CREATE TABLE military_equipment_sales (id INT,defense_contractor_id INT,country VARCHA... | SELECT m.country, d.name, SUM(m.sales) as total_sales FROM military_equipment_sales m JOIN defense_contractors d ON m.defense_contractor_id = d.id WHERE d.region = 'Asia-Pacific' GROUP BY m.country, d.name ORDER BY total_sales DESC; |
Find the number of male and female patients in the patient table. | CREATE TABLE patient (id INT,name VARCHAR(50),gender VARCHAR(10),dob DATE); INSERT INTO patient (id,name,gender,dob) VALUES (1,'John Doe','Male','1980-01-01'); INSERT INTO patient (id,name,gender,dob) VALUES (2,'Jane Smith','Female','1990-02-02'); | SELECT gender, COUNT(*) FROM patient GROUP BY gender; |
What is the minimum and maximum number of rural health centers in each state in the USA, and how many of these centers are located in states with more than 500 rural health centers? | CREATE TABLE rural_health_centers (center_id INT,center_name VARCHAR(100),state VARCHAR(50),num_staff INT); INSERT INTO rural_health_centers (center_id,center_name,state,num_staff) VALUES (1,'Center A','California',75),(2,'Center B','California',90),(3,'Center C','Texas',120),(4,'Center D','Texas',80),(5,'Center E','Ne... | SELECT MIN(num_staff) AS min_staff, MAX(num_staff) AS max_staff, COUNT(*) FILTER (WHERE num_staff > 500) AS centers_with_more_than_500_staff FROM ( SELECT state, COUNT(*) AS num_staff FROM rural_health_centers GROUP BY state ) subquery; |
List all unique departments, ordered from the fewest projects to the most. | CREATE TABLE projects (id INT,engineer_id INT,department VARCHAR(20),cost DECIMAL(10,2)); INSERT INTO projects (id,engineer_id,department,cost) VALUES (1,1001,'civil',5000),(2,1002,'civil',6000),(3,1003,'structural',4000),(4,1001,'civil',7000),(5,1002,'civil',3000),(6,1003,'structural',6000); | SELECT department FROM projects GROUP BY department ORDER BY COUNT(*) ASC; |
Find the difference in capacity between hydro and wind power in the 'renewables' schema? | CREATE SCHEMA renewables;CREATE TABLE hydro_power (name VARCHAR(50),capacity INT);INSERT INTO renewables.hydro_power (name,capacity) VALUES ('PowerPlant1',300); | SELECT SUM(renewables.wind_farms.capacity) - SUM(renewables.hydro_power.capacity) FROM renewables.wind_farms, renewables.hydro_power; |
Insert a new record for a ticket sale in the ticket_sales table | CREATE TABLE ticket_sales (sale_id INT,fan_id INT,team VARCHAR(50),event_date DATE,tickets_sold INT,revenue DECIMAL(6,2)); INSERT INTO ticket_sales (sale_id,fan_id,team,event_date,tickets_sold,revenue) VALUES (1,1,'Sky High Flyers','2022-07-25',2,150.00),(2,2,'Bouncing Bears','2022-07-26',1,75.00); | INSERT INTO ticket_sales (sale_id, fan_id, team, event_date, tickets_sold, revenue) VALUES (3, 4, 'Bouncing Bears', '2022-07-27', 3, 225.00); |
Delete all regions with no countries from the regions table | CREATE TABLE countries (id INT,name VARCHAR(50),region VARCHAR(50)); CREATE TABLE regions (id INT,name VARCHAR(50)); INSERT INTO regions (id,name) VALUES (1,'North America'),(2,'Europe'),(3,'Asia'),(4,'Antarctica'); INSERT INTO countries (id,name,region) VALUES (1,'USA','North America'),(2,'Russia','Europe'),(3,'China'... | DELETE FROM regions WHERE id NOT IN (SELECT region FROM countries); |
What carbon offset projects and green buildings are in Australia? | CREATE TABLE CarbonOffsets (id INT,project_name VARCHAR(50),country VARCHAR(50),co2_reduction INT,year INT); INSERT INTO CarbonOffsets (id,project_name,country,co2_reduction,year) VALUES (2,'Reef Renewal','Australia',6000,2021); | SELECT c.project_name, g.name FROM CarbonOffsets c INNER JOIN GreenBuildings g ON c.country = g.country WHERE c.country = 'Australia'; |
What is the average cost of climate change mitigation projects in Europe? | CREATE TABLE MitigationProjects (Id INT,Name VARCHAR(50),Cost DECIMAL(10,2),Location VARCHAR(20)); | SELECT AVG(Cost) FROM MitigationProjects WHERE Location = 'Europe'; |
Update the revenue by 10% for the 'Mobile' service in the 'Urban' region in Q1 of 2023. | CREATE TABLE Subscribers (subscriber_id INT,service VARCHAR(20),region VARCHAR(20),revenue FLOAT,payment_date DATE); INSERT INTO Subscribers (subscriber_id,service,region,revenue,payment_date) VALUES (1,'Broadband','Metro',50.00,'2023-01-01'),(2,'Mobile','Urban',35.00,'2023-01-15'),(3,'Mobile','Rural',20.00,'2023-01-31... | UPDATE Subscribers SET revenue = revenue * 1.10 WHERE service = 'Mobile' AND region = 'Urban' AND QUARTER(payment_date) = 1 AND YEAR(payment_date) = 2023; |
What is the percentage of female content creators in the Pacific region? | CREATE TABLE content_creators (id INT,gender VARCHAR,region VARCHAR); INSERT INTO content_creators (id,gender,region) VALUES (1,'Female','Pacific'); INSERT INTO content_creators (id,gender,region) VALUES (2,'Male','Atlantic'); | SELECT region, gender, COUNT(*) as count, ROUND(COUNT(*) * 100.0 / (SELECT COUNT(*) FROM content_creators WHERE region = 'Pacific'), 2) as percentage FROM content_creators WHERE region = 'Pacific' GROUP BY region, gender; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.