instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What was the score for the golfer from the country of fiji?
CREATE TABLE table_47057 ("Place" text,"Player" text,"Country" text,"Score" real,"To par" text)
SELECT COUNT("Score") FROM table_47057 WHERE "Country" = 'fiji'
provide the number of patients whose drug code is rosi8.
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 diagnoses (subject_id text,hadm_id text,icd9_code text,sho...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "ROSI8"
Where is Eduardo Romero from?
CREATE TABLE table_12327 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text)
SELECT "Country" FROM table_12327 WHERE "Player" = 'eduardo romero'
A line chart for what are the number of the dates with a maximum temperature higher than 85?, rank by the X from low to high.
CREATE TABLE station (id INTEGER,name TEXT,lat NUMERIC,long NUMERIC,dock_count INTEGER,city TEXT,installation_date TEXT)CREATE TABLE status (station_id INTEGER,bikes_available INTEGER,docks_available INTEGER,time TEXT)CREATE TABLE weather (date TEXT,max_temperature_f INTEGER,mean_temperature_f INTEGER,min_temperature_f...
SELECT date, COUNT(date) FROM weather WHERE max_temperature_f > 85 GROUP BY date ORDER BY date
What is Michael Stewart's school or club team?
CREATE TABLE table_name_93 (school_club_team VARCHAR,player VARCHAR)
SELECT school_club_team FROM table_name_93 WHERE player = "michael stewart"
What is the name of episode number 29 in the series?
CREATE TABLE table_29273182_1 (title VARCHAR,no_in_series VARCHAR)
SELECT title FROM table_29273182_1 WHERE no_in_series = 29
give me the number of patients whose admission location is phys referral/normal deli and lab test fluid is pleural?
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND lab.fluid = "Pleural"
What is the lowest Attendance, when Home Team is 'Welling United'?
CREATE TABLE table_name_26 (attendance INTEGER,home_team VARCHAR)
SELECT MIN(attendance) FROM table_name_26 WHERE home_team = "welling united"
What is the extortion and theft rates where the United Nations Observer Mission Uganda-Rwanda is active?
CREATE TABLE table_15652027_1 (extortion_theft_3 VARCHAR,united_nations_mission VARCHAR)
SELECT extortion_theft_3 FROM table_15652027_1 WHERE united_nations_mission = "United Nations Observer Mission Uganda-Rwanda"
when did patient 012-39576 get discharged from the hospital in 2102 for the first time?
CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE microlab ...
SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '012-39576' AND STRFTIME('%y', patient.hospitaldischargetime) = '2102' ORDER BY patient.hospitaldischargetime LIMIT 1
to how many patients was the drug maalox/diphenhydramine/lidocaine administered via po route?
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 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Maalox/Diphenhydramine/Lidocaine" AND prescriptions.route = "PO"
Which arena has a capactiy of 1,100?
CREATE TABLE table_55106 ("Team" text,"City/Area" text,"Arena" text,"Capacity" text,"Last season" text)
SELECT "Arena" FROM table_55106 WHERE "Capacity" = '1,100'
Give me the number of the descriptions of the service types that cost more than 100, I want to sort in desc by the Y-axis.
CREATE TABLE Stores (Store_ID VARCHAR(100),Address_ID INTEGER,Marketing_Region_Code CHAR(15),Store_Name VARCHAR(255),Store_Phone VARCHAR(255),Store_Email_Address VARCHAR(255),Other_Details VARCHAR(255))CREATE TABLE Products (Product_ID VARCHAR(100),Product_Name VARCHAR(255),Product_Price DECIMAL(20,4),Product_Descripti...
SELECT Service_Type_Description, COUNT(Service_Type_Description) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100 GROUP BY Service_Type_Description ORDER BY COUNT(Service_Type_Description) DESC
Who was the replacement manager for the vacancy of 12 Dec 2009?
CREATE TABLE table_22297198_3 (replaced_by VARCHAR,date_of_vacancy VARCHAR)
SELECT replaced_by FROM table_22297198_3 WHERE date_of_vacancy = "12 Dec 2009"
Who did Collingwood play at home?
CREATE TABLE table_name_89 (home_team VARCHAR,away_team VARCHAR)
SELECT home_team FROM table_name_89 WHERE away_team = "collingwood"
What us the number of the round during which #56 Blue Thunder Racing become the GTP winning team and #38 Mandeville Auto Tech became the GTO winning team?
CREATE TABLE table_13643320_2 (rnd VARCHAR,gtp_winning_team VARCHAR,gto_winning_team VARCHAR)
SELECT rnd FROM table_13643320_2 WHERE gtp_winning_team = "#56 Blue Thunder Racing" AND gto_winning_team = "#38 Mandeville Auto Tech"
What is the 1st leg of the team with a 2-1 agg.?
CREATE TABLE table_name_13 (agg VARCHAR)
SELECT 1 AS st_leg FROM table_name_13 WHERE agg = "2-1"
Who is the driver of the Chevrolet engine that is sponsored by godaddy.com?
CREATE TABLE table_3202 ("Team" text,"#" real,"Car Sponsor(s)" text,"Driver(s)" text,"Listed Owner(s)" text,"Engine" text,"Chassis" text)
SELECT "Driver(s)" FROM table_3202 WHERE "Engine" = 'Chevrolet' AND "Car Sponsor(s)" = 'GoDaddy.com'
Which Time/Retired has Laps smaller than 14, and a Rider of darren barton?
CREATE TABLE table_58776 ("Rider" text,"Manufacturer" text,"Laps" real,"Time/Retired" text,"Grid" real)
SELECT "Time/Retired" FROM table_58776 WHERE "Laps" < '14' AND "Rider" = 'darren barton'
Who was the opponent when they played at the legion field birmingham, al site?
CREATE TABLE table_43835 ("Date" text,"Opponent" text,"Site" text,"Result" text,"Attendance" text)
SELECT "Opponent" FROM table_43835 WHERE "Site" = 'legion field • birmingham, al'
What is the Copa Libertadores 1999 result for team vasco, which made the group stage in the Copa Mercosur 1999?
CREATE TABLE table_39175 ("Team" text,"Copa Libertadores 1999" text,"Copa Mercosur 1999" text,"Copa CONMEBOL 1999" text,"Intercontinental Cup 1999" text)
SELECT "Copa Libertadores 1999" FROM table_39175 WHERE "Copa Mercosur 1999" = 'group stage' AND "Team" = 'vasco'
what are the four most frequent procedures for patients with an age 40s?
CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosi...
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 4
What is the sum of Total ranking 9 and a Gold more than 6
CREATE TABLE table_name_74 (total INTEGER,rank VARCHAR,gold VARCHAR)
SELECT SUM(total) FROM table_name_74 WHERE rank = "9" AND gold > 6
What is the English name of the country that has Ramallah as its capital?
CREATE TABLE table_7047 ("English country name" text,"Arabic romanised country name" text,"Arabic country name" text,"English capital name" text,"Arabic romanised capital name" text,"Arabic capital name" text)
SELECT "English country name" FROM table_7047 WHERE "English capital name" = 'ramallah'
How many times was Arizona the team and the round was bigger than 11?
CREATE TABLE table_name_86 (overall VARCHAR,school_club_team VARCHAR,round VARCHAR)
SELECT COUNT(overall) FROM table_name_86 WHERE school_club_team = "arizona" AND round > 11
How many home games by each weekday (bin the year attr into weekdays interval)? Give me a bar chart.
CREATE TABLE batting (player_id TEXT,year INTEGER,stint INTEGER,team_id TEXT,league_id TEXT,g INTEGER,ab NUMERIC,r NUMERIC,h NUMERIC,double NUMERIC,triple NUMERIC,hr NUMERIC,rbi NUMERIC,sb NUMERIC,cs NUMERIC,bb NUMERIC,so NUMERIC,ibb NUMERIC,hbp NUMERIC,sh NUMERIC,sf NUMERIC,g_idp NUMERIC)CREATE TABLE team_half (year I...
SELECT year, COUNT(year) FROM home_game
what is patient 88409's insurance on their last hospital encounter?
CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABL...
SELECT admissions.insurance FROM admissions WHERE admissions.subject_id = 88409 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1
count the number of times that patient 16572 has taken tpn.
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 d_labitems (row_id number,itemid number,label text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,chartt...
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 = 16572)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'tpn' AND d_i...
Where was adac rally deutschland's rally HQ?
CREATE TABLE table_name_62 (rally_hq VARCHAR,rally_name VARCHAR)
SELECT rally_hq FROM table_name_62 WHERE rally_name = "adac rally deutschland"
What is the total number of bronze medals for teams with less than 0 silver?
CREATE TABLE table_name_98 (bronze VARCHAR,silver INTEGER)
SELECT COUNT(bronze) FROM table_name_98 WHERE silver < 0
Which headquarter locations are used by more than 2 companies?
CREATE TABLE companies (id number,name text,headquarters text,industry text,sales_billion number,profits_billion number,assets_billion number,market_value_billion text)CREATE TABLE buildings (id number,name text,city text,height number,stories number,status text)CREATE TABLE office_locations (building_id number,company...
SELECT headquarters FROM companies GROUP BY headquarters HAVING COUNT(*) > 2
Show me about the correlation between author_id and author_tutor_ATB in a scatter chart.
CREATE TABLE Students (student_id INTEGER,date_of_registration DATETIME,date_of_latest_logon DATETIME,login_name VARCHAR(40),password VARCHAR(10),personal_name VARCHAR(40),middle_name VARCHAR(40),family_name VARCHAR(40))CREATE TABLE Subjects (subject_id INTEGER,subject_name VARCHAR(120))CREATE TABLE Course_Authors_and_...
SELECT author_id, author_tutor_ATB FROM Course_Authors_and_Tutors ORDER BY personal_name
Name the original air date for prod code 201
CREATE TABLE table_25747 ("#" text,"Original title" text,"Directed by" text,"Written by" text,"Original air dates" text,"Prod. code" real)
SELECT "Original air dates" FROM table_25747 WHERE "Prod. code" = '201'
What is Points, when Points is 60, and when Club is Bedwas RFC?
CREATE TABLE table_name_24 (points_for VARCHAR,points VARCHAR,club VARCHAR)
SELECT points_for FROM table_name_24 WHERE points = "60" AND club = "bedwas rfc"
What is the average year that had a value less than 2,575 in Inglewood?
CREATE TABLE table_name_27 (year INTEGER,inglewood INTEGER)
SELECT AVG(year) FROM table_name_27 WHERE inglewood < 2 OFFSET 575
A bar chart for what is the number of locations of the wrestlers, and could you order in asc by the Location?
CREATE TABLE wrestler (Wrestler_ID int,Name text,Reign text,Days_held text,Location text,Event text)CREATE TABLE Elimination (Elimination_ID text,Wrestler_ID text,Team text,Eliminated_By text,Elimination_Move text,Time text)
SELECT Location, COUNT(Location) FROM wrestler GROUP BY Location ORDER BY Location
what is the drug name and route for the drug code amid200?
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, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "AMID200"
Plot the number of county by grouped by county as a bar graph, and I want to list in ascending by the bars.
CREATE TABLE grapes (ID INTEGER,Grape TEXT,Color TEXT)CREATE TABLE appellations (No INTEGER,Appelation TEXT,County TEXT,State TEXT,Area TEXT,isAVA TEXT)CREATE TABLE wine (No INTEGER,Grape TEXT,Winery TEXT,Appelation TEXT,State TEXT,Name TEXT,Year INTEGER,Price INTEGER,Score INTEGER,Cases INTEGER,Drink TEXT)
SELECT County, COUNT(County) FROM appellations GROUP BY County ORDER BY County
Which trainer had a time of 1:10.09 with a year less than 2009?
CREATE TABLE table_74529 ("Year" real,"Winner" text,"Jockey" text,"Trainer" text,"Time" text,"Grade" text)
SELECT "Trainer" FROM table_74529 WHERE "Year" < '2009' AND "Time" = '1:10.09'
Name the F. Goals for games of 22 22 and points of 012 12
CREATE TABLE table_name_31 (games VARCHAR,points VARCHAR)
SELECT F.goals FROM table_name_31 WHERE games = "22 22" AND points = "012 12"
what was the maximum monthly number of patients who had abn find-stool contents this year?
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,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE patients (row_id number,subject_id number,ge...
SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'abn find-stool contents') AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_TI...
What is the number of points of the game less than number 17 with an 11-6-0 record?
CREATE TABLE table_name_43 (points INTEGER,record VARCHAR,game__number VARCHAR)
SELECT SUM(points) FROM table_name_43 WHERE record = "11-6-0" AND game__number < 17
Name the number of going to for thurlby, braceborough spa at departure being 16.50
CREATE TABLE table_21415 ("Departure" text,"Going to" text,"Calling at" text,"Arrival" text,"Operator" text)
SELECT COUNT("Going to") FROM table_21415 WHERE "Calling at" = 'Thurlby, Braceborough Spa' AND "Departure" = '16.50'
Who did the most assists when Matt Barnes (11) got the most rebounds?
CREATE TABLE table_72891 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "High assists" FROM table_72891 WHERE "High rebounds" = 'Matt Barnes (11)'
At what arena was the September 21 game?
CREATE TABLE table_14137 ("Date" text,"Opponent" text,"Score" text,"Record" text,"Arena" text)
SELECT "Arena" FROM table_14137 WHERE "Date" = 'september 21'
what is the average total hospital cost involving a procedure called a anticonvulsant - lamotrigine until 2104?
CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender ...
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'anticonvulsant - lamotrigine')) AND STRFTIME...
What is Australia's role in the UN operation Unama?
CREATE TABLE table_10121127_1 (australian_role VARCHAR,un_operation_name VARCHAR)
SELECT australian_role FROM table_10121127_1 WHERE un_operation_name = "UNAMA"
Show the location with most number of train stations.
CREATE TABLE station (LOCATION VARCHAR)
SELECT LOCATION FROM station GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1
What is the Episode number of Ernest Dickerson in 2009 when the show was dexter?
CREATE TABLE table_50505 ("Year" real,"Show" text,"Season" text,"Episode" text,"Notes" text)
SELECT "Episode" FROM table_50505 WHERE "Year" = '2009' AND "Show" = 'dexter'
What is the fastest lap for a season smaller than 1979?
CREATE TABLE table_33644 ("Season" real,"Series Name" text,"Champion" text,"Races \u2020" text,"Pole Positions" text,"Wins" text,"Podiums" text,"Fastest Laps" text,"Points" text,"Margin (pts)" text)
SELECT "Fastest Laps" FROM table_33644 WHERE "Season" < '1979'
How many gold medals for a nation with rank less than 5, more than 0 silvers and a total of 2 medals?
CREATE TABLE table_name_27 (gold INTEGER,total VARCHAR,rank VARCHAR,silver VARCHAR)
SELECT AVG(gold) FROM table_name_27 WHERE rank < 5 AND silver > 0 AND total = 2
What does Prof. Kristina Daugirdas teach ?
CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE ...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Kristina Daugirdas%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering...
what is the name of the diagnosis patient 32606 last was received during this year?
CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)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 d_icd_procedures (row_id number,icd9_code text,short_title text...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT diagnoses_icd.icd9_code FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 32606) AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(C...
Which game was played on October 13?
CREATE TABLE table_27713030_3 (game INTEGER,date VARCHAR)
SELECT MAX(game) FROM table_27713030_3 WHERE date = "October 13"
What is the type if the transfer window is summer and the moving from category is free agent?
CREATE TABLE table_name_89 (type VARCHAR,transfer_window VARCHAR,moving_from VARCHAR)
SELECT type FROM table_name_89 WHERE transfer_window = "summer" AND moving_from = "free agent"
How many games have 5 goals and less than 8 assists?
CREATE TABLE table_name_20 (games VARCHAR,goals VARCHAR,assists VARCHAR)
SELECT COUNT(games) FROM table_name_20 WHERE goals = 5 AND assists < 8
what is the total number of awards that he has won ?
CREATE TABLE table_204_838 (id number,"year" number,"award" text,"category" text,"nominated work" text,"result" text)
SELECT COUNT("award") FROM table_204_838 WHERE "result" = 'won'
How many points were there in a year earlier than 1977, a Cosworth V8 engine, and an entry from HB Bewaking alarm systems?
CREATE TABLE table_57589 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" real)
SELECT "Points" FROM table_57589 WHERE "Year" < '1977' AND "Engine" = 'cosworth v8' AND "Entrant" = 'hb bewaking alarm systems'
Name the Silver which has a Bronze of 19, and a Total larger than 58?
CREATE TABLE table_51110 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT MIN("Silver") FROM table_51110 WHERE "Bronze" = '19' AND "Total" > '58'
in what playoffs the league was in the semifinals
CREATE TABLE table_22801 ("Year" text,"League" text,"Reg. Season" text,"Playoffs" text,"Owner(s)" text,"Avg. Attendance" real)
SELECT "League" FROM table_22801 WHERE "Playoffs" = 'Semifinals'
what is the least population listed in the table ?
CREATE TABLE table_204_64 (id number,"place" text,"code" number,"area (km2)" number,"population" number,"most spoken language" text)
SELECT MIN("population") FROM table_204_64
count the number of unmarried patients admitted before the year 2179.
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.admityear < "2179"
which weights more a ut507 salvage tug or a ut515 salvage tug ?
CREATE TABLE table_203_201 (id number,"class" text,"type" text,"ships" text,"displacement" text,"note" text)
SELECT "class" FROM table_203_201 WHERE "class" IN ('ut507 class', 'ut515 class') ORDER BY "displacement" DESC LIMIT 1
What location did the team win before 1998 in the europe/africa zone, group i, round robin?
CREATE TABLE table_name_96 (location VARCHAR,year VARCHAR,competition VARCHAR,result VARCHAR)
SELECT location FROM table_name_96 WHERE competition = "europe/africa zone, group i, round robin" AND result = "win" AND year < 1998
How many brandings are there where the Power kW (ERP) is 1kW (29.94kW ERP)?
CREATE TABLE table_2610582_2 (branding VARCHAR,power_kw__erp_ VARCHAR)
SELECT COUNT(branding) FROM table_2610582_2 WHERE power_kw__erp_ = "1kW (29.94kW ERP)"
tell me the only country to schore below 38 total points .
CREATE TABLE table_204_979 (id number,"place" number,"nation" text,"5 hoops" text,"3 balls,\n2 ribbons" text,"total" number)
SELECT "nation" FROM table_204_979 WHERE "total" < 38
who is the opponent when norway is against?
CREATE TABLE table_50814 ("Edition" text,"Round" text,"Date" text,"Against" text,"Surface" text,"Opponent" text,"Result" text)
SELECT "Opponent" FROM table_50814 WHERE "Against" = 'norway'
What is the 2012 value with a 1.3 in 2010 and a 3.6 in 2008?
CREATE TABLE table_name_67 (Id VARCHAR)
SELECT 2012 FROM table_name_67 WHERE 2010 = "1.3" AND 2008 = "3.6"
When was the episode 2x10 aired for the first time?
CREATE TABLE table_23441 ("Episode" text,"First broadcast" text,"Rufus guest" text,"Marcus guest" text,"Winner" text)
SELECT "First broadcast" FROM table_23441 WHERE "Episode" = '2x10'
When id the episode broadcast with Mark Webber as Jamie and John's guest?
CREATE TABLE table_30961 ("Episode" text,"First broadcast" text,"Andrew and Georgies guest Lee Mack replaced Andrew Flintoff as team captain for one week in series 4,episode 2." text,"Jamie and Johns guest" text,"Scores" text)
SELECT "First broadcast" FROM table_30961 WHERE "Jamie and Johns guest" = 'Mark Webber'
Show the organizer and name for churches that opened between 1830 and 1840.
CREATE TABLE church (organized_by VARCHAR,name VARCHAR,open_date INTEGER)
SELECT organized_by, name FROM church WHERE open_date BETWEEN 1830 AND 1840
Find ACC_Road and the average of Team_ID , and group by attribute ACC_Road, and visualize them by a bar chart, and order by the y axis in desc.
CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Perce...
SELECT ACC_Road, AVG(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY AVG(Team_ID) DESC
WHich Score has a To par of 3, and a Country of united states?
CREATE TABLE table_77081 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text)
SELECT "Score" FROM table_77081 WHERE "To par" = '–3' AND "Country" = 'united states'
How many times was pernell whitaker an opponent?
CREATE TABLE table_17529 ("Number" real,"Name" text,"Titles" text,"Date" text,"Opponent" text,"Result" text,"Defenses" real)
SELECT COUNT("Date") FROM table_17529 WHERE "Opponent" = 'Pernell Whitaker'
what is minimum age of patients whose language is cape and primary disease is complete heart block?
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 MIN(demographic.age) FROM demographic WHERE demographic.language = "CAPE" AND demographic.diagnosis = "COMPLETE HEART BLOCK"
What is the shipping agent code of shipping agent UPS?
CREATE TABLE addresses (address_id number,address_details text)CREATE TABLE documents_mailed (document_id number,mailed_to_address_id number,mailing_date time)CREATE TABLE ref_shipping_agents (shipping_agent_code text,shipping_agent_name text,shipping_agent_description text)CREATE TABLE roles (role_code text,role_descr...
SELECT shipping_agent_code FROM ref_shipping_agents WHERE shipping_agent_name = "UPS"
What was the lowest lost entry for a team with fewer than 21 goals for?
CREATE TABLE table_name_39 (lost INTEGER,goals_for INTEGER)
SELECT MIN(lost) FROM table_name_39 WHERE goals_for < 21
If the position in table is 10th, and the manner of departure was resigned, what was the date of vacancy?
CREATE TABLE table_29321 ("Team" text,"Outgoing head coach" text,"Manner of departure" text,"Date of vacancy" text,"Position in table" text,"Incoming head coach" text,"Date of appointment" text)
SELECT "Date of vacancy" FROM table_29321 WHERE "Manner of departure" = 'Resigned' AND "Position in table" = '10th'
Who had the high assists on the date December 12?
CREATE TABLE table_11960944_4 (high_assists VARCHAR,date VARCHAR)
SELECT high_assists FROM table_11960944_4 WHERE date = "December 12"
What is Odjidja-Ofoe's transfer fee?
CREATE TABLE table_name_82 (transfer_fee VARCHAR,name VARCHAR)
SELECT transfer_fee FROM table_name_82 WHERE name = "odjidja-ofoe"
what is the game when march is 15?
CREATE TABLE table_name_12 (game INTEGER,march VARCHAR)
SELECT SUM(game) FROM table_name_12 WHERE march = 15
prostate specific antigen > 4 ng / ml
CREATE TABLE table_train_149 ("id" int,"prostate_specific_antigen_psa" float,"c_peptide_level" float,"hemoglobin_a1c_hba1c" float,"fasting_serum_glucose" int,"vitamin_d" int,"NOUSE" float)
SELECT * FROM table_train_149 WHERE prostate_specific_antigen_psa > 4
What is the Tie no of the game with a Score of 1 1?
CREATE TABLE table_12304 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text)
SELECT "Tie no" FROM table_12304 WHERE "Score" = '1–1'
history of severe hypoglycemia
CREATE TABLE table_train_243 ("id" int,"c_peptide_level" float,"finger_stick_measurements" bool,"diabetic" string,"fasting_blood_glucose_fbg" float,"hypoglycemia" bool,"insulin_requirement" float,"triglyceride_tg" float,"a1c" float,"age" float,"NOUSE" float)
SELECT * FROM table_train_243 WHERE hypoglycemia = 1
Report all majors that have less than 3 students.
CREATE TABLE STUDENT (Major VARCHAR)
SELECT Major FROM STUDENT GROUP BY Major HAVING COUNT(*) < 3
when patient 49141 did get a lab test the first time during their first hospital visit?
CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number...
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 49141 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) ORDER BY labevents.charttime LIMIT 1
Visualize a bar chart about the distribution of ACC_Road and School_ID , and group by attribute ACC_Home, and order by the ACC_Road in asc.
CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Percent int,All_Home text,All_Road text,All_Neutral text)CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,En...
SELECT ACC_Road, School_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY ACC_Road
specify the primary disease and icd9 code of patient id 2110
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 demographic.diagnosis, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2110"
has patient 82132 received an anion gap test during the current hospital encounter?
CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABL...
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'anion gap') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 82132 AND admissions.dischtime IS NULL)
What's Australia's time in the heat more than 4?
CREATE TABLE table_63751 ("Heat" real,"Lane" real,"Name" text,"Nationality" text,"Time" text)
SELECT "Time" FROM table_63751 WHERE "Heat" > '4' AND "Nationality" = 'australia'
What classes this semester are a prerequisite to most other classes ?
CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE course (course_...
SELECT COUNT(DISTINCT course_prerequisite.course_id), course.department, course.name, course.number FROM course, course_offering, course_prerequisite, semester WHERE course.course_id = course_offering.course_id AND course.course_id = course_prerequisite.pre_course_id AND course.department = 'EECS' AND semester.semester...
What is the Loss of the game at Nationwide Arena with a Score of 4 3?
CREATE TABLE table_79629 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text,"Arena" text,"Points" real)
SELECT "Loss" FROM table_79629 WHERE "Score" = '4–3' AND "Arena" = 'nationwide arena'
How many Hispanic or Latino/Puerto Rican patients with the item id 51214?
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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND lab.itemid = "51214"
how did patient 8204 go into the hospital the first time.
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 microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE cost (row_id number...
SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 8204 ORDER BY admissions.admittime LIMIT 1
What date has a status of 1995 rugby world cup and an against of 20?
CREATE TABLE table_name_21 (date VARCHAR,status VARCHAR,against VARCHAR)
SELECT date FROM table_name_21 WHERE status = "1995 rugby world cup" AND against = 20
What is the total for the team with fewer than 2 bronze, ranked less than 4 and fewer than 1 silver?
CREATE TABLE table_name_98 (total VARCHAR,silver VARCHAR,bronze VARCHAR,rank VARCHAR)
SELECT COUNT(total) FROM table_name_98 WHERE bronze < 2 AND rank < 4 AND silver < 1
What company built the car driven by Tony Brooks?
CREATE TABLE table_53229 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real)
SELECT "Constructor" FROM table_53229 WHERE "Driver" = 'tony brooks'
which canadian driver finished first : alex tagliani or paul tracy ?
CREATE TABLE table_203_519 (id number,"pos" number,"no" number,"driver" text,"team" text,"laps" number,"time/retired" text,"grid" number,"points" number)
SELECT "driver" FROM table_203_519 WHERE "driver" IN ('alex tagliani', 'paul tracy') ORDER BY "pos" LIMIT 1
What is the ID of marshall landfill on 09/08/1983?
CREATE TABLE table_51657 ("CERCLIS ID" text,"Name" text,"County" text,"Proposed" text,"Listed" text,"Construction completed" text,"Partially deleted" text)
SELECT "CERCLIS ID" FROM table_51657 WHERE "Listed" = '09/08/1983' AND "Name" = 'marshall landfill'
what is the total number of dates ?
CREATE TABLE table_204_792 (id number,"#" number,"date" text,"opponent" text,"score" text,"win" text,"loss" text,"save" text,"attendance" number,"record" text)
SELECT COUNT("date") FROM table_204_792