instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
What is the sum of Second, when Total is less than 70, when Premier is less than 20, and when First is greater than 18? | CREATE TABLE table_name_1 (second INTEGER,first VARCHAR,total VARCHAR,premier VARCHAR) | SELECT SUM(second) FROM table_name_1 WHERE total < 70 AND premier < 20 AND first > 18 |
What's the smallest area in Russia that is ranked 23 with a population more than 522,800? | CREATE TABLE table_70380 ("Rank" real,"Subdivision name" text,"Country" text,"Area (km\u00b2)" real,"Population" real) | SELECT MIN("Area (km\u00b2)") FROM table_70380 WHERE "Country" = 'russia' AND "Rank" = '23' AND "Population" > '522,800' |
What was the score of the game when the Blue Jays were 55-39? | CREATE TABLE table_68465 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text) | SELECT "Score" FROM table_68465 WHERE "Record" = '55-39' |
How many times is the position lb and the overall is less than 46? | CREATE TABLE table_47902 ("Round" real,"Pick" real,"Overall" real,"Name" text,"Position" text,"College" text) | SELECT COUNT("Pick") FROM table_47902 WHERE "Position" = 'lb' AND "Overall" < '46' |
Who drove the Chevrolet with the Eagle chassis? | CREATE TABLE table_4607 ("Team" text,"Chassis" text,"Engine" text,"Tires" text,"Drivers" text) | SELECT "Drivers" FROM table_4607 WHERE "Engine" = 'chevrolet' AND "Chassis" = 'eagle' |
Can you tell me the Annual change that has the Location of manaus? | CREATE TABLE table_name_48 (annual_change VARCHAR,location VARCHAR) | SELECT annual_change FROM table_name_48 WHERE location = "manaus" |
How many Dates have an Opponent of romford raiders, and a Result of won 7-3, and an Attendance larger than 1,769? | CREATE TABLE table_name_24 (date VARCHAR,attendance VARCHAR,opponent VARCHAR,result VARCHAR) | SELECT COUNT(date) FROM table_name_24 WHERE opponent = "romford raiders" AND result = "won 7-3" AND attendance > 1 OFFSET 769 |
Who was the home team on the May 2 game? | CREATE TABLE table_name_30 (home VARCHAR,date VARCHAR) | SELECT home FROM table_name_30 WHERE date = "may 2" |
What is the number of airlines based in Russia? | CREATE TABLE routes (rid number,dst_apid number,dst_ap text,src_apid number,src_ap text,alid number,airline text,codeshare text)CREATE TABLE airlines (alid number,name text,iata text,icao text,callsign text,country text,active text)CREATE TABLE airports (apid number,name text,city text,country text,x number,y number,el... | SELECT COUNT(*) FROM airlines WHERE country = 'Russia' |
What is the score for set 2 when the time is 18:00 and the score of set 1 is 18 25? | CREATE TABLE table_49825 ("Date" text,"Time" text,"Score" text,"Set 1" text,"Set 2" text,"Set 3" text,"Total" text) | SELECT "Set 2" FROM table_49825 WHERE "Time" = '18:00' AND "Set 1" = '18–25' |
what is the number of patients whose drug code is metl25? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)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 tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "METL25" |
Who is the male talent in 1991? | CREATE TABLE table_name_39 (talent__male_ VARCHAR,year VARCHAR) | SELECT talent__male_ FROM table_name_39 WHERE year = 1991 |
Which division has an average home attendance of 2.459? | CREATE TABLE table_1816947_2 (division___section VARCHAR,average_attendance_home VARCHAR) | SELECT division___section FROM table_1816947_2 WHERE average_attendance_home = "2.459" |
How many faculty members do we have for each gender? Draw a bar chart. | CREATE TABLE Activity (actid INTEGER,activity_name varchar(25))CREATE TABLE Faculty_Participates_in (FacID INTEGER,actid INTEGER)CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1),Major INTEGER,Advisor INTEGER,city_code VARCHAR(3))CREATE TABLE Participates_in (stuid INTEG... | SELECT Sex, COUNT(*) FROM Faculty GROUP BY Sex |
what are the details of the cmi masters that have the cross reference code 'Tax', and count them by a bar chart, and rank by the y-axis in desc. | CREATE TABLE Electoral_Register (electoral_register_id INTEGER,cmi_cross_ref_id INTEGER)CREATE TABLE Rent_Arrears (council_tax_id INTEGER,cmi_cross_ref_id INTEGER)CREATE TABLE Council_Tax (council_tax_id INTEGER,cmi_cross_ref_id INTEGER)CREATE TABLE Customer_Master_Index (master_customer_id INTEGER,cmi_details VARCHAR(... | SELECT cmi_details, COUNT(cmi_details) FROM Customer_Master_Index AS T1 JOIN CMI_Cross_References AS T2 ON T1.master_customer_id = T2.master_customer_id WHERE T2.source_system_code = 'Tax' GROUP BY cmi_details ORDER BY COUNT(cmi_details) DESC |
Which Overall is the highest one that has a Name of raleigh mckenzie, and a Pick larger than 10? | CREATE TABLE table_name_31 (overall INTEGER,name VARCHAR,pick VARCHAR) | SELECT MAX(overall) FROM table_name_31 WHERE name = "raleigh mckenzie" AND pick > 10 |
what character did dave ward play | CREATE TABLE table_38211 ("Character Name" text,"Voice Actor (Japanese)" text,"Voice Actor (English 1997 / Saban)" text,"Voice Actor (English 1998 / Pioneer)" text,"Voice Actor (English 2006 / FUNimation)" text) | SELECT "Voice Actor (English 1998 / Pioneer)" FROM table_38211 WHERE "Voice Actor (English 1997 / Saban)" = 'dave ward' |
Show id, first and last names for all customers with at least two cards. | CREATE TABLE Customers_cards (customer_id VARCHAR)CREATE TABLE Customers (customer_first_name VARCHAR,customer_last_name VARCHAR,customer_id VARCHAR) | SELECT T1.customer_id, T2.customer_first_name, T2.customer_last_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) >= 2 |
how many years before was the film bacchae out before the watermelon ? | CREATE TABLE table_204_323 (id number,"year" number,"film" text,"function" text,"notes" text) | SELECT ABS((SELECT "year" FROM table_204_323 WHERE "film" = 'the watermelon') - (SELECT "year" FROM table_204_323 WHERE "film" = 'the bacchae')) |
Name the number of title for number in series being 25 | CREATE TABLE table_25810656_3 (title VARCHAR,no_in_series VARCHAR) | SELECT COUNT(title) FROM table_25810656_3 WHERE no_in_series = 25 |
What is the rank when there is 0 gold, the total is more than 1, and silver is more than 0? | CREATE TABLE table_79455 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT MAX("Rank") FROM table_79455 WHERE "Gold" = '0' AND "Total" > '1' AND "Silver" > '0' |
what's the total number of title for production code 39 | CREATE TABLE table_12226390_3 (title VARCHAR,production_code VARCHAR) | SELECT COUNT(title) FROM table_12226390_3 WHERE production_code = 39 |
What is the year when sigourney weaver was nominated for best actress? | CREATE TABLE table_name_26 (year__ceremony_ VARCHAR,category VARCHAR,actor_actress VARCHAR) | SELECT year__ceremony_ FROM table_name_26 WHERE category = "best actress" AND actor_actress = "sigourney weaver" |
give me the number of patients whose age is less than 61 and lab test category is hematology? | 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 text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "61" AND lab."CATEGORY" = "Hematology" |
What was the score of the Away team when the score of the Home team was 13.14 (92)? | CREATE TABLE table_55017 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Away team score" FROM table_55017 WHERE "Home team score" = '13.14 (92)' |
What is the sum of Points when the against is less than 24 and played is less than 20? | CREATE TABLE table_7552 ("Position" real,"Team" text,"Points" real,"Played" real,"Drawn" real,"Lost" real,"Against" real,"Difference" text) | SELECT SUM("Points") FROM table_7552 WHERE "Against" < '24' AND "Played" < '20' |
What is the 1985 value for the year when GDP as of 2012 after PPP was 369.38? | CREATE TABLE table_31522 ("Economy" text,"1980" real,"Gap from Thailand as of 1980 (times)" text,"1985" real,"1990" real,"1995" real,"2000" real,"2005" real,"2010" real,"2012" real,"Gap from Thailand as of 2012 (times)" text,"GDP as of 2012 after purchasing power parity (PPP) calculations (USD billions)" text,"GDP per ... | SELECT "1985" FROM table_31522 WHERE "GDP as of 2012 after purchasing power parity (PPP) calculations (USD billions)" = '369.38' |
Amritpur has what constituency number? | CREATE TABLE table_62518 ("Constituency number" text,"Name" text,"Reserved for (SC / ST /None)" text,"District" text,"Number of electorates (2009)" real) | SELECT "Constituency number" FROM table_62518 WHERE "Name" = 'amritpur' |
How many districts does john j. douglass represent? | CREATE TABLE table_18696 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT COUNT("District") FROM table_18696 WHERE "Incumbent" = 'John J. Douglass' |
what race did Dominican win with a distance of 1-1/16 miles? | CREATE TABLE table_58026 ("Date" text,"Track" text,"Race" text,"Distance" text,"Surface track" text,"Winning horse" text,"Winning jockey" text) | SELECT "Race" FROM table_58026 WHERE "Winning horse" = 'dominican' AND "Distance" = '1-1/16 miles' |
Who played against away team hereford united? | CREATE TABLE table_61483 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text) | SELECT "Home team" FROM table_61483 WHERE "Away team" = 'hereford united' |
Who is the January playmate with the November playmate Donna Edmondson? | CREATE TABLE table_69254 ("January" text,"February" text,"March" text,"April" text,"June" text,"July" text,"August" text,"September" text,"October" text,"November" text,"December" text) | SELECT "January" FROM table_69254 WHERE "November" = 'donna edmondson' |
what is age and days of hospital stay of subject id 9575? | CREATE TABLE procedures (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_fla... | SELECT demographic.age, demographic.days_stay FROM demographic WHERE demographic.subject_id = "9575" |
What nation has a sport of weightlifting and a pinyin of k k q nd o? | CREATE TABLE table_name_24 (nation VARCHAR,sport VARCHAR,pinyin VARCHAR) | SELECT nation FROM table_name_24 WHERE sport = "weightlifting" AND pinyin = "kùkè qúndǎo" |
What was fitzroy's score at home? | CREATE TABLE table_11167 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Home team score" FROM table_11167 WHERE "Home team" = 'fitzroy' |
how many patients admitted to trsf within this facility had a pleural fluid test? | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND lab.fluid = "Pleural" |
Who performed all the high rebounds when craig smith (4) was the lead for high assists? | CREATE TABLE table_21244 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "High rebounds" FROM table_21244 WHERE "High assists" = 'Craig Smith (4)' |
In what bowl game was the result Oklahoma 31, Stanford 27? | CREATE TABLE table_26294 ("Bowl Game" text,"Date" text,"Stadium" text,"City" text,"Television" text,"Matchup/Results" text,"Attendance" real,"Payout (US$)" text) | SELECT "Bowl Game" FROM table_26294 WHERE "Matchup/Results" = 'Oklahoma 31, Stanford 27' |
What is the total number of Wins, when Losses is less than 10, when Against is less than 1253, and when Byes is less than 0? | CREATE TABLE table_12645 ("South West DFL" text,"Wins" real,"Byes" real,"Losses" real,"Draws" real,"Against" real) | SELECT COUNT("Wins") FROM table_12645 WHERE "Losses" < '10' AND "Against" < '1253' AND "Byes" < '0' |
Bar chart x axis acc road y axis total number of school id, I want to rank in asc by the x axis. | CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Perce... | SELECT ACC_Road, SUM(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road |
what are the different card types, and how many transactions have been made with each?, and sort Y-axis in asc order please. | CREATE TABLE Financial_Transactions (transaction_id INTEGER,previous_transaction_id INTEGER,account_id INTEGER,card_id INTEGER,transaction_type VARCHAR(15),transaction_date DATETIME,transaction_amount DOUBLE,transaction_comment VARCHAR(255),other_transaction_details VARCHAR(255))CREATE TABLE Customers (customer_id INTE... | SELECT card_type_code, COUNT(*) FROM Financial_Transactions AS T1 JOIN Customers_Cards AS T2 ON T1.card_id = T2.card_id GROUP BY T2.card_type_code ORDER BY COUNT(*) |
how many points against with tries for being 43 | CREATE TABLE table_13758945_3 (points_against VARCHAR,tries_for VARCHAR) | SELECT COUNT(points_against) FROM table_13758945_3 WHERE tries_for = "43" |
How large was the crowd when they played at princes park? | CREATE TABLE table_32275 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT SUM("Crowd") FROM table_32275 WHERE "Venue" = 'princes park' |
tell me the number of times they competed in guatamala . | CREATE TABLE table_204_760 (id number,"year" number,"competition" text,"venue" text,"position" text,"event" text,"notes" text) | SELECT COUNT(*) FROM table_204_760 WHERE "venue" = 'guatemala' |
What is the Nation with less than 1 silver, and the total is 1, and bronze is less than 0? | CREATE TABLE table_41458 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT "Nation" FROM table_41458 WHERE "Silver" < '1' AND "Total" = '1' AND "Bronze" = '0' |
What is the lowest amount of gold a team with less than 2 total medals, ranked 17, and more than 0 silver medals, has? | CREATE TABLE table_name_62 (gold INTEGER,silver VARCHAR,total VARCHAR,rank VARCHAR) | SELECT MIN(gold) FROM table_name_62 WHERE total < 2 AND rank = 17 AND silver > 0 |
calculate the minimum age of male widow patients. | 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 procedures (subject_id text,hadm_id text,icd9_code text,sho... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.gender = "M" |
What is the score on May 18? | CREATE TABLE table_name_75 (score VARCHAR,date VARCHAR) | SELECT score FROM table_name_75 WHERE date = "may 18" |
What was the date for Colorado? | CREATE TABLE table_name_92 (date VARCHAR,state VARCHAR) | SELECT date FROM table_name_92 WHERE state = "colorado" |
WHAT ARE THE RACES FOR 2010 WITH FLAPS LARGER THAN 6? | CREATE TABLE table_name_27 (races INTEGER,season VARCHAR,flaps VARCHAR) | SELECT MAX(races) FROM table_name_27 WHERE season = "2010" AND flaps > 6 |
what is the number of patients whose discharge location is snf and diagnoses short title is chr kidney dis stage iv? | 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 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 ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "SNF" AND diagnoses.short_title = "Chr kidney dis stage IV" |
Review task counts on a typical day. | CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserI... | SELECT COUNT(*) / 31 FROM ReviewTaskResults WHERE CreationDate >= '2019-01-01' AND CreationDate < ('2019-02-01') |
Percentile of users with location. | CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,LastEditorUserId number,LastEditorDisplayName text,LastEditDate t... | SELECT (SELECT COUNT(Id) FROM Users WHERE NOT Location IS NULL) * 100.0 / (SELECT COUNT(Id) FROM Users) |
Which Bask has an Indoor track of 0, and a Swimming of 5? | CREATE TABLE table_name_73 (bask INTEGER,indoor_track VARCHAR,swimming VARCHAR) | SELECT MIN(bask) FROM table_name_73 WHERE indoor_track = "0" AND swimming = "5" |
When did a Venue of Antigua Recreation Ground happen? | CREATE TABLE table_80200 ("Date" text,"Home captain" text,"Away captain" text,"Venue" text,"Result" text) | SELECT "Date" FROM table_80200 WHERE "Venue" = 'antigua recreation ground' |
What surface was the November 5, 1995 match played on? | CREATE TABLE table_5604 ("Date" text,"Tournament" text,"Surface" text,"Opponent in the Final" text,"Score" text) | SELECT "Surface" FROM table_5604 WHERE "Date" = 'november 5, 1995' |
count the number of patients whose diagnoses icd9 code is 80624 and drug route is inhalation? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "80624" AND prescriptions.route = "INHALATION" |
who are the participants that wear clothing in 33-23-36 | CREATE TABLE table_27515452_3 (contestant VARCHAR,sizes VARCHAR) | SELECT contestant FROM table_27515452_3 WHERE sizes = "33-23-36" |
A line chart for finding the number of the order dates of the orders with price above 1000. | CREATE TABLE Performers_in_Bookings (Order_ID INTEGER,Performer_ID INTEGER)CREATE TABLE Services (Service_ID INTEGER,Service_Type_Code CHAR(15),Workshop_Group_ID INTEGER,Product_Description VARCHAR(255),Product_Name VARCHAR(255),Product_Price DECIMAL(20,4),Other_Product_Service_Details VARCHAR(255))CREATE TABLE Ref_Ser... | SELECT Order_Date, COUNT(Order_Date) FROM Customer_Orders AS T1 JOIN Order_Items AS T2 ON T1.Order_ID = T2.Order_ID JOIN Products AS T3 ON T2.Product_ID = T3.Product_ID WHERE T3.Product_Price > 1000 |
What was Tom Weiskopf's Finish? | CREATE TABLE table_name_54 (finish VARCHAR,player VARCHAR) | SELECT finish FROM table_name_54 WHERE player = "tom weiskopf" |
Which Player has United States as Nationality, forward as Position and a greater than 5 Round? | CREATE TABLE table_name_7 (player VARCHAR,round VARCHAR,nationality VARCHAR,position VARCHAR) | SELECT player FROM table_name_7 WHERE nationality = "united states" AND position = "forward" AND round > 5 |
How many faculty members do we have for each rank? Render a bar chart. | CREATE TABLE Faculty (FacID INTEGER,Lname VARCHAR(15),Fname VARCHAR(15),Rank VARCHAR(15),Sex VARCHAR(1),Phone INTEGER,Room VARCHAR(5),Building VARCHAR(13))CREATE TABLE Participates_in (stuid INTEGER,actid INTEGER)CREATE TABLE Faculty_Participates_in (FacID INTEGER,actid INTEGER)CREATE TABLE Activity (actid INTEGER,acti... | SELECT Rank, COUNT(Rank) FROM Faculty GROUP BY Rank |
How many teachers does the student named CHRISSY NABOZNY have? | CREATE TABLE teachers (classroom VARCHAR)CREATE TABLE list (classroom VARCHAR,firstname VARCHAR,lastname VARCHAR) | SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = "CHRISSY" AND T1.lastname = "NABOZNY" |
Which Ofsted has a Capacity of 1677? | CREATE TABLE table_76733 ("School" text,"Locality" text,"Ages" text,"Capacity" real,"Ofsted" real) | SELECT "Ofsted" FROM table_76733 WHERE "Capacity" = '1677' |
Name the country with pol k | CREATE TABLE table_55747 ("Name" text,"Country" text,"Type" text,"Moving from" text,"Transfer window" text,"Transfer fee" text) | SELECT "Country" FROM table_55747 WHERE "Name" = 'polák' |
What is the age of the celebrity who had a 402 aggregate? | CREATE TABLE table_25931938_1 (age INTEGER,aggregate VARCHAR) | SELECT MAX(age) FROM table_25931938_1 WHERE aggregate = 402 |
tell me the percentile of mcv 90.0 among all patients of the same age as patient 17944 in the last hospital visit? | CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)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 patients (row_id number,subject... | SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'mcv') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age = (SE... |
What is the record for game where Columbus is visitor, Phoenix is home, and decision is made by Denis? | CREATE TABLE table_67271 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Decision" text,"Attendance" real,"Record" text) | SELECT "Record" FROM table_67271 WHERE "Visitor" = 'columbus' AND "Decision" = 'denis' AND "Home" = 'phoenix' |
What place is Scott McCarron in? | CREATE TABLE table_name_4 (place VARCHAR,player VARCHAR) | SELECT place FROM table_name_4 WHERE player = "scott mccarron" |
When using a .375 Remington Ultra Magnum, what is the muzzle velocity? | CREATE TABLE table_16010376_1 (muzzle_velocity VARCHAR,cartridge VARCHAR) | SELECT muzzle_velocity FROM table_16010376_1 WHERE cartridge = ".375 Remington Ultra Magnum" |
Name the country for 22 events | CREATE TABLE table_1963 ("#" real,"Player" text,"Country" text,"Points" real,"Events" real,"Reset Points" real) | SELECT "Country" FROM table_1963 WHERE "Events" = '22' |
has patient 030-34260 been diagnosed with s/p knee surgery - replacement when they visited the hospital first time. | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,tempe... | SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-34260' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.ho... |
what's patient 030-52327's minimum value of fio2 on their current hospital encounter? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid ... | SELECT MIN(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-52327' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'fio2' |
what was the number of wins for the 201213 austin peay state governors basketball team ? | CREATE TABLE table_204_436 (id number,"date" text,"time" text,"opponent" text,"site" text,"tv" text,"result" text,"attendance" number,"record" text) | SELECT COUNT(*) FROM table_204_436 WHERE "result" = 'w' |
Who won the bronze when the Asian Games were in Doha? | CREATE TABLE table_name_70 (bronze VARCHAR,location VARCHAR) | SELECT bronze FROM table_name_70 WHERE location = "doha" |
what's the model name with engine code being b5204 t5 | CREATE TABLE table_16821 ("Model name" text,"Power (ps)" real,"Torque (Nm@rpm)" text,"Displacement (cm\u00b3)" real,"Engine code" text,"Comment" text) | SELECT "Model name" FROM table_16821 WHERE "Engine code" = 'B5204 T5' |
Do they offer a class about Molecular and Genomic Evolution ? | CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE course_tags_count (course_id int,clear_grading int,pop_quiz int,group_projects int,inspirational int,long_lectures int,extra_credit int,few_tests int,good_feedback int,tough_tests int,heavy_papers int,cares_for_students int,heavy_assi... | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Molecular and Genomic Evolution%' OR name LIKE '%Molecular and Genomic Evolution%') AND department = 'EECS' |
What is the title when 18.58 u.s. viewers (millions) watched? | CREATE TABLE table_18217741_1 (title VARCHAR,us_viewers__millions_ VARCHAR) | SELECT title FROM table_18217741_1 WHERE us_viewers__millions_ = "18.58" |
What is the name of the bo-bodh train with a number less than 5? | CREATE TABLE table_52736 ("Number" real,"Name" text,"Builder" text,"Type" text,"Date" real) | SELECT "Name" FROM table_52736 WHERE "Number" < '5' AND "Type" = 'bo-bodh' |
calculate the number of patients with chest pain - r/o pericardial disease diagnosed until 2 years ago. | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labres... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'chest pain - r/o pericardial disease' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-2 year')) |
How many bookings does each booking status have? List the booking status code and the number of corresponding bookings with a bar chart, and show names in asc order. | CREATE TABLE Apartment_Facilities (apt_id INTEGER,facility_code CHAR(15))CREATE TABLE Apartment_Bookings (apt_booking_id INTEGER,apt_id INTEGER,guest_id INTEGER,booking_status_code CHAR(15),booking_start_date DATETIME,booking_end_date DATETIME)CREATE TABLE Guests (guest_id INTEGER,gender_code CHAR(1),guest_first_name V... | SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code ORDER BY booking_status_code |
When the position in 2012-12 is 7th, third division what is the home ground? | CREATE TABLE table_name_24 (home_ground VARCHAR,position_in_2012_13 VARCHAR) | SELECT home_ground FROM table_name_24 WHERE position_in_2012_13 = "7th, third division" |
What is the Venue of the 2002 World Cup Qualification? | CREATE TABLE table_12282 ("Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text) | SELECT "Venue" FROM table_12282 WHERE "Competition" = '2002 world cup qualification' |
Name the sum of time for lane of 1 and rank less than 8 | CREATE TABLE table_name_17 (time INTEGER,lane VARCHAR,rank VARCHAR) | SELECT SUM(time) FROM table_name_17 WHERE lane = 1 AND rank < 8 |
What country had a film in 1993? | CREATE TABLE table_name_31 (country VARCHAR,year VARCHAR) | SELECT country FROM table_name_31 WHERE year = 1993 |
what is the score when the country is united states and the player is george fazio? | CREATE TABLE table_name_4 (score VARCHAR,country VARCHAR,player VARCHAR) | SELECT score FROM table_name_4 WHERE country = "united states" AND player = "george fazio" |
provide the number of female patients who have drug code azit500i. | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "F" AND prescriptions.formulary_drug_cd = "AZIT500I" |
what is primary disease and drug name of subject name wilbur braatz? | 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.diagnosis, prescriptions.drug FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Wilbur Braatz" |
What player is in the place of t1 and has the score of 67-70=137? | CREATE TABLE table_50633 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Player" FROM table_50633 WHERE "Place" = 't1' AND "Score" = '67-70=137' |
how many painters received a color mark below 10 ? | CREATE TABLE table_203_186 (id number,"painter" text,"composition" number,"drawing" number,"color" number,"expression" number) | SELECT COUNT("painter") FROM table_203_186 WHERE "color" < 10 |
User ranking for questions only, simple - no check for CW or rep cap. | CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,UpVotes number,DownVotes number,ProfileImageUrl text,EmailHash text,AccountId number)CREATE T... | SELECT p.OwnerUserId AS "user_link", COUNT(DISTINCT p.Id) AS "total_questions", SUM(CASE WHEN VoteTypeId = 2 THEN 5 WHEN VoteTypeId = 3 THEN -2 END) + (SELECT COUNT(*) FROM Posts AS acc WHERE acc.OwnerUserId = p.OwnerUserId AND NOT AcceptedAnswerId IS NULL) * 2 AS "total_reputation" FROM Posts AS p INNER JOIN Votes AS ... |
For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of job_id and the average of department_id , and group by attribute job_id, and display in desc by the bar. | CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE ... | SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID DESC |
What is the FCC info for the radio station in West Lafayette, Indiana? | CREATE TABLE table_name_35 (fcc_info VARCHAR,state VARCHAR,city_of_license VARCHAR) | SELECT fcc_info FROM table_name_35 WHERE state = "indiana" AND city_of_license = "west lafayette" |
On what Date was the Record 9 6 4? | CREATE TABLE table_37198 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text) | SELECT "Date" FROM table_37198 WHERE "Record" = '9–6–4' |
How many attendance figures are given for the game where the final score was lost 5-3? | CREATE TABLE table_21345 ("Date" text,"Opponent" text,"Venue" text,"Result" text,"Attendance" real,"Competition" text,"Man of the Match" text) | SELECT COUNT("Attendance") FROM table_21345 WHERE "Result" = 'Lost 5-3' |
Who is in December when November has Alexus Winston? | CREATE TABLE table_14153 ("Year" real,"September" text,"October" text,"November" text,"December" text) | SELECT "December" FROM table_14153 WHERE "November" = 'alexus winston' |
Bar graph to show the average of product price from different product category code, show names from low to high order. | CREATE TABLE Customers (customer_id INTEGER,customer_type_code VARCHAR(20),address_line_1 VARCHAR(80),address_line_2 VARCHAR(80),town_city VARCHAR(80),state VARCHAR(80),email_address VARCHAR(255),phone_number VARCHAR(80))CREATE TABLE Products (product_id INTEGER,parent_product_id INTEGER,product_category_code VARCHAR(2... | SELECT product_category_code, AVG(product_price) FROM Products GROUP BY product_category_code ORDER BY product_category_code |
Stackoverflow Top 100 users from Banglore. | CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,LastEditorUserId number,LastEditorDisplayName text,Las... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%kolkata%' ORDER BY Reputation DESC LIMIT 100 |
what is the number of people served by the rolla station ? | CREATE TABLE table_204_863 (id number,"state" text,"city/county" text,"population served" number,"charter type" text,"station name" text,"web site" text) | SELECT "population served" FROM table_204_863 WHERE "city/county" = 'rolla' |
What is the number of lost games when 2 were drawn, and there were 6 bonus points? | CREATE TABLE table_name_55 (lost VARCHAR,drawn VARCHAR,bonus_points VARCHAR) | SELECT lost FROM table_name_55 WHERE drawn = "2" AND bonus_points = "6" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.