instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Which team did daniel bradshaw play for after 1935? | CREATE TABLE table_name_59 (team VARCHAR,year VARCHAR,player VARCHAR) | SELECT team FROM table_name_59 WHERE year > 1935 AND player = "daniel bradshaw" |
What 1976 has a 1978 of grand slam tournaments? | CREATE TABLE table_name_57 (Id VARCHAR) | SELECT 1976 FROM table_name_57 WHERE 1978 = "grand slam tournaments" |
show me ground transportation in BALTIMORE | CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum_stay int,application text,no_discounts text)CREATE TABLE code_description (code varchar,descripti... | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'BALTIMORE' AND ground_service.city_code = city.city_code |
what is the number of patients whose discharge location is disc-tran cancer/chldrn h and lab test name is basophils? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" AND lab.label = "Basophils" |
What is essendon's away team score? | CREATE TABLE table_name_1 (away_team VARCHAR) | SELECT away_team AS score FROM table_name_1 WHERE away_team = "essendon" |
For those employees who was hired before 2002-06-21, find job_id and the average of employee_id , and group by attribute job_id, and visualize them by a bar chart. | CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE departments (DEP... | SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID |
when was the first time patient 16554 had meropenem prescribed in 01/this year? | 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 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,... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 16554) AND prescriptions.drug = 'meropenem' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME... |
Get the maximum days the patients that died stayed at the hospital. | 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)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,sho... | SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.expire_flag = "1" |
Who wrote the episode that has the production code ad1c05? | CREATE TABLE table_name_4 (written_by VARCHAR,production_code VARCHAR) | SELECT written_by FROM table_name_4 WHERE production_code = "ad1c05" |
In what class is the laps greater than 134 and the position is 4th? | CREATE TABLE table_45107 ("Year" real,"Team" text,"Co-Drivers" text,"Class" text,"Laps" real,"Pos." text,"Class Pos." text) | SELECT "Class" FROM table_45107 WHERE "Laps" > '134' AND "Pos." = '4th' |
what is the average for January with points of 51 | CREATE TABLE table_name_7 (january VARCHAR,points VARCHAR) | SELECT january FROM table_name_7 WHERE points = 51 |
What was the region for Malartic with 159.31 km2? | CREATE TABLE table_78024 ("Code" real,"Type" text,"Name" text,"Area (km 2)" real,"Population" real,"Regional County Municipality" text,"Region" real) | SELECT COUNT("Region") FROM table_78024 WHERE "Name" = 'malartic' AND "Area (km 2 )" < '159.31' |
How many first downs were there when the attendance was 13196? | CREATE TABLE table_19633 ("Game" real,"Date" text,"Opponent" text,"Result" text,"Packers points" real,"Opponents" real,"First Downs" real,"Record" text,"Streak" text,"Venue" text,"Attendance" real) | SELECT MIN("First Downs") FROM table_19633 WHERE "Attendance" = '13196' |
Who was the player moving to Arminia Bielefeld? | CREATE TABLE table_name_68 (name VARCHAR,moving_to VARCHAR) | SELECT name FROM table_name_68 WHERE moving_to = "arminia bielefeld" |
had a microbiology test been done since 4 months ago for patient 76327? | CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE procedures_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... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 76327) AND DATETIME(microbiologyevents.charttime) >= DATETIME(CURRENT_TIME(), '-4 month') |
When was the last final lost of the club with 7 wins? | CREATE TABLE table_34523 ("Club" text,"Wins" text,"Last win" text,"Runners-up" text,"Last final lost" text) | SELECT "Last final lost" FROM table_34523 WHERE "Wins" = '7' |
Where did Collingwood play as the home team? | CREATE TABLE table_4492 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Venue" FROM table_4492 WHERE "Home team" = 'collingwood' |
What was the Set 1 game score when Set 3 game score was 15 4, and a Set 2 game score was 15 7? | CREATE TABLE table_11417 ("Date" text,"Score" text,"Set 1" text,"Set 2" text,"Set 3" text,"Total" text) | SELECT "Set 1" FROM table_11417 WHERE "Set 3" = '15–4' AND "Set 2" = '15–7' |
Which name has an Order smaller than 997,more than 5 goals, and 215 games? | CREATE TABLE table_11661 ("Order" real,"Name" text,"Seasons" text,"Games" real,"Goals" real) | SELECT "Name" FROM table_11661 WHERE "Order" < '997' AND "Goals" > '5' AND "Games" = '215' |
What is the Money ($) when the Place is t6, and Player is chris dimarco? | CREATE TABLE table_77362 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money ($)" real) | SELECT "Money ( $ )" FROM table_77362 WHERE "Place" = 't6' AND "Player" = 'chris dimarco' |
WHAT IS THE DRAW FOR PERFORMER ANDREA CUBRIC? | CREATE TABLE table_47034 ("Draw" real,"Song" text,"Performer" text,"Points" real,"Rank" text) | SELECT "Draw" FROM table_47034 WHERE "Performer" = 'andrea cubric' |
how many patients of black/cape verdean ethnicity are below the age 89? | 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 WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.age < "89" |
What is the total code number for places with a population greater than 87,585? | CREATE TABLE table_name_41 (code VARCHAR,population INTEGER) | SELECT COUNT(code) FROM table_name_41 WHERE population > 87 OFFSET 585 |
What's the date released when there was 9.7% of Green communist? | CREATE TABLE table_name_53 (date_released VARCHAR,green_communist VARCHAR) | SELECT date_released FROM table_name_53 WHERE green_communist = "9.7%" |
What is the date for the name of Granville? | CREATE TABLE table_name_39 (date VARCHAR,name VARCHAR) | SELECT date FROM table_name_39 WHERE name = "granville" |
tries against correct as of 2007-10-15 has what tries for? | CREATE TABLE table_35279 ("Club" text,"Played" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Tries for" text,"Tries against" text,"Try bonus" text) | SELECT "Tries for" FROM table_35279 WHERE "Tries against" = 'correct as of 2007-10-15' |
what are the three most frequently prescribed medications for patients who have been prescribed with ceftriaxone sodium 1 g ij solr previously within 2 months, 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 microlab (microlabid number,patientunitstayid number,culturesite text,organism text,cultu... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'ceftriaxone sodium 1 g ij solr' AND STRFTIME('%y', ... |
Which spacecraft were launched by the Titan II? | CREATE TABLE table_59939 ("Spaceport" text,"Launch complex" text,"Launcher" text,"Spacecraft" text,"Flights" text,"Years" text) | SELECT "Spacecraft" FROM table_59939 WHERE "Launcher" = 'titan ii' |
To which college/junior/club team did the player that was Pick 16 belong? | CREATE TABLE table_name_6 (college_junior_club_team VARCHAR,pick__number VARCHAR) | SELECT college_junior_club_team FROM table_name_6 WHERE pick__number = "16" |
What years did Alvin Mitchell play? | CREATE TABLE table_name_44 (years VARCHAR,player VARCHAR) | SELECT years FROM table_name_44 WHERE player = "alvin mitchell" |
What Chassis did Rich Vogler use? | CREATE TABLE table_name_94 (chassis VARCHAR,drivers VARCHAR) | SELECT chassis FROM table_name_94 WHERE drivers = "rich vogler" |
What was john farrow's run 2 associated with a run 1 of greater than 52.25? | CREATE TABLE table_name_21 (run_2 INTEGER,run_1 VARCHAR,athlete VARCHAR) | SELECT MAX(run_2) FROM table_name_21 WHERE run_1 > 52.25 AND athlete = "john farrow" |
How many states that have some college students playing in the mid position but not in the goalie position. | CREATE TABLE tryout (cName VARCHAR,pPos VARCHAR)CREATE TABLE college (state VARCHAR,cName VARCHAR) | SELECT COUNT(*) FROM (SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie') |
Bar chart x axis location y axis sum total passengers, I want to sort in descending by the Location please. | CREATE TABLE station (Station_ID int,Name text,Annual_entry_exit real,Annual_interchanges real,Total_Passengers real,Location text,Main_Services text,Number_of_Platforms int)CREATE TABLE train_station (Train_ID int,Station_ID int)CREATE TABLE train (Train_ID int,Name text,Time text,Service text) | SELECT Location, SUM(Total_Passengers) FROM station GROUP BY Location ORDER BY Location DESC |
what is the difference in frequency between the at90s1200 and the at90s2313 ? | CREATE TABLE table_204_416 (id number,"chip" text,"flash size" text,"eeprom" number,"sram" number,"frequency\n[mhz]" number,"package" text) | SELECT ABS((SELECT "frequency\n[mhz]" FROM table_204_416 WHERE "chip" = 'at90s1200') - (SELECT "frequency\n[mhz]" FROM table_204_416 WHERE "chip" = 'at90s2313')) |
Who was the winner when the total attendance was 16597? | CREATE TABLE table_1672976_5 (winner VARCHAR,attendance VARCHAR) | SELECT winner FROM table_1672976_5 WHERE attendance = 16597 |
For those records from the products and each product's manufacturer, show me about the distribution of founder and the sum of price , and group by attribute founder in a bar chart, sort x-axis from high to low order. | CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER) | SELECT Founder, SUM(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder DESC |
What is the Nationality Club Team of Quebec remparts (qmjhl)? | CREATE TABLE table_10660 ("Round" real,"Overall" text,"Player" text,"Position" text,"Nationality" text,"Club team" text) | SELECT "Nationality" FROM table_10660 WHERE "Club team" = 'quebec remparts (qmjhl)' |
what is the 2nd garfield episode where u.s. acres episode is the bunny rabbits is coming! | CREATE TABLE table_22395 ("Episode" text,"Garfield Episode 1" text,"U.S. Acres Episode" text,"Garfield Episode 2" text,"Original Airdate" text) | SELECT "Garfield Episode 2" FROM table_22395 WHERE "U.S. Acres Episode" = 'The Bunny Rabbits is Coming!' |
What's the record for home team ottawa senators on march 6? | CREATE TABLE table_name_45 (record VARCHAR,home VARCHAR,date VARCHAR) | SELECT record FROM table_name_45 WHERE home = "ottawa senators" AND date = "march 6" |
What is the highest chart number for the song Yardbirds aka Roger the Engineer? | CREATE TABLE table_37628 ("Date" text,"Title" text,"Origin" text,"Label & Cat. no." text,"Chart no." real) | SELECT MAX("Chart no.") FROM table_37628 WHERE "Title" = 'yardbirds aka roger the engineer' |
Name the opponent for 2-27-10 | CREATE TABLE table_25475 ("Date" text,"Location" text,"Opponent" text,"Irish Points" real,"Opp. Points" real,"Record" text) | SELECT "Opponent" FROM table_25475 WHERE "Date" = '2-27-10' |
Necromancer-winning answers on questions with zero or negative score. | CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABL... | SELECT q.Id AS "post_link", a.OwnerUserId AS "user_link", q.Score AS QuestionScore, a.Score AS AnswerScore, q.CreationDate AS QuestionCreationDate, a.CreationDate AS AnswerCreationDate, DATEDIFF(day, q.CreationDate, CreationDate) AS DateDifference FROM Posts AS a JOIN Posts AS q ON q.Id = a.ParentId WHERE a.Score >= 5 ... |
how many silver medals did poland win ? | CREATE TABLE table_203_707 (id number,"rank" number,"npc" text,"gold" number,"silver" number,"bronze" number,"total" number) | SELECT "silver" FROM table_203_707 WHERE "npc" = 'poland' |
Find the number of routes that have destination John F Kennedy International Airport. | CREATE TABLE airlines (alid number,name text,iata text,icao text,callsign text,country text,active text)CREATE TABLE routes (rid number,dst_apid number,dst_ap text,src_apid number,src_ap text,alid number,airline text,codeshare text)CREATE TABLE airports (apid number,name text,city text,country text,x number,y number,el... | SELECT COUNT(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.name = 'John F Kennedy International Airport' |
PHYSED 415 is offered on which days ? | CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,en... | SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_i... |
What is the S Registered User, when Userpics Free is 6 [free] or 15 [plus]? | CREATE TABLE table_name_98 (s_registered_user VARCHAR,userpics_free VARCHAR) | SELECT s_registered_user FROM table_name_98 WHERE userpics_free = "6 [free] or 15 [plus]" |
What candidate was re-elected in the Louisiana 5 district? | CREATE TABLE table_1342149_18 (candidates VARCHAR,result VARCHAR,district VARCHAR) | SELECT candidates FROM table_1342149_18 WHERE result = "Re-elected" AND district = "Louisiana 5" |
when roberts 86' is the scorer what is the round? | CREATE TABLE table_28181401_4 (round VARCHAR,scorers VARCHAR) | SELECT round FROM table_28181401_4 WHERE scorers = "Roberts 86'" |
For the United Kingdom, what's the date? | CREATE TABLE table_71614 ("Date" text,"Company" text,"Business" text,"Country" text,"Value (USD)" text) | SELECT "Date" FROM table_71614 WHERE "Country" = 'united kingdom' |
What is the highest overall number for someone from round 16? | CREATE TABLE table_name_51 (overall INTEGER,round VARCHAR) | SELECT MAX(overall) FROM table_name_51 WHERE round = 16 |
Who has a constituency of 84? | CREATE TABLE table_name_62 (name VARCHAR,constituency_number VARCHAR) | SELECT name FROM table_name_62 WHERE constituency_number = "84" |
What format was used for Mobil 1? | CREATE TABLE table_name_21 (format VARCHAR,catalog VARCHAR) | SELECT format FROM table_name_21 WHERE catalog = "mobil 1" |
Which nominee won the Drama Desk Award for outstanding choreography? | CREATE TABLE table_52832 ("Year" real,"Award" text,"Category" text,"Nominee" text,"Result" text) | SELECT "Nominee" FROM table_52832 WHERE "Award" = 'drama desk award' AND "Result" = 'won' AND "Category" = 'outstanding choreography' |
What was the college for the player with the cfl team of Edmonton Eskimos (via calgary)? | CREATE TABLE table_10812938_3 (college VARCHAR,cfl_team VARCHAR) | SELECT college FROM table_10812938_3 WHERE cfl_team = "Edmonton Eskimos (via Calgary)" |
How much is the total ERP W for an 107.9 fm freqeuncy MHz? | CREATE TABLE table_67338 ("Call sign" text,"Frequency MHz" text,"City of license" text,"ERP W" real,"Class" text,"FCC info" text) | SELECT COUNT("ERP W") FROM table_67338 WHERE "Frequency MHz" = '107.9 fm' |
Give me both the short title and long title of the procedure for procedure icd9 code 5059. | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marita... | SELECT procedures.short_title, procedures.long_title FROM procedures WHERE procedures.icd9_code = "5059" |
Which player is from Marshall and played 1974-75? | CREATE TABLE table_11545282_12 (player VARCHAR,years_for_jazz VARCHAR,school_club_team VARCHAR) | SELECT player FROM table_11545282_12 WHERE years_for_jazz = "1974-75" AND school_club_team = "Marshall" |
Find the average capacity among rooms in each building with a bar chart, I want to sort from high to low by the building please. | CREATE TABLE classroom (building varchar(15),room_number varchar(7),capacity numeric(4,0))CREATE TABLE time_slot (time_slot_id varchar(4),day varchar(1),start_hr numeric(2),start_min numeric(2),end_hr numeric(2),end_min numeric(2))CREATE TABLE prereq (course_id varchar(8),prereq_id varchar(8))CREATE TABLE course (cours... | SELECT building, AVG(capacity) FROM classroom GROUP BY building ORDER BY building DESC |
What is the average draws with more than 38 played? | CREATE TABLE table_14833 ("Position" real,"Club" text,"Played" real,"Points" text,"Wins" real,"Draws" real,"Losses" real,"Goals for" real,"Goals against" real,"Goal Difference" real) | SELECT AVG("Draws") FROM table_14833 WHERE "Played" > '38' |
What is the average of the top-25 with 16 cuts and less than 23 events? | CREATE TABLE table_67730 ("Tournament" text,"Wins" real,"Top-5" real,"Top-10" real,"Top-25" real,"Events" real,"Cuts made" real) | SELECT AVG("Top-25") FROM table_67730 WHERE "Cuts made" = '16' AND "Events" < '23' |
Who is the away team that played at punt road oval where the crowd was larger than 17,000? | CREATE TABLE table_56966 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Away team" FROM table_56966 WHERE "Crowd" > '17,000' AND "Venue" = 'punt road oval' |
may i have a listing of flight numbers from COLUMBUS OHIO to MINNEAPOLIS MINNESOTA on monday | CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,time_zone_code varchar)CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_s... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight, state AS STATE_0, state AS STATE_1 WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MINNEAPOLIS' AND date_day.day_number ... |
Year larger than 2008, and a Nationality of director of lebanon is what director? | CREATE TABLE table_67188 ("Year" real,"Film" text,"Director" text,"Nationality of director" text,"Award" text) | SELECT "Director" FROM table_67188 WHERE "Year" > '2008' AND "Nationality of director" = 'lebanon' |
What season has races larger than 18 and 36 points? | CREATE TABLE table_4774 ("Season" text,"Series" text,"Team Name" text,"Races" real,"Poles" real,"Wins" real,"Points" real,"Position" text) | SELECT "Season" FROM table_4774 WHERE "Races" > '18' AND "Points" = '36' |
The game in week 11 has what result? | CREATE TABLE table_44457 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real) | SELECT "Result" FROM table_44457 WHERE "Week" = '11' |
When was shippensburg university Colonized? | CREATE TABLE table_32983 ("Chapter" text,"Colonized" text,"Chartered" text,"School" text,"State" text,"Status" text,"Charter Range" text) | SELECT "Colonized" FROM table_32983 WHERE "School" = 'shippensburg university' |
What is the average of the total when t11 is the finish? | CREATE TABLE table_name_39 (total INTEGER,finish VARCHAR) | SELECT AVG(total) FROM table_name_39 WHERE finish = "t11" |
Who choreographed the smooth waltz with lacey schwimmer? | CREATE TABLE table_53705 ("Week" real,"Partner" text,"Style" text,"Choreographer(s)" text,"Results" text) | SELECT "Choreographer(s)" FROM table_53705 WHERE "Style" = 'smooth waltz' AND "Partner" = 'lacey schwimmer' |
Which date did 64,443 people attend a game? | CREATE TABLE table_10565 ("Week" text,"Date" text,"Opponent" text,"Result" text,"Kickoff [a ]" text,"Game site" text,"Attendance" text,"Record" text) | SELECT "Date" FROM table_10565 WHERE "Attendance" = '64,443' |
number of rounds in which murphy placed above 4th | CREATE TABLE table_204_115 (id number,"year" number,"track" text,"number" number,"team" text,"car" text,"round result" text) | SELECT COUNT(*) FROM table_204_115 WHERE "round result" < 4 |
give me the number of patients whose primary disease is liver transplant and age is less than 79? | 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 WHERE demographic.diagnosis = "LIVER TRANSPLANT" AND demographic.age < "79" |
in 06/2103, how much did patient 011-23004 weigh for the first time? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,he... | SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-23004') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y-%m', patient.unitadmittime) = '2103-06' ORDER BY patient.unitadmittime LIMIT 1 |
what is the name of patient 016-6134's last intake on the last intensive care unit visit? | 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 number,chargetime time,cost number)CREATE TABLE lab (labid number,p... | 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 = '016-6134') AND NOT patient.unitdischargetime IS NULL ORDER B... |
count the number of patients that have been diagnosed with bacteremia but did not return to the hospital during the same month since 2103. | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number... | SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'bacteremia' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2103') AS t1) - (SELECT COUNT(DISTINCT t... |
What episode # has govinda & david dhawan as the eliminated contestant? | CREATE TABLE table_63432 ("Contestant Name" text,"Episode #" text,"Date Premiered (2009)" text,"Winning Amount" text,"Eliminated Contestant" text) | SELECT "Episode #" FROM table_63432 WHERE "Eliminated Contestant" = 'govinda & david dhawan' |
is enping more/less dense than kaiping ? | CREATE TABLE table_203_222 (id number,"category" text,"#" number,"name" text,"hanzi" text,"hanyu pinyin" text,"population (2010 census)" number,"area (km2)" number,"density (/km2)" number) | SELECT (SELECT "density (/km2)" FROM table_203_222 WHERE "name" = 'enping') > (SELECT "density (/km2)" FROM table_203_222 WHERE "name" = 'kaiping') |
WHAT WERE ALL OF THE RESULTS WHEN THEY PLAYED AGAINST LITHUANIA AND THE SURFACE WAS MADE OF CLAY? | CREATE TABLE table_16741821_8 (result VARCHAR,surface VARCHAR,against VARCHAR) | SELECT result FROM table_16741821_8 WHERE surface = "Clay" AND against = "Lithuania" |
How many games had fewer than 118 opponents and more than 109 net points with an opponent of Washington? | CREATE TABLE table_77089 ("Game" real,"Date" text,"Opponent" text,"Result" text,"Nets points" real,"Opponents" real,"Record" text,"Streak" text) | SELECT COUNT("Game") FROM table_77089 WHERE "Opponents" < '118' AND "Nets points" > '109' AND "Opponent" = 'washington' |
What was the crowd size when the home team was Hawthorn? | CREATE TABLE table_53881 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Crowd" FROM table_53881 WHERE "Home team" = 'hawthorn' |
Where does the Bayou Blvd./12th Avenue route that has a terminus at the downtown transit center operate? | CREATE TABLE table_name_5 (operates VARCHAR,terminus VARCHAR,name VARCHAR) | SELECT operates FROM table_name_5 WHERE terminus = "downtown transit center" AND name = "bayou blvd./12th avenue" |
How many field goals were scored by the player that got 7 touchdowns? | CREATE TABLE table_3399 ("Player" text,"Touchdowns (5 points)" real,"Extra points 1 point" real,"Field goals (4 points)" real,"Safeties (2 points)" real,"Total Points" real) | SELECT "Field goals (4 points)" FROM table_3399 WHERE "Touchdowns (5 points)" = '7' |
what was the last perc ins carotid stent time of patient 88409? | CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,ite... | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'perc ins carotid stent') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 88409) ORDER... |
Getting a user's most popular tags in order. | 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,LastEditorDisplayName text,LastEditDate time,LastActivityDate time,Title text,Ta... | WITH UserPosts AS (SELECT * FROM Posts WHERE OwnerUserId = '##UserId##'), TagCount AS (SELECT COUNT(*) AS Cnt, TagId FROM PostTags WHERE PostId IN (SELECT Id FROM UserPosts WHERE PostTypeId = 1 UNION ALL SELECT ParentId FROM UserPosts WHERE PostTypeId = 2) GROUP BY TagId) SELECT TagName, Cnt FROM TagCount AS TC JOIN Ta... |
Which Completions has Yards of 10,098? | CREATE TABLE table_6374 ("Year" text,"Team" text,"Attempts" text,"Completions" text,"Completion %" text,"Yards" text) | SELECT "Completions" FROM table_6374 WHERE "Yards" = '10,098' |
Name the eliminated 7th voted out day 21 | CREATE TABLE table_26698 ("Episode" real,"Airdate" text,"Reward" text,"Immunity" text,"Eliminated" text,"Vote" text,"Finish" text) | SELECT "Eliminated" FROM table_26698 WHERE "Finish" = '7th Voted Out Day 21' |
What is the lowest number of places for Sherri Baier / Robin Cowan when ranked lower than 1? | CREATE TABLE table_54559 ("Rank" real,"Name" text,"Nation" text,"Points" real,"Places" real) | SELECT MIN("Places") FROM table_54559 WHERE "Name" = 'sherri baier / robin cowan' AND "Rank" < '1' |
what is the maximum total hospital cost which involves s/p thrombectomy until 3 years ago? | 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)CREATE TABLE allergy (allergyid number,patientunitstayid number,d... | SELECT MAX(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 diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 's/p thrombectomy')) AND DATETIME(cost.charge... |
What is the Score when the winner was sanyo wild knights, and a Runner-up of suntory sungoliath? | CREATE TABLE table_76145 ("Title" text,"Season" text,"Winner" text,"Score" text,"Runner-up" text,"Venue" text,"Attendance" text) | SELECT "Score" FROM table_76145 WHERE "Winner" = 'sanyo wild knights' AND "Runner-up" = 'suntory sungoliath' |
which was the first episode to drop the average below 0.60 ? | CREATE TABLE table_204_958 (id number,"episode" number,"original broadcast date" text,"average" number,"rank" number,"remarks" text) | SELECT MIN("episode") FROM table_204_958 WHERE "average" < 0.6 |
How many departments are in each school. Show bar chart. | 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 COURSE (CRS_CODE varchar(10),DEPT_CODE varchar(10),CRS_DESCRIPTION varchar(35),CRS_CREDIT float(8))CREATE TABLE EMPLOYEE (EMP_NUM int,EMP_LNAME varchar(15),EMP_FNAME varch... | SELECT SCHOOL_CODE, COUNT(DISTINCT DEPT_NAME) FROM DEPARTMENT |
What is the lowest rank of Citigroup? | CREATE TABLE table_name_67 (rank INTEGER,name VARCHAR) | SELECT MIN(rank) FROM table_name_67 WHERE name = "citigroup" |
Visualize a bar chart about the distribution of meter_700 and meter_100 , display x axis in desc order. | CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 text,meter_400 text,meter_500 text,meter_600 text,meter_700 text,Time text)CREATE TABLE stadiu... | SELECT meter_700, meter_100 FROM swimmer ORDER BY meter_700 DESC |
Top Comments of all time. | CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,Text text,ContentLicense text)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,... | SELECT Score, Text FROM Comments ORDER BY Score DESC |
give me the total amount of chest tubes cticu ct 2 that patient 65582 has produced on 12/08/this year. | CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)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 patients (row_id number,subject... | SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65582)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'che... |
What chng has a rank greater than 6, with 12 as a prev? | CREATE TABLE table_40183 ("Rank" real,"Prev" real,"Player" text,"Rating" real,"Chng" text) | SELECT "Chng" FROM table_40183 WHERE "Rank" > '6' AND "Prev" = '12' |
What is the lowest total reb of player Mcalarney, who has a 3FGM less than 103? | CREATE TABLE table_7427 ("Player" text,"FG Pct" real,"3FGM" real,"3FGA" real,"3FG Pct" real,"FT Pct" real,"Off Reb" real,"Def Reb" real,"Total Reb" real,"Asst" real) | SELECT MIN("Total Reb") FROM table_7427 WHERE "Player" = 'mcalarney' AND "3FGM" < '103' |
What was the record on July 1? | CREATE TABLE table_name_58 (record VARCHAR,date VARCHAR) | SELECT record FROM table_name_58 WHERE date = "july 1" |
count the number of patients whose insurance is government and procedure short title is skin closure nec? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,sho... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.short_title = "Skin closure NEC" |
What are the first name and last name of Linda Smith's advisor? | CREATE TABLE activity (actid number,activity_name text)CREATE TABLE faculty_participates_in (facid number,actid number)CREATE TABLE faculty (facid number,lname text,fname text,rank text,sex text,phone number,room text,building text)CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major numbe... | SELECT T1.fname, T1.lname FROM faculty AS T1 JOIN student AS T2 ON T1.facid = T2.advisor WHERE T2.fname = "Linda" AND T2.lname = "Smith" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.