instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Show the start dates and end dates of all the apartment bookings. | CREATE TABLE Apartment_Bookings (booking_start_date VARCHAR,booking_end_date VARCHAR) | SELECT booking_start_date, booking_end_date FROM Apartment_Bookings |
have buprenorphine-naloxone (8mg-2mg) ever been prescribed to patient 18457 until 2103? | CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)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,l... | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18457) AND prescriptions.drug = 'buprenorphine-naloxone (8mg-2mg)' AND STRFTIME('%y', prescriptions.startdate) <= '2103' |
who is the semi-finalist #1 where runner-up is elon university | CREATE TABLE table_16527 ("Year" text,"Champion" text,"Score" text,"Runner-Up" text,"Location" text,"Semi-Finalist #1" text,"Semi-Finalist #2" text) | SELECT "Semi-Finalist #1" FROM table_16527 WHERE "Runner-Up" = 'Elon University' |
what is the least total when the nation is canada (can) and bronze is less than 0? | CREATE TABLE table_79608 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT MIN("Total") FROM table_79608 WHERE "Nation" = 'canada (can)' AND "Bronze" < '0' |
what is the number of patients whose marital status is married and admission year is less than 2103? | 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 text,flag text,value_unit text,label text,fluid 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 WHERE demographic.marital_status = "MARRIED" AND demographic.admityear < "2103" |
specify the name & marital status of patient id 3284 | 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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do... | SELECT demographic.name, demographic.marital_status FROM demographic WHERE demographic.subject_id = "3284" |
show me all round trip flights from NEW YORK to MIAMI nonstop | CREATE TABLE month (month_number int,month_name text)CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,fare_airline text,restriction_code text,one_direction_cost int,round_trip_cost int,round_trip_required var... | 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, fare, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MIAMI' AND NOT fare.round_trip_cost IS NULL AND flight_fare.fare_id =... |
What is the visitor team of the game with Chicago as the home team? | CREATE TABLE table_name_74 (visitor VARCHAR,home VARCHAR) | SELECT visitor FROM table_name_74 WHERE home = "chicago" |
for the first time in 11/2104, what specimen test did patient 031-9128 get? | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname... | SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-9128')) AND STRFTIME('%y-%m', microlab.culturetakentime) = '2104-1... |
What team was Sigachev on when he had 38 points? | CREATE TABLE table_27672 ("Season" real,"Series" text,"Team Name" text,"Races" real,"Wins" real,"Points" text,"Final Placing" text) | SELECT "Team Name" FROM table_27672 WHERE "Points" = '38' |
Return a scatter chart about the correlation between People_ID and Clean_Jerk . | CREATE TABLE people (People_ID int,Name text,Height real,Weight real,Birth_Date text,Birth_Place text)CREATE TABLE body_builder (Body_Builder_ID int,People_ID int,Snatch real,Clean_Jerk real,Total real) | SELECT People_ID, Clean_Jerk FROM body_builder |
How many l's are there for the skip with 3 for w? | CREATE TABLE table_3394 ("Skip (Club)" text,"W" real,"L" real,"PF" real,"PA" real,"Ends Won" real,"Ends Lost" real,"Blank Ends" real,"Stolen Ends" real) | SELECT MAX("L") FROM table_3394 WHERE "W" = '3' |
give me the number of patients whose marital status is married and procedure icd9 code is 3611? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid 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_status text,age text,dob... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "MARRIED" AND procedures.icd9_code = "3611" |
List the type of the services in alphabetical order. | CREATE TABLE services (service_type_code VARCHAR) | SELECT service_type_code FROM services ORDER BY service_type_code |
How many wins of average has cuts made less than 0? | CREATE TABLE table_63118 ("Tournament" text,"Wins" real,"Top-5" real,"Events" real,"Cuts made" real) | SELECT AVG("Wins") FROM table_63118 WHERE "Cuts made" < '0' |
Which team in 1987 had a start of 28 and drove a chrysler? | CREATE TABLE table_name_39 (team VARCHAR,start VARCHAR,year VARCHAR,manufacturer VARCHAR) | SELECT team FROM table_name_39 WHERE year < 1987 AND manufacturer = "chrysler" AND start = "28" |
What is the other name for martono ? | CREATE TABLE table_2562572_33 (cyrillic_name_other_names VARCHAR,settlement VARCHAR) | SELECT cyrillic_name_other_names FROM table_2562572_33 WHERE settlement = "Martonoš" |
What is the result for the Green-Communist party when the Left Bloc has 3.0%? | CREATE TABLE table_66276 ("Date Released" text,"Polling institute" text,"Social Democratic" text,"Socialist" text,"Green-Communist" text,"People's Party" text,"Left Bloc" text,"Lead" text) | SELECT "Green-Communist" FROM table_66276 WHERE "Left Bloc" = '3.0%' |
how many patients whose ethnicity is hispanic/latino - puerto rican and diagnoses long title is closed fracture of base of skull with subarachnoid, subdural, and extradural hemorrhage, with loss of consciousness of unspecified duration? | 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 text,flag text,value_unit text,label text,fluid 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND diagnoses.long_title = "Closed fracture of base of skull with subarachnoid, subdural, and extradural hemorrhage, with loss of ... |
Get all your questions, ordered by viewcounts.. | CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,R... | SELECT Id AS "post_link", ViewCount FROM Posts WHERE OwnerUserId = @UID AND NOT ViewCount IS NULL ORDER BY ViewCount DESC |
How many words are there in rusyn for the bulgarian word (kupuva)? | CREATE TABLE table_28136_15 (rusyn VARCHAR,bulgarian VARCHAR) | SELECT COUNT(rusyn) FROM table_28136_15 WHERE bulgarian = "купува (kupuva)" |
What are the date and venue of each debate? | CREATE TABLE debate (Date VARCHAR,Venue VARCHAR) | SELECT Date, Venue FROM debate |
What team was the away team when the tie no is 40? | CREATE TABLE table_48962 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text) | SELECT "Away team" FROM table_48962 WHERE "Tie no" = '40' |
what is the laps when the grid is less than 2? | CREATE TABLE table_55513 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT "Laps" FROM table_55513 WHERE "Grid" < '2' |
what is the diagnosis short title and long title of diagnosis icd9 code 56721? | 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 diagnoses.short_title, diagnoses.long_title FROM diagnoses WHERE diagnoses.icd9_code = "56721" |
Give me the comparison about the amount of Sex over the Sex , and group by attribute Sex by a bar chart, and show in asc by the x axis. | CREATE TABLE candidate (Candidate_ID int,People_ID int,Poll_Source text,Date text,Support_rate real,Consider_rate real,Oppose_rate real,Unsure_rate real)CREATE TABLE people (People_ID int,Sex text,Name text,Date_of_Birth text,Height real,Weight real) | SELECT Sex, COUNT(Sex) FROM people GROUP BY Sex ORDER BY Sex |
What was the score of the player from South Africa? | CREATE TABLE table_45043 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money ($)" real) | SELECT "Score" FROM table_45043 WHERE "Country" = 'south africa' |
What is the gold for a bronze larger than 1, with a total smaller than 10, and a silver of 3? | CREATE TABLE table_65545 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT "Gold" FROM table_65545 WHERE "Bronze" > '1' AND "Total" < '10' AND "Silver" = '3' |
resting blood pressure greater than or equal to 160 / 100 mm hg | CREATE TABLE table_dev_8 ("id" int,"systolic_blood_pressure_sbp" int,"heart_disease" bool,"diastolic_blood_pressure_dbp" int,"coronary_artery_disease_cad" bool,"triglyceride_tg" float,"hypertension" bool,"NOUSE" float) | SELECT * FROM table_dev_8 WHERE systolic_blood_pressure_sbp > 160 OR diastolic_blood_pressure_dbp > 100 |
What is the level name of the cheapest catalog (in USD)? | CREATE TABLE attribute_definitions (attribute_id number,attribute_name text,attribute_data_type text)CREATE TABLE catalog_contents (catalog_entry_id number,catalog_level_number number,parent_entry_id number,previous_entry_id number,next_entry_id number,catalog_entry_name text,product_stock_number text,price_in_dollars ... | SELECT t2.catalog_level_name FROM catalog_contents AS t1 JOIN catalog_structure AS t2 ON t1.catalog_level_number = t2.catalog_level_number ORDER BY t1.price_in_dollars LIMIT 1 |
Who was the worship leader that had a lead supporting vocal Marcus Temu? | CREATE TABLE table_50427 ("Track" real,"Song" text,"Author" text,"Worship Leader" text,"Lead Supporting Vocal" text,"Time" text) | SELECT "Worship Leader" FROM table_50427 WHERE "Lead Supporting Vocal" = 'marcus temu' |
what is your least expensive fare between ATLANTA and BOSTON | CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE ground_service (city_code text,airport_code text,transport_type text,ground_fare int)CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections int,departure_time int,dual_carrier text,flight_d... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare 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... |
Who is the director of the fimm Biola Tak Berdawai? | CREATE TABLE table_13719788_1 (director VARCHAR,original_title VARCHAR) | SELECT director FROM table_13719788_1 WHERE original_title = "Biola tak berdawai" |
what is the aggregate score for the europa league play off round contest and round | CREATE TABLE table_31018 ("Team" text,"Contest and round" text,"Opponent" text,"1st leg score*" text,"2nd leg score**" text,"Aggregate score" text) | SELECT "Aggregate score" FROM table_31018 WHERE "Contest and round" = 'Europa League Play Off Round' |
How many HUC example codes have 1 level? | CREATE TABLE table_41895 ("Name" text,"Level" real,"Digits" real,"Average size (square miles)" text,"Number of HUs (approximate)" real,"Example name" text,"Example code (HUC)" real) | SELECT COUNT("Example code (HUC)") FROM table_41895 WHERE "Level" = '1' |
what is the bore where the vehicle code is t214? | CREATE TABLE table_26301 ("Vehicle code" text,"Bore (mm)" text,"Stroke (mm)" text,"Capacity (cm 3)" real,"Compression ratio" text,"Torque (N m)" real,"Power (HP)" real) | SELECT "Bore (mm)" FROM table_26301 WHERE "Vehicle code" = 'T214' |
Which police force serves a population of 17000? | CREATE TABLE table_12340907_1 (police_force VARCHAR,population VARCHAR) | SELECT police_force FROM table_12340907_1 WHERE population = 17000 |
For episode number 2-03, what are the names of the cast? | CREATE TABLE table_3388 ("Episode #" text,"Original Air Date (UK)" text,"Episode Title" text,"Director" text,"Writer" text,"Cast" text) | SELECT "Cast" FROM table_3388 WHERE "Episode #" = '2-03' |
what is the analog type for wxmi? | CREATE TABLE table_name_9 (analog VARCHAR,callsign VARCHAR) | SELECT analog FROM table_name_9 WHERE callsign = "wxmi" |
Name the year for donlavey racing bill davis racing | CREATE TABLE table_2181798_1 (year VARCHAR,team_s_ VARCHAR) | SELECT year FROM table_2181798_1 WHERE team_s_ = "Donlavey Racing Bill Davis Racing" |
What is the least ties when they played less than 14 games, and a lost less than 8 of them? | CREATE TABLE table_name_7 (draw INTEGER,played VARCHAR,lost VARCHAR) | SELECT MIN(draw) FROM table_name_7 WHERE played < 14 AND lost < 8 |
Name the D 42 which has a D 44 of d 44 | CREATE TABLE table_name_29 (d_42 VARCHAR,d_44 VARCHAR) | SELECT d_42 FROM table_name_29 WHERE d_44 = "d 44" |
when was the last time that patient 006-158689 had maximum mchc value in 11/last year? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemic... | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-158689')) AND lab.labname = 'mchc' AND DATETIME(lab.labresulttime, 'start of ye... |
What year did Ferrari win the Kyalami circuit? | CREATE TABLE table_name_16 (year VARCHAR,circuit VARCHAR,winning_constructor VARCHAR) | SELECT year FROM table_name_16 WHERE circuit = "kyalami" AND winning_constructor = "ferrari" |
What is the part number for s-spec number sk096? | CREATE TABLE table_15261_1 (part_number VARCHAR,s_spec_number VARCHAR) | SELECT part_number FROM table_15261_1 WHERE s_spec_number = "SK096" |
Find the total savings balance of all accounts except the account with name Brown . | CREATE TABLE accounts (custid VARCHAR,name VARCHAR)CREATE TABLE savings (balance INTEGER,custid VARCHAR) | SELECT SUM(T2.balance) FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T1.name <> 'Brown' |
What home team had a score of 6.9 (45) | CREATE TABLE table_58127 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Home team" FROM table_58127 WHERE "Home team score" = '6.9 (45)' |
How many Baia Mare have an Electrica North Transylvania under 14.476, Bistrita of 643, and Zalau under 737? | CREATE TABLE table_69411 ("Installation" text,"Cluj" real,"Oradea" real,"Baia Mare" real,"Bistrita" real,"Satu Mare" real,"Zalau" real,"Electrica North Transylvania" real) | SELECT COUNT("Baia Mare") FROM table_69411 WHERE "Electrica North Transylvania" < '14.476' AND "Bistrita" = '643' AND "Zalau" < '737' |
Who is the call sign that has a commenced operation before 1976? | CREATE TABLE table_name_3 (callsign VARCHAR,commenced_operations INTEGER) | SELECT callsign FROM table_name_3 WHERE commenced_operations < 1976 |
how many times had patient 17462 had an intake of ns w/40 kcl since 05/17/2104? | CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)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 cost (r... | SELECT COUNT(*) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17462)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'ns w/40 kcl'... |
What is the 2006 value of the 2011 grand slam tournaments? | CREATE TABLE table_63514 ("Tournament" text,"2003" text,"2004" text,"2005" text,"2006" text,"2007" text,"2008" text,"2009" text,"2010" text,"2011" text,"2012" text,"Win %" text) | SELECT "2006" FROM table_63514 WHERE "2011" = 'grand slam tournaments' |
how much money does patient 11779 have to spend on the hospital stay in a year before? | CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime tim... | SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11779) AND DATETIME(cost.chargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') |
Who was the Home Captain and the Result for AUS by 4 wkts? | CREATE TABLE table_42570 ("Date" text,"Home captain" text,"Away captain" text,"Venue" text,"Result" text) | SELECT "Home captain" FROM table_42570 WHERE "Result" = 'aus by 4 wkts' |
until 2104, what were the top four most frequently ordered microbiology tests for patients during the same month after receiving antiplatelet agent - aspirin? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE treatment (treatmen... | SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antiplatelet agent - aspirin' AND STRFTIME('... |
Which object has an Apparent magnitude larger than 9.6, and a Right ascension ( J2000 ) of 17h59m02.0s? | CREATE TABLE table_name_56 (object_type VARCHAR,apparent_magnitude VARCHAR,right_ascension___j2000__ VARCHAR) | SELECT object_type FROM table_name_56 WHERE apparent_magnitude > 9.6 AND right_ascension___j2000__ = "17h59m02.0s" |
does the first blood, venipuncture microbiology test of patient 031-4987 since 3 years ago have any organisms? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitsta... | SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-4987')) AND microlab.culturesite = 'blood, venipuncture' AND DATETIME(micr... |
How many of the Asian patients were admitted before the year 2111? | CREATE TABLE procedures (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 te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.admityear < "2111" |
what is the laps when the time/retired is turbo and the grid is less than 14? | CREATE TABLE table_name_29 (laps VARCHAR,time_retired VARCHAR,grid VARCHAR) | SELECT laps FROM table_name_29 WHERE time_retired = "turbo" AND grid < 14 |
What is the number of dead patients who had brain mass intracranial hemorrhage? | 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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" |
What is the lowest place of the team who conceded 36 goals and lost more than 6 times? | CREATE TABLE table_name_41 (place INTEGER,goals_conceded VARCHAR,lost VARCHAR) | SELECT MIN(place) FROM table_name_41 WHERE goals_conceded = 36 AND lost > 6 |
what are the top five most frequent medications that followed in the same hospital visit for patients who received left heart cardiac cath until 2104? | CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod 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 admissio... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR... |
What venue did South Melbourne play as the away team? | CREATE TABLE table_name_61 (venue VARCHAR,away_team VARCHAR) | SELECT venue FROM table_name_61 WHERE away_team = "south melbourne" |
Who was in the 2005 film with the role mark cohen? | CREATE TABLE table_28689 ("Role" text,"Original Broadway Cast" text,"2005 film" text,"2008 Final Performance Film" text,"Hollywood Bowl Cast" text,"2011 Off-Broadway Revival" text) | SELECT "2005 film" FROM table_28689 WHERE "Role" = 'Mark Cohen' |
what papers do Parsing papers typically cite ? | CREATE TABLE field (fieldid int)CREATE TABLE paper (paperid int,title varchar,venueid int,year int,numciting int,numcitedby int,journalid int)CREATE TABLE paperdataset (paperid int,datasetid int)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE venue (venueid int,venuename varchar)CREATE TABLE paperk... | SELECT DISTINCT cite.citedpaperid FROM cite, keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'Parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = cite.citingpaperid AND paper.paperid = paperkeyphrase.paperid |
How many writers had an US air date of september 25, 1993? | CREATE TABLE table_16116 ("No." real,"#" real,"Title" text,"Director" text,"Writer" text,"US air date" text,"Storyteller" text,"Villains" text) | SELECT COUNT("Writer") FROM table_16116 WHERE "US air date" = 'September 25, 1993' |
What's the highest swimsuit for an average less than 8.073, evening gown less than 8.31, and an interview over 8.23 in georgia? | CREATE TABLE table_name_13 (swimsuit INTEGER,state VARCHAR,interview VARCHAR,average VARCHAR,evening_gown VARCHAR) | SELECT MAX(swimsuit) FROM table_name_13 WHERE average < 8.073 AND evening_gown < 8.31 AND interview > 8.23 AND state = "georgia" |
when english is tea how many nihon-shiki | CREATE TABLE table_3535 ("English" text,"Japanese" text,"Kana spelling" text,"Revised Hepburn" text,"Kunrei-shiki" text,"Nihon-shiki" text) | SELECT "Nihon-shiki" FROM table_3535 WHERE "English" = 'tea' |
Which week was the game on December 14, 1967? | CREATE TABLE table_80409 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text) | SELECT "Week" FROM table_80409 WHERE "Date" = 'december 14, 1967' |
How many populations have a capital of Montpelier and more than 1 House seat? | CREATE TABLE table_14520 ("State" text,"Abbr." text,"Capital" text,"Largest city" text,"Statehood" text,"Population est. (2012)" real,"House seat(s)" real) | SELECT COUNT("Population est. (2012)") FROM table_14520 WHERE "Capital" = 'montpelier' AND "House seat(s)" > '1' |
Which Season has a Third of colin hodgson? | CREATE TABLE table_76521 ("Season" text,"Skip" text,"Third" text,"Second" text,"Lead" text) | SELECT "Season" FROM table_76521 WHERE "Third" = 'colin hodgson' |
Is it possible to take 400 -level classes in Fall or Winter ? | CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE course_tags_count (course_id i... | SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE ((SEM... |
has there ever been any type of microbiology test done on patient 025-28600's abscess since 1 year ago? | CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyna... | SELECT COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-28600')) AND microlab.culturesite = 'abscess' AND DATETIME(microlab.culturetak... |
What time span is listed under years for the 96th congres? | CREATE TABLE table_2841865_2 (years VARCHAR,congress VARCHAR) | SELECT years FROM table_2841865_2 WHERE congress = "96th" |
Player of dan federman, and a Pick larger than 114 involves which highest round? | CREATE TABLE table_34077 ("Round" real,"Pick" real,"Player" text,"Nationality" text,"College" text) | SELECT MAX("Round") FROM table_34077 WHERE "Player" = 'dan federman' AND "Pick" > '114' |
What position does peter mcgeough cover? | CREATE TABLE table_2679061_12 (position VARCHAR,player VARCHAR) | SELECT position FROM table_2679061_12 WHERE player = "Peter McGeough" |
Which player is the 24 pick? | CREATE TABLE table_54066 ("Round" real,"Pick" text,"Player" text,"Position" text,"School/Club Team" text) | SELECT "Player" FROM table_54066 WHERE "Pick" = '24' |
Which country is Kursk-1 in? | CREATE TABLE nuclear_power_plants (id text,name text,latitude text,longitude text,country text,status text,reactortype text,reactormodel text,constructionstartat text,operationalfrom text,operationalto text,capacity text,lastupdatedat text,source text) | SELECT country FROM nuclear_power_plants WHERE name = "Kursk-1" |
What is the record of the 73-82 score? | CREATE TABLE table_41350 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Leading scorer" text,"Record" text) | SELECT "Record" FROM table_41350 WHERE "Score" = '73-82' |
count the number of patients whose marital status is single and drug route is po? | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "SINGLE" AND prescriptions.route = "PO" |
Please provide me with a list of classes being taught by Dr. Celia Cunningham next semester . | CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE course_offering (offering_id int,course_id int,semester in... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Celia Cunningham%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.... |
What date did the episode, with John O'Connell as the coach, premier? | CREATE TABLE table_2140071_5 (premier_date VARCHAR,coach VARCHAR) | SELECT premier_date FROM table_2140071_5 WHERE coach = "John O'Connell" |
How many attended the game with a record of 43-34? | CREATE TABLE table_56620 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text) | SELECT COUNT("Attendance") FROM table_56620 WHERE "Record" = '43-34' |
what is the average number of gold when the rank is more than 5? | CREATE TABLE table_name_5 (gold INTEGER,rank INTEGER) | SELECT AVG(gold) FROM table_name_5 WHERE rank > 5 |
What team is in the toyota h llin arena? | CREATE TABLE table_name_42 (team VARCHAR,arena VARCHAR) | SELECT team FROM table_name_42 WHERE arena = "toyota höllin" |
did nes systems have games for more than 5 years ? | CREATE TABLE table_203_489 (id number,"year" number,"title" text,"system" text,"developer" text,"publisher" text) | SELECT COUNT("year") > 5 FROM table_203_489 WHERE "system" = 'nes' |
how many times did fumio place in the top ten ? | CREATE TABLE table_204_798 (id number,"year" number,"competition" text,"venue" text,"position" text,"notes" text) | SELECT COUNT(*) FROM table_204_798 WHERE "position" <= 10 |
What is the total number of television channels when one of the radio stations is onda madrid? | CREATE TABLE table_25683 ("Autonomous Community" text,"Organization" text,"Television Channels" text,"Radio Stations" text,"Foundation" real) | SELECT COUNT("Television Channels") FROM table_25683 WHERE "Radio Stations" = 'Onda Madrid' |
What nation started in lane 3 of heat 2? | CREATE TABLE table_14826 ("Heat" real,"Lane" real,"Name" text,"Nationality" text,"Time" text) | SELECT "Nationality" FROM table_14826 WHERE "Heat" = '2' AND "Lane" = '3' |
what is the drug dose of Theophylline SR? | 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 prescriptions.drug_dose FROM prescriptions WHERE prescriptions.drug = "Theophylline SR" |
how many positions below valentino rossi did john hopkins place in the 2008 malaysian motorcycle grand prix ? | CREATE TABLE table_203_166 (id number,"pos" text,"no" number,"rider" text,"manufacturer" text,"laps" number,"time" text,"grid" number,"points" number) | SELECT (SELECT "pos" FROM table_203_166 WHERE "rider" = 'john hopkins') - (SELECT "pos" FROM table_203_166 WHERE "rider" = 'valentino rossi') |
What's the series number of the episode with season number 2? | CREATE TABLE table_19236587_4 (series_no INTEGER,season_no VARCHAR) | SELECT MIN(series_no) FROM table_19236587_4 WHERE season_no = 2 |
Which date was the syracuse circuit? | CREATE TABLE table_name_67 (date VARCHAR,circuit VARCHAR) | SELECT date FROM table_name_67 WHERE circuit = "syracuse" |
Which player has a height of 6-7? | CREATE TABLE table_54585 ("Player" text,"Height" text,"School" text,"Hometown" text,"College" text,"NBA Draft" text) | SELECT "Player" FROM table_54585 WHERE "Height" = '6-7' |
What are the names of customers with checking balances lower than the average checking balance? | CREATE TABLE accounts (custid number,name text)CREATE TABLE checking (custid number,balance number)CREATE TABLE savings (custid number,balance number) | SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT AVG(balance) FROM checking) |
What is the greatest number of losses when there are more than 0 draws and 1390 against matches? | CREATE TABLE table_59648 ("Golden Rivers" text,"Wins" real,"Byes" real,"Losses" real,"Draws" real,"Against" real) | SELECT MAX("Losses") FROM table_59648 WHERE "Draws" > '0' AND "Against" = '1390' |
What is the population in 2011 for the name Beaubassin East? | CREATE TABLE table_28569 ("Name" text,"Population (2011)" real,"Population (2006)" real,"Change (%)" text,"Area (km\u00b2)" text,"Population density" text) | SELECT "Population (2011)" FROM table_28569 WHERE "Name" = 'Beaubassin East' |
What home team scored 10.14 (74)? | CREATE TABLE table_52814 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Home team" FROM table_52814 WHERE "Home team score" = '10.14 (74)' |
What is the try BP when the losing BP is 4 and the club is Bargoed RFC? | CREATE TABLE table_67891 ("Club" text,"Played" text,"Drawn" text,"Lost" text,"Try BP" text,"Losing BP" text) | SELECT "Try BP" FROM table_67891 WHERE "Losing BP" = '4' AND "Club" = 'bargoed rfc' |
Show the names of climbers and the heights of mountains they climb. Show bar chart. | CREATE TABLE mountain (Mountain_ID int,Name text,Height real,Prominence real,Range text,Country text)CREATE TABLE climber (Climber_ID int,Name text,Country text,Time text,Points real,Mountain_ID int) | SELECT T1.Name, T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID |
How many different nationalities is pick number 179? | CREATE TABLE table_29997 ("Pick" real,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text) | SELECT COUNT("Nationality") FROM table_29997 WHERE "Pick" = '179' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.