id stringlengths 20 20 | title stringclasses 1
value | text stringlengths 40 1.84k |
|---|---|---|
04f8e7488804e2ac06c1 | CREATE TABLE artists (id INT, name TEXT); INSERT INTO artists (id, name) VALUES (1, 'Artist 1'); CREATE TABLE artworks (id INT, title TEXT, artist_id INT); INSERT INTO artworks (id, title, artist_id) VALUES (1, 'Artwork 1', 1), (2, 'Artwork 2', 1);
DELETE a, ar FROM artworks a INNER JOIN artists ar ON a.artist_id = ar.... | |
04f96cd12382560acde2 | CREATE TABLE mental_health_providers (id INT, name VARCHAR(50), state VARCHAR(50), cultural_competency_score DECIMAL(3,2)); INSERT INTO mental_health_providers (id, name, state, cultural_competency_score) VALUES (1, 'Dr. Sarah Johnson', 'California', 4.75), (2, 'Dr. Michael Davis', 'Texas', 4.50), (3, 'Dr. Emily Garcia... | |
04fa5334df24b7722e06 | CREATE TABLE if not exists nonprofit_events (event_id serial PRIMARY KEY, name text, description text, location text, start_date date, end_date date, organizer_id integer REFERENCES nonprofit_organizers(organizer_id));
CREATE TABLE nonprofit_events (event_id serial PRIMARY KEY, name text, description text, location tex... | |
04fe0d7b696145af00e6 | CREATE TABLE Designers (DesignerID INT, DesignerName VARCHAR(50), YearsOfExperience INT); CREATE TABLE Games (GameID INT, GameName VARCHAR(50), Genre VARCHAR(20), DesignerID INT); CREATE TABLE GamePlayer (PlayerID INT, GameID INT); CREATE TABLE Players (PlayerID INT, Age INT, Gender VARCHAR(10)); CREATE TABLE VR_Games ... | |
04ff52eaa7f733571ecc | CREATE TABLE disease_prevalence (disease_id INT, name VARCHAR(50), location VARCHAR(20), prevalence INT); INSERT INTO disease_prevalence (disease_id, name, location, prevalence) VALUES (1, 'Diabetes', 'Rural Mississippi', 1200); INSERT INTO disease_prevalence (disease_id, name, location, prevalence) VALUES (2, 'Heart D... | |
050463ec2a13404480df | CREATE TABLE water_usage (id INT PRIMARY KEY, region VARCHAR(20), usage FLOAT); CREATE TABLE conservation_initiatives (id INT PRIMARY KEY, region VARCHAR(20), initiative TEXT);
CREATE VIEW conservation_efforts AS SELECT water_usage.region, water_usage.usage, conservation_initiatives.initiative FROM water_usage INNER JO... | |
05087b7619e51e8eb0d4 | CREATE TABLE fish_habitats (id INT, fish_id INT, habitat_type VARCHAR(20), temperature DECIMAL(5,2)); INSERT INTO fish_habitats (id, fish_id, habitat_type, temperature) VALUES (1, 1, 'tropical', 28.3); INSERT INTO fish_habitats (id, fish_id, habitat_type, temperature) VALUES (2, 2, 'temperate', 15.5);
SELECT habitat_ty... | |
050a1f32e9015a0a8489 | CREATE TABLE patient_diagnosis (patient_id INT, age INT, condition VARCHAR(255), country VARCHAR(255)); INSERT INTO patient_diagnosis (patient_id, age, condition, country) VALUES (1, 25, 'Anxiety', 'Germany'); INSERT INTO patient_diagnosis (patient_id, age, condition, country) VALUES (2, 30, 'Depression', 'Germany');
S... | |
050a7c3ba12180a9453e | CREATE TABLE login_attempts (attempt_id INT, attempt_date DATE, user_account VARCHAR(100), source_ip VARCHAR(50));
SELECT * FROM login_attempts WHERE attempt_result = 'unsuccessful' ORDER BY attempt_date DESC LIMIT 10; | |
050dd28c9d69c4bfce24 | CREATE TABLE books (id INT, title TEXT, genre TEXT);
SELECT DISTINCT genre FROM books WHERE genre != 'children'; | |
050df3c44cc3d9e0e448 | CREATE TABLE PublicTransitUsers (id INT, city VARCHAR(50), age INT, usage INT); INSERT INTO PublicTransitUsers (id, city, age, usage) VALUES (1, 'Chicago', 35, 25); INSERT INTO PublicTransitUsers (id, city, age, usage) VALUES (2, 'Chicago', 42, 32);
SELECT SUM(usage) AS total_users, AVG(age) AS avg_age FROM PublicTrans... | |
051376776d4538588303 | CREATE TABLE sales (sale_id INT, menu_item_id INT, sale_amount DECIMAL(10, 2), sale_date DATE); INSERT INTO sales VALUES (1, 1, 50.00, '2022-03-01'), (2, 2, 75.00, '2022-03-02'), (3, 3, 60.00, '2022-03-03'), (4, 1, 100.00, '2022-03-04'); CREATE TABLE menu_items (menu_item_id INT, menu_item_name VARCHAR(255), category V... | |
0514d839f0a40ff7f407 | CREATE TABLE companies (id INT, name TEXT, industry TEXT, founders TEXT, funding FLOAT); INSERT INTO companies (id, name, industry, founders, funding) VALUES (1, 'BioLab', 'Biotech', 'Latinx', 5000000.0);
SELECT SUM(funding) FROM companies WHERE founders = 'Latinx' AND industry = 'Biotech'; | |
051785b9468a434fffdd | CREATE TABLE phishing_attacks (id INT, ip_address VARCHAR(255), date DATE);
SELECT COUNT(*) FROM phishing_attacks WHERE ip_address = '192.168.1.1' AND date >= DATE_SUB(CURRENT_DATE, INTERVAL 1 MONTH); | |
05186601b651da4d948a | CREATE TABLE BrandSatisfaction(brand VARCHAR(255), satisfaction_score DECIMAL(3,2));
SELECT brand, satisfaction_score FROM BrandSatisfaction; | |
051ade2bb5f9db8c0fa1 | CREATE TABLE Artifacts (ArtifactName VARCHAR(50), SiteName VARCHAR(50), AnalysisResult VARCHAR(50)); INSERT INTO Artifacts (ArtifactName, SiteName, AnalysisResult) VALUES ('ArtifactC1', 'Site13', 'ResultC1'), ('ArtifactC2', 'Site14', 'ResultC2'), ('ArtifactD1', 'Site15', 'ResultD1');
SELECT ArtifactName, AnalysisResult... | |
051ec108a8cbe65be4f0 | CREATE TABLE Vessels (ID INT, Name VARCHAR(255), SafetyScore INT, Arrival DATETIME);
INSERT INTO Vessels (Name, SafetyScore, Arrival) SELECT 'Arctic Explorer', 95, '2022-02-25' FROM (SELECT 1) AS Sub WHERE NOT EXISTS (SELECT 1 FROM Vessels WHERE Name = 'Arctic Explorer'); | |
051ecd29e686c56d4a95 | CREATE TABLE investment_rounds (startup_id INT PRIMARY KEY, round_type VARCHAR(255), funding_amount FLOAT);
SELECT AVG(funding_amount) FROM investment_rounds WHERE round_type = 'seed'; | |
05233104f34559240d35 | CREATE TABLE rehab_release (animal_id INT, release_date DATE); INSERT INTO rehab_release (animal_id, release_date) VALUES (1, '2021-07-20'), (2, '2021-07-25'), (3, '2021-07-31'), (4, '2021-08-03');
SELECT COUNT(*) FROM rehab_release WHERE release_date BETWEEN '2021-07-25' AND '2021-07-31'; | |
0525bf6c3acc4813e179 | CREATE TABLE hotel_revenue (hotel_id INT, name TEXT, city TEXT, country TEXT, daily_revenue DECIMAL(5,2)); INSERT INTO hotel_revenue (hotel_id, name, city, country, daily_revenue) VALUES (4, 'The Ritz London', 'London', 'UK', 500);
SELECT SUM(daily_revenue) FROM hotel_revenue WHERE city = 'London'; | |
0525dd33f1dd7b4955cc | CREATE TABLE unsold_garments (id INT, garment_type VARCHAR(20), color VARCHAR(20), quantity INT); CREATE TABLE sales (id INT, garment_type VARCHAR(20), color VARCHAR(20), price DECIMAL(10, 2), quantity INT);
SELECT SUM(sales.price * sales.quantity) AS total_revenue FROM unsold_garments INNER JOIN sales ON unsold_garmen... | |
0528764a2dddb296d919 | CREATE TABLE volunteers (id INT, name TEXT, region TEXT, volunteer_date DATE);
INSERT INTO volunteers (id, name, region, volunteer_date) VALUES (1, 'Pablo Rodriguez', 'Southeast', '2022-02-14'); | |
0528aa420bcf98ddd198 | CREATE TABLE player_demographics (player_id INT, age INT, favorite_genre VARCHAR(20)); INSERT INTO player_demographics (player_id, age, favorite_genre) VALUES (1, 25, 'Action'), (2, 30, 'RPG'), (3, 22, 'FPS'), (4, 35, 'Simulation');
SELECT COUNT(*) FROM player_demographics WHERE favorite_genre = 'FPS'; | |
052ae95fc1894d47f80b | CREATE TABLE company (id INT, name TEXT, founding_year INT, founder_race TEXT); INSERT INTO company (id, name, founding_year, founder_race) VALUES (1, 'EbonyTech', 2012, 'Black or African American'); INSERT INTO company (id, name, founding_year, founder_race) VALUES (2, 'Beta', 2015, 'White');
SELECT MAX(funding_amount... | |
052c33ca88f7fb8f6f77 | CREATE TABLE financial_capability_programs (id INT PRIMARY KEY, program_name TEXT, launch_date DATE, country TEXT);
SELECT country, COUNT(*) FROM financial_capability_programs WHERE launch_date BETWEEN '2022-01-01' AND '2022-03-31' GROUP BY country; | |
052c6f195b0635df7283 | CREATE TABLE tickets_2 (team TEXT, quantity INTEGER, sport TEXT); INSERT INTO tickets_2 (team, quantity, sport) VALUES ('Broncos', 20000, 'Football'), ('Lakers', 15000, 'Basketball'), ('Dodgers', 30000, 'Baseball');
SELECT sport, SUM(quantity) FROM tickets_2 GROUP BY sport; | |
052dc47889ae683abebd | CREATE TABLE city_feedback (city VARCHAR(255), feedback_id INT, feedback TEXT, response_time INT); INSERT INTO city_feedback
SELECT AVG(response_time) FROM city_feedback WHERE city = 'City F' | |
052f6d8121ffe7776ed6 | CREATE TABLE tv_shows (id INT, title VARCHAR(100), viewership_count INT); INSERT INTO tv_shows (id, title, viewership_count) VALUES (1, 'The Mandalorian', 8000000); INSERT INTO tv_shows (id, title, viewership_count) VALUES (2, 'The Crown', 10000000);
UPDATE tv_shows SET viewership_count = 12000000 WHERE title = 'The Cr... | |
052fb10dc291d9601ba1 | CREATE TABLE renewable_energy_projects (id INT, state VARCHAR(20), completion_year INT); INSERT INTO renewable_energy_projects (id, state, completion_year) VALUES (1, 'Texas', 2017), (2, 'Texas', 2020);
SELECT COUNT(*) FROM renewable_energy_projects WHERE state = 'Texas' AND completion_year > 2018; | |
053046bd25ab3a517e71 | CREATE TABLE ExcavationSites (SiteID INT, SiteName TEXT, Country TEXT); INSERT INTO ExcavationSites (SiteID, SiteName, Country) VALUES (1, 'MayanRuins', 'Guatemala'), (3, 'Pompeii', 'Italy'); CREATE TABLE Artifacts (ArtifactID INT, SiteID INT, ArtifactName TEXT, ArtifactType TEXT, Quantity INT); INSERT INTO Artifacts (... | |
0531450adaba15d66e6a | CREATE TABLE bridges (id INT PRIMARY KEY, bridge_name VARCHAR(255), year_built INT, region VARCHAR(255), last_maintenance_date DATE); INSERT INTO bridges (id, bridge_name, year_built, region, last_maintenance_date) VALUES (1, 'Bridge A', 1965, 'Midwest', '2022-01-01'); INSERT INTO bridges (id, bridge_name, year_built, ... | |
0532ef66c8bc0b670691 | CREATE TABLE DispensarySales (dispensary_id INT, strain VARCHAR(20), quantity INT); INSERT INTO DispensarySales (dispensary_id, strain, quantity) VALUES (1, 'Sour Diesel', 50), (1, 'Blue Dream', 75), (2, 'Green Crack', 60), (2, 'Jack Herer', 80); CREATE TABLE OregonDispensaries (dispensary_id INT, location VARCHAR(20))... | |
05349475c4958f97fd1b | CREATE TABLE playtime (user_id INT, game_id INT, playtime_hours DECIMAL(3,2), region VARCHAR(10)); INSERT INTO playtime (user_id, game_id, playtime_hours, region) VALUES (1, 1, 15.2, 'asia'), (2, 2, 12.5, 'america'), (3, 1, 20.0, 'asia');
SELECT SUM(playtime_hours) FROM playtime WHERE game_id = 1 AND region = 'asia'; | |
053521b98d1dbc6593a1 | CREATE TABLE military_spending (country VARCHAR(50), continent VARCHAR(50), year INT, amount FLOAT); INSERT INTO military_spending (country, continent, year, amount) VALUES ('Nigeria', 'Africa', 2020, 2.5), ('Algeria', 'Africa', 2020, 10.3), ('South Africa', 'Africa', 2020, 6.7);
SELECT SUM(amount) FROM military_spendi... | |
053617498043a1d5b839 | CREATE TABLE Roads (name TEXT, number TEXT, state TEXT);
SELECT state, COUNT(*) FROM Roads WHERE number LIKE 'I-%' GROUP BY state; | |
053772471404596bca83 | CREATE TABLE regulatory_frameworks (asset_id INT PRIMARY KEY, country TEXT, status TEXT); INSERT INTO regulatory_frameworks (asset_id, country, status) VALUES (3, 'United States', 'Under Review');
SELECT status FROM regulatory_frameworks WHERE asset_id = 3 AND country = 'United States'; | |
05380704300ef29c957a | CREATE TABLE recycling_programs (city varchar(255), start_year int, end_year int, program_name varchar(255)); INSERT INTO recycling_programs (city, start_year, end_year, program_name) VALUES ('Denver', 2015, 2017, 'Composting Pilot'), ('Denver', 2018, 2020, 'Glass Recycling'), ('Denver', 2019, 2022, 'Plastic Film Recyc... | |
053b70c5997bca4affce | CREATE TABLE donors (id INT, name TEXT);CREATE TABLE donations (id INT, donor_id INT, amount DECIMAL, donation_date DATE);
SELECT COUNT(DISTINCT donors.id) as active_donors FROM donors JOIN (SELECT donor_id, YEAR(donation_date) as donation_year FROM donations GROUP BY donor_id, donation_year) as donation_summary ON don... | |
053d1c58911de4d99ed0 | CREATE TABLE labor_unions (id INT, union_name VARCHAR(50), members INT); CREATE TABLE employees (id INT, union_id INT, name VARCHAR(50), position VARCHAR(50));
SELECT e.name, e.position, l.union_name FROM employees e JOIN labor_unions l ON e.union_id = l.id WHERE l.union_name LIKE 'F%'; | |
053db49945f3d6521c65 | CREATE TABLE companies (id INT, name TEXT, founded_date DATE, founder_race TEXT); INSERT INTO companies (id, name, founded_date, founder_race) VALUES (1, 'Acme Inc', '2010-01-01', 'white'); INSERT INTO companies (id, name, founded_date, founder_race) VALUES (2, 'Beta Corp', '2015-05-15', 'asian'); INSERT INTO companies... | |
05404c19831b897ac04d | CREATE TABLE volunteers (volunteer_id INT, volunteer_name TEXT, program_name TEXT, volunteer_start_date DATE); INSERT INTO volunteers (volunteer_id, volunteer_name, program_name, volunteer_start_date) VALUES (1, 'Jacques Leclerc', 'Health Check', '2022-04-01');
SELECT 100.0 * COUNT(*) / (SELECT COUNT(*) FROM volunteers... | |
0543bb4b3a7c4f79d3d5 | CREATE TABLE vulnerabilities_by_actor (id INT, actor VARCHAR(50), vuln_count INT); INSERT INTO vulnerabilities_by_actor (id, actor, vuln_count) VALUES (1, 'APT28', 200), (2, 'APT33', 150), (3, 'Lazarus', 100);
SELECT actor, SUM(vuln_count) as total_vulnerabilities FROM vulnerabilities_by_actor GROUP BY actor; | |
0543f3daa460f9d4e33e | CREATE TABLE military_equipment (equipment_type VARCHAR(255), quantity INT);
SELECT equipment_type, SUM(quantity) FROM military_equipment WHERE equipment_type != 'Aircraft' GROUP BY equipment_type; | |
05449ecf0f666a0a1b14 | CREATE TABLE hospital_equipment (hospital_id INT, region VARCHAR(10), num_of_equipment INT); INSERT INTO hospital_equipment (hospital_id, region, num_of_equipment) VALUES (1, 'Africa', 15), (2, 'Europe', 25), (3, 'Africa', 20), (4, 'Asia', 22);
SELECT AVG(num_of_equipment) FROM hospital_equipment WHERE region = 'Africa... | |
0544c7ea480c7a69383e | CREATE TABLE wastewater_treatment_india(id INT, city VARCHAR(50), treatment_type VARCHAR(50), capacity INT, efficiency FLOAT); INSERT INTO wastewater_treatment_india(id, city, treatment_type, capacity, efficiency) VALUES (1, 'Mumbai', 'Screening', 1200, 0.92);
SELECT city, SUM(capacity) as total_capacity FROM wastewate... | |
05473bf84ada3816ea31 | CREATE TABLE Artifacts (ArtifactID INT, SiteID INT, ArtifactType TEXT, Date DATE); INSERT INTO Artifacts (ArtifactID, SiteID, ArtifactType, Date) VALUES (1, 3, 'Pottery', '1950-01-01'), (2, 3, 'Bronze Sword', '1950-01-02'), (3, 1, 'Glassware', '1900-01-01');
SELECT ArtifactID, ArtifactType, Date FROM Artifacts WHERE Si... | |
05486a38624212e42271 | CREATE TABLE space_missions (id INT, mission_name VARCHAR(50), country VARCHAR(50), launch_date DATE); INSERT INTO space_missions (id, mission_name, country, launch_date) VALUES (1, 'Mission 1', 'USA', '2018-01-01'); INSERT INTO space_missions (id, mission_name, country, launch_date) VALUES (2, 'Mission 2', 'China', '2... | |
054fa052bb32cccdddaa | CREATE TABLE MilitaryTechnology (Id INT PRIMARY KEY, Country VARCHAR(50), Name VARCHAR(50), Year INT);
SELECT MilitaryTechnology.Name FROM MilitaryTechnology INNER JOIN (SELECT Country FROM CountryCybersecurity WHERE SuccessRate > 0.8 GROUP BY Country) AS C ON MilitaryTechnology.Country = C.Country; | |
054fc77e3e0acb9778de | CREATE TABLE climate_mitigation (project_name VARCHAR(255), region VARCHAR(255), start_date DATE, end_date DATE); INSERT INTO climate_mitigation (project_name, region, start_date, end_date) VALUES ('Tree Planting', 'Europe', '2021-01-01', '2023-12-31'); INSERT INTO climate_mitigation (project_name, region, start_date, ... | |
05536d3fe09fab8bb4bd | CREATE TABLE IF NOT EXISTS cargo (id INT PRIMARY KEY, vessel_name VARCHAR(255), average_speed DECIMAL(5,2)); CREATE TABLE IF NOT EXISTS vessel_safety (id INT PRIMARY KEY, vessel_name VARCHAR(255), safety_inspection_date DATE); INSERT INTO cargo (id, vessel_name, average_speed) VALUES (1, 'Poseidon', 26.3), (2, 'Oceanus... | |
0553d9941f99d6fa01c3 | diversity(id, startup_id, gender_diversity, ethnic_diversity)
INSERT INTO diversity (id, startup_id, gender_diversity, ethnic_diversity) VALUES (3, 2, 0.7, 0.3); | |
0553da6b5d61d4dcad82 | CREATE TABLE green_vehicles (make VARCHAR(50), model VARCHAR(50), year INT, horsepower DECIMAL(5,1));
SELECT SUM(horsepower) FROM green_vehicles WHERE make = 'Tesla' OR make = 'Rivian'; | |
05560d5ef65a77711958 | CREATE TABLE fares (fare_id INT, fare_date DATE, fare DECIMAL); INSERT INTO fares VALUES (1, '2022-01-01', 2.5); INSERT INTO fares VALUES (2, '2022-01-01', 2.5); INSERT INTO fares VALUES (3, '2022-01-02', 3.0); INSERT INTO fares VALUES (4, '2022-01-02', 3.0); INSERT INTO fares VALUES (5, '2022-01-02', 3.0);
SELECT DATE... | |
055da8a88b4a0ea732a8 | CREATE TABLE produce (id INT, name VARCHAR(255), qty_sold INT); INSERT INTO produce (id, name, qty_sold) VALUES (1, 'Organic Milk', 600), (2, 'Seasonal Vegetables', 700), (3, 'Whole Grain Bread', 800); CREATE TABLE date (id INT, date DATE); INSERT INTO date (id, date) VALUES (1, '2022-03-14'), (2, '2022-03-15'), (3, '2... | |
05621ebbd7aa2f6c0a27 | CREATE TABLE artist_exhibitions (id INT, artist_id INT, city VARCHAR(20)); INSERT INTO artist_exhibitions (id, artist_id, city) VALUES (1, 1, 'New York'), (2, 2, 'Los Angeles'), (3, 3, 'Los Angeles'), (4, 1, 'Los Angeles');
SELECT artist_id FROM artist_exhibitions WHERE city IN ('New York', 'Los Angeles') GROUP BY arti... | |
056242098e215a4df6d6 | CREATE TABLE excavation_sites (site_id INT, site_name VARCHAR(255)); CREATE TABLE artifacts (artifact_id INT, site_id INT, artifact_type VARCHAR(255)); INSERT INTO excavation_sites (site_id, site_name) VALUES (1, 'site_a'), (2, 'site_b'), (3, 'site_c'), (4, 'site_d'), (5, 'site_e'); INSERT INTO artifacts (artifact_id, ... | |
0562479ea553b76189e6 | CREATE TABLE hospitals (id INT, name TEXT, location TEXT, beds INT, rural BOOLEAN); INSERT INTO hospitals (id, name, location, beds, rural) VALUES (1, 'Hospital A', 'Delaware', 180, true), (2, 'Hospital B', 'Delaware', 220, true);
SELECT AVG(beds) FROM hospitals WHERE location = 'Delaware' AND rural = true AND beds > 1... | |
0564f24dcd023655f5b9 | CREATE TABLE businesses (business_id INT, business_name TEXT, country TEXT); CREATE TABLE sustainable_tourism (business_id INT, initiative_type TEXT); INSERT INTO businesses (business_id, business_name, country) VALUES (1, 'Ramen Shop', 'Japan'), (2, 'Art Gallery', 'Japan'), (3, 'Brewery', 'USA'); INSERT INTO sustainab... | |
056aa6ec9e50de09745b | CREATE TABLE inventory (id INT, product TEXT, category TEXT, is_organic BOOLEAN, country TEXT); INSERT INTO inventory (id, product, category, is_organic, country) VALUES (1, 'Apples', 'Produce', true, 'Germany'); INSERT INTO inventory (id, product, category, is_organic, country) VALUES (2, 'Bananas', 'Produce', false, ... | |
056c5c394c8d2fa6ea93 | CREATE TABLE Research_Papers (title TEXT, year INT, domain TEXT, technique TEXT); INSERT INTO Research_Papers VALUES ('Explainable AI Research', 2019, 'Safety', 'Decision Trees'), ('Explainable AI Research', 2019, 'Safety', 'Rule-based Systems');
SELECT DISTINCT technique FROM Research_Papers WHERE domain = 'Safety' AN... | |
056e896c8d0b017b5b96 | CREATE TABLE chemicals (id INT, name VARCHAR(255), category VARCHAR(255), production_yield FLOAT, region VARCHAR(255));
SELECT category, AVG(production_yield) as avg_yield FROM chemicals WHERE region = 'Europe' GROUP BY category; | |
056e9e5c5e9688cb016d | CREATE TABLE marine_species_biomass (species TEXT, biomass FLOAT, location TEXT); INSERT INTO marine_species_biomass (species, biomass, location) VALUES ('Krill', 0.5, 'Southern Ocean'); INSERT INTO marine_species_biomass (species, biomass, location) VALUES ('Blue Whale', 200.0, 'Southern Ocean');
SELECT SUM(biomass) F... | |
056f2ac5df34e153b892 | CREATE TABLE FarmingSystems (FarmingSystemID INT, FarmingSystemName VARCHAR(50), AvgSurvivalRate DECIMAL(5,2)); INSERT INTO FarmingSystems VALUES (1, 'Pond Systems', 75.5), (2, 'Cage Systems', 85.3), (3, 'Recirculating Systems', 92.0);
SELECT FarmingSystemName, AvgSurvivalRate FROM FarmingSystems; | |
05723db5f37d26f1643f | CREATE TABLE FoodAssistance (id INT, person_name VARCHAR(50), person_age INT, country VARCHAR(50), assistance_date DATE); INSERT INTO FoodAssistance (id, person_name, person_age, country, assistance_date) VALUES (1, 'John Doe', 25, 'Yemen', '2021-05-02');
SELECT COUNT(DISTINCT FoodAssistance.person_name) AS total_peopl... | |
05739bfe46def171f468 | CREATE TABLE store_sales_3(id INT, store VARCHAR(255), product VARCHAR(255), revenue FLOAT, date DATE); INSERT INTO store_sales_3(id, store, product, revenue, date) VALUES (1, 'San Francisco Flagship', 'Organic Apples', 800.00, '2022-04-01');
SELECT store, SUM(revenue) as total_revenue FROM store_sales_3 WHERE product ... | |
0574e3bffca7fb979bc4 | CREATE TABLE marine_life (id INT, species VARCHAR(255), population INT, region VARCHAR(255)); INSERT INTO marine_life (id, species, population, region) VALUES (1, 'Salmon', 15000, 'pacific_ocean'); INSERT INTO marine_life (id, species, population, region) VALUES (2, 'Lionfish', 1200, 'atlantic_ocean'); INSERT INTO mari... | |
0575da582e1ba7933534 | CREATE TABLE restaurant_revenue(restaurant_id INT, food_safety_rating INT, revenue DECIMAL(10,2), revenue_date DATE);
SELECT SUM(revenue) FROM restaurant_revenue WHERE food_safety_rating IN (4, 5) AND city = 'New York' AND revenue_date BETWEEN '2022-06-01' AND '2022-06-30'; | |
0576cccfebd07cfcd102 | CREATE TABLE customers (customer_id INT, customer_name TEXT, country TEXT); CREATE TABLE orders (order_id INT, customer_id INT, order_value DECIMAL); INSERT INTO customers (customer_id, customer_name, country) VALUES (1, 'Jane Smith', 'Canada'), (2, 'John Doe', 'Asia'), (3, 'Mike Johnson', 'USA'), (4, 'Sara Lee', 'Asia... | |
05794332f5376f9c14b4 | CREATE TABLE clients (client_id INT, name VARCHAR(50), investment FLOAT); CREATE TABLE fund_investments (client_id INT, fund_name VARCHAR(50), investment FLOAT);
SELECT COUNT(DISTINCT clients.client_id) FROM clients INNER JOIN fund_investments ON clients.client_id = fund_investments.client_id WHERE clients.investment >... | |
0579e3ab2814c3344b3f | CREATE TABLE steps (id INT, user_id INT, daily_step_count INT, step_date DATE); INSERT INTO steps (id, user_id, daily_step_count, step_date) VALUES (1, 1, 8000, '2022-03-01'), (2, 2, 9000, '2022-03-15');
SELECT user_id FROM (SELECT user_id, daily_step_count, LAG(daily_step_count, 1) OVER (PARTITION BY user_id ORDER BY ... | |
057a56869e840d826000 | CREATE TABLE Company (id INT, name VARCHAR(50), HQ VARCHAR(50), diversity_score FLOAT); CREATE TABLE Investment (id INT, company_id INT, investor VARCHAR(50), investment_amount FLOAT, investment_date DATE); INSERT INTO Company (id, name, HQ, diversity_score) VALUES (4, 'Delta Inc', 'USA', 65.8); INSERT INTO Investment ... | |
057ce1b58be8829ea609 | CREATE TABLE songs (id INT, title TEXT, length FLOAT, genre TEXT); INSERT INTO songs (id, title, length, genre) VALUES (1, 'Song1', 245.6, 'Pop'), (2, 'Song2', 189.3, 'Rock'), (3, 'Song3', 215.9, 'Pop'), (4, 'Song4', 150.2, 'Hip Hop'), (5, 'Song5', 120.0, 'Hip Hop');
SELECT SUM(length) FROM songs WHERE genre = 'Hip Hop... | |
057d7f7c80e006fab4cf | CREATE TABLE VolunteerMonth (VolunteerMonthID INT, VolunteerDate DATE, VolunteerHours DECIMAL); INSERT INTO VolunteerMonth (VolunteerMonthID, VolunteerDate, VolunteerHours) VALUES (1, '2022-01-01', 200), (2, '2022-02-05', 250), (3, '2022-03-10', 300);
SELECT DATE_TRUNC('month', VolunteerDate) as Month, COUNT(*) as Volu... | |
057f8fff9a5e5ef5debc | CREATE TABLE oil_production (production_id INT PRIMARY KEY, company_name VARCHAR(255), year INT, yearly_production BIGINT);
UPDATE oil_production SET yearly_production = 1000000 WHERE company_name = 'Green Oil Inc.'; | |
05880e5c4a277aff6994 | CREATE TABLE games (id INT, sport VARCHAR(50), date DATE, team VARCHAR(50), fans INT); INSERT INTO games (id, sport, date, team, fans) VALUES (1, 'NBA', '2017-01-01', 'Bulls', 20000); INSERT INTO games (id, sport, date, team, fans) VALUES (2, 'NBA', '2018-01-01', 'Celtics', 22000);
SELECT COUNT(*) FROM games WHERE spor... | |
0588fa8c6a2dddf7eee2 | CREATE TABLE water_consumption (mine_id INT, date DATE, water_consumption INT); INSERT INTO water_consumption (mine_id, date, water_consumption) VALUES (1, '2022-07-10', 50000); INSERT INTO water_consumption (mine_id, date, water_consumption) VALUES (2, '2022-12-05', 80000);
SELECT mine_id, water_consumption FROM (SELE... | |
0589132e7364bc3a6a72 | CREATE TABLE workplaces (id INT, name TEXT, state TEXT); INSERT INTO workplaces (id, name, state) VALUES (1, 'LMN Company', 'Texas');
SELECT COUNT(*) FROM workplaces WHERE state = 'Texas'; | |
058991034d24e58d735c | CREATE TABLE companies (id INT, sector VARCHAR(20)); INSERT INTO companies (id, sector) VALUES (1, 'technology'), (2, 'finance'), (3, 'technology'), (4, 'healthcare'), (5, 'finance'), (6, 'renewable_energy');
SELECT sector, COUNT(*) FROM companies GROUP BY sector HAVING COUNT(*) > 3; | |
058ab982a5362c8c1b29 | CREATE TABLE art_galleries (name TEXT, founding_year INTEGER); INSERT INTO art_galleries (name, founding_year) VALUES ('Uffizi Gallery', 1581), ('Louvre Museum', 1793), ('Prado Museum', 1819);
SELECT name, founding_year FROM art_galleries WHERE founding_year < 1900; | |
058c23999683e81882b8 | CREATE TABLE deep_sea_dives (id INT, dive_name TEXT, max_depth INT); INSERT INTO deep_sea_dives (id, dive_name, max_depth) VALUES (1, 'The Mariana Trench dive', 10994); INSERT INTO deep_sea_dives (id, dive_name, max_depth) VALUES (2, 'The Challenger Deep dive', 10972);
SELECT MAX(max_depth) FROM deep_sea_dives; | |
058c7a1c141933dbbd9c | CREATE TABLE rooms (room_id INT, hotel_id INT, price INT); INSERT INTO rooms (room_id, hotel_id, price) VALUES (1, 1, 100);
UPDATE rooms SET price = 120 WHERE hotel_id = 1; | |
058ef71aa1575e6e5a26 | CREATE TABLE cargo ( id INT PRIMARY KEY, container_id INT, location VARCHAR(255), container_type VARCHAR(255) ); INSERT INTO cargo (id, container_id, location, container_type) VALUES (1, 101, 'Port A', 'reefer'), (2, 102, 'Port B', 'dry'), (3, 103, 'Port C', 'reefer');
SELECT c.container_id, c.location, c.container_typ... | |
058f9b2fb3ceb6431cdf | CREATE TABLE basketball_players (player_id INT, player_name VARCHAR(50), team_id INT, position VARCHAR(10), wellbeing_score DECIMAL(3,2)); CREATE TABLE basketball_wellbeing_programs (program_id INT, player_id INT, program_date DATE);
SELECT bp.position, AVG(bp.wellbeing_score) as avg_wellbeing_score FROM basketball_pla... | |
0591e01ab50791c7f6c0 | CREATE TABLE CityData (resident_id INT, age INT, gender VARCHAR(10));
SELECT * FROM CityData; | |
05930c6693b008982652 | CREATE TABLE ocean_properties (location VARCHAR(255), dissolved_oxygen FLOAT); INSERT INTO ocean_properties (location, dissolved_oxygen) VALUES ('Arctic Ocean', 5.6), ('Antarctic Ocean', 6.2);
SELECT MIN(dissolved_oxygen) FROM ocean_properties WHERE location = 'Arctic Ocean'; | |
05964b48f44d999cd32b | CREATE TABLE ResearchFunding (id INT, research_type VARCHAR(50), location VARCHAR(50), funding DECIMAL(10, 2)); INSERT INTO ResearchFunding (id, research_type, location, funding) VALUES (1, 'Astrophysics', 'North America', 5000000.00), (2, 'Particle Physics', 'Europe', 4000000.00);
SELECT AVG(funding) FROM ResearchFund... | |
0597c0d37950f098092d | CREATE TABLE space_missions (mission_id INT, name VARCHAR(100), launch_date DATE, launching_agency VARCHAR(50)); INSERT INTO space_missions (mission_id, name, launch_date, launching_agency) VALUES (1, 'Luna 1', '1959-01-02', 'ISA');
SELECT name, launch_date FROM space_missions WHERE launching_agency = 'ISA'; | |
0598ebf31ef53cc046f6 | CREATE TABLE VehicleSafetyTotal (VehicleID INT, SafetyRating INT, ShowName TEXT);
SELECT SUM(SafetyRating) FROM VehicleSafetyTotal WHERE ShowName = 'Paris Auto Show'; | |
05992b8c4369b5f9f6ec | CREATE TABLE ProgramDonations (DonationID INT, ProgramName VARCHAR(50), DonationAmount DECIMAL(10, 2), DonationDate DATE);
SELECT ProgramName, SUM(DonationAmount) AS TotalDonations, AVG(DonationAmount) AS AvgDonation FROM ProgramDonations GROUP BY ProgramName; | |
059b67fdd9ab1babb2ac | CREATE TABLE Donors (DonorID INT, DonorName TEXT, DonationAmount DECIMAL(10,2), Cause TEXT);
SELECT Cause, AVG(DonationAmount) as AvgDonationPerDonor FROM Donors GROUP BY Cause; | |
059c59e6b9eacabe0a1b | CREATE TABLE offenders (offender_id INT, offender_age INT, offender_gender VARCHAR(10), offense_date DATE); INSERT INTO offenders (offender_id, offender_age, offender_gender, offense_date) VALUES (1, 32, 'Male', '2018-01-01'), (2, 28, 'Female', '2019-01-01'), (3, 45, 'Male', '2020-01-01');
SELECT offender_age, COUNT(*)... | |
059d16b574315a2c07ef | CREATE TABLE attorney_time_tracking (attorney TEXT, billable_hours DECIMAL(5,2)); INSERT INTO attorney_time_tracking (attorney, billable_hours) VALUES ('Smith', 10.00), ('Johnson', 12.00), ('Williams', 15.00), ('Brown', 20.00); CREATE TABLE attorney_cases (attorney TEXT, cases INT); INSERT INTO attorney_cases (attorney... | |
059d697aae48f256407a | CREATE TABLE software (id INT, name VARCHAR(255)); INSERT INTO software (id, name) VALUES (1, 'Product A'), (2, 'Product B'), (3, 'Product C'); CREATE TABLE vulnerabilities (id INT, software_id INT, severity VARCHAR(255)); INSERT INTO vulnerabilities (id, software_id, severity) VALUES (1, 1, 'High'), (2, 1, 'Medium'), ... | |
059fcf6face865fdba52 | CREATE TABLE financial_wellbeing_na (id INT, customer_id INT, country VARCHAR(255), score INT); INSERT INTO financial_wellbeing_na (id, customer_id, country, score) VALUES (1, 5001, 'United States', 70), (2, 5002, 'Canada', 80), (3, 5003, 'Mexico', 65);
SELECT MIN(score) FROM financial_wellbeing_na WHERE country IN ('U... | |
05a4aee84936d002fa10 | CREATE TABLE Donors (DonorID INT, DonorName TEXT, DonationAmount INT, Cause TEXT); INSERT INTO Donors (DonorID, DonorName, DonationAmount, Cause) VALUES (1, 'John Doe', 5000, 'Environment'), (2, 'Jane Smith', 7000, 'Health'), (3, 'Bob Johnson', 3000, 'Environment'), (4, 'Alice Williams', 8000, 'Education'), (5, 'Richar... | |
05a4e697fbf5cef56960 | CREATE TABLE carbon_sequestration (id INT, country VARCHAR(255), year INT, sequestration FLOAT, hectares FLOAT); INSERT INTO carbon_sequestration (id, country, year, sequestration, hectares) VALUES (1, 'Canada', 2018, 1000.2, 12000000.5), (2, 'Australia', 2019, 1100.1, 15000000.3), (3, 'Brazil', 2018, 1300.0, 20000000.... | |
05a5ffc91ee4da32ea70 | CREATE TABLE wellbeing_programs (athlete_id INT, sport VARCHAR(50), program_date DATE); INSERT INTO wellbeing_programs (athlete_id, sport, program_date) VALUES (1, 'Soccer', '2022-01-01'), (2, 'Basketball', '2022-01-02'), (3, 'Football', '2022-01-03'), (4, 'Soccer', '2022-01-04'), (5, 'Baseball', '2022-01-05');
SELECT ... | |
05acfb9a70ff20fd122f | CREATE TABLE bike_stations (station_id INT, station_name VARCHAR(255), city VARCHAR(255));
SELECT COUNT(*) FROM bike_stations WHERE city = 'Madrid'; | |
05af63fd7874565e6d63 | CREATE TABLE diversity_metrics (id INT, company_id INT, female_founders INT, minority_founders INT, underrepresented_founders INT); INSERT INTO diversity_metrics (id, company_id, female_founders, minority_founders, underrepresented_founders) VALUES (1, 1, 1, 0, 0), (2, 2, 0, 1, 0), (3, 3, 0, 0, 1);
SELECT MIN(funding_r... | |
05b5dfb16e8ba33e7270 | CREATE TABLE Resource_Depletion(Mine_Name TEXT, Reserves_Copper INT, Reserves_Gold INT); INSERT INTO Resource_Depletion(Mine_Name, Reserves_Copper, Reserves_Gold) VALUES('Tasiast', 2500000, 15000); INSERT INTO Resource_Depletion(Mine_Name, Reserves_Copper, Reserves_Gold) VALUES('Katanga', 3500000, 20000);
SELECT Mine_N... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.