instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What network is working in 2014?
CREATE TABLE table_4562 ("Year" real,"Network" text,"Play-by-play" text,"Color commentator(s)" text,"Sideline reporter(s)" text)
SELECT "Network" FROM table_4562 WHERE "Year" = '2014'
what is the last diagnosed diagnosis of patient 030-21071 on the first hospital encounter?
CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,syst...
SELECT diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-21071' AND NOT patient.hospitaldischargetime IS NULL ORDER BY...
Which upper-level courses are 1 credits ?
CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)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,predi...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 1 AND program_course.category LIKE 'ULCS'
What time is listed against the Wrestler Jimmy Rave?
CREATE TABLE table_59183 ("Elimination" text,"Wrestler" text,"Eliminated by" text,"Elimination Move" text,"Time" text)
SELECT "Time" FROM table_59183 WHERE "Wrestler" = 'jimmy rave'
What was the entrant in round 16 were Ferrari was the constructor?
CREATE TABLE table_52403 ("Entrant" text,"Constructor" text,"Chassis" text,"Engine" text,"Tyre" text,"Driver" text,"Rounds" text)
SELECT "Entrant" FROM table_52403 WHERE "Rounds" = '16' AND "Constructor" = 'ferrari'
Tell me the number of patients admitted before the year 2110 who had a joint fluid lab test.
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2110" AND lab.fluid = "Joint Fluid"
What was the Score in the Final against Opponent in the Final Manuel Orantes, prior to 1978?
CREATE TABLE table_name_35 (score_in_the_final VARCHAR,date VARCHAR,opponent_in_the_final VARCHAR)
SELECT score_in_the_final FROM table_name_35 WHERE date < 1978 AND opponent_in_the_final = "manuel orantes"
What is the time for Moscow, Russia?
CREATE TABLE table_name_62 (time VARCHAR,location VARCHAR)
SELECT time FROM table_name_62 WHERE location = "moscow, russia"
What is the attendance when the st kilda score is 13.10.88?
CREATE TABLE table_28211103_1 (attendance VARCHAR,st_kilda_score VARCHAR)
SELECT attendance FROM table_28211103_1 WHERE st_kilda_score = "13.10.88"
what is the number of anchor roles this actor has had ?
CREATE TABLE table_204_729 (id number,"year" text,"show" text,"role" text,"channel" text,"notes" text)
SELECT COUNT(*) FROM table_204_729 WHERE "role" = 'anchor'
What are the names of projects that require more than 300 hours, and how many scientists are assigned to each, list by the x-axis in descending please.
CREATE TABLE AssignedTo (Scientist int,Project char(4))CREATE TABLE Projects (Code Char(4),Name Char(50),Hours int)CREATE TABLE Scientists (SSN int,Name Char(30))
SELECT Name, COUNT(*) FROM Projects AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project WHERE T1.Hours > 300 GROUP BY T1.Name ORDER BY Name DESC
Visualize a bar chart, the x-axis is the arrival time, and the y-axis is the total number of trains in each arrival time, and show Y in ascending order.
CREATE TABLE manager (Manager_ID int,Name text,Country text,Working_year_starts text,Age int,Level int)CREATE TABLE train (Train_ID int,Train_Num text,Name text,From text,Arrival text,Railway_ID int)CREATE TABLE railway_manage (Railway_ID int,Manager_ID int,From_Year text)CREATE TABLE railway (Railway_ID int,Railway te...
SELECT Arrival, COUNT(Arrival) FROM train GROUP BY Arrival ORDER BY COUNT(Arrival)
Name the score for hawthorn opponent
CREATE TABLE table_15446 ("Year" text,"Competition" text,"Opponent" text,"Score" text,"Venue" text)
SELECT "Score" FROM table_15446 WHERE "Opponent" = 'hawthorn'
how many games were released for the psp ?
CREATE TABLE table_203_583 (id number,"title" text,"release" number,"6th gen" text,"handheld" text,"note" text)
SELECT COUNT("title") FROM table_203_583 WHERE "handheld" = 'psp'
When the A Score was larger than 5.933 with a total of 19.833, what nation was this?
CREATE TABLE table_38622 ("Nation" text,"T Score" real,"A Score" real,"E Score" real,"Total" real)
SELECT "Nation" FROM table_38622 WHERE "A Score" > '5.933' AND "Total" = '19.833'
How many games does the player with 1 (0) finals and a w-league of 28 (1) have?
CREATE TABLE table_64597 ("Name" text,"Games" text,"W-League" text,"Finals" text,"Goals" real,"Years" text)
SELECT "Games" FROM table_64597 WHERE "Finals" = '1 (0)' AND "W-League" = '28 (1)'
What is Venue, when Opposing Teams is 'South Africa', and when Date is '17/06/2000'?
CREATE TABLE table_name_46 (venue VARCHAR,opposing_teams VARCHAR,date VARCHAR)
SELECT venue FROM table_name_46 WHERE opposing_teams = "south africa" AND date = "17/06/2000"
how much does the cost of t3 are?
CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname te...
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'lab' AND cost.eventid IN (SELECT lab.labid FROM lab WHERE lab.labname = 't3')
What's the smallest number of players?
CREATE TABLE table_10682862_68 (players INTEGER)
SELECT MIN(players) FROM table_10682862_68
what is the television order of the episode directed by ben jones, written by j. m. dematteis and originally aired on february6,2009
CREATE TABLE table_20360535_2 (television_order VARCHAR,original_air_date VARCHAR,directed_by VARCHAR,written_by VARCHAR)
SELECT television_order FROM table_20360535_2 WHERE directed_by = "Ben Jones" AND written_by = "J. M. DeMatteis" AND original_air_date = "February6,2009"
What is the minimum manhunt beauty contest?
CREATE TABLE table_31432 ("Rank" real,"Country/Territory" text,"Manhunt International" real,"1st runner-up" real,"2nd runner-up" real,"3rd runner-up" real,"4th runner-up" real,"Semifinalists" real,"Total" real)
SELECT MIN("Manhunt International") FROM table_31432
What was the purse when the trainer was Aidan O'Brien?
CREATE TABLE table_name_21 (purse VARCHAR,trainer VARCHAR)
SELECT purse FROM table_name_21 WHERE trainer = "aidan o'brien"
Tell me the timeslot of calls of wrko
CREATE TABLE table_31963 ("Calls" text,"Frequency" text,"Branding" text,"Format" text,"Timeslot" text,"Group owner" text)
SELECT "Timeslot" FROM table_31963 WHERE "Calls" = 'wrko'
On which date were the 2003 Toronto Blue Jays 54-55?
CREATE TABLE table_name_5 (date VARCHAR,record VARCHAR)
SELECT date FROM table_name_5 WHERE record = "54-55"
What is Internet Plan, when Price is '22 EUR'?
CREATE TABLE table_50855 ("Internet Plan" text,"Downstream" text,"Upstream" text,"Bandwidth Included" text,"Price" text)
SELECT "Internet Plan" FROM table_50855 WHERE "Price" = '22 eur'
Which competition has a Season of 2010/11?
CREATE TABLE table_name_56 (competition VARCHAR,season VARCHAR)
SELECT competition FROM table_name_56 WHERE season = "2010/11"
what were the five most frequently ordered specimen tests for patients who were previously diagnosed with adv eff antibiotics nec since 2 years ago in the same hospital encounter?
CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE d_items (row_id number,itemid number,label text,linksto te...
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, 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_diagnos...
what is days of hospital stay and discharge time of subject id 9575?
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 (subject_id text,hadm_id text,name text,marital_status text,age text,dob...
SELECT demographic.days_stay, demographic.dischtime FROM demographic WHERE demographic.subject_id = "9575"
List all the possible ways to get to attractions, together with the number of attractions accessible by these methods Visualize by bar chart, could you show total number in desc order?
CREATE TABLE Hotels (hotel_id INTEGER,star_rating_code CHAR(15),pets_allowed_yn CHAR(1),price_range real,other_hotel_details VARCHAR(255))CREATE TABLE Photos (Photo_ID INTEGER,Tourist_Attraction_ID INTEGER,Name VARCHAR(255),Description VARCHAR(255),Filename VARCHAR(255),Other_Details VARCHAR(255))CREATE TABLE Features ...
SELECT How_to_Get_There, COUNT(*) FROM Tourist_Attractions GROUP BY How_to_Get_There ORDER BY COUNT(*) DESC
What is the status of the player who is moving to Nantes?
CREATE TABLE table_8429 ("Name" text,"Country" text,"Status" text,"Moving to" text,"Transfer window" text,"Transfer fee" text)
SELECT "Status" FROM table_8429 WHERE "Moving to" = 'nantes'
What Municipality has a Rank of 44?
CREATE TABLE table_75659 ("Rank" real,"Municipality" text,"Province" text,"Status" text,"Area (km 2)" real)
SELECT "Municipality" FROM table_75659 WHERE "Rank" = '44'
what is the number of patients whose diagnoses short title is nephritis nos and lab test category is chemistry?
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 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 = "Nephritis NOS" AND lab."CATEGORY" = "Chemistry"
what's the number of patients who have had ac alcoholic hepatitis diagnosed until 2104?
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 outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE diagnoses_icd ...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'ac alcoholic hepatitis') AND STRFTIME('%y', diagnoses_icd....
How much Peak Position has Sales Total larger than 1,540,088?
CREATE TABLE table_78789 ("Release" text,"Chart" text,"Peak Position" real,"Sales Total" real,"Chart Run" text)
SELECT COUNT("Peak Position") FROM table_78789 WHERE "Sales Total" > '1,540,088'
what is the five, the most frequent input event in this year?
CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE chartevents (row_id number,subject_id nu...
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT inputevents_cv.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM inputevents_cv WHERE DATETIME(inputevents_cv.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY inputevents_cv.it...
Who's ranked less than 2?
CREATE TABLE table_10545 ("Rank" real,"Player" text,"Country" text,"Earnings ($)" real,"Events" real,"Wins" real)
SELECT "Player" FROM table_10545 WHERE "Rank" < '2'
Which Homological Algebra courses offer 3 credits ?
CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE course (course_id int,name varchar,department varchar,numbe...
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Homological Algebra%' OR name LIKE '%Homological Algebra%') AND credits = 3
What was the score of the game when the record was 50-85?
CREATE TABLE table_34840 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" text,"Record" text)
SELECT "Score" FROM table_34840 WHERE "Record" = '50-85'
Which Articulatory class has and Aspirated stop of ?
CREATE TABLE table_9321 ("Articulatory class" text,"Non- stop" text,"Plain stop" text,"Aspirated stop" text,"\"Muddy\" voice" text)
SELECT "Articulatory class" FROM table_9321 WHERE "Aspirated stop" = 'ㅍ'
How many hispanic or latino-puerto rican patients have warf5 drug code?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,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 ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND prescriptions.formulary_drug_cd = "WARF5"
how many emergency hospital admitted patients were born before 2197?
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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.dob_year < "2197"
What is Away Captain, when Date is 30 Dec, 1,2,3 Jan 1911/2?
CREATE TABLE table_42768 ("Date" text,"Home captain" text,"Away captain" text,"Venue" text,"Result" text)
SELECT "Away captain" FROM table_42768 WHERE "Date" = '30 dec, 1,2,3 jan 1911/2'
what is the birth date when the weight (kg) is 100 and the world rank is 2?
CREATE TABLE table_65380 ("Nation" text,"Birth date" text,"Height (m)" text,"Weight (kg)" text,"World Rank" text)
SELECT "Birth date" FROM table_65380 WHERE "Weight (kg)" = '100' AND "World Rank" = '2'
Who was the opponent on the date of November 29, 1970 and the attendance was less than 31,427?
CREATE TABLE table_33752 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real)
SELECT AVG("Week") FROM table_33752 WHERE "Date" = 'november 29, 1970' AND "Attendance" < '31,427'
Which new team has a compensation-a round, and Frank Catalanotto as a player?
CREATE TABLE table_name_27 (new_team VARCHAR,round VARCHAR,player VARCHAR)
SELECT new_team FROM table_name_27 WHERE round = "compensation-a" AND player = "frank catalanotto"
What is the Pick # of the Player from Southern MIssissippi?
CREATE TABLE table_name_98 (pick VARCHAR,school VARCHAR)
SELECT COUNT(pick) FROM table_name_98 WHERE school = "southern mississippi"
On what date is the winning score 8 (70-71-67=208)?
CREATE TABLE table_name_54 (date VARCHAR,winning_score VARCHAR)
SELECT date FROM table_name_54 WHERE winning_score = –8(70 - 71 - 67 = 208)
Posts with pastall files newer then 5 months, grouped by user.
CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,UpVotes number,DownVotes number,ProfileImageUrl text,EmailHash text,AccountId number)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TA...
SELECT Posts.Id AS "post_link", Users.Id AS "user_link", PostTypes.Name AS type FROM Posts JOIN Users ON Users.Id = Posts.OwnerUserId JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Posts.Body LIKE '%pasteall.org%' AND DATEDIFF(month, Posts.CreationDate, CURRENT_TIMESTAMP()) <= 5 ORDER BY Users.Reputation DESC,...
Please tell the salary of each hire date using a line chart, and rank X-axis from high to low order.
CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,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 emp...
SELECT HIRE_DATE, SALARY FROM employees ORDER BY HIRE_DATE DESC
This Fall , how many upper-level 8 -credit ASIAN classes are offered ?
CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_credit varchar,repeat_term varchar,test_id varchar)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE p...
SELECT COUNT(DISTINCT course.course_id) FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.credits = 8 AND course.department = 'ASIAN' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Fall...
What was the first win for pos 6?
CREATE TABLE table_17750 ("Pos" real,"Manufacturer" text,"Seasons" text,"Starts" real,"Wins" real,"Sole supplier" real,"First win" text,"Last win" text,"Drivers" real,"Constr." real)
SELECT "First win" FROM table_17750 WHERE "Pos" = '6'
How many teams did they play week 6
CREATE TABLE table_205 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Kickoff [a ]" text,"Venue" text,"TV" text,"Attendance" real,"Record" text)
SELECT COUNT("Opponent") FROM table_205 WHERE "Week" = '6'
What is the Result with an NFL Recap, played at bank of america stadium?
CREATE TABLE table_name_41 (result VARCHAR,nfl_recap VARCHAR,game_site VARCHAR)
SELECT result FROM table_name_41 WHERE nfl_recap = "recap" AND game_site = "bank of america stadium"
how many years did the first three presidents serve combined ?
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)
SELECT SUM("years served") FROM table_203_800 WHERE "#" <= 3
How much Technique has the Highest rank of yokozuna, and a Total larger than 11?
CREATE TABLE table_name_89 (technique VARCHAR,highest_rank VARCHAR,total VARCHAR)
SELECT COUNT(technique) FROM table_name_89 WHERE highest_rank = "yokozuna" AND total > 11
What's the average round for the OT position from tulane college with an overall over 38?
CREATE TABLE table_name_41 (round INTEGER,overall VARCHAR,position VARCHAR,college VARCHAR)
SELECT AVG(round) FROM table_name_41 WHERE position = "ot" AND college = "tulane" AND overall > 38
When dayton is the team what is the record?
CREATE TABLE table_29556461_8 (record VARCHAR,team VARCHAR)
SELECT record FROM table_29556461_8 WHERE team = "Dayton"
who is at the top of the list ?
CREATE TABLE table_204_77 (id number,"number" text,"builder" text,"type" text,"date" text,"works number" number,"notes" text)
SELECT "builder" FROM table_204_77 WHERE id = 1
What is the result in 91-92 for the team with a 1.053 average?
CREATE TABLE table_19305 ("Team" text,"Average" text,"Points" real,"Played" real,"1991-92" text,"1992-93" text,"1993-94" real)
SELECT "1991-92" FROM table_19305 WHERE "Average" = '1.053'
When gniazdo is polish what is proto-slavic?
CREATE TABLE table_26757_4 (proto_slavic VARCHAR,polish VARCHAR)
SELECT proto_slavic FROM table_26757_4 WHERE polish = "gniazdo"
Name the date for faro
CREATE TABLE table_name_33 (date VARCHAR,location VARCHAR)
SELECT date FROM table_name_33 WHERE location = "faro"
until 2102, what are the three most frequent medications prescribed within 2 months to the patients with age 60 or above after having been diagnosed with chest pain?
CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'chest pain' AND STRFTIME('%y', diagnosis.diagnosis...
Which Event has a Surface of semifinal, and a Winner of hard (i)?
CREATE TABLE table_66231 ("!Event" real,"Round" text,"Surface" text,"Winner" text,"Opponent" text,"Result" text)
SELECT MAX("!Event") FROM table_66231 WHERE "Surface" = 'semifinal' AND "Winner" = 'hard (i)'
what is the number of patients whose insurance is self pay and days of hospital stay is greater than 30?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Self Pay" AND demographic.days_stay > "30"
What is the location/state of the race on 16 Jun?
CREATE TABLE table_name_92 (location___state VARCHAR,date VARCHAR)
SELECT location___state FROM table_name_92 WHERE date = "16 jun"
what school is rudy gay from
CREATE TABLE table_15872 ("Player" text,"No." real,"Nationality" text,"Position" text,"Years in Toronto" text,"School/Club Team" text)
SELECT "School/Club Team" FROM table_15872 WHERE "Player" = 'Rudy Gay'
what is patient 006-195310's height for the first time until 19 months ago?
CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid...
SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-195310') AND NOT patient.admissionheight IS NULL AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-19 month') ORDER BY patient.unit...
Which celebrity who was famous for being the ex busted member and TV presenter exited on day 19?
CREATE TABLE table_name_53 (celebrity VARCHAR,exited VARCHAR,famous_for VARCHAR)
SELECT celebrity FROM table_name_53 WHERE exited = "day 19" AND famous_for = "ex busted member and tv presenter"
WHich Places have a score smaller than 69?
CREATE TABLE table_15793 ("Place" text,"Player" text,"Country" text,"Score" real,"To par" text)
SELECT "Place" FROM table_15793 WHERE "Score" < '69'
Show all party names and the number of members in each party Show bar chart, and order the total number in ascending order.
CREATE TABLE party (Party_ID int,Minister text,Took_office text,Left_office text,Region_ID int,Party_name text)CREATE TABLE member (Member_ID int,Member_Name text,Party_ID text,In_office text)CREATE TABLE party_events (Event_ID int,Event_Name text,Party_ID int,Member_in_charge_ID int)CREATE TABLE region (Region_ID int,...
SELECT Party_name, COUNT(*) FROM member AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID ORDER BY COUNT(*)
Show the race class and number of races in each class with a bar chart, and sort in desc by the bars.
CREATE TABLE track (Track_ID int,Name text,Location text,Seating real,Year_Opened real)CREATE TABLE race (Race_ID int,Name text,Class text,Date text,Track_ID text)
SELECT Class, COUNT(*) FROM race GROUP BY Class ORDER BY Class DESC
Which Type has a Principal activities of health services?
CREATE TABLE table_name_28 (type VARCHAR,principal_activities VARCHAR)
SELECT type FROM table_name_28 WHERE principal_activities = "health services"
What is the hand number of the hand where player 1 is south and the east wind is prevailing?
CREATE TABLE table_26853172_1 (hand_number VARCHAR,player_1 VARCHAR,prevailing_wind VARCHAR)
SELECT COUNT(hand_number) FROM table_26853172_1 WHERE player_1 = "South" AND prevailing_wind = "East"
What was the least amount of camp mates?
CREATE TABLE table_19293 ("Series" text,"Presenters" text,"Start date" text,"End date" text,"Days in camp" real,"Camp mates" real,"Winner" text,"Highest viewers (millions)" text,"Lowest viewers (millions)" text,"Average viewers (millions)" text)
SELECT MIN("Camp mates") FROM table_19293
please show me airlines with service from BOSTON to DENVER
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 airline.airline_code FROM airline, 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_na...
How many names have a country of civ?
CREATE TABLE table_25312 ("N" real,"P" text,"Name" text,"EU" text,"Country" text,"Age" real,"Type" text,"Moving from" text,"Transfer window" text,"Ends" text,"Transfer fee" text,"Source" text)
SELECT COUNT("Name") FROM table_25312 WHERE "Country" = 'CIV'
show me the costs and times for flights from SAN FRANCISCO to ATLANTA
CREATE TABLE ground_service (city_code text,airport_code text,transport_type text,ground_fare int)CREATE TABLE fare_basis (fare_basis_code text,booking_class text,class_type text,premium text,economy text,discounted text,night text,season text,basis_days text)CREATE TABLE compartment_class (compartment varchar,class_ty...
SELECT DISTINCT fare.fare_id, flight.arrival_time, flight.departure_time 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 = 'SAN FRANCISCO' AND CITY_1.city_...
What is the Chinese name of the Eliminated player from Singapore in Index f9?
CREATE TABLE table_70964 ("Index" text,"Name" text,"Chinese Name" text,"Country" text,"Status" text)
SELECT "Chinese Name" FROM table_70964 WHERE "Status" = 'eliminated' AND "Country" = 'singapore' AND "Index" = 'f9'
What is the capacity for the school that has the Owl Athletic Complex baseball stadium?
CREATE TABLE table_23252 ("School" text,"Baseball stadium" text,"Softball stadium" text,"Basketball arena" text,"Capacity" text)
SELECT "Capacity" FROM table_23252 WHERE "Baseball stadium" = 'Owl Athletic Complex'
What was the title of the episode directed by David Mamet?
CREATE TABLE table_28420 ("No." real,"#" real,"Title" text,"Directed by" text,"Written by" text,"U.S. viewers (million)" text,"Rank (week)" text,"Original air date" text,"Production code" text)
SELECT "Title" FROM table_28420 WHERE "Directed by" = 'David Mamet'
Find the year and semester when offers the largest number of courses.
CREATE TABLE course (course_id text,title text,dept_name text,credits number)CREATE TABLE section (course_id text,sec_id text,semester text,year number,building text,room_number text,time_slot_id text)CREATE TABLE instructor (id text,name text,dept_name text,salary number)CREATE TABLE takes (id text,course_id text,sec_...
SELECT semester, year FROM section GROUP BY semester, year ORDER BY COUNT(*) DESC LIMIT 1
What is the name where p is mf?
CREATE TABLE table_11891841_2 (name VARCHAR,p VARCHAR)
SELECT name FROM table_11891841_2 WHERE p = "MF"
what's the first elected with opponent being ralph regula (r) 75.0% j. michael finn (d) 25.0%
CREATE TABLE table_1341522_38 (first_elected VARCHAR,opponent VARCHAR)
SELECT first_elected FROM table_1341522_38 WHERE opponent = "Ralph Regula (R) 75.0% J. Michael Finn (D) 25.0%"
How many miles were driven with the average speed at 116.81?
CREATE TABLE table_24596 ("Year" real,"Date" text,"Driver" text,"Team" text,"Manufacturer" text,"Laps" text,"Miles (km)" text,"Race Time" text,"Average Speed (mph)" text,"Report" text)
SELECT "Miles (km)" FROM table_24596 WHERE "Average Speed (mph)" = '116.81'
Who wrote episode 27 in the series that was directed by Wendey Stanzler?
CREATE TABLE table_30749 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text,"U.S. viewers (million)" text)
SELECT "Written by" FROM table_30749 WHERE "Directed by" = 'Wendey Stanzler' AND "No. in series" = '27'
please show me all the flights from BOSTON
CREATE TABLE compartment_class (compartment varchar,class_type varchar)CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,t...
SELECT DISTINCT flight.flight_id FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'BOSTON' AND flight.from_airport = airport_service.airport_code
In what venue was the event held on 14 February 2009?
CREATE TABLE table_45888 ("Date" text,"Opponent" text,"Venue" text,"Result" text,"Attendance" real)
SELECT "Venue" FROM table_45888 WHERE "Date" = '14 february 2009'
What is the Attendance on 11/10/1928?
CREATE TABLE table_name_42 (attendance VARCHAR,date VARCHAR)
SELECT attendance FROM table_name_42 WHERE date = "11/10/1928"
Which institution has a nickname of Blue Hens?
CREATE TABLE table_name_88 (institution VARCHAR,nickname VARCHAR)
SELECT institution FROM table_name_88 WHERE nickname = "blue hens"
Who is the head coach of the team located in Mudgeeraba?
CREATE TABLE table_name_53 (head_coach VARCHAR,location VARCHAR)
SELECT head_coach FROM table_name_53 WHERE location = "mudgeeraba"
For those employees who did not have any job in the past, visualize a scatter chart about the correlation between commission_pct and manager_id .
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 countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12...
SELECT COMMISSION_PCT, MANAGER_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
What was the grid for anthony davidson when the laps were less than 8?
CREATE TABLE table_name_86 (grid VARCHAR,driver VARCHAR,laps VARCHAR)
SELECT COUNT(grid) FROM table_name_86 WHERE driver = "anthony davidson" AND laps < 8
For those employees who was hired before 2002-06-21, draw a scatter chart about the correlation between employee_id and department_id .
CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGER_ID decimal(6,0),DEPARTMENT_ID decimal(4,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),S...
SELECT EMPLOYEE_ID, DEPARTMENT_ID FROM employees WHERE HIRE_DATE < '2002-06-21'
provide the number of patients whose discharge location is long term care hospital and procedure short title is form cutan ileoureterost?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid 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 t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "LONG TERM CARE HOSPITAL" AND procedures.short_title = "Form cutan ileoureterost"
What are the distinct creation years of the departments managed by a secretary born in state 'Alabama'?
CREATE TABLE head (head_id VARCHAR,born_state VARCHAR)CREATE TABLE department (creation VARCHAR,department_id VARCHAR)CREATE TABLE management (department_id VARCHAR,head_id VARCHAR)
SELECT DISTINCT T1.creation FROM department AS T1 JOIN management AS T2 ON T1.department_id = T2.department_id JOIN head AS T3 ON T2.head_id = T3.head_id WHERE T3.born_state = 'Alabama'
how many of the patients with unspecified protein-calorie malnutrition were treated with a base drug?
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Unspecified protein-calorie malnutrition" AND prescriptions.drug_type = "BASE"
For those employees whose first name is ending with the letter m, sum their salary for visualizing a pie chart.
CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGER_ID decimal(6,0),DEPARTMENT_ID decimal(4,0))CREATE TABLE countries (COUNTRY_ID varchar(2),COUN...
SELECT FIRST_NAME, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%m' GROUP BY FIRST_NAME
What is the mascot whose school opened in 1970?
CREATE TABLE table_55988 ("School's name" text,"School's namesake" text,"Year opened" text,"Principal" text,"Mascot" text)
SELECT "Mascot" FROM table_55988 WHERE "Year opened" = '1970'
Tell me the date for emery and home of ottawa with attendance more than 19,575
CREATE TABLE table_10094 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Decision" text,"Attendance" real,"Record" text)
SELECT "Date" FROM table_10094 WHERE "Decision" = 'emery' AND "Attendance" > '19,575' AND "Home" = 'ottawa'
Who had a time of 26.11?
CREATE TABLE table_name_39 (name VARCHAR,time VARCHAR)
SELECT name FROM table_name_39 WHERE time = "26.11"