table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
CREATE TABLE table_name_34 ( agg VARCHAR, team_2 VARCHAR )
Name the agg for team 2 of asl sport guyanais.
SELECT agg FROM table_name_34 WHERE team_2 = "asl sport guyanais"
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 prescription...
what is discharge time of subject id 8440?
SELECT demographic.dischtime FROM demographic WHERE demographic.subject_id = "8440"
CREATE TABLE table_name_72 ( race VARCHAR, replica VARCHAR )
Which race has a replica of DNF?
SELECT race FROM table_name_72 WHERE replica = "dnf"
CREATE TABLE table_name_6 ( Id VARCHAR )
What 1997, has qf as a 1994, and 1r as a 1999?
SELECT 1997 FROM table_name_6 WHERE 1994 = "qf" AND 1999 = "1r"
CREATE TABLE table_name_62 ( attendance INTEGER, week VARCHAR )
what is the sum of attendance of week 11
SELECT SUM(attendance) FROM table_name_62 WHERE week = 11
CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE field ( fieldid int ) CREATE TA...
which year had the most NIPS papers ?
SELECT DISTINCT COUNT(paper.paperid), paper.year FROM paper, venue WHERE venue.venueid = paper.venueid AND venue.venuename = 'NIPS' GROUP BY paper.year ORDER BY COUNT(paper.paperid) DESC
CREATE TABLE student ( major VARCHAR, city_code VARCHAR )
Find the numbers of different majors and cities.
SELECT COUNT(DISTINCT major), COUNT(DISTINCT city_code) FROM student
CREATE TABLE table_name_18 ( bodyweight VARCHAR, total__kg_ VARCHAR )
Which bodyweight has a Total (kg) of 145.0?
SELECT bodyweight FROM table_name_18 WHERE total__kg_ = "145.0"
CREATE TABLE table_name_7 ( director VARCHAR, prod_code VARCHAR )
Who directed the episode with production code 40811-005?
SELECT director FROM table_name_7 WHERE prod_code = "40811-005"
CREATE TABLE table_name_66 ( state VARCHAR, royal_house VARCHAR )
Which state has a royal house of Ying?
SELECT state FROM table_name_66 WHERE royal_house = "ying"
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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, chart...
calculate how many times patient 26995 has undergone the procedure of insert endotracheal tube a year before.
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 = 'insert endotracheal tube') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26995) AND DATETIME(proced...
CREATE TABLE table_22627 ( "Year" real, "Champion (average in final)" text, "Legs" text, "Runner-up (average in final)" text, "Sponsor" text, "Prize Fund" text, "Champion" text, "Runner-up" text, "Venue" text )
How much was the prize money for rwe-sporthalle, m lheim ?
SELECT "Prize Fund" FROM table_22627 WHERE "Venue" = 'RWE-Sporthalle, Mülheim'
CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE geographic ( city_name varchar, county varchar, region varchar ) CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_n...
show me a good arabic restaurant in mountain view ?
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'mountain view' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5
CREATE TABLE table_name_42 ( score VARCHAR, record VARCHAR )
WHAT SCORE HAD A RECORD OF 1-1?
SELECT score FROM table_name_42 WHERE record = "1-1"
CREATE TABLE table_16388478_3 ( date VARCHAR, away_team VARCHAR )
On what date did the away team Fremantle play?
SELECT date FROM table_16388478_3 WHERE away_team = "Fremantle"
CREATE TABLE table_name_30 ( stadium VARCHAR, final_score VARCHAR )
In what stadium did a game result in a final scoreline reading 27-34?
SELECT stadium FROM table_name_30 WHERE final_score = "27-34"
CREATE TABLE table_67801 ( "Date" text, "Home captain" text, "Away captain" text, "Venue" text, "Result" text )
What venue had a draw?
SELECT "Venue" FROM table_67801 WHERE "Result" = 'draw'
CREATE TABLE table_23057 ( "Series #" real, "Episode #" real, "Title" text, "Written by" text, "Directed by" text, "Viewers" real, "Original airdate" text )
What is the series number for the episode written by Kristen Dunphy and David Ogilvy?
SELECT MAX("Series #") FROM table_23057 WHERE "Written by" = 'Kristen Dunphy and David Ogilvy'
CREATE TABLE table_8576 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text )
what is the latest year when the venue is berlin, germany?
SELECT MAX("Year") FROM table_8576 WHERE "Venue" = 'berlin, germany'
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
what is the number of patients whose admission type is emergency and procedure long title is hemodialysis?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.long_title = "Hemodialysis"
CREATE TABLE table_12557 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text )
What was the latest year with a position of 1st at Maputo, Mozambique?
SELECT MAX("Year") FROM table_12557 WHERE "Position" = '1st' AND "Venue" = 'maputo, mozambique'
CREATE TABLE table_200_41 ( id number, "number" text, "encoding" text, "implied probability" number )
what is the implied probability of 8 = 23 + 0 ?
SELECT "implied probability" FROM table_200_41 WHERE "number" = '8 = 23 + 0'
CREATE TABLE table_74569 ( "Area" text, "Advertisement date" text, "Block" text, "Winning applicant" text, "Ensemble name" text )
Who is the Winning Applicant of Ensemble Name Muxco Lincolnshire in Block 10D?
SELECT "Winning applicant" FROM table_74569 WHERE "Block" = '10d' AND "Ensemble name" = 'muxco lincolnshire'
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 (...
Find out the short title of the procedure for procedure icd9 code 3613.
SELECT procedures.short_title FROM procedures WHERE procedures.icd9_code = "3613"
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
For Ibsen and Strindberg , are there any classes I need to have taken ?
SELECT DISTINCT advisory_requirement FROM course WHERE name LIKE '%Ibsen and Strindberg%'
CREATE TABLE table_name_59 ( finish VARCHAR, player VARCHAR )
What was the finish for Billy Casper?
SELECT finish FROM table_name_59 WHERE player = "billy casper"
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TAB...
Percentage of closed question per month.
SELECT LAST_DATE_OF_MONTH(p.CreationDate), ROUND((COUNT(p.ClosedDate)) * 100.0 / (COUNT(p.Id)), 2) AS percentage FROM Posts AS p WHERE (p.PostTypeId = 1) AND (p.CreationDate >= '##Date1?2010-01-01##') AND (p.CreationDate <= '##Date2?2021-01-01##') GROUP BY LAST_DATE_OF_MONTH(p.CreationDate) ORDER BY LAST_DATE_OF_MONTH(...
CREATE TABLE staff ( staff_id number, staff_address_id number, nickname text, first_name text, middle_name text, last_name text, date_of_birth time, date_joined_staff time, date_left_staff time ) CREATE TABLE customers ( customer_id number, customer_address_id number, cu...
In what city does Janessa Sawayn live?
SELECT T1.city FROM addresses AS T1 JOIN staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn"
CREATE TABLE table_name_24 ( player VARCHAR, nationality VARCHAR )
Which player has a nationality of spain?
SELECT player FROM table_name_24 WHERE nationality = "spain"
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val...
what was the name of procedure, that patient 43959 was first received in this year?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 43959) AND DATETIME(procedures_icd.charttime, 'start of year') = DAT...
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE icustays ( row_id number, s...
how many hours has passed since the last sodium polystyrene sulfonate prescription of patient 99647 in this hospital visit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 99647 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'sodium polystyrene sulfonate' ORDER BY presc...
CREATE TABLE table_203_700 ( id number, "year" number, "species" text, "height" text, "location grown" text, "state" text, "notes" text )
what species of tree was the tallest one used ?
SELECT "species" FROM table_203_700 ORDER BY "height" DESC LIMIT 1
CREATE TABLE customer ( cust_ID varchar(3), cust_name varchar(20), acc_type char(1), acc_bal int, no_of_loans int, credit_score int, branch_ID int, state varchar(20) ) CREATE TABLE bank ( branch_ID int, bname varchar(20), no_of_customers int, city varchar(10), state ...
What is the average account balance of customers with credit score below 50 for the different account types. Visualize by bar chart.
SELECT acc_type, AVG(acc_bal) FROM customer WHERE credit_score < 50 GROUP BY acc_type
CREATE TABLE table_name_42 ( podium VARCHAR, race VARCHAR, flap VARCHAR )
On Race 14 when the FLap is larger than 1, what is the podium number?
SELECT COUNT(podium) FROM table_name_42 WHERE race = 14 AND flap > 1
CREATE TABLE table_35609 ( "Team" text, "Copa Libertadores 1996" text, "Supercopa Sudamericana 1996" text, "Copa CONMEBOL 1996" text, "Recopa Sudamericana 1996" text )
What is the recoupa sudamericana 1996 result of team corinthians?
SELECT "Recopa Sudamericana 1996" FROM table_35609 WHERE "Team" = 'corinthians'
CREATE TABLE table_36579 ( "Player" text, "Touchdowns (5 points)" real, "Extra points 1 point" real, "Field goals (5 points)" real, "Total Points" real )
Which Extra points 1 point is the highest one that has a Total Points smaller than 8?
SELECT MAX("Extra points 1 point") FROM table_36579 WHERE "Total Points" < '8'
CREATE TABLE table_54845 ( "Team" text, "Nation" text, "From" text, "Matches" real, "Drawn" real, "Lost" real, "Win %" real )
Name the sum of drawn for 30 october 2006 and win % more than 43.2
SELECT SUM("Drawn") FROM table_54845 WHERE "From" = '30 october 2006' AND "Win %" > '43.2'
CREATE TABLE table_name_5 ( Id VARCHAR )
What is the 2013 with virgin in 2009?
SELECT 2013 FROM table_name_5 WHERE 2009 = "virgin"
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, systemics...
when did patient 027-41381 get admitted to the hospital for the first time until 2104 via emergency department?
SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '027-41381' AND patient.hospitaladmitsource = 'emergency department' AND STRFTIME('%y', patient.hospitaladmittime) <= '2104' ORDER BY patient.hospitaladmittime LIMIT 1
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 TAB...
since 6 years ago, how many patients were given the stress ulcer prophylaxis - esomeprazole two times?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'stress ulcer prophylaxis - esomeprazole' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(),...
CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS varchar(20), DEPT_EXTENSION varchar(4) ) CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE STUDENT ( STU_NUM...
Return a bar chart on what is the number of professors for different school?
SELECT SCHOOL_CODE, COUNT(*) FROM DEPARTMENT AS T1 JOIN PROFESSOR AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.SCHOOL_CODE
CREATE TABLE table_name_84 ( country VARCHAR, player VARCHAR )
where did arron oberholser play?
SELECT country FROM table_name_84 WHERE player = "arron oberholser"
CREATE TABLE table_name_40 ( number_of_electorates__2009_ INTEGER, reserved_for___sc___st__none_ VARCHAR, name VARCHAR )
Name the Number of electorates (2009 which has a Reserved for ( SC / ST /None) of none, and a Name of jahanabad?
SELECT MIN(number_of_electorates__2009_) FROM table_name_40 WHERE reserved_for___sc___st__none_ = "none" AND name = "jahanabad"
CREATE TABLE gymnast ( gymnast_id number, floor_exercise_points number, pommel_horse_points number, rings_points number, vault_points number, parallel_bars_points number, horizontal_bar_points number, total_points number ) CREATE TABLE people ( people_id number, name text, a...
List the distinct hometowns that are not associated with any gymnast.
SELECT DISTINCT hometown FROM people EXCEPT SELECT DISTINCT T2.hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.gymnast_id = T2.people_id
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, ...
what is the number of patients whose gender is f and diagnoses short title is depress psychosis-unspec?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.short_title = "Depress psychosis-unspec"
CREATE TABLE table_name_35 ( losses INTEGER, ballarat_fl VARCHAR, draws VARCHAR )
What is the total number of Losses that Melton had when they had fewer Draws than 0?
SELECT SUM(losses) FROM table_name_35 WHERE ballarat_fl = "melton" AND draws < 0
CREATE TABLE media_types ( id number, name text ) CREATE TABLE employees ( id number, last_name text, first_name text, title text, reports_to number, birth_date time, hire_date time, address text, city text, state text, country text, postal_code text, phone t...
List the top 5 genres by number of tracks. List genres name and total tracks.
SELECT T1.name, COUNT(*) FROM genres AS T1 JOIN tracks AS T2 ON T2.genre_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 5
CREATE TABLE table_36317 ( "Game" real, "November" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
What was the Score in the game against the Buffalo Sabres?
SELECT "Score" FROM table_36317 WHERE "Opponent" = 'buffalo sabres'
CREATE TABLE table_59606 ( "Pick" real, "AFL Team" text, "Player" text, "Position" text, "College" text )
Which player is an offensive tackle for the New York Jets?
SELECT "Player" FROM table_59606 WHERE "Position" = 'offensive tackle' AND "AFL Team" = 'new york jets'
CREATE TABLE mill ( architect_id int, id int, location text, name text, type text, built_year int, notes text ) CREATE TABLE architect ( id text, name text, nationality text, gender text ) CREATE TABLE bridge ( architect_id int, id int, name text, location t...
Give me a histogram for what are the ids and names of the architects who built at least 3 bridges ?, and I want to display by the Y in desc.
SELECT T1.name, T1.id FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id ORDER BY T1.id DESC
CREATE TABLE table_203_325 ( id number, "year" number, "title" text, "(english)" text, "ifpi israel certification" text, "label" text )
which is david d'or 's oldest album ?
SELECT "title" FROM table_203_325 ORDER BY "year" LIMIT 1
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, r...
show me the evening flights from BALTIMORE to ATLANTA
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 = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATL...
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 TAB...
since 4 years ago who is diagnosed with oliguria - suspect atn?
SELECT patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'oliguria - suspect atn' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-4 year'))
CREATE TABLE table_47068 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Can you tell me the highest Gold that has the Bronze larger than 3, and the Total smaller than 24?
SELECT MAX("Gold") FROM table_47068 WHERE "Bronze" > '3' AND "Total" < '24'
CREATE TABLE table_23465864_6 ( tues_25_aug VARCHAR, mon_24_aug VARCHAR )
What was the Tues 25 Aug time and speed when Mon 24 Aug was 22' 24.56 101.021mph?
SELECT tues_25_aug FROM table_23465864_6 WHERE mon_24_aug = "22' 24.56 101.021mph"
CREATE TABLE table_19874169_3 ( branding VARCHAR, callsign VARCHAR )
If the call sign is DXYR, what is the branding?
SELECT branding FROM table_19874169_3 WHERE callsign = "DXYR"
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( ...
how many patients are under 61 years of age and use the drug route inhalation?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "61" AND prescriptions.route = "INHALATION"
CREATE TABLE table_203_800 ( id number, "#" number, "president" text, "president's party" text, "senate with" number, "senate opposed" number, "house with" number, "house opposed" number, "years served" number, "elections won" number )
how many years did ulysses grant serve ?
SELECT "years served" FROM table_203_800 WHERE "president" = 'ulysses grant'
CREATE TABLE table_1239 ( "Maximum Ceiling Temperature" text, "Temperature Rating" text, "Temperature Classification" text, "Color Code (with Fusible Link)" text, "Glass Bulb Color" text )
Name the most ceiling temperature for intermediate
SELECT "Maximum Ceiling Temperature" FROM table_1239 WHERE "Temperature Classification" = 'Intermediate'
CREATE TABLE table_47719 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Crowd" real, "Date" text )
Which Crowd has a Home team of st kilda?
SELECT "Crowd" FROM table_47719 WHERE "Home team" = 'st kilda'
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) C...
what 's the earliest flight leaving DENVER for PITTSBURGH
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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSB...
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) 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...
what was the medication patient 77586 had been prescribed two or more times in the last hospital encounter?
SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 77586 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) GROUP BY prescriptions.dr...
CREATE TABLE table_name_79 ( transfer_fee VARCHAR, ends VARCHAR )
What was the transfer fee for the player with an ends of 2007?
SELECT transfer_fee FROM table_name_79 WHERE ends = 2007
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 is age and insurance of subject name hector blair?
SELECT demographic.age, demographic.insurance FROM demographic WHERE demographic.name = "Hector Blair"
CREATE TABLE table_23117208_3 ( no_in_season INTEGER, directed_by VARCHAR )
which is the biggest number of episode in the season, when the director of the episode was Constantine Makris?
SELECT MAX(no_in_season) FROM table_23117208_3 WHERE directed_by = "Constantine Makris"
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE chart...
until 2104 what are the five most frequently ordered medications for patients who have also been prescribed skelaxin at the same time?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'skelaxin' AND STRFTIME('%y', prescriptions.startdate) <= '2104') ...
CREATE TABLE table_1348 ( "Season" real, "Series" text, "Team Name" text, "Races" real, "Podiums" real, "Poles" real, "Wins" real, "Points" real, "Final Placing" text )
What is the highest value for race?
SELECT MAX("Races") FROM table_1348
CREATE TABLE table_name_46 ( party VARCHAR, office VARCHAR )
Which Party has a Office of majority floor leader
SELECT party FROM table_name_46 WHERE office = "majority floor leader"
CREATE TABLE table_80110 ( "Hits" real, "Player" text, "Team" text, "Year" real, "Years Record Stood" text )
Name the hits for years before 1883
SELECT "Hits" FROM table_80110 WHERE "Year" < '1883'
CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, available_yn BIT ) CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE Guests ( guest_id INTEGER, gender_code CHAR(1), guest_first_name VARCHAR(80), ...
Give me a bar chart for room_count of each apt number, and order from low to high by the apt_number.
SELECT apt_number, room_count FROM Apartments ORDER BY apt_number
CREATE TABLE table_60858 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the smallest number of gold medals a country with 7 medals has?
SELECT MIN("Gold") FROM table_60858 WHERE "Total" = '7'
CREATE TABLE table_17387 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text )
WHAT IS 'DAVE MOVES OUT' PRODUCTION CODE?
SELECT "Production code" FROM table_17387 WHERE "Title" = 'Dave Moves Out'
CREATE TABLE table_51104 ( "Owner" text, "Class" text, "Number in class" real, "Road numbers" text, "Built" text )
What was built in a class with less than 10, and the Downer Rail owner?
SELECT "Built" FROM table_51104 WHERE "Number in class" < '10' AND "Owner" = 'downer rail'
CREATE TABLE table_59824 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
What Catalog has a Label of geffen records / universal music special markets?
SELECT "Catalog" FROM table_59824 WHERE "Label" = 'geffen records / universal music special markets'
CREATE TABLE table_66538 ( "Constituency number" text, "Name" text, "Reserved for ( SC / ST /None)" text, "District" text, "Number of electorates (2009)" real )
What is the name for the assembly segment with a constituency number of 214?
SELECT "Name" FROM table_66538 WHERE "Constituency number" = '214'
CREATE TABLE table_43395 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
What was the winning score with a margin victory of 2 strokes?
SELECT "Winning score" FROM table_43395 WHERE "Margin of victory" = '2 strokes'
CREATE TABLE table_47452 ( "Election" text, "Candidate" text, "Number of votes" text, "Share of votes" text, "Outcome of election" text )
Who is the candidate in the 2008 (2) election?
SELECT "Candidate" FROM table_47452 WHERE "Election" = '2008 (2)'
CREATE TABLE table_16659 ( "Round" real, "Grand Prix" text, "Pole Position" text, "Fastest Lap" text, "Winning Driver" text, "Winning Constructor" text, "Report" text )
Who was the winning driver when Michael Schumacher had the pole and the fastest lap?
SELECT "Winning Driver" FROM table_16659 WHERE "Fastest Lap" = 'Michael Schumacher' AND "Pole Position" = 'Michael Schumacher'
CREATE TABLE table_15491596_1 ( engine VARCHAR, no VARCHAR )
How many cars used number 48?
SELECT COUNT(engine) FROM table_15491596_1 WHERE no = 48
CREATE TABLE table_203_497 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
which nation has earned the least amount of gold medals ?
SELECT "nation" FROM table_203_497 ORDER BY "gold" LIMIT 1
CREATE TABLE table_14447 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text )
Having 429 points against, what is the Tries Against?
SELECT "Tries against" FROM table_14447 WHERE "Points against" = '429'
CREATE TABLE table_19532 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text )
How many people directed the show written by Chris Sheridan?
SELECT COUNT("Directed by") FROM table_19532 WHERE "Written by" = 'Chris Sheridan'
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 ( Scho...
Visualize a bar chart about the distribution of All_Home and the average of Team_ID , and group by attribute All_Home, and rank by the X-axis in ascending please.
SELECT All_Home, AVG(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home
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 d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABL...
what are the three most frequent drugs that are prescribed to patients 50s after they were diagnosed with glaucoma nos in the previous year in the same hospital encounter?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_...
CREATE TABLE table_name_86 ( name VARCHAR, appearances VARCHAR, goals VARCHAR, rank VARCHAR )
Who had less than 7 goals, was ranked under 7, and had more than 8 appearances?
SELECT name FROM table_name_86 WHERE goals < 7 AND rank < 7 AND appearances > 8
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE days ( days_code varchar, day_name varchar ) ...
okay what flights are there US from ORLANDO to CLEVELAND leaving in the afternoon
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 (((flight.departure_time <= 1200 AND flight.departure_time >= 1800) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ORLANDO' AND fligh...
CREATE TABLE campuses ( county VARCHAR )
How many campuses are there in Los Angeles county?
SELECT COUNT(*) FROM campuses WHERE county = "Los Angeles"
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 Voting_record ( StuID INTEGER, Registration_Date VARCHAR(12), Election_Cycle VARCHAR(12), Presiden...
Visualize a scatter chart on how many students does each advisor have?
SELECT Advisor, COUNT(*) FROM Student GROUP BY Advisor
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, ...
Which teachers will be teaching Other next Winter ?
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr...
CREATE TABLE table_2858 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text )
Name the most number in season for production code 3abc12
SELECT MAX("No. in season") FROM table_2858 WHERE "Production code" = '3ABC12'
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 ...
what is the five most commonly ordered procedure in patients aged 30s until 2102?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B...
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
Scores of answers by a specific user.
SELECT a.Id AS "post_link", q.Title, a.Score FROM Posts AS a JOIN Posts AS q ON a.ParentId = q.Id WHERE a.OwnerUserId = '##id?210401##' AND a.PostTypeId = 2 ORDER BY a.Id
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( ...
count the number of patients whose religion is romanian east. orth.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.religion = "ROMANIAN EAST. ORTH"
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, ...
Are there any courses worth 18 credits ?
SELECT DISTINCT name, number FROM course WHERE credits = 18 AND department = 'EECS'
CREATE TABLE table_53389 ( "NGC number" real, "Object type" text, "Constellation" text, "Right ascension ( J2000 )" text, "Declination ( J2000 )" text )
what is the constellation when the Right ascension ( J2000 ) is 10h18m58.4s?
SELECT "Constellation" FROM table_53389 WHERE "Right ascension ( J2000 )" = '10h18m58.4s'
CREATE TABLE table_68150 ( "Race" text, "Dist (f)" real, "Course" text, "Class" text, "Prize (\u00a3K)" real, "Odds" text, "Runners" real, "Placing" real, "Margin" real, "Time" text, "Jockey" text, "Trainer" text )
Who has 6/1 odds?
SELECT "Trainer" FROM table_68150 WHERE "Odds" = '6/1'
CREATE TABLE table_204_200 ( id number, "iso/iec standard" text, "title" text, "status" text, "description" text, "wg" number )
what was the last standard published ?
SELECT "iso/iec standard" FROM table_204_200 ORDER BY "status" DESC LIMIT 1
CREATE TABLE table_204_53 ( id number, "date" text, "result" text, "opponent" text, "event" text, "location" text, "method" text, "round" number, "time" text )
how many events did grigorian attend in 2010 ?
SELECT COUNT("event") FROM table_204_53 WHERE "date" = 2010
CREATE TABLE table_name_44 ( qual VARCHAR, rank VARCHAR, year VARCHAR )
What is the qual for rank 18 in 1964?
SELECT qual FROM table_name_44 WHERE rank = "18" AND year = "1964"
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
how many patients whose ethnicity is hispanic/latino - puerto rican and year of birth is less than 2197?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND demographic.dob_year < "2197"