instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
How many defending champs from thailand? | CREATE TABLE table_19765685_2 (defending_champion VARCHAR,country VARCHAR) | SELECT COUNT(defending_champion) FROM table_19765685_2 WHERE country = "Thailand" |
what is the difference between the number of wins pallac . reggiana reggio emilia has had and the number of wins progresso castelmaggiore has had ? | CREATE TABLE table_204_506 (id number,"seasons" number,"team" text,"ch.wins" number,"promotions" number,"relegations" number) | SELECT ABS((SELECT "ch.wins" FROM table_204_506 WHERE "team" = 'pallac. reggiana reggio emilia') - (SELECT "ch.wins" FROM table_204_506 WHERE "team" = 'progresso castelmaggiore')) |
Give me a bar chart to compare the number of departments located in different cities. | CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGER_ID decimal(6,0),DEPARTMENT_ID decimal(4,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),S... | SELECT CITY, COUNT(CITY) FROM locations GROUP BY CITY |
Compare the total number of different ranks using a bar graph. | CREATE TABLE captain (Captain_ID int,Name text,Ship_ID int,age text,Class text,Rank text)CREATE TABLE Ship (Ship_ID int,Name text,Type text,Built_Year real,Class text,Flag text) | SELECT Rank, COUNT(Rank) FROM captain GROUP BY Rank |
What is the episode number for 'case two (part 1)'? | CREATE TABLE table_24313 ("Episode" real,"Title" text,"Directed by" text,"Written by" text,"Originalairdate" text,"Viewing Figures (millions) Sourced by BARB ; includes ITV1 HD and ITV1 +1" text) | SELECT "Episode" FROM table_24313 WHERE "Title" = 'Case Two (Part 1)' |
Which Electorate is from vic, a labor party, and is David Charles a member of? | CREATE TABLE table_67392 ("Member" text,"Party" text,"Electorate" text,"State" text,"Term in office" text) | SELECT "Electorate" FROM table_67392 WHERE "State" = 'vic' AND "Party" = 'labor' AND "Member" = 'david charles' |
What is the population in those place where the market income per capita is $17,362? | CREATE TABLE table_2706 ("County" text,"Population" real,"Unemployment Rate" text,"Market Income Per Capita" text,"Poverty Rate" text,"Status" text) | SELECT "Population" FROM table_2706 WHERE "Market Income Per Capita" = '$17,362' |
Bar chart x axis position y axis how many position, display from low to high by the the number of position. | CREATE TABLE club (Club_ID int,name text,Region text,Start_year text)CREATE TABLE player (Player_ID int,name text,Position text,Club_ID int,Apps real,Tries real,Goals text,Points real)CREATE TABLE competition (Competition_ID int,Year real,Competition_type text,Country text)CREATE TABLE club_rank (Rank real,Club_ID int,... | SELECT Position, COUNT(Position) FROM player GROUP BY Position HAVING AVG(Points) >= 20 ORDER BY COUNT(Position) |
Who was the home team that played against Armthorpe Welfare? | CREATE TABLE table_name_51 (home_team VARCHAR,away_team VARCHAR) | SELECT home_team FROM table_name_51 WHERE away_team = "armthorpe welfare" |
what is the maximum cost in a hospital involving a laboratory test for cpk-mb index since 5 years ago? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,ob... | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'cpk-mb index')) AND DATETIME(cost.chargetime) >= DATETIME(CURRENT_TI... |
What is the place of the player with a 71-69-66=206 score? | CREATE TABLE table_60183 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Place" FROM table_60183 WHERE "Score" = '71-69-66=206' |
what is the marital status of patient 10855 on their current hospital visit. | CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE icus... | SELECT admissions.marital_status FROM admissions WHERE admissions.subject_id = 10855 AND admissions.dischtime IS NULL |
Find the team names of the universities whose enrollments are smaller than the average enrollment size. | CREATE TABLE university (school_id number,school text,location text,founded number,affiliation text,enrollment number,nickname text,primary_conference text)CREATE TABLE basketball_match (team_id number,school_id number,team_name text,acc_regular_season text,acc_percent text,acc_home text,acc_road text,all_games text,al... | SELECT t2.team_name FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id WHERE enrollment < (SELECT AVG(enrollment) FROM university) |
what is the number of patients whose admission year is less than 2197 and drug name is tamsulosin? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2197" AND prescriptions.drug = "Tamsulosin" |
Which Away team that has a Crowd greater than 15,481, and a Home team score of 20.17 (137)? | CREATE TABLE table_58072 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Away team" FROM table_58072 WHERE "Crowd" > '15,481' AND "Home team score" = '20.17 (137)' |
get the number of patients who had biopsy of tonsil and adenoids and were admitted before 2138. | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethni... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2138" AND procedures.short_title = "Tonsil&adenoid biopsy" |
in 12/2105 has patient 006-158338's systemicdiastolic been normal? | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatment... | SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-158338')) AND vitalperiodic.systemicdiastolic BETWEEN diastolic_... |
In 2011 with a hydroelectricity less than 119.6, what was the solar? | CREATE TABLE table_48376 ("Country" text,"Year" real,"Total" real,"Hydroelectricity" real,"Wind Power" real,"Biomass and Waste" text,"Solar" real) | SELECT "Solar" FROM table_48376 WHERE "Year" = '2011' AND "Hydroelectricity" < '119.6' |
What is the gdp per capita in 2008 for the region that had a combined gross enrollment ration of 89.0? | CREATE TABLE table_25042332_33 (gdp__ppp__per_capita__2008_ INTEGER,combined_gross_enrollment_ratio__2009_ VARCHAR) | SELECT MIN(gdp__ppp__per_capita__2008_) FROM table_25042332_33 WHERE combined_gross_enrollment_ratio__2009_ = "89.0" |
Name the total number of rank for lane 7 | CREATE TABLE table_68511 ("Rank" real,"Lane" real,"Name" text,"Nationality" text,"Time" real) | SELECT COUNT("Rank") FROM table_68511 WHERE "Lane" = '7' |
What is the round when they played against Middlesbrough, and the h/a was h? | CREATE TABLE table_44286 ("Date" text,"Round" text,"Opponents" text,"H / A" text,"Result F \u2013 A" text,"Attendance" real) | SELECT "Round" FROM table_44286 WHERE "Opponents" = 'middlesbrough' AND "H / A" = 'h' |
What is the status for the monarch Mingyinyo? | CREATE TABLE table_28717 ("Monarch" text,"Heir" text,"Status" text,"Relationship to Monarch" text,"Became heir; reason" text,"Ceased to be heir; reason" text,"Next in succession" text) | SELECT "Status" FROM table_28717 WHERE "Monarch" = 'Mingyinyo' |
What is the Mascot for the team from leo that had a Previous Conference value of independent? | CREATE TABLE table_name_13 (mascot VARCHAR,previous_conference VARCHAR,location VARCHAR) | SELECT mascot FROM table_name_13 WHERE previous_conference = "independent" AND location = "leo" |
List the grape and winery of the wines whose price is bigger than 100, visualize them with a stacked bar chart, the x-axis is winery and group the grape, and y-axis is the number of wineries, and show y-axis in asc order. | CREATE TABLE appellations (No INTEGER,Appelation TEXT,County TEXT,State TEXT,Area TEXT,isAVA TEXT)CREATE TABLE wine (No INTEGER,Grape TEXT,Winery TEXT,Appelation TEXT,State TEXT,Name TEXT,Year INTEGER,Price INTEGER,Score INTEGER,Cases INTEGER,Drink TEXT)CREATE TABLE grapes (ID INTEGER,Grape TEXT,Color TEXT) | SELECT Winery, COUNT(Winery) FROM wine WHERE Price > 100 GROUP BY Grape, Winery ORDER BY COUNT(Winery) |
Please list the years of film market estimations when the market is in country 'Japan' in descending order, and count them by a bar chart | CREATE TABLE film (Film_ID int,Title text,Studio text,Director text,Gross_in_dollar int)CREATE TABLE market (Market_ID int,Country text,Number_cities int)CREATE TABLE film_market_estimation (Estimation_ID int,Low_Estimate real,High_Estimate real,Film_ID int,Type text,Market_ID int,Year int) | SELECT Year, COUNT(Year) FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T2.Country = "Japan" ORDER BY T1.Year DESC |
How many against have a status of first test? | CREATE TABLE table_name_20 (against VARCHAR,status VARCHAR) | SELECT COUNT(against) FROM table_name_20 WHERE status = "first test" |
What country was Brage, built by karljohansverns verft, from? | CREATE TABLE table_65528 ("Country" text,"Builder" text,"Location" text,"Ship" text,"Class / type" text) | SELECT "Country" FROM table_65528 WHERE "Builder" = 'karljohansverns verft' AND "Ship" = 'brage' |
What are the names and average prices of products for manufacturers whose products cost on average 150 or more. Plot them as bar chart. | CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER) | SELECT T2.Name, AVG(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name |
what flights go from CHICAGO to SEATTLE on saturday on CO | CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,time_zone_code varchar)CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_s... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SEATTLE' AND date_day.day_number = 26 AND date_day.month_number = 7 AND ... |
have patient 24921's respiratory rate's been less than 15.0 in 09/last year? | CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE d_labitems (row_id number,itemid number,label text)... | SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24921)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'respiratory rate'... |
give me the number of patients whose ethnicity is american indian/alaska native and diagnoses icd9 code is 59654? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND diagnoses.icd9_code = "59654" |
What is the least w? | CREATE TABLE table_29704430_1 (w INTEGER) | SELECT MIN(w) FROM table_29704430_1 |
The Decile of 6 has which corresponding Years? | CREATE TABLE table_name_91 (years VARCHAR,decile VARCHAR) | SELECT years FROM table_name_91 WHERE decile = "6" |
What is the date Listed of the Bridge Built in 1864? | CREATE TABLE table_49984 ("Name" text,"Built" text,"Listed" text,"Location" text,"County" text) | SELECT "Listed" FROM table_49984 WHERE "Built" = '1864' |
list the patient ids of those patients who in 2105 had been diagnosed with adv eff medicinal nec. | CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE cost (row_id numbe... | SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'adv eff medicinal nec') AND STRFTIME('%y', diagnoses_icd.charttime) = '210... |
Count the number of countries. | CREATE TABLE county_public_safety (county_id number,name text,population number,police_officers number,residents_per_officer number,case_burden number,crime_rate number,police_force text,location text)CREATE TABLE city (city_id number,county_id number,name text,white number,black number,amerindian number,asian number,m... | SELECT COUNT(*) FROM county_public_safety |
give me the number of patients whose admission year is less than 2131 and procedure short title is open biopsy soft tissue? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2131" AND procedures.short_title = "Open biopsy soft tissue" |
Number of posts vs. number of bounties. | CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE SuggestedEdits (Id number,PostId number,Creatio... | WITH bounties_cte AS (SELECT COUNT(v.BountyAmount) AS bnt, p.Id AS pid, p.ViewCount AS vc FROM Posts AS p JOIN Votes AS v ON v.PostId = p.Id WHERE v.VoteTypeId = 8 GROUP BY p.Id, p.ViewCount) SELECT bnt AS "bounties_count", COUNT(pid) FROM bounties_cte GROUP BY bnt ORDER BY bnt |
Name the langauge for switzerland | CREATE TABLE table_name_96 (language VARCHAR,country VARCHAR) | SELECT language FROM table_name_96 WHERE country = "switzerland" |
Tell me the rank for bronze less than 17 and gold less than 1 | CREATE TABLE table_name_28 (rank VARCHAR,gold VARCHAR,bronze VARCHAR,silver VARCHAR) | SELECT rank FROM table_name_28 WHERE bronze < 17 AND silver > 1 AND gold < 1 |
Find the number of teachers who teach the student called MADLOCK RAY. | CREATE TABLE teachers (lastname text,firstname text,classroom number)CREATE TABLE list (lastname text,firstname text,grade number,classroom number) | SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = "MADLOCK" AND T1.lastname = "RAY" |
did they finish in a better position in portugal or greece ? | CREATE TABLE table_203_189 (id number,"year" number,"competition" text,"venue" text,"position" text,"notes" text) | SELECT "venue" FROM table_203_189 WHERE "venue" IN ('portugal', 'greece') ORDER BY "position" LIMIT 1 |
how many hours are passed since the last time patient 70267 stayed in careunit micu during their current hospital visit? | CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outtime time)CREATE TABLE admissions (row_id number,subje... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 70267 AND admissions.dischtime IS NULL) AND transfers.careunit = 'micu' ORDER BY transfers.intime DESC LIMIT 1 |
Which opponent has a Club of essendon, and a Score of 13.4.82? | CREATE TABLE table_name_73 (opponent VARCHAR,club VARCHAR,score VARCHAR) | SELECT opponent FROM table_name_73 WHERE club = "essendon" AND score = "13.4.82" |
which teams have the most number of wins ? | CREATE TABLE table_203_309 (id number,"team" text,"winners" number,"runners-up" number,"years won" text,"years lost" text) | SELECT "team" FROM table_203_309 WHERE "winners" = (SELECT MAX("winners") FROM table_203_309) |
Which Designation has a Manufacturer of siemens, and a Quantity of 52? | CREATE TABLE table_5851 ("Designation" text,"Car numbers" text,"Manufacturer" text,"Model No." text,"First used" text,"Quantity" real) | SELECT "Designation" FROM table_5851 WHERE "Manufacturer" = 'siemens' AND "Quantity" = '52' |
what was the first tv series that gauri tejwani appeared in ? | CREATE TABLE table_203_485 (id number,"year" text,"show" text,"role" text,"notes" text) | SELECT "show" FROM table_203_485 ORDER BY "year" LIMIT 1 |
What type of 3D game did Valve Corporation release? | CREATE TABLE table_43622 ("Developer(s)" text,"Release date" text,"Required OS" text,"Genre" text,"Type" text) | SELECT "Genre" FROM table_43622 WHERE "Type" = '3d' AND "Developer(s)" = 'valve corporation' |
what is religion of subject id 6983? | CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ... | SELECT demographic.religion FROM demographic WHERE demographic.subject_id = "6983" |
A bar chart for what are the number of the name of rooms booked by customers whose first name has 'ROY' in part?, could you display from high to low by the names? | CREATE TABLE Reservations (Code INTEGER,Room TEXT,CheckIn TEXT,CheckOut TEXT,Rate REAL,LastName TEXT,FirstName TEXT,Adults INTEGER,Kids INTEGER)CREATE TABLE Rooms (RoomId TEXT,roomName TEXT,beds INTEGER,bedType TEXT,maxOccupancy INTEGER,basePrice INTEGER,decor TEXT) | SELECT roomName, COUNT(roomName) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE FirstName LIKE '%ROY%' GROUP BY roomName ORDER BY roomName DESC |
What was the average of points with ranks smaller than 7 but with total point games of 113? | CREATE TABLE table_69787 ("Rank" real,"Player" text,"Years" text,"Games" real,"PPG Avg." real,"Total Points" real) | SELECT AVG("Total Points") FROM table_69787 WHERE "Games" = '113' AND "Rank" < '7' |
what is the total number of record where streak is l2 and leading scorer is roy : 23 | CREATE TABLE table_72249 ("#" real,"Date" text,"Visitor" text,"Score" text,"Home" text,"Leading scorer" text,"Attendance" text,"Record" text,"Streak" text) | SELECT COUNT("Record") FROM table_72249 WHERE "Streak" = 'L2' AND "Leading scorer" = 'Roy : 23' |
what team lost on july 30 | CREATE TABLE table_name_23 (loss VARCHAR,date VARCHAR) | SELECT loss FROM table_name_23 WHERE date = "july 30" |
what is the next fastest after the rocket powered aircraft ? | CREATE TABLE table_203_688 (id number,"category" text,"speed\n(km/h)" number,"speed\n(mph)" number,"vehicle" text,"pilot" text,"date" text) | SELECT "category" FROM table_203_688 WHERE "speed\n(km/h)" < (SELECT "speed\n(km/h)" FROM table_203_688 WHERE "category" = 'rocket-powered aircraft') ORDER BY "speed\n(km/h)" DESC LIMIT 1 |
how many patients whose drug code is vori200? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "VORI200" |
what is the least silver when bronze is 1, rank is less than 2 and gold is more than 4? | CREATE TABLE table_name_98 (silver INTEGER,gold VARCHAR,bronze VARCHAR,rank VARCHAR) | SELECT MIN(silver) FROM table_name_98 WHERE bronze = 1 AND rank < 2 AND gold > 4 |
What was round of 64 of the singles event when the result of round 16 was did not advance and the athlete was Iveta Bene ov ? | CREATE TABLE table_21468 ("Athlete" text,"Event" text,"Round of 64" text,"Round of 32" text,"Round of 16" text,"Quarterfinals" text) | SELECT "Round of 64" FROM table_21468 WHERE "Event" = 'Singles' AND "Round of 16" = 'Did not advance' AND "Athlete" = 'Iveta Benešová' |
What is the name of the highest mountain? | CREATE TABLE mountain (Name VARCHAR,Height VARCHAR) | SELECT Name FROM mountain ORDER BY Height DESC LIMIT 1 |
What city had a score of 20 in aigburth after 1907? | CREATE TABLE table_name_76 (city VARCHAR,venue VARCHAR,year VARCHAR,score VARCHAR) | SELECT city FROM table_name_76 WHERE year > 1907 AND score > 20 AND venue = "aigburth" |
who won the women's singles in 1992? | CREATE TABLE table_68944 ("Year" text,"Men's singles" text,"Women's singles" text,"Men's doubles" text,"Women's doubles" text,"Mixed doubles" text) | SELECT "Women's singles" FROM table_68944 WHERE "Year" = '1992' |
How many people were in attendance at Hawthorn's home match? | CREATE TABLE table_57092 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT MIN("Crowd") FROM table_57092 WHERE "Home team" = 'hawthorn' |
What is the average attendance against the expos? | CREATE TABLE table_name_57 (attendance INTEGER,opponent VARCHAR) | SELECT AVG(attendance) FROM table_name_57 WHERE opponent = "expos" |
when was patient 027-203413's urinary catheter output: indwelling/continuous ure output for the last time on this month/19? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,di... | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-203413')) AND intakeoutput.cellpath LIKE '%output... |
Who is the minister with a term end on 10 March 1974? | CREATE TABLE table_name_71 (minister VARCHAR,term_end VARCHAR) | SELECT minister FROM table_name_71 WHERE term_end = "10 march 1974" |
Which standing broad jump (cm) had the b grade? | CREATE TABLE table_54931 ("Grade" text,"Points" real,"Sit-up (reps)" text,"Standing Broad Jump (cm)" text,"Chin-up (reps)" text,"Shuttle Run (sec)" text,"2.4km Run (min:sec)" text) | SELECT "Standing Broad Jump (cm)" FROM table_54931 WHERE "Grade" = 'b' |
How many people attended the Scottish Cup on 29.02.2000? | CREATE TABLE table_name_60 (attendance VARCHAR,competition VARCHAR,date VARCHAR) | SELECT attendance FROM table_name_60 WHERE competition = "scottish cup" AND date = "29.02.2000" |
what's the swimsuit where average is 8.670 | CREATE TABLE table_12094609_1 (swimsuit VARCHAR,average VARCHAR) | SELECT swimsuit FROM table_12094609_1 WHERE average = "8.670" |
What is airing at 9:30 on the channel that airs Heroes at 9:00? | CREATE TABLE table_7513 ("8:00" text,"8:30" text,"9:00" text,"9:30" text,"10:00" text) | SELECT "9:30" FROM table_7513 WHERE "9:00" = 'heroes' |
when for the first time since 05/2102 was patient 006-146580 prescribed aspirin and 2 ml vial : famotidine 10 mg/ml iv soln at the same time? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweigh... | SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'aspirin' AND patient.uniquepid = '006-146580' AND STRFTIME('%y-%m', medication.drugstarttime) >= '2102-05') AS t1 JOIN (S... |
What is the average number of stars that each reviewer awards for a movie Show bar chart, and rank in ascending by the y-axis. | CREATE TABLE Reviewer (rID int,name text)CREATE TABLE Rating (rID int,mID int,stars int,ratingDate date)CREATE TABLE Movie (mID int,title text,year int,director text) | SELECT name, AVG(T1.stars) FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T2.name ORDER BY AVG(T1.stars) |
What was the Score when the Loss was ruthven (1-4)? | CREATE TABLE table_6472 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Save" text) | SELECT "Score" FROM table_6472 WHERE "Loss" = 'ruthven (1-4)' |
For a date of 29 Sep and a time of 16:40, what is the corresponding Set 3? | CREATE TABLE table_78043 ("Date" text,"Time" text,"Score" text,"Set 1" text,"Set 2" text,"Set 3" text,"Total" text,"Report" text) | SELECT "Set 3" FROM table_78043 WHERE "Date" = '29 sep' AND "Time" = '16:40' |
What was the average Game, when the attendance was higher than 56,040? | CREATE TABLE table_15213 ("Game" real,"Date" text,"Score" text,"Location" text,"Time" text,"Attendance" real) | SELECT AVG("Game") FROM table_15213 WHERE "Attendance" > '56,040' |
Exemplo de busca de coment rios de Java. | CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE Comment... | SELECT * FROM Comments WHERE Text LIKE '%java%' |
get me the top four most common treatments during this year? | CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status ... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of ye... |
When Star Zemba was featured in Week 3, who was the cyber girl for Week 2? | CREATE TABLE table_name_11 (week_2 VARCHAR,week_3 VARCHAR) | SELECT week_2 FROM table_name_11 WHERE week_3 = "star zemba" |
What is the average Week, when Result is l 37 34? | CREATE TABLE table_name_80 (week INTEGER,result VARCHAR) | SELECT AVG(week) FROM table_name_80 WHERE result = "l 37–34" |
Who is the Host team that has a chicago bears as a visiting team? | CREATE TABLE table_name_61 (host_team VARCHAR,visiting_team VARCHAR) | SELECT host_team FROM table_name_61 WHERE visiting_team = "chicago bears" |
How much 2005 has a 2006 larger than 4,67, and a 2004 of -14,76? | CREATE TABLE table_60236 ("Commercial balance" text,"2003" real,"2004" real,"2005" real,"2006" real) | SELECT COUNT("2005") FROM table_60236 WHERE "2006" > '4,67' AND "2004" = '-14,76' |
What is the name of the Leftfielder when the Shortstop was bill russell, and the Second Baseman was steve sax in 1983? | CREATE TABLE table_name_25 (leftfielder VARCHAR,year VARCHAR,shortstop VARCHAR,second_baseman VARCHAR) | SELECT leftfielder FROM table_name_25 WHERE shortstop = "bill russell" AND second_baseman = "steve sax" AND year = 1983 |
flights from ATLANTA to WASHINGTON | CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE airport (airport_code varchar,airport_name text,airport_location text,state_code varchar,country_name varchar,time_zone_code varchar,minimum_connect_time int)CREATE TABLE flight_stop (flight_id int,stop_number int,stop_day... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHIN... |
What is the candidates result that is tom j. murray (d) unopposed? | CREATE TABLE table_1342149_42 (result VARCHAR,candidates VARCHAR) | SELECT result FROM table_1342149_42 WHERE candidates = "Tom J. Murray (D) Unopposed" |
show me flights from PITTSBURGH to PHILADELPHIA | CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum_stay int,application text,no_discounts text)CREATE TABLE flight_stop (flight_id int,stop_number int,stop_days text,stop_airport text,arrival_time int,arrival_airline text,arrival_flig... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHI... |
What was the number of Laps with a Grid of more than 3 and Time of 39:24.967? | CREATE TABLE table_38882 ("Rider" text,"Bike" text,"Laps" real,"Time" text,"Grid" real) | SELECT MIN("Laps") FROM table_38882 WHERE "Grid" > '3' AND "Time" = '39:24.967' |
Return a bar chart on what are the names and distances for all airplanes?, and could you rank by the x axis in desc? | CREATE TABLE certificate (eid number(9,0),aid number(9,0))CREATE TABLE aircraft (aid number(9,0),name varchar2(30),distance number(6,0))CREATE TABLE employee (eid number(9,0),name varchar2(30),salary number(10,2))CREATE TABLE flight (flno number(4,0),origin varchar2(20),destination varchar2(20),distance number(6,0),dep... | SELECT name, distance FROM aircraft ORDER BY name DESC |
How many different genres appear for the Jimi Hendrix Experience? | CREATE TABLE table_28749 ("Song title" text,"Artist" text,"Year Year of songs original release,as listed in Rock Band 3" real,"Genre" text,"Keyboard support" text,"Vocal parts" real,"Nintendo DS setlist" text) | SELECT COUNT("Genre") FROM table_28749 WHERE "Artist" = 'The Jimi Hendrix Experience' |
how many patients died in or before 2158 and primarily had st elevated myocardial infraction\cardiac cath? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" AND demographic.dod_year <= "2158.0" |
Who was the runner-up with the margin of victory of 8 strokes? | CREATE TABLE table_7850 ("Date" text,"Tournament" text,"Winning score" text,"Margin of victory" text,"Runner(s)-up" text) | SELECT "Runner(s)-up" FROM table_7850 WHERE "Margin of victory" = '8 strokes' |
What was St Kilda's away team score? | CREATE TABLE table_name_21 (away_team VARCHAR) | SELECT away_team AS score FROM table_name_21 WHERE away_team = "st kilda" |
What is the City 1 that has less than 8.211 million passengers and traveled 1075km in distance? | CREATE TABLE table_41107 ("Rank" real,"City 1" text,"City 2" text,"2012 Passengers (in millions)" real,"2011 Passengers (in millions)" text,"Distance" text) | SELECT "City 1" FROM table_41107 WHERE "2012 Passengers (in millions)" < '8.211' AND "Distance" = '1075km' |
Name the total number of revenue for italy with team of internazionale with operating income less than 27 | CREATE TABLE table_name_21 (revenue__ VARCHAR,operating_income__$m_ VARCHAR,country VARCHAR,team VARCHAR) | SELECT COUNT(revenue__) AS $m_ FROM table_name_21 WHERE country = "italy" AND team = "internazionale" AND operating_income__$m_ < 27 |
For artist names who are not from the United States, how many names in each year?, and I want to sort by the y axis in descending. | CREATE TABLE artist (Artist_ID int,Name text,Country text,Year_Join int,Age int)CREATE TABLE exhibition (Exhibition_ID int,Year int,Theme text,Artist_ID int,Ticket_Price real)CREATE TABLE exhibition_record (Exhibition_ID int,Date text,Attendance int) | SELECT Year_Join, COUNT(Year_Join) FROM artist WHERE Country <> 'United States' GROUP BY Name ORDER BY COUNT(Year_Join) DESC |
Who are all the Moto2 winners when the grand prix was Shell Advance Malaysian Grand Prix? | CREATE TABLE table_26781017_1 (moto2_winner VARCHAR,grand_prix VARCHAR) | SELECT moto2_winner FROM table_26781017_1 WHERE grand_prix = "Shell Advance Malaysian grand_prix" |
What is the program where the focus is risk management and regulation? | CREATE TABLE table_12591022_2 (program VARCHAR,focus VARCHAR) | SELECT program FROM table_12591022_2 WHERE focus = "Risk Management and Regulation" |
All my posts with Github Lines (convert to tagged repo). | CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,ContentLicense text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance t... | SELECT q.Id AS "post_link", a.Body FROM Posts AS q JOIN Posts AS a ON a.ParentId = q.Id WHERE a.OwnerUserId = '##UserId##' |
how many of these cars are operational ? | CREATE TABLE table_203_717 (id number,"number" number,"year built" number,"livery" text,"current status" text,"notes" text) | SELECT COUNT(*) FROM table_203_717 WHERE "current status" = 'operational' |
Name the constructor for number 10 | CREATE TABLE table_28190534_1 (constructor VARCHAR,no VARCHAR) | SELECT constructor FROM table_28190534_1 WHERE no = 10 |
What is the total number of Established for soccer plated in kuntz stadium? | CREATE TABLE table_name_65 (established VARCHAR,sport VARCHAR,venue VARCHAR) | SELECT COUNT(established) FROM table_name_65 WHERE sport = "soccer" AND venue = "kuntz stadium" |
when is the first procedure patient 52018 received in 2104? | CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value num... | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52018) AND STRFTIME('%y', procedures_icd.charttime) = '2104' ORDER BY procedures_icd.charttime LIMIT 1 |
Which capitals have an area of exactly 377930 square km? | CREATE TABLE table_19605700_1 (capital VARCHAR,area_km² VARCHAR) | SELECT capital FROM table_19605700_1 WHERE area_km² = 377930 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.