instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
get me the number of government health insurance patients who had closed [needle] biopsy of tongue.
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.long_title = "Closed [needle] biopsy of tongue"
Who is the opponent in game 5?
CREATE TABLE table_20745706_1 (opponent VARCHAR,_number VARCHAR)
SELECT opponent FROM table_20745706_1 WHERE _number = "5"
What is the round for the qualifying phase with a draw date on 16 July 2010?
CREATE TABLE table_62144 ("Phase" text,"Round" text,"Draw date" text,"First leg" text,"Second leg" text)
SELECT "Round" FROM table_62144 WHERE "Phase" = 'qualifying' AND "Draw date" = '16 july 2010'
Show all locations and the total number of platforms for all train stations in each location in a bar chart, sort by the Location in ascending.
CREATE TABLE train (Train_ID int,Name text,Time text,Service text)CREATE TABLE train_station (Train_ID int,Station_ID int)CREATE TABLE station (Station_ID int,Name text,Annual_entry_exit real,Annual_interchanges real,Total_Passengers real,Location text,Main_Services text,Number_of_Platforms int)
SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location ORDER BY Location
in this month patient 004-32341 received a magnesium test?
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 cost (costid number,uniquepid text,patienthealthsystemstayid number,...
SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-32341')) AND lab.labname = 'magnesium' AND DATETIME(lab.labresulttime, 'start of mon...
What is the average rank of Great Britain when their total is over 4?
CREATE TABLE table_57342 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT AVG("Rank") FROM table_57342 WHERE "Total" > '4' AND "Nation" = 'great britain'
What are the tries against when points against 287?
CREATE TABLE table_812 ("Club" text,"Played" text,"Won" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Tries for" text,"Tries against" text,"Try bonus" text,"Losing bonus" text,"Points" text)
SELECT "Tries against" FROM table_812 WHERE "Points against" = '287'
what is the lowest height (ft) for messeturm and more than 55 floors?
CREATE TABLE table_54024 ("Rank" real,"Name" text,"City" text,"Height (m)" real,"Height (ft)" real,"Floors" real)
SELECT MIN("Height (ft)") FROM table_54024 WHERE "Name" = 'messeturm' AND "Floors" > '55'
since 5 years ago, what are the five most frequently performed procedures for patients in the same month after receiving a vascular surgery consultation?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,ob...
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, 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 = 'vascular surgery consultation' AND DATET...
what is the drug route of Ascorbic acid?
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,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id tex...
SELECT prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Ascorbic Acid"
What was the highest points on October 12, when the attendance where is over 10,701?
CREATE TABLE table_43705 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Attendance" real,"Record" text,"Points" real)
SELECT MAX("Points") FROM table_43705 WHERE "Date" = 'october 12' AND "Attendance" > '10,701'
A bar chart for what are the number of the first names of all students in Smith Hall?, could you list in ascending by the total number please?
CREATE TABLE Dorm (dormid INTEGER,dorm_name VARCHAR(20),student_capacity INTEGER,gender VARCHAR(1))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 Lives_in (stuid INTEGER,dormid INTEGER,room_number INTEGER...
SELECT Fname, COUNT(Fname) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' GROUP BY Fname ORDER BY COUNT(Fname)
Who was the Interview Subject on the Date when there were Pictorials of Christie Brinkley?
CREATE TABLE table_40077 ("Date" text,"Cover model" text,"Centerfold model" text,"Interview subject" text,"Pictorials" text)
SELECT "Interview subject" FROM table_40077 WHERE "Pictorials" = 'christie brinkley'
What is the sum of the total of the player who won in 1979?
CREATE TABLE table_62505 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" real,"Finish" text)
SELECT SUM("Total") FROM table_62505 WHERE "Year(s) won" = '1979'
What is the accreditation level for the approved (awarded 05.12.12) date?
CREATE TABLE table_name_72 (accreditation_level VARCHAR,date VARCHAR)
SELECT accreditation_level FROM table_name_72 WHERE date = "approved (awarded 05.12.12)"
Give me a bar chart for the total number of each class, and could you sort from high to low by the y-axis please?
CREATE TABLE race (Race_ID int,Name text,Class text,Date text,Track_ID text)CREATE TABLE track (Track_ID int,Name text,Location text,Seating real,Year_Opened real)
SELECT Class, COUNT(*) FROM race GROUP BY Class ORDER BY COUNT(*) DESC
Before round 7, what is the greatest Pick # for a player that plays defensive tackle?
CREATE TABLE table_name_5 (pick__number INTEGER,position VARCHAR,round VARCHAR)
SELECT MAX(pick__number) FROM table_name_5 WHERE position = "defensive tackle" AND round < 7
Please give me a bar chart for the total enrollment in each county, sort in asc by the total number.
CREATE TABLE endowment (endowment_id int,School_id int,donator_name text,amount real)CREATE TABLE School (School_id text,School_name text,Location text,Mascot text,Enrollment int,IHSAA_Class text,IHSAA_Football_Class text,County text)CREATE TABLE budget (School_id int,Year int,Budgeted int,total_budget_percent_budgeted...
SELECT County, SUM(Enrollment) FROM School GROUP BY County ORDER BY SUM(Enrollment)
What is Record, when Game is greater than 55, and when Date is 'March 25'?
CREATE TABLE table_8366 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location/Attendance" text,"Record" text)
SELECT "Record" FROM table_8366 WHERE "Game" > '55' AND "Date" = 'march 25'
Who is the captain of Neil Warnock's team?
CREATE TABLE table_3592 ("Team" text,"Manager" text,"Chairman" text,"Team captain" text,"Kit maker" text,"Sponsor" text)
SELECT "Team captain" FROM table_3592 WHERE "Manager" = 'Neil Warnock'
Users with 10 or more meta posts with score of 2 or more (Convention badge).
CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,Deletion...
SELECT u.Id AS "user_link", COUNT(*) AS NumPosts FROM Posts AS p INNER JOIN Users AS u ON u.Id = p.OwnerUserId WHERE p.Score >= 2 GROUP BY u.Id HAVING COUNT(*) >= 10 ORDER BY NumPosts DESC
tell me about flights from INDIANAPOLIS to HOUSTON
CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE days (days_code varchar,day_name varchar)CREATE...
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 = 'INDIANAPOLIS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'H...
When the winners votes were 50.54% who were the members of parliment?
CREATE TABLE table_18106841_1 (members_of_parliament VARCHAR,winners__percentage_votes VARCHAR)
SELECT members_of_parliament FROM table_18106841_1 WHERE winners__percentage_votes = "50.54%"
What's the highest scoring team in the round in Ring Knutstorp in which Polestar Racing is the winning team?
CREATE TABLE table_20079931_4 (highest_scoring_team VARCHAR,circuit_location VARCHAR,winning_team VARCHAR)
SELECT highest_scoring_team FROM table_20079931_4 WHERE circuit_location = "Ring Knutstorp" AND winning_team = "Polestar Racing"
Is it true that geoffrey e. hinton has more citations than yann lecun ?
CREATE TABLE paper (paperid int,title varchar,venueid int,year int,numciting int,numcitedby int,journalid int)CREATE TABLE paperfield (fieldid int,paperid int)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE dataset (datasetid int,datasetname varchar)CREATE TABLE paperdataset (paperid int,datasetid ...
SELECT DISTINCT author.authorname, COUNT(writes.paperid) FROM author, writes WHERE author.authorname IN ('geoffrey e. hinton', 'yann lecun') AND writes.authorid = author.authorid GROUP BY author.authorname ORDER BY COUNT(writes.paperid) DESC
Who is the mixed doubled on the tour korea super series?
CREATE TABLE table_27753492_2 (mixed_doubles VARCHAR,tour VARCHAR)
SELECT mixed_doubles FROM table_27753492_2 WHERE tour = "Korea Super Series"
show me the three year survival rate of patients who have been prescribed tobramycin-dexamethasone ophth oint after having been diagnosed with hypertension nos?
CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,ward...
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd...
calculate how many times patient 19627 received a laboratory test for potassium until 01/2103.
CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id...
SELECT COUNT(*) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'potassium') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19627) AND STRFTIME('%y-%m', labevents.charttime) <= '2103-01'
which is longer the carolina or kentucky race ?
CREATE TABLE table_204_630 (id number,"no" number,"date" text,"race" text,"track" text,"winner" text,"reports" text)
SELECT "race" FROM table_204_630 WHERE "race" IN ('carolina 500', 'kentucky') ORDER BY "no" DESC LIMIT 1
What time is CDT when PDT is 3:17 a.m.?
CREATE TABLE table_name_13 (cdt___5_utc_ VARCHAR,pdt___7_utc_ VARCHAR)
SELECT cdt___5_utc_ FROM table_name_13 WHERE pdt___7_utc_ = "3:17 a.m."
Who was Mountains Classification in the race with Nick Frey as Youth Classification and Tom Zirbel as Points Classification?
CREATE TABLE table_25679 ("Stage" real,"Winner" text,"General classification" text,"Mountains classification" text,"Points classification" text,"Youth classification" text,"Team Classification" text)
SELECT "Mountains classification" FROM table_25679 WHERE "Youth classification" = 'Nick Frey' AND "Points classification" = 'Tom Zirbel'
What Region has a Catalog of crgd 86136?
CREATE TABLE table_name_47 (region VARCHAR,catalog VARCHAR)
SELECT region FROM table_name_47 WHERE catalog = "crgd 86136"
What is the Pashto word for the Somali word talaado?
CREATE TABLE table_name_24 (pashto VARCHAR,somali VARCHAR)
SELECT pashto FROM table_name_24 WHERE somali = "talaado"
What years have claudia ruffo as the actor?
CREATE TABLE table_65588 ("Actor" text,"Character" text,"Soap Opera" text,"Years" text,"Duration" text)
SELECT "Years" FROM table_65588 WHERE "Actor" = 'claudia ruffo'
what is the maximum age of patients that survived in or above the age 72?
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 MAX(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.age >= "72"
What is Final, when Run 3 is 1:57.41?
CREATE TABLE table_name_60 (final VARCHAR,run_3 VARCHAR)
SELECT final FROM table_name_60 WHERE run_3 = "1:57.41"
Which away team has a venue of Arden Street Oval?
CREATE TABLE table_name_76 (away_team VARCHAR,venue VARCHAR)
SELECT away_team FROM table_name_76 WHERE venue = "arden street oval"
what was the first time that patient 031-24513 got a microbiology test?
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 cost (costid number,uniquepid text,patienthealthsystemstayid number,eventt...
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-24513')) ORDER BY microlab.culturetakentime LIMIT 1
What is the pick number for Danny Green in a round less than 2?
CREATE TABLE table_47989 ("Year" real,"Round" real,"Pick" real,"Player" text,"NBA Club" text)
SELECT COUNT("Pick") FROM table_47989 WHERE "Player" = 'danny green' AND "Round" < '2'
when was the last time patient 016-35266 was admitted via a hospital other hospital?
CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosag...
SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '016-35266' AND patient.hospitaladmitsource = 'other hospital' ORDER BY patient.hospitaladmittime DESC LIMIT 1
For those employees who was hired before 2002-06-21, give me the comparison about the sum of employee_id over the hire_date bin hire_date by weekday.
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 HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21'
Give me a pie to show how many other account details from different other account details.
CREATE TABLE Accounts (account_id INTEGER,customer_id INTEGER,date_account_opened DATETIME,account_name VARCHAR(50),other_account_details VARCHAR(255))CREATE TABLE Order_Items (order_item_id INTEGER,order_id INTEGER,product_id INTEGER,product_quantity VARCHAR(50),other_order_item_details VARCHAR(255))CREATE TABLE Finan...
SELECT other_account_details, COUNT(other_account_details) FROM Accounts GROUP BY other_account_details
What is the score from the game where Algeria is the opponent at Porto-Novo?
CREATE TABLE table_name_28 (score VARCHAR,opponent VARCHAR,location VARCHAR)
SELECT score FROM table_name_28 WHERE opponent = "algeria" AND location = "porto-novo"
What is the Location of the Bridge Built in 1869?
CREATE TABLE table_name_58 (location VARCHAR,built VARCHAR)
SELECT location FROM table_name_58 WHERE built = "1869"
Which series occurred in which the semi-finalist was runner-up and the 7800.00 was 6420.00?
CREATE TABLE table_2544694_3 (indonesia_super_series_2008 VARCHAR,runner_up VARCHAR)
SELECT indonesia_super_series_2008 FROM table_2544694_3 WHERE runner_up = "Semi-Finalist" AND 780000 = "6420.00"
What is the status of the fleet that was commissioned on July 28, 1963?
CREATE TABLE table_name_9 (status VARCHAR,commissioned VARCHAR)
SELECT status FROM table_name_9 WHERE commissioned = "july 28, 1963"
what is patient 031-22988's monthly maximum level of oxyhemoglobin?
CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,obs...
SELECT MAX(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 = '031-22988')) AND lab.labname = 'oxyhemoglobin' GROUP BY STRFTIME('%y-%m', lab.labr...
I want the score for 23 july 1992
CREATE TABLE table_name_86 (score VARCHAR,date VARCHAR)
SELECT score FROM table_name_86 WHERE date = "23 july 1992"
What player's original team are the Oakland Raiders?
CREATE TABLE table_80251 ("Original NFL team" text,"Player" text,"Pos." text,"College" text,"Conf." text)
SELECT "Player" FROM table_80251 WHERE "Original NFL team" = 'oakland raiders'
What is the number of patients diagnosed with rheumatic heart failure (congestive) who have a delta abnormal lab 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 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Rheumatic heart failure (congestive)" AND lab.flag = "delta"
so what's the average mch value of patient 006-157753 on their current hospital encounter?
CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE allergy (allergyid number,patientunits...
SELECT AVG(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 = '006-157753' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'mch'
Which Colliery has a Death toll of 7?
CREATE TABLE table_name_76 (colliery VARCHAR,death_toll VARCHAR)
SELECT colliery FROM table_name_76 WHERE death_toll = 7
What is the status of vessel number K-223?
CREATE TABLE table_1634376_1 (status VARCHAR,_number VARCHAR)
SELECT status FROM table_1634376_1 WHERE _number = "K-223"
Name the post poles for 4 podiums
CREATE TABLE table_29650 ("Season" real,"Series" text,"Team Name" text,"Races" real,"Poles" real,"Wins" real,"Podiums" real,"F/Laps" real,"Points" real,"Final Placing" text)
SELECT MAX("Poles") FROM table_29650 WHERE "Podiums" = '4'
A line chart for what are the number of the distinct visit dates?
CREATE TABLE Photos (Photo_ID INTEGER,Tourist_Attraction_ID INTEGER,Name VARCHAR(255),Description VARCHAR(255),Filename VARCHAR(255),Other_Details VARCHAR(255))CREATE TABLE Theme_Parks (Theme_Park_ID INTEGER,Theme_Park_Details VARCHAR(255))CREATE TABLE Hotels (hotel_id INTEGER,star_rating_code CHAR(15),pets_allowed_yn ...
SELECT Visit_Date, COUNT(Visit_Date) FROM Visits
How many faculty members does each building have? List the result with the name of the building with a bar chart, show from high to low by the x-axis.
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 Faculty_Participates_in (FacID INTEGER,actid INTEGER)CREATE TABLE Participates_in (stuid INTEGER,actid INTEGER)CREATE TABLE Student (StuID INTEGER,LName...
SELECT Building, COUNT(*) FROM Faculty GROUP BY Building ORDER BY Building DESC
What was the result of the game in Stuttgart, West Germany and a goal number of less than 9?
CREATE TABLE table_name_12 (result VARCHAR,venue VARCHAR,goal VARCHAR)
SELECT result FROM table_name_12 WHERE venue = "stuttgart, west germany" AND goal < 9
Who had the high rebounds in the game with a final score of w 140-108?
CREATE TABLE table_1683 ("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_1683 WHERE "Score" = 'W 140-108'
What is the weight of the shortest person?
CREATE TABLE people (Weight VARCHAR,Height VARCHAR)
SELECT Weight FROM people ORDER BY Height LIMIT 1
What was the 110H that the 1500m was 692 and the final was more than 7906?
CREATE TABLE table_77037 ("Athlete" text,"Event" text,"100 m" real,"400 m" real,"110H" real,"1500 m" text,"Final" real)
SELECT COUNT("110H") FROM table_77037 WHERE "1500 m" = '692' AND "Final" > '7906'
What is the mean pick when the play is Marc Lewis (lhp) and the round is less than 20?
CREATE TABLE table_name_76 (pick INTEGER,player VARCHAR,round VARCHAR)
SELECT AVG(pick) FROM table_name_76 WHERE player = "marc lewis (lhp)" AND round < 20
Which Opponent has a Surface of hardcourt, an Outcome of runner-up, and a Tournament of honolulu?
CREATE TABLE table_name_51 (opponent VARCHAR,tournament VARCHAR,surface VARCHAR,outcome VARCHAR)
SELECT opponent FROM table_name_51 WHERE surface = "hardcourt" AND outcome = "runner-up" AND tournament = "honolulu"
dysphagia nec what does it stand for?
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 inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE cost (row_id number,...
SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'dysphagia nec' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'dysphagia nec'
For all employees who have the letters D or S in their first name, show me about the distribution of job_id and the average of employee_id , and group by attribute job_id in a bar chart, and list y axis in asc order please.
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 jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE countries (COUNTRY_ID varchar(2),...
SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY AVG(EMPLOYEE_ID)
What Points for has a Try bonus of 140?
CREATE TABLE table_name_26 (points_for VARCHAR,try_bonus VARCHAR)
SELECT points_for FROM table_name_26 WHERE try_bonus = "140"
Name the langauge for switzerland
CREATE TABLE table_71432 ("Country" text,"Film title used in nomination" text,"Language" text,"Original title" text,"Director" text)
SELECT "Language" FROM table_71432 WHERE "Country" = 'switzerland'
Name the total number of bids of the sun belt conference
CREATE TABLE table_10722506_6 (_number_of_bids VARCHAR,conference VARCHAR)
SELECT COUNT(_number_of_bids) FROM table_10722506_6 WHERE conference = "Sun Belt"
Count the number of cinemas.
CREATE TABLE cinema (cinema_id number,name text,openning_year number,capacity number,location text)CREATE TABLE film (film_id number,rank_in_series number,number_in_season number,title text,directed_by text,original_air_date text,production_code text)CREATE TABLE schedule (cinema_id number,film_id number,date text,show...
SELECT COUNT(*) FROM cinema
What is the lowest Rank with more than 0 bronze, 8 silver, and a total of 19, with less than 9 gold?
CREATE TABLE table_name_23 (rank INTEGER,gold VARCHAR,total VARCHAR,bronze VARCHAR,silver VARCHAR)
SELECT MIN(rank) FROM table_name_23 WHERE bronze > 0 AND silver = 8 AND total = 19 AND gold < 9
What is the number of patients with private health insurance who had a urea nitrogen urine lab test?
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Private" AND lab.label = "Urea Nitrogen, Urine"
Name the 2006 when the 2010 is 27
CREATE TABLE table_15796 ("Tournament" text,"2006" text,"2007" text,"2008" text,"2009" text,"2010" text,"2011" text,"2012" text)
SELECT "2006" FROM table_15796 WHERE "2010" = '27'
What was the score of the game when the Indians ended up with a record of 55-51?
CREATE TABLE table_name_33 (score VARCHAR,record VARCHAR)
SELECT score FROM table_name_33 WHERE record = "55-51"
Who won the mens singles when sayaka sato won the womens singles?
CREATE TABLE table_12275551_1 (mens_singles VARCHAR,womens_singles VARCHAR)
SELECT mens_singles FROM table_12275551_1 WHERE womens_singles = "Sayaka Sato"
What is the name of the Original artist when the week # is top 16 (8 men)?
CREATE TABLE table_name_15 (original_artist VARCHAR,week__number VARCHAR)
SELECT original_artist FROM table_name_15 WHERE week__number = "top 16 (8 men)"
With an original artist names Bette Midler, what is the order number?
CREATE TABLE table_21501565_1 (order__number VARCHAR,original_artist VARCHAR)
SELECT COUNT(order__number) FROM table_21501565_1 WHERE original_artist = "Bette Midler"
Posts that were edited by other users.
CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId...
SELECT Id AS "post_link", LastEditorUserId AS "user_link", LastEditDate FROM Posts WHERE OwnerUserId = '##UserId##' AND LastEditorUserId != '##UserId##' ORDER BY LastEditDate DESC
How many appointment dates were recorded when J rgen Kohler was the replaced by?
CREATE TABLE table_21275 ("Team" text,"Outgoing manager" text,"Manner of departure" text,"Date of vacancy" text,"Replaced by" text,"Date of appointment" text)
SELECT COUNT("Date of appointment") FROM table_21275 WHERE "Replaced by" = 'Jürgen Kohler'
What is the average year with an average start smaller than 6.3 and fewer than 0 wins?
CREATE TABLE table_36915 ("Year" real,"Starts" real,"Wins" real,"Top 5" real,"Top 10" real,"Poles" real,"Avg. Start" real,"Avg. Finish" real,"Winnings" text,"Position" text)
SELECT AVG("Year") FROM table_36915 WHERE "Avg. Start" < '6.3' AND "Wins" < '0'
japan earned only 1 bronze metal in boxing during the 1960 olympics . how many other countries earned the exact same metal count as japan ?
CREATE TABLE table_203_496 (id number,"pos" number,"country" text,"gold" number,"silver" number,"bronze" number,"total" number)
SELECT COUNT("country") FROM table_203_496 WHERE "country" <> 'japan' AND "bronze" = 1 AND "total" = 1
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and the sum of code , and group by attribute name, and I want to display Name in asc order.
CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)
SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name
Which Wins have Losses smaller than 6, and a Position of 4, and Played larger than 9?
CREATE TABLE table_name_98 (wins INTEGER,played VARCHAR,losses VARCHAR,position VARCHAR)
SELECT MIN(wins) FROM table_name_98 WHERE losses < 6 AND position = 4 AND played > 9
What date did the epiode that had 1.37 million as the rating originally air?
CREATE TABLE table_27218002_2 (originalairdate VARCHAR,ratings VARCHAR)
SELECT originalairdate FROM table_27218002_2 WHERE ratings = "1.37 Million"
When divisional semifinals are the playoffs what is the year?
CREATE TABLE table_23374 ("Year" text,"Division" text,"League" text,"Regular Season" text,"Playoffs" text,"Open Cup" text)
SELECT "Year" FROM table_23374 WHERE "Playoffs" = 'Divisional Semifinals'
Which label released the catalog Magik Muzik CD 07 on 28 March 2007?
CREATE TABLE table_name_86 (label VARCHAR,date VARCHAR,catalog VARCHAR)
SELECT label FROM table_name_86 WHERE date = "28 march 2007" AND catalog = "magik muzik cd 07"
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of hire_date and the average of employee_id bin hire_date by weekday in a bar chart, and sort in ascending by the Y-axis.
CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))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 v...
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(EMPLOYEE_ID)
when did patient 029-16431 come this year for the last time to the hospital?
CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text...
SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '029-16431' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY patient.hospitaladmittime DESC LIMIT 1
what is the number of patients whose diagnoses long title is sinoatrial node dysfunction?
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,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 ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Sinoatrial node dysfunction"
Show me how many destination by destination in a histogram, display by the bars in ascending.
CREATE TABLE certificate (eid number(9,0),aid number(9,0))CREATE TABLE employee (eid number(9,0),name varchar2(30),salary number(10,2))CREATE TABLE flight (flno number(4,0),origin varchar2(20),destination varchar2(20),distance number(6,0),departure_date date,arrival_date date,price number(7,2),aid number(9,0))CREATE TA...
SELECT destination, COUNT(destination) FROM flight GROUP BY destination ORDER BY destination
Which player plays for the college of manitoba?
CREATE TABLE table_52523 ("Pick #" real,"CFL Team" text,"Player" text,"Position" text,"College" text)
SELECT "Player" FROM table_52523 WHERE "College" = 'manitoba'
what is diagnoses short title of subject id 17519?
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 diagnoses.short_title FROM diagnoses WHERE diagnoses.subject_id = "17519"
What was the Engine, when the Chassis was Bugatti T51, and when the Entrant was a Private Entry?
CREATE TABLE table_7679 ("Driver" text,"Entrant" text,"Constructor" text,"Chassis" text,"Engine" text)
SELECT "Engine" FROM table_7679 WHERE "Chassis" = 'bugatti t51' AND "Entrant" = 'private entry'
find the number of patients whose admission type is elective and lab test name is potassium, urine.
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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.label = "Potassium, Urine"
Name the city for los angeles stadium
CREATE TABLE table_30442 ("Stadium" text,"Capacity" real,"City" text,"Country" text,"Tenant" text,"Opening" text)
SELECT "City" FROM table_30442 WHERE "Stadium" = 'Los Angeles Stadium'
What is the Film/Show, when the Year is 2010?
CREATE TABLE table_68099 ("Year" real,"Group" text,"Award" text,"Film/Show" text,"Result" text)
SELECT "Film/Show" FROM table_68099 WHERE "Year" = '2010'
Name the score for opponents of nathan healey igor kunitsyn
CREATE TABLE table_38244 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Partnering" text,"Opponents in the final" text,"Score" text)
SELECT "Score" FROM table_38244 WHERE "Opponents in the final" = 'nathan healey igor kunitsyn'
What is the average Season, when F/Laps is 1, and when Poles is less than 0?
CREATE TABLE table_42825 ("Season" real,"Series" text,"Races" real,"Wins" real,"Poles" real,"F/Laps" real,"Podiums" real,"Points" text,"Position" text)
SELECT AVG("Season") FROM table_42825 WHERE "F/Laps" = '1' AND "Poles" < '0'
let me know the birth date and death date of patient caren obrien.
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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text...
SELECT demographic.dob, demographic.dod FROM demographic WHERE demographic.name = "Caren Obrien"
Show party names and the number of events for each party. Visualize by pie chart.
CREATE TABLE party (Party_ID int,Minister text,Took_office text,Left_office text,Region_ID int,Party_name text)CREATE TABLE member (Member_ID int,Member_Name text,Party_ID text,In_office text)CREATE TABLE party_events (Event_ID int,Event_Name text,Party_ID int,Member_in_charge_ID int)CREATE TABLE region (Region_ID int,...
SELECT Party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID
List all results from the 3-3 scoring game.
CREATE TABLE table_26930 ("Game" real,"Date" text,"Opponent" text,"Result" text,"Wildcats points" real,"Opponents" real,"Record" text)
SELECT "Result" FROM table_26930 WHERE "Record" = '3-3'
How many laps did BRM have with a grid of 11?
CREATE TABLE table_name_33 (laps VARCHAR,constructor VARCHAR,grid VARCHAR)
SELECT COUNT(laps) FROM table_name_33 WHERE constructor = "brm" AND grid = 11