instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
what is the first venue in calender year 2012 ?
CREATE TABLE table_204_860 (id number,"#" number,"date" text,"venue" text,"opponent" text,"score" text,"result" text,"competition" text)
SELECT "venue" FROM table_204_860 WHERE "date" = 2012 ORDER BY "date" LIMIT 1
What was the date of the game that lasted 75:43?
CREATE TABLE table_35597 ("Length of game" text,"Date" text,"Away team" text,"Score" text,"Home team" text)
SELECT "Date" FROM table_35597 WHERE "Length of game" = '75:43'
Who was the opponent when the time was 1:47?
CREATE TABLE table_32297 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text)
SELECT "Opponent" FROM table_32297 WHERE "Time" = '1:47'
What is the Visitor with a Leading scorer with rudy gay (24)?
CREATE TABLE table_name_28 (visitor VARCHAR,leading_scorer VARCHAR)
SELECT visitor FROM table_name_28 WHERE leading_scorer = "rudy gay (24)"
Who had the most the most rebounds and how many did they have on April 1?
CREATE TABLE table_74159 ("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_74159 WHERE "Date" = 'April 1'
How many total losses were with less than 51 draws but more than 6 wins?
CREATE TABLE table_58656 ("Matches" real,"Wins" real,"Draw" real,"Losses" real,"Against" real)
SELECT COUNT("Losses") FROM table_58656 WHERE "Draw" < '51' AND "Wins" > '6'
what is death status of subject id 83678?
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 demographic.expire_flag FROM demographic WHERE demographic.subject_id = "83678"
which rider is listed in the position after loris capirossi ?
CREATE TABLE table_203_718 (id number,"pos" text,"rider" text,"manufacturer" text,"time/retired" text,"points" number)
SELECT "rider" FROM table_203_718 WHERE "pos" = (SELECT "pos" FROM table_203_718 WHERE "rider" = 'loris capirossi') + 1
What was the total number of Top-25 values, for which Cuts made was 62, and for which Wins were less than 1?
CREATE TABLE table_6886 ("Tournament" text,"Wins" real,"Top-5" real,"Top-10" real,"Top-25" real,"Events" real,"Cuts made" real)
SELECT COUNT("Top-25") FROM table_6886 WHERE "Cuts made" = '62' AND "Wins" < '1'
What date final has 1982 as the year?
CREATE TABLE table_67992 ("Year" text,"Date Final" text,"Venue" text,"Prize Money" text,"Champion" text,"Runner-up" text,"Score in final" text,"Commercial name" text)
SELECT "Date Final" FROM table_67992 WHERE "Year" = '1982'
Which station is from China and has a frequency of 684khz?
CREATE TABLE table_name_79 (station VARCHAR,country_of_origin VARCHAR,frequency VARCHAR)
SELECT station FROM table_name_79 WHERE country_of_origin = "china" AND frequency = "684khz"
How many missions countries have notability with president of burundi?
CREATE TABLE table_22248 ("Name" text,"Notability" text,"Reason for Seeking Refuge" text,"Country" text,"City" text,"Missions Country" text,"Start Date" text,"End Date" text,"Resolution" text)
SELECT COUNT("Missions Country") FROM table_22248 WHERE "Notability" = 'President of Burundi'
What team did he compete for in the GP3 series?
CREATE TABLE table_73207 ("Season" text,"Series" text,"Team" text,"Races" real,"Wins" real,"Poles" real,"F/Laps" real,"Podiums" real,"Points" real,"Position" text)
SELECT "Team" FROM table_73207 WHERE "Series" = 'GP3 Series'
Name the percentage for ole miss
CREATE TABLE table_25395 ("Team" text,"SEC Wins" real,"SEC Losses" real,"Percentage" text,"Home Record" text,"Road Record" text,"Overall Record" text)
SELECT "Percentage" FROM table_25395 WHERE "Team" = 'Ole Miss'
What year did finish 1st in LMP1 class?
CREATE TABLE table_71549 ("Year" real,"Team" text,"Co-Drivers" text,"Class" text,"Laps" real,"Pos." text,"Class Pos." text)
SELECT AVG("Year") FROM table_71549 WHERE "Class" = 'lmp1' AND "Class Pos." = '1st'
List the venues of debates in ascending order of the number of audience.
CREATE TABLE debate (Venue VARCHAR,Num_of_Audience VARCHAR)
SELECT Venue FROM debate ORDER BY Num_of_Audience
what is the number of patients with the prescription of ondansetron and have a diagnoses of chronic total occlusion of coronary artery primary disease?
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Chronic total occlusion of coronary artery" AND prescriptions.drug = "Ondansetron"
how much is the daily minimum weight of patient 015-8398 on their last hospital encounter?
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 MIN(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-8398' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1) AND NOT patient.admissionweight IS NULL G...
show me the flights that go from SAN DIEGO to NEWARK by way of HOUSTON
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 code_description (code varchar,description text)CREATE TABLE month (month_number int,month_name text)CREATE TABLE airline (air...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEWARK' AND CITY_2.cit...
Who did the cowboys play when 65,537 attended?
CREATE TABLE table_name_54 (opponent VARCHAR,attendance VARCHAR)
SELECT opponent FROM table_name_54 WHERE attendance = "65,537"
Deleted user's answers (link, question title, tags, score).
CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGui...
SELECT a.Id AS link, q.Title AS title, q.Tags AS tags, a.Score AS score FROM Posts AS q INNER JOIN Posts AS a ON q.Id = a.ParentId AND a.PostTypeId = 2 AND q.PostTypeId = 1 WHERE a.CommunityOwnedDate IS NULL AND a.OwnerDisplayName = '##UserName##' AND a.OwnerUserId IS NULL ORDER BY a.Score DESC
Which club has a try bonus of 2 ?
CREATE TABLE table_67611 ("Club" text,"Played" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Tries for" text,"Tries against" text,"Try bonus" text)
SELECT "Club" FROM table_67611 WHERE "Try bonus" = '2'
Which Match played in a Location of San Francisco has a Competition of Semifinal?
CREATE TABLE table_name_19 (match VARCHAR,competition VARCHAR,location VARCHAR)
SELECT match FROM table_name_19 WHERE competition = "semifinal" AND location = "san francisco"
Draw a bar chart for what are the different nationalities of pilots? Show each nationality and the number of pilots of each nationality, and could you display total number from low to high order?
CREATE TABLE pilot_record (Record_ID int,Pilot_ID int,Aircraft_ID int,Date text)CREATE TABLE aircraft (Aircraft_ID int,Order_Year int,Manufacturer text,Model text,Fleet_Series text,Powertrain text,Fuel_Propulsion text)CREATE TABLE pilot (Pilot_ID int,Pilot_name text,Rank int,Age int,Nationality text,Position text,Join_...
SELECT Nationality, COUNT(*) FROM pilot GROUP BY Nationality ORDER BY COUNT(*)
Top 200 from Chennai, India.
CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE ReviewTasks (Id number,ReviewTaskTy...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%chennai%india%' ORDER BY Reputation DESC LIMIT 200
tell me the name of the drug which patient 010-1155 was prescribed within 2 days after receiving a oxygen therapy (40% to 60%) - 50-60% procedure since 03/2105?
CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsyste...
SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-1155') AND treatment.treatmen...
When is the cyrillic name other names what is the largest ethnic group of 2002?
CREATE TABLE table_2562572_25 (largest_ethnic_group__2002_ VARCHAR,cyrillic_name_other_names VARCHAR)
SELECT largest_ethnic_group__2002_ FROM table_2562572_25 WHERE cyrillic_name_other_names = "Дероње"
hello i'd like a DL flight from ATLANTA to BOSTON
CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion varchar,wide_body varchar,wing_span int,length int,weight int,capacity int,pay_load int,cruising_spe...
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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANT...
In 1962, what was the total number of points, when the Engine was Ferrari v6?
CREATE TABLE table_name_97 (points VARCHAR,engine VARCHAR,year VARCHAR)
SELECT COUNT(points) FROM table_name_97 WHERE engine = "ferrari v6" AND year = 1962
Who is the owner of the Raglan Road winner?
CREATE TABLE table_name_43 (owner VARCHAR,winner VARCHAR)
SELECT owner FROM table_name_43 WHERE winner = "raglan road"
What is the sum of the runs when the wkts were bigger than 0 and ovrs were smaller than 2?
CREATE TABLE table_45127 ("Player" text,"Wkts" real,"Runs" real,"Econ" real,"Ovrs" real)
SELECT SUM("Runs") FROM table_45127 WHERE "Ovrs" < '2' AND "Wkts" > '0'
is the sample size of siena more or less than the sample size of quinnipiac ?
CREATE TABLE table_204_481 (id number,"poll source" text,"date(s)\nadministered" text,"sample\nsize" number,"margin of\nerror" text,"andrew\ncuomo (d)" text,"rob\nastorino (r)" text,"other" text,"undecided" text)
SELECT (SELECT "sample\nsize" FROM table_204_481 WHERE "poll source" = 'siena') > (SELECT "sample\nsize" FROM table_204_481 WHERE "poll source" = 'quinnipiac')
who is listed after pat burrell ?
CREATE TABLE table_203_618 (id number,"pick" number,"player" text,"team" text,"position" text,"school" text)
SELECT "player" FROM table_203_618 WHERE id = (SELECT id FROM table_203_618 WHERE "player" = 'pat burrell') + 1
Who drove during the race with less than 19 laps and a time listed as ignition?
CREATE TABLE table_name_55 (driver VARCHAR,laps VARCHAR,time_retired VARCHAR)
SELECT driver FROM table_name_55 WHERE laps < 19 AND time_retired = "ignition"
What is Team 1 where Team 2 is gombe united f.c.?
CREATE TABLE table_name_23 (team_1 VARCHAR,team_2 VARCHAR)
SELECT team_1 FROM table_name_23 WHERE team_2 = "gombe united f.c."
Tier of 2, and a Season of 2000 01 is what European competitions?
CREATE TABLE table_79968 ("Season" text,"Tier" real,"League" text,"Turkish Cup" text,"European Competitions" text)
SELECT "European Competitions" FROM table_79968 WHERE "Tier" = '2' AND "Season" = '2000–01'
What was the date of the match where the home team scored 14.13 (97)
CREATE TABLE table_56851 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Date" FROM table_56851 WHERE "Home team score" = '14.13 (97)'
what is the average b score when the gymnast is k hei uchimura ( jpn )?
CREATE TABLE table_name_20 (b_score INTEGER,gymnast VARCHAR)
SELECT AVG(b_score) FROM table_name_20 WHERE gymnast = "kōhei uchimura ( jpn )"
has patient 005-87465 received oxygen therapy (> 60%) - >90% since 2105 in another hospital?
CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim...
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '005-87465' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '005-87465' AND patient.hospitaldischargetime IS NULL)) AND tr...
Name the competition for november 19, 2008
CREATE TABLE table_name_82 (competition VARCHAR,date VARCHAR)
SELECT competition FROM table_name_82 WHERE date = "november 19, 2008"
What is the sum for the int yards that has an assts more than 3, and player Jay Alford?
CREATE TABLE table_75855 ("Player" text,"Tackles" real,"Solo" real,"Assts" real,"Sacks" real,"Int yards" real,"Int avg." real,"Int TD" real,"Fum. rec" real,"Fum. rec TD" real)
SELECT SUM("Int yards") FROM table_75855 WHERE "Assts" > '3' AND "Player" = 'jay alford'
How many people attended the game on February 3, 2008?
CREATE TABLE table_name_34 (attendance INTEGER,date VARCHAR)
SELECT SUM(attendance) FROM table_name_34 WHERE date = "february 3, 2008"
how many patients whose gender is m and age is less than 24?
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 diagnoses (subject_id text,hadm_id tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.age < "24"
Calculate the minimum age of urgent hospital admission patients admitted in or after the year 2178.
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 MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.admityear >= "2178"
What are the names of people who are not entrepreneurs?
CREATE TABLE people (people_id number,name text,height number,weight number,date_of_birth text)CREATE TABLE entrepreneur (entrepreneur_id number,people_id number,company text,money_requested number,investor text)
SELECT name FROM people WHERE NOT people_id IN (SELECT people_id FROM entrepreneur)
What is City, when State is Florida, when AAM Member is No, and when AAM Accredited is No?
CREATE TABLE table_42121 ("City" text,"State" text,"AAM Accredited" text,"AAM Member" text,"ASTC Member" text)
SELECT "City" FROM table_42121 WHERE "State" = 'florida' AND "AAM Member" = 'no' AND "AAM Accredited" = 'no'
When was the circuit Donington Park?
CREATE TABLE table_22334183_3 (date VARCHAR,circuit VARCHAR)
SELECT date FROM table_22334183_3 WHERE circuit = "Donington Park"
What are the civilian total when the security force total is 36?
CREATE TABLE table_21636599_2 (civilians VARCHAR,security_forces VARCHAR)
SELECT civilians FROM table_21636599_2 WHERE security_forces = "36"
how many patients whose age is less than 48 and drug name is psyllium?
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.age < "48" AND prescriptions.drug = "Psyllium"
Name the original name for last days of the victim
CREATE TABLE table_15502 ("Country" text,"Film title used in nomination" text,"Language" text,"Original name" text,"Director" text)
SELECT "Original name" FROM table_15502 WHERE "Film title used in nomination" = 'last days of the victim'
What is the lowest week number where they played against the Detroit Lions?
CREATE TABLE table_name_94 (week INTEGER,opponent VARCHAR)
SELECT MIN(week) FROM table_name_94 WHERE opponent = "detroit lions"
Tell me the total number of time for heat rank of 1
CREATE TABLE table_4398 ("Heat Rank" real,"Lane" real,"Swimmer" text,"Country" text,"Time" real,"Overall Rank" text)
SELECT COUNT("Time") FROM table_4398 WHERE "Heat Rank" = '1'
What is the population on average with a per capita of 1,158, and a 2011 GDP less than 6,199?
CREATE TABLE table_41469 ("Country" text,"Population" real,"GDP 2011 (In Millions USD)" real,"GDP 2012 (In Millions USD)" real,"per capita" real)
SELECT AVG("Population") FROM table_41469 WHERE "per capita" = '1,158' AND "GDP 2011 (In Millions USD)" < '6,199'
Which Height (m) has a Name of plessur alps, and a AVE-No larger than 63?
CREATE TABLE table_58392 ("AVE- No." real,"Name" text,"Country" text,"Highest mountain" text,"Height (m)" real)
SELECT MIN("Height (m)") FROM table_58392 WHERE "Name" = 'plessur alps' AND "AVE- No." > '63'
what was the name of the procedure that was given two times to patient 27172 since 65 months ago?
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 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, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 271...
what is the enrollment for the Cavaliers?
CREATE TABLE table_16432543_3 (enrollment INTEGER,nickname VARCHAR)
SELECT MAX(enrollment) FROM table_16432543_3 WHERE nickname = "Cavaliers"
Return a bar chart on how old is the youngest person for each job?, could you rank by the x-axis in asc?
CREATE TABLE Person (name varchar(20),age INTEGER,city TEXT,gender TEXT,job TEXT)CREATE TABLE PersonFriend (name varchar(20),friend varchar(20),year INTEGER)
SELECT job, MIN(age) FROM Person GROUP BY job ORDER BY job
What is the sum of the weeks during which the Redskins played against the Houston Oilers and had more than 54,582 fans in attendance?
CREATE TABLE table_33871 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real)
SELECT SUM("Week") FROM table_33871 WHERE "Opponent" = 'houston oilers' AND "Attendance" > '54,582'
how many days have elapsed since patient 015-23047's last stay in the ward 608 during this hospital visit?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE microlab (microlabid number,patientunitstayid number...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '015-23047' AND patient.wardid = 608 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the change of commission_pct over hire_date in a line chart, and sort HIRE_DATE in ascending order.
CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID varchar(2))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DA...
SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE
How many seats does the election with the outcome of election of minority in parliament and 186,226 PNC votes have?
CREATE TABLE table_44643 ("Election" real,"Number of PNC votes" text,"Share of votes" text,"Seats" text,"Outcome of election" text)
SELECT "Seats" FROM table_44643 WHERE "Outcome of election" = 'minority in parliament' AND "Number of PNC votes" = '186,226'
when was the first time patient 033-42758 got prescribed for pantoprazole 40 mg iv recon soln and meropenem 500 mg iv solr at the same time in 11/2104?
CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissio...
SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'pantoprazole 40 mg iv recon soln' AND patient.uniquepid = '033-42758' AND STRFTIME('%y-%m', medication.drugstarttime) = '...
what is the percentile of 9.8 in a calcium, total lab test conducted at the same age of patient 40059 in this hospital encounter?
CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE prescriptions (row_id...
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 = 'calcium, total') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admission...
What is the home team's score when south melbourne is away?
CREATE TABLE table_name_23 (home_team VARCHAR,away_team VARCHAR)
SELECT home_team AS score FROM table_name_23 WHERE away_team = "south melbourne"
Who was the finalist in the 2010 season in the host city tartu?
CREATE TABLE table_37207 ("Season" real,"Winner" text,"Finalist" text,"Score" text,"Host City" text)
SELECT "Finalist" FROM table_37207 WHERE "Host City" = 'tartu' AND "Season" = '2010'
what is the number of patients whose ethnicity is hispanic or latino and procedure short title is closed liver biopsy?
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND procedures.short_title = "Closed liver biopsy"
What is the host city of the Singapore Indoor Stadium venue and a Valentine's Day theme?
CREATE TABLE table_name_24 (host_city VARCHAR,venue VARCHAR,theme VARCHAR)
SELECT host_city FROM table_name_24 WHERE venue = "singapore indoor stadium" AND theme = "valentine's day"
Competition of friendly, and a Date of 03-jun-62 had what score?
CREATE TABLE table_35095 ("Date" text,"Result" text,"Score" text,"Venue" text,"Competition" text)
SELECT "Score" FROM table_35095 WHERE "Competition" = 'friendly' AND "Date" = '03-jun-62'
give me SUNDAY nonstop flights from MEMPHIS to LAS VEGAS
CREATE TABLE flight_fare (flight_id int,fare_id 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 varchar)CREATE TABLE compartment_class (compartment varchar,class_type va...
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, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LAS VEGAS' AND days.day_name = 'SUNDAY' AND flight.flight_days = days.days_code AN...
which woman finished last in the 1971 world figured skating championships ?
CREATE TABLE table_204_291 (id number,"rank" number,"name" text,"nation" text,"cp" number,"fp" number,"points" number,"placings" number)
SELECT "name" FROM table_204_291 ORDER BY "rank" DESC LIMIT 1
What was the attendance at Corio Oval?
CREATE TABLE table_name_9 (crowd VARCHAR,venue VARCHAR)
SELECT crowd FROM table_name_9 WHERE venue = "corio oval"
Show the number of courses for each course description in a bar chart, show in asc by the total number.
CREATE TABLE COURSE (CRS_CODE varchar(10),DEPT_CODE varchar(10),CRS_DESCRIPTION varchar(35),CRS_CREDIT float(8))CREATE TABLE STUDENT (STU_NUM int,STU_LNAME varchar(15),STU_FNAME varchar(15),STU_INIT varchar(1),STU_DOB datetime,STU_HRS int,STU_CLASS varchar(2),STU_GPA float(8),STU_TRANSFER numeric,DEPT_CODE varchar(18),...
SELECT CRS_DESCRIPTION, COUNT(CRS_DESCRIPTION) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY CRS_DESCRIPTION ORDER BY COUNT(CRS_DESCRIPTION)
How many locations have the callsign DXGH?
CREATE TABLE table_30768 ("Branding" text,"Callsign" text,"Frequency" text,"Power (kW)" text,"Station Type" text,"Location" text)
SELECT COUNT("Location") FROM table_30768 WHERE "Callsign" = 'DXGH'
What record was reached with a score of 7 - 2?
CREATE TABLE table_name_8 (record VARCHAR,score VARCHAR)
SELECT record FROM table_name_8 WHERE score = "7 - 2"
What was the smallest crowd at a home game for essendon?
CREATE TABLE table_55491 ("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_55491 WHERE "Home team" = 'essendon'
How many top 10s when he had under 1 top 5s?
CREATE TABLE table_74861 ("Tournament" text,"Wins" real,"Top-5" real,"Top-10" real,"Top-25" real,"Events" real,"Cuts made" real)
SELECT SUM("Top-10") FROM table_74861 WHERE "Top-5" < '1'
Which Record has a Date of january 31?
CREATE TABLE table_name_18 (record VARCHAR,date VARCHAR)
SELECT record FROM table_name_18 WHERE date = "january 31"
who won the largest amount of bronze medals ?
CREATE TABLE table_203_653 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number)
SELECT "nation" FROM table_203_653 ORDER BY "bronze" DESC LIMIT 1
How much Gold has a Nation of mongolia, and a Total larger than 18?
CREATE TABLE table_65288 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT SUM("Gold") FROM table_65288 WHERE "Nation" = 'mongolia' AND "Total" > '18'
What is the Author of the Title with an Ongoing Last Issue?
CREATE TABLE table_63813 ("Title" text,"Author" text,"First Issue" text,"Last Issue" text,"Completed?" text)
SELECT "Author" FROM table_63813 WHERE "Last Issue" = 'ongoing'
When was the first year when Fowler joined?
CREATE TABLE table_name_73 (year_left INTEGER,location VARCHAR)
SELECT MIN(year_left) FROM table_name_73 WHERE location = "fowler"
What is the number of cities in each country? Return a bar chart.
CREATE TABLE county_public_safety (County_ID int,Name text,Population int,Police_officers int,Residents_per_officer int,Case_burden int,Crime_rate real,Police_force text,Location text)CREATE TABLE city (City_ID int,County_ID int,Name text,White real,Black real,Amerindian real,Asian real,Multiracial real,Hispanic real)
SELECT T2.Name, COUNT(T2.Name) FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID GROUP BY T2.Name
What category was nominated in 2010 fo the British Soap Awards?
CREATE TABLE table_name_38 (category VARCHAR,awards VARCHAR,year VARCHAR,result VARCHAR)
SELECT category FROM table_name_38 WHERE year = 2010 AND result = "nominated" AND awards = "british soap awards"
Name the average zone for waddon marsh tram stop
CREATE TABLE table_57557 ("Stations" text,"Place" text,"Managed By" text,"Platforms" real,"Zone" real)
SELECT AVG("Zone") FROM table_57557 WHERE "Stations" = 'waddon marsh tram stop'
What is Result, when Director is Veljko Bulaji category:articles with hcards, and when Original title is Sarajevski Atentat?
CREATE TABLE table_41272 ("Year (Ceremony)" text,"Film title used in nomination" text,"Original title" text,"Director" text,"Result" text)
SELECT "Result" FROM table_41272 WHERE "Director" = 'veljko bulajić category:articles with hcards' AND "Original title" = 'sarajevski atentat'
what's the total dose of gentamicin sulfate that patient 40435 has been prescribed until 11/2105?
CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE...
SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40435) AND prescriptions.drug = 'gentamicin sulfate' AND STRFTIME('%y-%m', prescriptions.startdate) <= '2105-11'
What was the winning score in the year 2002?
CREATE TABLE table_46566 ("Year" real,"Championship" text,"Winning score" text,"Margin of victory" text,"Runner(s)-up" text)
SELECT "Winning score" FROM table_46566 WHERE "Year" = '2002'
provide the number of patients whose primary disease is s/p fall and year of death is less than or equal to 2180?
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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "S/P FALL" AND demographic.dod_year <= "2180.0"
what is the total amount of nations with more than 5 bronze medals ?
CREATE TABLE table_203_812 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number)
SELECT COUNT("nation") FROM table_203_812 WHERE "bronze" > 5
now i'd like to see flights from DETROIT to ST. PETERSBURG on the next tuesday
CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE flight_stop ...
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 = 'ST. PETERSBURG' AND date_day.day_number = 22 AND date_day.month_number = ...
What was the position of the team that had a goal difference of less than -11 and played less than 38 games?
CREATE TABLE table_67376 ("Position" real,"Club" text,"Played" real,"Points" text,"Wins" real,"Draws" real,"Losses" real,"Goals for" real,"Goals against" real,"Goal Difference" real)
SELECT SUM("Position") FROM table_67376 WHERE "Goal Difference" < '-11' AND "Played" < '38'
Who was the away team at Junction Oval?
CREATE TABLE table_name_63 (away_team VARCHAR,venue VARCHAR)
SELECT away_team FROM table_name_63 WHERE venue = "junction oval"
What set 2 has 15:33 as the time?
CREATE TABLE table_7540 ("Date" text,"Time" text,"Score" text,"Set 1" text,"Set 2" text,"Set 3" text,"Total" text,"Report" text)
SELECT "Set 2" FROM table_7540 WHERE "Time" = '15:33'
give me the number of patients whose admission location is phys referral/normal deli and lab test name is lactate dehydrogenase, pleural?
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 diagnoses (subject_id text,hadm_id text,icd9_code text,sho...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND lab.label = "Lactate Dehydrogenase, Pleural"
what is the name that had 46 floors?
CREATE TABLE table_13719 ("Sr No" real,"Name" text,"Locale" text,"Height" text,"Floors" real,"Building Type" text)
SELECT "Name" FROM table_13719 WHERE "Floors" = '46'
How many outcomes occur on the date of January 31, 2010?
CREATE TABLE table_3511 ("Outcome" text,"No." text,"Date" text,"Championship" text,"Surface" text,"Opponent in the final" text,"Score in the final" text)
SELECT COUNT("Outcome") FROM table_3511 WHERE "Date" = 'January 31, 2010'
What is the losses when the goal difference is larger than 26?
CREATE TABLE table_79025 ("Position" real,"Club" text,"Played" real,"Points" real,"Wins" real,"Draws" real,"Losses" real,"Goals for" real,"Goals against" real,"Goal Difference" real)
SELECT MAX("Losses") FROM table_79025 WHERE "Goal Difference" > '26'
what was the last time during their current hospital visit patient 55360 had the maximum hemoglobin.
CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREATE TABLE microbiologyev...
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 55360 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'hemoglobin') ORDER BY labevents.valuenum DESC,...
For each county, find the name of the county and the number of delegates from that county.
CREATE TABLE party (party_id number,year number,party text,governor text,lieutenant_governor text,comptroller text,attorney_general text,us_senate text)CREATE TABLE election (election_id number,counties_represented text,district number,delegate text,party number,first_elected number,committee text)CREATE TABLE county (...
SELECT T1.county_name, COUNT(*) FROM county AS T1 JOIN election AS T2 ON T1.county_id = T2.district GROUP BY T1.county_id
What was the air date of the episod that had 456.58 thousand viewers?
CREATE TABLE table_23114705_7 (original_air_date VARCHAR,nz_viewers__thousand_ VARCHAR)
SELECT original_air_date FROM table_23114705_7 WHERE nz_viewers__thousand_ = "456.58"