table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
CREATE TABLE table_name_37 ( third INTEGER, club VARCHAR, rank VARCHAR )
What is the smallest number of third place earned for the Es Sahel at a rank less than 3?
SELECT MIN(third) FROM table_name_37 WHERE club = "es sahel" AND rank < 3
CREATE TABLE table_17625749_1 ( club VARCHAR, tries_for VARCHAR )
Name the club for when tries for is 32
SELECT club FROM table_17625749_1 WHERE tries_for = "32"
CREATE TABLE table_17209 ( "Round" real, "Overall" text, "Player" text, "Position" text, "Nationality" text, "Club team" text )
What position is the player Jordan Fransoo in?
SELECT "Position" FROM table_17209 WHERE "Player" = 'Jordan Fransoo'
CREATE TABLE table_name_71 ( competition VARCHAR, venue VARCHAR, score VARCHAR )
Venue of klfa stadium, cheras, and a Score of 3-3 had what competition?
SELECT competition FROM table_name_71 WHERE venue = "klfa stadium, cheras" AND score = "3-3"
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, e...
For the top 3 days with the largest max gust speeds, show the date and average temperature with a bar chart.
SELECT date, mean_temperature_f FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 3
CREATE TABLE table_204_871 ( id number, "ano" text, "title" text, "role" text, "channel" text, "notes" text )
how many tv shows did natalia oreiro between 1998 and 2002 ?
SELECT COUNT("title") FROM table_204_871 WHERE "ano" >= 1998 AND "ano" <= 2002
CREATE TABLE table_8011 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What is the date when Grimsby Town is the home team?
SELECT "Date" FROM table_8011 WHERE "Home team" = 'grimsby town'
CREATE TABLE table_21956 ( "Name" text, "Map colour" text, "First operated" real, "Type" text, "Length" text, "No. Sta" real, "Current Stock" text, "Future Stock" text, "Trips per annum (\u00d71000)" real, "Avg. trips per mile (\u00d71000)" real )
When 4744 is the avg. trips per mile (x1000) what is the current stock?
SELECT "Current Stock" FROM table_21956 WHERE "Avg. trips per mile (\u00d71000)" = '4744'
CREATE TABLE table_1000181_1 ( current_series VARCHAR, notes VARCHAR )
What is the current series where the new series began in June 2011?
SELECT current_series FROM table_1000181_1 WHERE notes = "New series began in June 2011"
CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE fare_basis ( far...
the cheapest flights between BOSTON and PHILADELPHIA which arrive between 3 and 1700 o'clock on tuesday
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, fare, flight, flight_fare WHERE ((((((flight.arrival_time < flight.departure_time) AND date_day.day_number = 22 AND date_day.month_number = 3 AND date_day.yea...
CREATE TABLE table_204_795 ( id number, "date" text, "opponent" text, "score" text, "result" text, "location" text, "attendance" number )
which team did this team face against next after beating minnesota on january 29 of this season ?
SELECT "opponent" FROM table_204_795 WHERE "date" > (SELECT "date" FROM table_204_795 WHERE "date" = 'january 29, 1949') ORDER BY "date" LIMIT 1
CREATE TABLE table_54709 ( "Catches" text, "Player" text, "Versus" text, "Venue" text, "Date" text )
What date had a versus of source: cricinfo.com?
SELECT "Date" FROM table_54709 WHERE "Versus" = 'source: cricinfo.com'
CREATE TABLE table_16698 ( "Year" real, "Winners" text, "Grand Finalist" text, "Scores" text, "Venue" text, "Crowd" real, "Margin" real, "Season Result" text )
what's the grand finalist where winners is collingwood
SELECT "Grand Finalist" FROM table_16698 WHERE "Winners" = 'Collingwood'
CREATE TABLE table_12283 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What is the Venue with the Friendly Competition?
SELECT "Venue" FROM table_12283 WHERE "Competition" = 'friendly'
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) ) CREAT...
Find the number of dorms for each gender in a bar chart, I want to show by the x axis from high to low please.
SELECT gender, COUNT(*) FROM Dorm GROUP BY gender ORDER BY gender DESC
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
what was the name of the output that patient 002-7771 got last until 1929 days ago?
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-7771')) AND intakeoutput.cellpath LIKE '%output%' AND DA...
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom te...
what are the top three most common laboratory tests that followed in the same hospital encounter for patients who were given ins drug-elut coronry st until 2103?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_i...
CREATE TABLE table_name_38 ( score VARCHAR, date VARCHAR )
What was the score of the match played on 5 September 2001?
SELECT score FROM table_name_38 WHERE date = "5 september 2001"
CREATE TABLE table_69759 ( "First game" real, "Played" real, "Drawn" real, "Lost" real, "Percentage" text )
What is the sum of matches played that has a year of first match before 2000, fewer than 21 lost, and 0 drawn?
SELECT SUM("Played") FROM table_69759 WHERE "First game" < '2000' AND "Lost" < '21' AND "Drawn" < '0'
CREATE TABLE table_name_66 ( against INTEGER, played VARCHAR, drawn VARCHAR, points VARCHAR )
What is the average against that has a drawn less than 7, points greater than 22, and 19 for the played?
SELECT AVG(against) FROM table_name_66 WHERE drawn < 7 AND points > 22 AND played = 19
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, ...
how many asian patients have diagnoses icd9 code 30501?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "ASIAN" AND diagnoses.icd9_code = "30501"
CREATE TABLE table_name_67 ( round INTEGER, player VARCHAR )
What is the highest round played by Chris Phillips?
SELECT MAX(round) FROM table_name_67 WHERE player = "chris phillips"
CREATE TABLE course ( course_id VARCHAR, dept_name VARCHAR )
How many different courses offered by Physics department?
SELECT COUNT(DISTINCT course_id) FROM course WHERE dept_name = 'Physics'
CREATE TABLE table_34236 ( "Season" text, "Order" text, "Played" real, "Drawn" real, "Lost" real, "Penalties" real, "Points For" real, "Points Against" real, "Points Diff" real, "Coach" text )
How many games were lost when the order was 2nd and the play was more than 13
SELECT COUNT("Lost") FROM table_34236 WHERE "Order" = '2nd' AND "Played" > '13'
CREATE TABLE table_train_53 ( "id" int, "immune_suppression" bool, "need_hemodialysis" bool, "steroid_therapy" bool, "cardiogenic_shock" bool, "hematologic_disease" bool, "coronary_syndrome" bool, "NOUSE" float )
immunosuppression, systemic steroid therapy ( > 10 mg prednisolon / day )
SELECT * FROM table_train_53 WHERE immune_suppression = 1 OR steroid_therapy = 1
CREATE TABLE table_30552 ( "#" real, "Player" text, "Country" text, "Points" real, "Reset points" real, "Events" real )
what is the person there the numbers is 2343
SELECT "Player" FROM table_30552 WHERE "Points" = '2343'
CREATE TABLE table_23329 ( "(Virtual)" text, "Callsign" text, "Affiliation" text, "Branding" text, "Channel" text, "Programming" text, "Owner" text )
what is the virtual callsign if is wnet
SELECT "(Virtual)" FROM table_23329 WHERE "Callsign" = 'WNET'
CREATE TABLE table_name_7 ( pick VARCHAR, round VARCHAR, position VARCHAR )
What was the pick number for the kicker in round 8?
SELECT COUNT(pick) FROM table_name_7 WHERE round = "round 8" AND position = "kicker"
CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIGH_DEGREE varchar(5) ) CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS varchar(20), ...
How many courses each teacher taught? Show me a bar chart grouping by course code, sort names in ascending order please.
SELECT CRS_CODE, COUNT(CRS_CODE) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM GROUP BY CRS_CODE ORDER BY CRS_CODE
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
what is the number of office admission patients who have procedure icd9 code 4233?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND procedures.icd9_code = "4233"
CREATE TABLE table_2758 ( "Pos" text, "##" real, "Name" text, "Team" text, "Lap One" text, "Lap Two" text, "Lap Three" text, "Lap Four" text, "Total Time" text, "Avg. Speed" text )
How many positions have a total time of 1:30.4135?
SELECT COUNT("Pos") FROM table_2758 WHERE "Total Time" = '1:30.4135'
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
how many widow patients had transplant from cadaver?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "WIDOWED" AND procedures.short_title = "Transplant cadaver donor"
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 t...
how many patients whose admission type is emergency and drug type is main?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.drug_type = "MAIN"
CREATE TABLE table_37550 ( "Date" text, "City" text, "Opponent" text, "Results\u00b9" text, "Type of game" text )
What day did Yugoslavia play Luxembourg?
SELECT "Date" FROM table_37550 WHERE "Opponent" = 'luxembourg'
CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_start_date DATETIME, booking_end_date DATETIME ) CREATE TABLE Apartment_Buildin...
Return the apartment number and the number of rooms for each apartment, sort by the bars in desc.
SELECT apt_number, room_count FROM Apartments ORDER BY apt_number DESC
CREATE TABLE table_name_85 ( lungchang VARCHAR, halang VARCHAR, rera VARCHAR )
Which Lungchang has a Halang of , and a Rera of o ?
SELECT lungchang FROM table_name_85 WHERE halang = "ʒɯ²" AND rera = "ʒo²"
CREATE TABLE table_68773 ( "Estimate" text, "Name" text, "Nat." text, "Ship type" text, "Where sunk" text, "Date" text )
What nation had a ship named Roma?
SELECT "Nat." FROM table_68773 WHERE "Name" = 'roma'
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org...
whats patient 3229 minimum arterial bp mean on the first icu visit?
SELECT MIN(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3229) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemid I...
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 Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy ( StuID INTEGE...
Find the last name and age of the student who has allergy to both milk and cat Show a bar chart, order in asc by the Y.
SELECT LName, Age FROM Student WHERE StuID IN (SELECT StuID FROM Has_Allergy WHERE Allergy = "Milk" INTERSECT SELECT StuID FROM Has_Allergy WHERE Allergy = "Cat") ORDER BY Age
CREATE TABLE table_15887683_17 ( dar VARCHAR, television_service VARCHAR )
Name the dar for telenord
SELECT dar FROM table_15887683_17 WHERE television_service = "Telenord"
CREATE TABLE table_name_81 ( position VARCHAR, birthplace VARCHAR )
What is the Position of the person with a birthplace of phoenix, new york?
SELECT position FROM table_name_81 WHERE birthplace = "phoenix, new york"
CREATE TABLE table_name_50 ( against INTEGER, wins VARCHAR, draws VARCHAR, losses VARCHAR )
Which Against has a Draws larger than 0, a Losses smaller than 16, and a Wins smaller than 4?
SELECT MAX(against) FROM table_name_50 WHERE draws > 0 AND losses < 16 AND wins < 4
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 t...
How many patients categorized under a chemistry lab test are diagnosed with esophageal varices in diseases classified elsewhere (with bleeding)?
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.short_title = "Bleed esoph var oth dis" AND lab."CATEGORY" = "Chemistry"
CREATE TABLE table_name_35 ( builder VARCHAR, country VARCHAR, location VARCHAR )
What is Builder, when Country is 'United Kingdom', and when Location is 'Chatham, Kent'?
SELECT builder FROM table_name_35 WHERE country = "united kingdom" AND location = "chatham, kent"
CREATE TABLE table_8560 ( "Episode Number" real, "Air Date" text, "Event 1" text, "Event 2" text, "Event 3" text, "Event 4" text )
What is the earliest episode aired on 8 June 2008?
SELECT MIN("Episode Number") FROM table_8560 WHERE "Air Date" = '8 june 2008'
CREATE TABLE table_71446 ( "Tournament" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text )
What is the 2009 value with a q1 in 2006 in the French Open?
SELECT "2009" FROM table_71446 WHERE "2006" = 'q1' AND "Tournament" = 'french open'
CREATE TABLE table_name_20 ( elevation VARCHAR, county VARCHAR )
Tell me the elevation for oslo
SELECT elevation FROM table_name_20 WHERE county = "oslo"
CREATE TABLE table_73201 ( "No." real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real, "Television order" text )
who wrote s01e06
SELECT "Written by" FROM table_73201 WHERE "Television order" = 'S01E06'
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 t...
what number of patients admitted before the year 2125 have lab test item id 51484?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2125" AND lab.itemid = "51484"
CREATE TABLE table_49927 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text )
WHAT IS THE POSITION FOR CANADA, ROUND SMALLER THAN 7, PLAYER ZACH BOYCHUK?
SELECT "Position" FROM table_49927 WHERE "Nationality" = 'canada' AND "Round" < '7' AND "Player" = 'zach boychuk'
CREATE TABLE table_28473 ( "Character" text, "Played by" text, "Season 1" real, "Season 2" real, "Season 3" real, "Season 4" real, "First Appearance" text )
How many season 3 appearances by Morgan the Dog?
SELECT MAX("Season 3") FROM table_28473 WHERE "Played by" = 'Morgan the Dog'
CREATE TABLE table_test_16 ( "id" int, "left_ventricular_ejection_fraction_lvef" int, "systolic_blood_pressure_sbp" int, "severe_hypertension" bool, "adrenaline" bool, "stroke" bool, "renal_disease" bool, "severe_uncontrolled_arterial_hypertension" bool, "hepatic_disease" bool, "...
recent stroke ( within the last six month )
SELECT * FROM table_test_16 WHERE stroke = 1
CREATE TABLE table_62407 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What player scored 68-66=134?
SELECT "Player" FROM table_62407 WHERE "Score" = '68-66=134'
CREATE TABLE table_1341865_44 ( incumbent VARCHAR, district VARCHAR )
what's incumbent with district being tennessee 5
SELECT incumbent FROM table_1341865_44 WHERE district = "Tennessee 5"
CREATE TABLE table_27411 ( "Country" text, "Skip" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real, "Shot %" real )
Name the ends won for blank ends for 0
SELECT "Ends Won" FROM table_27411 WHERE "Blank Ends" = '0'
CREATE TABLE table_35256 ( "Rank" real, "Airport" text, "Location" text, "Code (IATA)" text, "Total Cargo (Metric Tonnes)" text, "2003 Rank" text, "% Change" text )
What is the IATA code of the airport that has a Total Cargo of 1,838,894 Metric Tonnes?
SELECT "Code (IATA)" FROM table_35256 WHERE "Total Cargo (Metric Tonnes)" = '1,838,894'
CREATE TABLE table_name_13 ( date_of_birth VARCHAR, position_s_ VARCHAR, seasons VARCHAR )
What is the date of birth of the goalkeeper from the 1st season?
SELECT date_of_birth FROM table_name_13 WHERE position_s_ = "goalkeeper" AND seasons = "1st"
CREATE TABLE table_27696 ( "Round" real, "Circuit" text, "Location" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Winning team" text, "Supporting" text )
Who got the pole position if the supporting is USAC National Midget Series?
SELECT "Pole position" FROM table_27696 WHERE "Supporting" = 'USAC National Midget Series'
CREATE TABLE table_77710 ( "Name" text, "Bodyweight" real, "Snatch" real, "Clean & jerk" real, "Total (kg)" real )
Name the average clean and jerk for snatch of 140 and total kg less than 315
SELECT AVG("Clean & jerk") FROM table_77710 WHERE "Snatch" = '140' AND "Total (kg)" < '315'
CREATE TABLE table_41741 ( "Date" text, "Opponent" text, "Location" text, "Score" text, "Loss" text, "Record" text )
What is the name of the Opponent when there is a Record of 39-19?
SELECT "Opponent" FROM table_41741 WHERE "Record" = '39-19'
CREATE TABLE table_21582 ( "County" text, "Kerry%" text, "Kerry#" real, "Bush%" text, "Bush#" real, "Others%" text, "Others#" real )
What is the percentage of others when the number of others is 2286?
SELECT "Others%" FROM table_21582 WHERE "Others#" = '2286'
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) C...
Uber Employees on Stack Overflow by reputation.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Users.AboutMe) LIKE LOWER('% Uber %') ORDER BY Reputation DESC
CREATE TABLE table_670 ( "Year" real, "Finish position" text, "1st day" text, "2nd day" text, "3rd day" text, "4th Day" text )
what's the 4th day with 3rd day being bumped by downing
SELECT "4th Day" FROM table_670 WHERE "3rd day" = 'bumped by Downing'
CREATE TABLE technician ( Name VARCHAR, technician_ID VARCHAR ) CREATE TABLE machine ( Machine_series VARCHAR, machine_id VARCHAR ) CREATE TABLE repair_assignment ( machine_id VARCHAR, technician_ID VARCHAR )
Show names of technicians and series of machines they are assigned to repair.
SELECT T3.Name, T2.Machine_series FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID
CREATE TABLE table_10007452_3 ( fuel_propulsion VARCHAR, fleet_series__quantity_ VARCHAR )
what is the fuel propulsion where the fleet series (quantity) is 310-329 (20)?
SELECT fuel_propulsion FROM table_10007452_3 WHERE fleet_series__quantity_ = "310-329 (20)"
CREATE TABLE table_54250 ( "Player" text, "No.(s)" text, "Height in Ft." text, "Position" text, "Years for Rockets" text, "School/Club Team/Country" text )
What is the Height for Years for Rockets of 2005-06?
SELECT "Height in Ft." FROM table_54250 WHERE "Years for Rockets" = '2005-06'
CREATE TABLE table_204_888 ( id number, "location" text, "mile" number, "destinations" text, "notes" text )
how many miles is the us 522 south - berkeley springs , wv location ?
SELECT "mile" FROM table_204_888 WHERE "destinations" = 'us 522 south - berkeley springs, wv'
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
what's the total output of patient 033-3992 today?
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-3992')) AND intakeoutput.cellpath LIKE '%out...
CREATE TABLE table_204_980 ( id number, "name" text, "type" text, "elevation\n(ground station)" number, "elevation\n(mountain station)" number, "slope length" number, "capacity\n(persons/hour)" number, "construction year" number )
what name was in the last construction year ?
SELECT "name" FROM table_204_980 ORDER BY "construction year" DESC LIMIT 1
CREATE TABLE table_11820 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" real, "Record" text )
Name the record when the visitor is mavericks
SELECT "Record" FROM table_11820 WHERE "Visitor" = 'mavericks'
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE prescriptions ( row_id number, subject_id number, h...
count the number of times patient 26849 during the last year had received a venous cath nec procedure.
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'venous cath nec') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26849) AND DATETIME(procedures_icd....
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeri...
how many hours has elapsed since the last time that patient 006-133605 took a enteral tube intake: orogastric oral 16 intake on the current icu visit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ...
CREATE TABLE table_10268 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which away team scored 17.17 (119)?
SELECT "Away team" FROM table_10268 WHERE "Away team score" = '17.17 (119)'
CREATE TABLE table_55622 ( "Year" real, "Rank" real, "Games" real, "Win%" real, "Postseason" text )
What postseason has a win% between 0.40700000000000003 and 108 with a rank of 1?
SELECT "Postseason" FROM table_55622 WHERE "Win%" > '0.40700000000000003' AND "Games" < '108' AND "Rank" = '1'
CREATE TABLE table_name_38 ( winter_olympics VARCHAR, country VARCHAR )
What was the Winter Olympics was Japan as the country?
SELECT winter_olympics FROM table_name_38 WHERE country = "japan"
CREATE TABLE table_44379 ( "Number" text, "Builder" text, "Type" text, "Date" text, "Works number" text )
What is Type, when Works Number is 75823?
SELECT "Type" FROM table_44379 WHERE "Works number" = '75823'
CREATE TABLE table_30845 ( "taluka Name" text, "Population (2001 census)" real, "% of District Population" text, "Male" real, "Male(%)" text, "Female" real, "Female(%)" text, "Sex Ratio" real, "Literacy" real, "Literacy(%)" text, "Literate Male" real, "Literate Male(%)" t...
How many literate male (%) are there in the district that has a population of 3.28?
SELECT COUNT("Literate Male(%)") FROM table_30845 WHERE "% of District Population" = '3.28'
CREATE TABLE table_15346009_1 ( date VARCHAR, location VARCHAR )
On what day was the tournament in Alabama?
SELECT date FROM table_15346009_1 WHERE location = "Alabama"
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE...
Highest Scoring Comments by User. Finds the highest-scoring comments by a user.
SELECT Id AS "comment_link", PostId AS "post_link", CreationDate AS "comment_date", Score FROM Comments WHERE '##UserId:int##' = UserId AND Score > 0 ORDER BY Score DESC, CreationDate DESC LIMIT 1000
CREATE TABLE table_name_91 ( score VARCHAR, attendance VARCHAR, away_team VARCHAR )
What is the score when the attendance is less than 83 and Raunds Town is the away team?
SELECT score FROM table_name_91 WHERE attendance < 83 AND away_team = "raunds town"
CREATE TABLE table_10935548_1 ( title VARCHAR, directed_by VARCHAR )
Which episode was directed by Jean de Segonzac?
SELECT title FROM table_10935548_1 WHERE directed_by = "Jean de Segonzac"
CREATE TABLE list ( classroom VARCHAR, grade VARCHAR )
Report the total number of students for each fourth-grade classroom.
SELECT classroom, COUNT(*) FROM list WHERE grade = "4" GROUP BY classroom
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 ( ...
count the number of patients whose admission type is elective and primary disease is coronary artery disease?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.diagnosis = "CORONARY ARTERY DISEASE"
CREATE TABLE table_name_80 ( laps INTEGER, year VARCHAR )
How many laps were in 1958?
SELECT SUM(laps) FROM table_name_80 WHERE year = "1958"
CREATE TABLE table_name_48 ( body_width_mm INTEGER, lead_pitch_mm VARCHAR, body_length_mm VARCHAR )
Which Body Width/mm has a Lead Pitch/mm smaller than 0.55, and a Body Length/mm larger than 18.4?
SELECT MIN(body_width_mm) FROM table_name_48 WHERE lead_pitch_mm < 0.55 AND body_length_mm > 18.4
CREATE TABLE table_name_11 ( week INTEGER, game_site VARCHAR, date VARCHAR )
What average week has shea stadium as the game site, and 1979-12-09 as the date?
SELECT AVG(week) FROM table_name_11 WHERE game_site = "shea stadium" AND date = "1979-12-09"
CREATE TABLE table_76405 ( "Year" text, "2009" text, "2008" text, "2007" text, "2006" text, "2005" text, "2004" text, "2003" text )
What is the 2007 for the 2003 desert prince?
SELECT "2007" FROM table_76405 WHERE "2003" = 'desert prince'
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
give the number of patients who have been transferred within this facility and have stayed in the hospital for more than 30 days.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.days_stay > "30"
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,...
what is the number of patients categorized under chemistry lab test who have diagnoses of unspecified procedure as the cause of abnormal reaction of patient, or of later complication, without mention of misadventure at the time of procedure?
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.short_title = "Abn react-procedure NOS" AND lab."CATEGORY" = "Chemistry"
CREATE TABLE table_204_781 ( id number, "name(s)" text, "yard no." number, "type (as built)" text, "owner" text, "imo number" number, "laid down" text, "launched" text, "delivered/\ncommissioned" text, "fate/\ndecommissioned" text, "notes" text )
who is the first owner listed in the top portion of the table ?
SELECT "owner" FROM table_204_781 WHERE id = 1
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid numb...
how many hours have passed since the first time that patient 016-27397 was given a procedure during the current hospital visit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-27397...
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 ) ...
what is the number of patients whose admission year is less than 2129 and item id is 50993?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2129" AND lab.itemid = "50993"
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) 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...
how many patients in the ccu careunit in 2105?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'ccu' AND STRFTIME('%y', transfers.intime) = '2105')
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREA...
when was the first time since 05/2105 that a medication prescribed to patient 022-89058.
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-89058')) AND STRFTIME('%y-%m', medication.drugstarttime) >...
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 microlab ( microl...
what are the top four most frequently given diagnoses that patients were given in the same hospital visit after being diagnosed with drug withdrawal syndrome - alcohol?
SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'drug ...
CREATE TABLE Room ( RoomNumber INTEGER, RoomType VARCHAR(30), BlockFloor INTEGER, BlockCode INTEGER, Unavailable BOOLEAN ) CREATE TABLE Physician ( EmployeeID INTEGER, Name VARCHAR(30), Position VARCHAR(30), SSN INTEGER ) CREATE TABLE Stay ( StayID INTEGER, Patient INTEGER,...
A bar chart for listing the number of the names of patients who have made appointments, and order from low to high by the y axis.
SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Patient AS T2 ON T1.Patient = T2.SSN GROUP BY Name ORDER BY COUNT(Name)
CREATE TABLE table_1140082_2 ( location VARCHAR, race VARCHAR )
Where is the German Grand Prix?
SELECT location FROM table_1140082_2 WHERE race = "German Grand Prix"
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
give the number of patients who were admitted before the year 2198 and undergone the procedure circumcision.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2198" AND procedures.long_title = "Circumcision"
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a scatter chart about the correlation between employee_id and commission_pct .
SELECT EMPLOYEE_ID, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
CREATE TABLE table_78172 ( "Season" real, "Belonging league" text, "Matches" real, "league point" real, "Draw" real, "Lose" real, "Goal difference" real, "Point" real, "Lost point" real, "Final rank" real )
I want the average lose for lost point more than 16 and goal difference less than 37 and point less than 43
SELECT AVG("Lose") FROM table_78172 WHERE "Lost point" > '16' AND "Goal difference" < '37' AND "Point" < '43'