instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What time did Channel 4 air an episode number larger than 106 with the title of Marry Me A Little?
CREATE TABLE table_name_74 (time_of_airing_on_channel_4 VARCHAR,episode_number VARCHAR,title VARCHAR)
SELECT time_of_airing_on_channel_4 FROM table_name_74 WHERE episode_number > 106 AND title = "marry me a little"
How many hosts were on Seven Network?
CREATE TABLE table_19384 ("Country" text,"Local Name" text,"Host" text,"Channel" text,"Year Aired" text,"Top Prize" text)
SELECT COUNT("Host") FROM table_19384 WHERE "Channel" = 'Seven Network'
What are the lowest points with a Chassis of zakspeed 841, and a Year smaller than 1985?
CREATE TABLE table_name_32 (points INTEGER,chassis VARCHAR,year VARCHAR)
SELECT MIN(points) FROM table_name_32 WHERE chassis = "zakspeed 841" AND year < 1985
when the points for is 139 is points difference?
CREATE TABLE table_20396710_1 (points_difference VARCHAR,points_for VARCHAR)
SELECT COUNT(points_difference) FROM table_20396710_1 WHERE points_for = "139"
What title has daffy (as duck dodgers) as the character?
CREATE TABLE table_name_98 (title VARCHAR,characters VARCHAR)
SELECT title FROM table_name_98 WHERE characters = "daffy (as duck dodgers)"
Which 2006 tournament had a 4R performance in 2001?
CREATE TABLE table_54099 ("Tournament" text,"1998" text,"1999" text,"2000" text,"2001" text,"2002" text,"2003" text,"2004" text,"2005" text,"2006" text,"2007" text,"Career SR" text)
SELECT "2006" FROM table_54099 WHERE "2001" = '4r'
Saint-Jacques has what as the area km 2?
CREATE TABLE table_name_73 (area_km_2 VARCHAR,official_name VARCHAR)
SELECT area_km_2 FROM table_name_73 WHERE official_name = "saint-jacques"
for the first time , when did patient 27465 receive insert intercostal cath?
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_items (row_id number,itemid number,label text,linksto text)CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventty...
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 = 'insert intercostal cath') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27465) ORDE...
what was the last systemicsystolic of patient 016-29746 since 07/12/2101.
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,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE treatment (treatmen...
SELECT vitalperiodic.systemicsystolic FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-29746')) AND NOT vitalperiodic.systemicsystoli...
Record of 11-10-3 is what sum of game #?
CREATE TABLE table_name_57 (game__number INTEGER,record VARCHAR)
SELECT SUM(game__number) FROM table_name_57 WHERE record = "11-10-3"
What is melbourne's home team score?
CREATE TABLE table_name_48 (home_team VARCHAR)
SELECT home_team AS score FROM table_name_48 WHERE home_team = "melbourne"
What was the margin of the match on 19 Jan 2002?
CREATE TABLE table_73386 ("S No" real,"Team (A)" text,"Team (B)" text,"Winner" text,"Margin" text,"Match Date" text)
SELECT "Margin" FROM table_73386 WHERE "Match Date" = '19 Jan 2002'
What are the ids and durations of the trips with the top 3 durations?
CREATE TABLE trip (id VARCHAR,duration VARCHAR)
SELECT id, duration FROM trip ORDER BY duration DESC LIMIT 3
How many courses for each subject? Plot a bar chart.
CREATE TABLE Subjects (subject_id INTEGER,subject_name VARCHAR(120))CREATE TABLE Student_Course_Enrolment (registration_id INTEGER,student_id INTEGER,course_id INTEGER,date_of_enrolment DATETIME,date_of_completion DATETIME)CREATE TABLE Student_Tests_Taken (registration_id INTEGER,date_test_taken DATETIME,test_result VA...
SELECT subject_name, COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id
Displacement of 4.4l (4423cc/269in ) and a Power of 220kw (299hp) @ 4000 belongs to what engine?
CREATE TABLE table_name_21 (engine VARCHAR,displacement VARCHAR,power VARCHAR)
SELECT engine FROM table_name_21 WHERE displacement = "4.4l (4423cc/269in³)" AND power = "220kw (299hp) @ 4000"
what was patient 17435's first arterial bp mean on the first intensive care unit visit.
CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE d_items (row_id number,itemid number,label text,linksto 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,intime time,outt...
SELECT 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 = 17435) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemid IN (S...
how many women were not executed by lethal injection ?
CREATE TABLE table_204_867 (id number,"number" number,"date" text,"name" text,"age\n(at execution)" number,"age\n(at offense)" number,"race" text,"state" text,"method" text)
SELECT COUNT("name") FROM table_204_867 WHERE "method" <> 'lethal injection'
what's the district with incumbent being william j. driver
CREATE TABLE table_1342331_5 (district VARCHAR,incumbent VARCHAR)
SELECT district FROM table_1342331_5 WHERE incumbent = "William J. Driver"
Find the number of the dates of the tests taken with result 'Pass', order x-axis from high to low order.
CREATE TABLE Students (student_id INTEGER,date_of_registration DATETIME,date_of_latest_logon DATETIME,login_name VARCHAR(40),password VARCHAR(10),personal_name VARCHAR(40),middle_name VARCHAR(40),family_name VARCHAR(40))CREATE TABLE Courses (course_id INTEGER,author_id INTEGER,subject_id INTEGER,course_name VARCHAR(120...
SELECT date_test_taken, COUNT(date_test_taken) FROM Student_Tests_Taken WHERE test_result = "Pass" ORDER BY date_test_taken DESC
Which rounds had 32 clubs involved?
CREATE TABLE table_26073 ("Round" text,"Clubs remaining" real,"Clubs involved" real,"Winners from previous round" text,"New entries this round" text,"Leagues entering at this round" text)
SELECT "Round" FROM table_26073 WHERE "Clubs involved" = '32'
Questions with at least one upvoted answer.
CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHos...
SELECT YEAR(q.CreationDate) AS "year", SUM(CASE WHEN a.ParentId IS NULL THEN 1 END) AS "open_unanswered_questions", COUNT(a.ParentId) AS "questions_with_answers", COUNT(CASE WHEN a.Score > 0 THEN a.ParentId END) AS "qs_with_positive_answers" FROM Posts AS q LEFT JOIN (SELECT DISTINCT ans.ParentId, MAX(ans.Score) AS "sc...
What team was the opponent when the result was l 0-27?
CREATE TABLE table_41049 ("Date" text,"Opponent" text,"Location" text,"Result" text,"Attendance" real)
SELECT "Opponent" FROM table_41049 WHERE "Result" = 'l 0-27'
On what dates was the final score of the game L 14 24?
CREATE TABLE table_27613 ("Week" real,"Date" text,"Kickoff" text,"Opponent" text,"Final score" text,"Team record" text,"Game site" text,"Attendance" real)
SELECT "Date" FROM table_27613 WHERE "Final score" = 'L 14–24'
what is the total number of films shoko goto appeared in 2005 ?
CREATE TABLE table_203_365 (id number,"released" text,"video title" text,"company" text,"director" text,"notes" text)
SELECT COUNT(DISTINCT "video title") FROM table_203_365 WHERE "released" = 2005
What is the Facility ID that has a City of license of wheeling, and a ERP kW less than 4.5?
CREATE TABLE table_71982 ("Station" text,"City of license" text,"Channel" text,"ERP kW" real,"HAAT m (ft)" text,"Facility ID" real)
SELECT MAX("Facility ID") FROM table_71982 WHERE "City of license" = 'wheeling' AND "ERP kW" < '4.5'
Which state has a king named xiang?
CREATE TABLE table_7199 ("State" text,"Type" text,"Name" text,"Title" text,"Royal house" text,"From" text)
SELECT "State" FROM table_7199 WHERE "Title" = 'king' AND "Name" = 'xiang'
Who were the partners during times that harry johnson hazel hotchkiss wightman was the opponent?
CREATE TABLE table_2127933_3 (partner VARCHAR,opponents VARCHAR)
SELECT partner FROM table_2127933_3 WHERE opponents = "Harry Johnson Hazel Hotchkiss Wightman"
GT Force of yes, and a G27 Racing Wheel of 16 involves which driving force ex?
CREATE TABLE table_name_87 (driving_force_ex VARCHAR,gt_force VARCHAR,g27_racing_wheel VARCHAR)
SELECT driving_force_ex FROM table_name_87 WHERE gt_force = "yes" AND g27_racing_wheel = "16"
What amount is the junior high school where the gender is male and the specification is minimum diameter of sakigawa?
CREATE TABLE table_18814 ("Specification" text,"Gender" text,"Junior High School (12\u201315 yrs)" text,"Senior High School (15\u201318 yrs)" text,"University students and Adults (18yrs+)" text)
SELECT "Junior High School (12\u201315 yrs)" FROM table_18814 WHERE "Gender" = 'Male' AND "Specification" = 'Minimum diameter of sakigawa'
What is the pole position of the grand prix with 1 round?
CREATE TABLE table_57239 ("Round" real,"Grand Prix" text,"Pole Position" text,"Fastest Lap" text,"Winning Driver" text,"Winning Constructor" text,"Report" text)
SELECT "Pole Position" FROM table_57239 WHERE "Round" = '1'
What MLS team is affiliated with yale university?
CREATE TABLE table_31848 ("Pick #" real,"MLS Team" text,"Player" text,"Position" text,"Affiliation" text)
SELECT "MLS Team" FROM table_31848 WHERE "Affiliation" = 'yale university'
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the trend about salary over hire_date , display X-axis in asc order.
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 locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID varchar(2))CREATE TABLE departments (D...
SELECT HIRE_DATE, SALARY FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_DATE
Bin the hire date into Month interval, and then compute the average salary of employees in each month for a bar chart, note that just select those employees without the letter M in their first name.
CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))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 locations (LOCATION_ID decimal(4,0),STREET_ADDRESS...
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT FIRST_NAME LIKE '%M%'
Which Date has a Record of 19 16 8?
CREATE TABLE table_name_43 (date VARCHAR,record VARCHAR)
SELECT date FROM table_name_43 WHERE record = "19–16–8"
Which track has the original album turbulent indigo?
CREATE TABLE table_name_59 (track INTEGER,original_album VARCHAR)
SELECT AVG(track) FROM table_name_59 WHERE original_album = "turbulent indigo"
How many leage apperances for the player with one FA cup, and a FLT Apps of 0 (1)?
CREATE TABLE table_51505 ("Squad No." real,"Name" text,"Position" text,"League Apps" text,"League Goals" real,"FA Cup Apps" text,"FA Cup Goals" real,"League Cup Apps" text,"League Cup Goals" real,"FLT Apps" text,"FLT Goals" real,"Total Apps" text,"Total Goals" real)
SELECT "League Apps" FROM table_51505 WHERE "FA Cup Apps" = '1' AND "FLT Apps" = '0 (1)'
what was the first operation time in their last hospital visit for patient 015-67291?
CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE intakeoutput (intakeoutputid number,pat...
SELECT 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 = '015-67291' AND NOT patient.hospitaldischargetime IS NULL ORDER BY...
For each classroom with at least 2 classes, how many classes are offered. Show the proportion.
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 CLASS (CLASS_CODE varchar(5),CRS_CODE varchar(10),CLASS_SECTION varchar(2),CLASS_TIME varchar(20),CLASS_ROOM varchar(8),PROF_NUM int)CREATE TABLE EMPLOY...
SELECT CLASS_ROOM, COUNT(*) FROM CLASS GROUP BY CLASS_ROOM
What is the tone for gen.sing. plague?
CREATE TABLE table_47 ("Nominative" text,"Old orthography" text,"New orthography" text,"/e/ or /\u00e6/ (IPA)" text,"Tone (Latvian notation: /~/ - level,/^/ - broken)" text,"Translation" text)
SELECT "Tone (Latvian notation: /~/ - level, /^/ - broken)" FROM table_47 WHERE "Translation" = 'Gen.Sing. plague'
Which home team was playing on January 13?
CREATE TABLE table_name_87 (home VARCHAR,date VARCHAR)
SELECT home FROM table_name_87 WHERE date = "january 13"
Tell me the number of patients younger than 31 years who have syncope telemetry as their primary disease.
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,language text,religion text,admission_type text,days_stay text,insurance text,ethni...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SYNCOPE;TELEMETRY" AND demographic.age < "31"
What is the 1990 value with a 24 in 1995?
CREATE TABLE table_name_87 (Id VARCHAR)
SELECT 1990 FROM table_name_87 WHERE 1995 = "24"
What is the Time (EEST), when the Stage is ss8?
CREATE TABLE table_name_5 (time__eest_ VARCHAR,stage VARCHAR)
SELECT time__eest_ FROM table_name_5 WHERE stage = "ss8"
how many patients whose gender is m and lab test name is ferritin?
CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "M" AND lab.label = "Ferritin"
When the conference is west coast and the number of bids are at 2, what's the percentage of games won?
CREATE TABLE table_47521 ("Conference" text,"# of Bids" real,"Record" text,"Win %" text,"Round of 32" text,"Sweet Sixteen" text,"Elite Eight" text,"Final Four" text,"Championship Game" text)
SELECT "Win %" FROM table_47521 WHERE "# of Bids" = '2' AND "Conference" = 'west coast'
Who weighed 135lbs that was in the same class as Treveor Grant (Lowry) at 119 lbs?
CREATE TABLE table_1857 ("Class" text,"Team" text,"103lbs" text,"112lbs" text,"119lbs" text,"125lbs" text,"130lbs" text,"135lbs" text,"140lbs" text)
SELECT "135lbs" FROM table_1857 WHERE "119lbs" = 'Treveor Grant (Lowry)'
What is the type of vocals that the band member with the last name 'Heilo' played the most?
CREATE TABLE band (id number,firstname text,lastname text)CREATE TABLE tracklists (albumid number,position number,songid number)CREATE TABLE albums (aid number,title text,year number,label text,type text)CREATE TABLE vocals (songid number,bandmate number,type text)CREATE TABLE instruments (songid number,bandmateid numb...
SELECT type FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE lastname = "Heilo" GROUP BY type ORDER BY COUNT(*) DESC LIMIT 1
WHAT IS THE POSITION WITH A ROUND LARGER THAN 6, AND OVERALL OF 191?
CREATE TABLE table_47809 ("Round" real,"Pick" real,"Overall" real,"Name" text,"Position" text,"College" text)
SELECT "Position" FROM table_47809 WHERE "Round" > '6' AND "Overall" = '191'
Name the language for fox business network
CREATE TABLE table_1368 ("N\u00b0" real,"Television service" text,"Country" text,"Language" text,"Content" text,"DAR" text,"HDTV" text,"Package/Option" text)
SELECT "Language" FROM table_1368 WHERE "Television service" = 'Fox Business Network'
Which 1965 has a 1962 of 0.35000000000000003, and a 1967 smaller than 0.53?
CREATE TABLE table_name_38 (Id VARCHAR)
SELECT MIN(1965) FROM table_name_38 WHERE 1962 = 0.35000000000000003 AND 1967 < 0.53
What are Scott Zygulski's pick numbers?
CREATE TABLE table_2897457_7 (pick__number VARCHAR,player VARCHAR)
SELECT pick__number FROM table_2897457_7 WHERE player = "Scott Zygulski"
What is the name of the pictorial in the 11-98 issue?
CREATE TABLE table_1566850_9 (pictorials VARCHAR,date VARCHAR)
SELECT pictorials FROM table_1566850_9 WHERE date = "11-98"
What was the minimum pick by the Florida Panthers?
CREATE TABLE table_2781227_11 (pick INTEGER,nhl_team VARCHAR)
SELECT MIN(pick) FROM table_2781227_11 WHERE nhl_team = "Florida Panthers"
What Surface has a Date of 1 september 2008?
CREATE TABLE table_name_18 (surface VARCHAR,date VARCHAR)
SELECT surface FROM table_name_18 WHERE date = "1 september 2008"
what was the title of the episode 21a?
CREATE TABLE table_17810099_3 (title VARCHAR,episode__number VARCHAR)
SELECT title FROM table_17810099_3 WHERE episode__number = "21a"
Which date was hermanos rodr guez the location?
CREATE TABLE table_57168 ("Round" real,"Grand Prix" text,"Date" text,"Location" text,"Pole Position" text,"Fastest Lap" text,"Winning Driver" text,"Winning Constructor" text,"Report" text)
SELECT "Date" FROM table_57168 WHERE "Location" = 'hermanos rodríguez'
when was the last time the respiratory rate for patient 14671 was greater than 16.0 since 09/25/2100?
CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_...
SELECT chartevents.charttime 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 = 14671)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'respirat...
On which dates played Home Captain Courtney Walsh at the Queen's Park Oval?
CREATE TABLE table_name_35 (date VARCHAR,home_captain VARCHAR,venue VARCHAR)
SELECT date FROM table_name_35 WHERE home_captain = "courtney walsh" AND venue = "queen's park oval"
Before I take SOC 311 what other courses would be useful to have ?
CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,entered_as varchar,admit_term int,predicted_graduation_semester int,degree...
SELECT DISTINCT advisory_requirement FROM course WHERE department = 'SOC' AND number = 311
What type of photos of Angelina Jolie cost $500,000?
CREATE TABLE table_name_21 (type VARCHAR,reported_price VARCHAR,person_s_ VARCHAR)
SELECT type FROM table_name_21 WHERE reported_price = "$500,000" AND person_s_ = "angelina jolie"
Highest Voted Comments for a User on SFF.
CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,Creati...
SELECT PostId AS "post_link", Score, Text FROM Comments WHERE UserId = '##UserId##' ORDER BY Score DESC LIMIT 250
count the number of patients whose days of hospital stay is greater than 2 and procedure long title is exteriorization of small intestine?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "2" AND procedures.long_title = "Exteriorization of small intestine"
what 's the cheapest round trip fare between DALLAS and BALTIMORE
CREATE TABLE ground_service (city_code text,airport_code text,transport_type text,ground_fare int)CREATE TABLE code_description (code varchar,description text)CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE aircraft (aircraft_code varchar,aircraft_descrip...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_...
What role did John Wayne play in The Trail Beyond, directed by R.N. Bradbury?
CREATE TABLE table_name_56 (role VARCHAR,director VARCHAR,title VARCHAR)
SELECT role FROM table_name_56 WHERE director = "r.n. bradbury" AND title = "the trail beyond"
Show names for all aircrafts of which John Williams has certificates.
CREATE TABLE flight (flno number,origin text,destination text,distance number,departure_date time,arrival_date time,price number,aid number)CREATE TABLE aircraft (aid number,name text,distance number)CREATE TABLE certificate (eid number,aid number)CREATE TABLE employee (eid number,name text,salary number)
SELECT T3.name FROM employee AS T1 JOIN certificate AS T2 ON T1.eid = T2.eid JOIN aircraft AS T3 ON T3.aid = T2.aid WHERE T1.name = "John Williams"
What is the date of birth of the person who started their reign in 1986?
CREATE TABLE table_42193 ("Name" text,"Start of Reign" real,"End of Reign" text,"Birth Name" text,"Title" text)
SELECT "Birth Name" FROM table_42193 WHERE "Start of Reign" = '1986'
Who was the opponent in round 2 of the UFC 49 event?
CREATE TABLE table_46149 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" text,"Location" text)
SELECT "Opponent" FROM table_46149 WHERE "Round" = '2' AND "Event" = 'ufc 49'
What network has an origin in India, a genre of general, and broadcasts in Bengali?
CREATE TABLE table_name_20 (network VARCHAR,language VARCHAR,origin_of_programming VARCHAR,genre VARCHAR)
SELECT network FROM table_name_20 WHERE origin_of_programming = "india" AND genre = "general" AND language = "bengali"
provide the number of patients whose diagnoses short title is gstr/ddnts nos w/o hmrhg and lab test fluid is pleural?
CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Gstr/ddnts NOS w/o hmrhg" AND lab.fluid = "Pleural"
What are the fa.brill when w.h. archer is known as r. newman?
CREATE TABLE table_636 ("W.H. Archer" text,"J.E. Armstrong" text,"H.L. Birkett" text,"F.A. Brill" text,"H.T. Brewer" text)
SELECT "F.A. Brill" FROM table_636 WHERE "W.H. Archer" = 'R. Newman'
for how many days was the patient with patient id 22999 hospitalized?
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 demographic.days_stay FROM demographic WHERE demographic.subject_id = "22999"
Which Year is the lowest one that has a US Cham Rank smaller than 1?
CREATE TABLE table_34645 ("Year" real,"US Cham. Rank" real,"US Cham. Spending" text,"Next Highest Spender" text,"Next Highest Amount" text)
SELECT MIN("Year") FROM table_34645 WHERE "US Cham. Rank" < '1'
Which of the engines has a displacement of 1,585 cc, with a model number of 90i?
CREATE TABLE table_5699 ("Model" text,"Engine" text,"Displacement" text,"Power" text,"Torque" text)
SELECT "Engine" FROM table_5699 WHERE "Displacement" = '1,585 cc' AND "Model" = '90i'
Name the segment a for 8-08
CREATE TABLE table_1200 ("Series Ep." text,"Episode" real,"Netflix" text,"Segment A" text,"Segment B" text,"Segment C" text,"Segment D" text)
SELECT "Segment A" FROM table_1200 WHERE "Series Ep." = '8-08'
in this year, how many patients had been diagnosed with dvt - right lower extremity?
CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesit...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'dvt - right lower extremity' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year'))
How many play-off legs were won when the prize money was 10,300?
CREATE TABLE table_24334163_1 (Winners VARCHAR,total_money_won VARCHAR)
SELECT COUNT(Winners) AS play_off_legs_won FROM table_24334163_1 WHERE total_money_won = "£10,300"
give me the number of patients whose age is less than 89 and admission year is less than 2195?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "89" AND demographic.admityear < "2195"
What series had Joan Tena in sixth place?
CREATE TABLE table_name_54 (series INTEGER,sixth_place VARCHAR)
SELECT SUM(series) FROM table_name_54 WHERE sixth_place = "joan tena"
What is the lowest value in the miss international column?
CREATE TABLE table_31401 ("Rank" real,"Country/Territory" text,"Miss International" real,"1st Runner-up" real,"2nd Runner-up" real,"3rd Runner-up" real,"4th Runner-up" real,"Semifinalists" real,"Total" real)
SELECT MIN("Miss International") FROM table_31401
What is the country of player lee trevino, who has a to par of +2?
CREATE TABLE table_50021 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text)
SELECT "Country" FROM table_50021 WHERE "To par" = '+2' AND "Player" = 'lee trevino'
What is the date of the episode with Ryan Stiles as performer 2, Colin Mochrie as performer 3, and Tony Slattery as performer 4?
CREATE TABLE table_name_26 (date VARCHAR,performer_4 VARCHAR,performer_2 VARCHAR,performer_3 VARCHAR)
SELECT date FROM table_name_26 WHERE performer_2 = "ryan stiles" AND performer_3 = "colin mochrie" AND performer_4 = "tony slattery"
Name the candidates for ellsworth b. buck
CREATE TABLE table_18574 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text)
SELECT "Candidates" FROM table_18574 WHERE "Incumbent" = 'Ellsworth B. Buck'
What is the 2000 population in OK with a 1990-2000 percent change of A078 +17.22%?
CREATE TABLE table_69213 ("Rank (CSA)" text,"State(s)" text,"2007 Estimate" text,"2000 Population" text,"Percent Change (1990\u20132000)" text)
SELECT "2000 Population" FROM table_69213 WHERE "State(s)" = 'ok' AND "Percent Change (1990\u20132000)" = 'a078 +17.22%'
Find the city with post code 255.
CREATE TABLE addresses (city VARCHAR,zip_postcode VARCHAR)
SELECT city FROM addresses WHERE zip_postcode = 255
What college did the player for the Hamilton Tiger-Cats go to?
CREATE TABLE table_24276 ("Pick #" real,"CFL Team" text,"Player" text,"Position" text,"College" text)
SELECT "College" FROM table_24276 WHERE "CFL Team" = 'Hamilton Tiger-Cats'
What club team has 216 overall?
CREATE TABLE table_name_70 (club_team VARCHAR,overall VARCHAR)
SELECT club_team FROM table_name_70 WHERE overall = 216
Who is the studio host that has a play-by-play announcer of Bob Cole and a colour commentator of Harry Neale?
CREATE TABLE table_name_38 (studio_host VARCHAR,play_by_play VARCHAR,colour_commentator_s_ VARCHAR)
SELECT studio_host FROM table_name_38 WHERE play_by_play = "bob cole" AND colour_commentator_s_ = "harry neale"
what is maximum age of patients whose gender is m and discharge location is home?
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 text,gender text,language text,religion text,admission_type text,days_stay ...
SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.discharge_location = "HOME"
Draw a bar chart of date moved in versus how many date moved in, and order in desc by the Y please.
CREATE TABLE Customer_Events (Customer_Event_ID INTEGER,customer_id INTEGER,date_moved_in DATETIME,property_id INTEGER,resident_id INTEGER,thing_id INTEGER)CREATE TABLE Organizations (organization_id INTEGER,parent_organization_id INTEGER,organization_details VARCHAR(255))CREATE TABLE Customers (customer_id INTEGER,cus...
SELECT date_moved_in, COUNT(date_moved_in) FROM Customer_Events GROUP BY date_moved_in ORDER BY COUNT(date_moved_in) DESC
Which Home Team has a Game of game 1?
CREATE TABLE table_48705 ("Game" text,"Date" text,"Home Team" text,"Result" text,"Road Team" text)
SELECT "Home Team" FROM table_48705 WHERE "Game" = 'game 1'
count the number of patients that have been admitted to the hospital during this year.
CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_icd_procedures (row_id number,icd9_code ...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
for patients who were given heart countershock nec during the last year, what are the top four most frequent lab tests that followed afterwards during the same hospital encounter?
CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE cost (row_id number,subject_id number,hadm_i...
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...
What are the names of all songs that have a lower rating than some song of blues genre?
CREATE TABLE genre (g_name text,rating text,most_popular_in text)CREATE TABLE artist (artist_name text,country text,gender text,preferred_genre text)CREATE TABLE song (song_name text,artist_name text,country text,f_id number,genre_is text,rating number,languages text,releasedate time,resolution number)CREATE TABLE file...
SELECT song_name FROM song WHERE rating < (SELECT MAX(rating) FROM song WHERE genre_is = "blues")
Rolling 30 day > 30 question user count.
CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,ContentLicense text)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId n...
WITH DayPosts AS (SELECT OwnerUserId, CreationDate, COUNT(*) AS PostCount, ROW_NUMBER() OVER (PARTITION BY OwnerUserId ORDER BY CreationDate) AS Num FROM Posts WHERE PostTypeId = 1 GROUP BY OwnerUserId, CreationDate), UserMonths AS (SELECT OwnerUserId, CreationDate, PostCount, Num FROM DayPosts UNION ALL SELECT DayPost...
Who was the opponent on September 17, 1995?
CREATE TABLE table_name_63 (opponent VARCHAR,date VARCHAR)
SELECT opponent FROM table_name_63 WHERE date = "september 17, 1995"
What's the title of the episode with production number 103?
CREATE TABLE table_23958944_2 (title VARCHAR,production_number VARCHAR)
SELECT title FROM table_23958944_2 WHERE production_number = 103
among patients who had a lab test for human chorionic gonadotropin, calculate the number of ones' who have unspecified death status.
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 demographic (subject_id text,hadm_id text,name text,marital...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.expire_flag = "0" AND lab.label = "Human Chorionic Gonadotropin"
How many in the introduced section had Fokker as a manufacturer, a quantity of 5, and retired later than 1999?
CREATE TABLE table_name_94 (introduced INTEGER,retired VARCHAR,manufacturer VARCHAR,quantity VARCHAR)
SELECT SUM(introduced) FROM table_name_94 WHERE manufacturer = "fokker" AND quantity = 5 AND retired > 1999
How many total goals have 0 (3) as total apps, with league goals less than 0?
CREATE TABLE table_name_80 (total_goals VARCHAR,total_apps VARCHAR,league_goals VARCHAR)
SELECT COUNT(total_goals) FROM table_name_80 WHERE total_apps = "0 (3)" AND league_goals < 0
show me all fares between PHILADELPHIA and SAN FRANCISCO that are less than 200 dollars one way
CREATE TABLE state (state_code text,state_name text,country_name text)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 airport_service (city_code varchar,airport_code varchar,...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare WHERE ((fare.one_direction_cost < 200 AND fare.round_trip_required = 'NO') AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND fare...