instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
Hiw many losses have 30 for the goals with points greater than 24?
CREATE TABLE table_58695 ("Position" real,"Club" text,"Played" real,"Points" real,"Wins" real,"Draws" real,"Losses" real,"Goals for" real,"Goals against" real,"Goal Difference" real)
SELECT COUNT("Losses") FROM table_58695 WHERE "Goals for" = '30' AND "Points" > '24'
what flights from ST. LOUIS to ST. PAUL on thursday leaving after 1000
CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircra...
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 WHERE ((date_day.day_number = 24 AND date_day.month_number = 5 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time...
What value in 2013 corresponds to Grand Slam Tournaments in 2012?
CREATE TABLE table_33199 ("Tournament" text,"2007" text,"2011" text,"2012" text,"2013" text)
SELECT "2013" FROM table_33199 WHERE "2012" = 'grand slam tournaments'
What are the numbers of races for each constructor id?
CREATE TABLE qualifying (qualifyid number,raceid number,driverid number,constructorid number,number number,position number,q1 text,q2 text,q3 text)CREATE TABLE races (raceid number,year number,round number,circuitid number,name text,date text,time text,url text)CREATE TABLE laptimes (raceid number,driverid number,lap n...
SELECT COUNT(*), constructorid FROM constructorstandings GROUP BY constructorid
when did patient 20165 first undergo the procedure until 2100?
CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time...
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20165) AND STRFTIME('%y', procedures_icd.charttime) <= '2100' ORDER BY procedures_icd.charttime LIMIT 1
What is the average of all Heats of competitors with a Time of 59.11 and a lane higher than 3?
CREATE TABLE table_name_43 (heat INTEGER,time VARCHAR,lane VARCHAR)
SELECT AVG(heat) FROM table_name_43 WHERE time = "59.11" AND lane > 3
What country does charles coody play for?
CREATE TABLE table_name_21 (country VARCHAR,player VARCHAR)
SELECT country FROM table_name_21 WHERE player = "charles coody"
Name the state class for iowa admitted to the union december 28, 1846
CREATE TABLE table_225205_3 (state__class_ VARCHAR,reason_for_change VARCHAR)
SELECT state__class_ FROM table_225205_3 WHERE reason_for_change = "Iowa admitted to the Union December 28, 1846"
Which opponent had a round of SF?
CREATE TABLE table_name_45 (opponent VARCHAR,round VARCHAR)
SELECT opponent FROM table_name_45 WHERE round = "sf"
What number identifies Chris Gatling?
CREATE TABLE table_72685 ("Player" text,"No." real,"Nationality" text,"Position" text,"Years in Orlando" text,"School/Club Team" text)
SELECT MAX("No.") FROM table_72685 WHERE "Player" = 'Chris Gatling'
How many total golds do teams have when the total medals is less than 1?
CREATE TABLE table_name_79 (gold INTEGER,total INTEGER)
SELECT SUM(gold) FROM table_name_79 WHERE total < 1
how many patients whose language is span and age is less than 70?
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "SPAN" AND demographic.age < "70"
What competition has a goal number of 13?
CREATE TABLE table_54604 ("Goal" real,"Date" text,"Score" text,"Result" text,"Competition" text)
SELECT "Competition" FROM table_54604 WHERE "Goal" = '13'
provide the number of patients whose gender is f and primary disease is morbid obesity/sda?
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 lab (subject_id text,hadm_id text,itemid text,charttime tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "MORBID OBESITY/SDA"
history of congestive heart failure
CREATE TABLE table_train_195 ("id" int,"gender" string,"pregnancy_or_lactation" bool,"allergy_to_perflutren" bool,"heart_disease" bool,"body_mass_index_bmi" float,"age" float,"NOUSE" float)
SELECT * FROM table_train_195 WHERE heart_disease = 1
Tell me the title for pages of 96
CREATE TABLE table_name_99 (title VARCHAR,pages VARCHAR)
SELECT title FROM table_name_99 WHERE pages = 96
when did patient 85700 have a minimum potassium for the first time this month?
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 procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code tex...
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 85700) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'potassium') AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURR...
tell me the drug that was prescribed to patient 6580 for the last time through the po route since 04/2105?
CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,i...
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 6580) AND prescriptions.route = 'po' AND STRFTIME('%y-%m', prescriptions.startdate) >= '2105-04' ORDER BY prescriptions.startdate DESC LIMIT 1
count the number of patients with unspecified paraplegia diagnoses who had abnormal lab test 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 procedures (subject_id text,hadm_id text,icd9_code text,sho...
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 = "Paraplegia NOS" AND lab.flag = "abnormal"
which player was the first player to be drafted ?
CREATE TABLE table_203_305 (id number,"round" number,"#" number,"player" text,"nationality" text,"college/junior/club team (league)" text)
SELECT "player" FROM table_203_305 WHERE id = 1
What is Stella Farentino's current relationship status?
CREATE TABLE table_24143253_2 (current_marital_status VARCHAR,name VARCHAR)
SELECT current_marital_status FROM table_24143253_2 WHERE name = "Stella Farentino"
What game in the season does this list start?
CREATE TABLE table_27713030_7 (game INTEGER)
SELECT MIN(game) FROM table_27713030_7
What is the earliest season with an advertising account manager profile?
CREATE TABLE table_name_38 (season INTEGER,profile VARCHAR)
SELECT MIN(season) FROM table_name_38 WHERE profile = "advertising account manager"
When driver heinz-harald frentzen has a number of laps greater than 60, what is the sum of grid?
CREATE TABLE table_54320 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real)
SELECT COUNT("Grid") FROM table_54320 WHERE "Laps" > '60' AND "Driver" = 'heinz-harald frentzen'
Which player went to Emporia State?
CREATE TABLE table_10361230_1 (player_name VARCHAR,college VARCHAR)
SELECT player_name FROM table_10361230_1 WHERE college = "Emporia State"
What nationality was peter slamiar?
CREATE TABLE table_4121 ("Pick" text,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text)
SELECT "Nationality" FROM table_4121 WHERE "Player" = 'Peter Slamiar'
what are the three most common laboratory tests patients had within 2 months after receiving a vte prophylaxis - compression boots treatment procedure until 2102?
CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsyste...
SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'vte prophylaxis - compression boots' AND STRFTIME('%...
Who was the visitor when vancouver was at home?
CREATE TABLE table_name_77 (visitor VARCHAR,home VARCHAR)
SELECT visitor FROM table_name_77 WHERE home = "vancouver"
Name the country when dar is 16:9 for italian english for disney xd +2
CREATE TABLE table_20398 ("N\u00b0" real,"Television service" text,"Country" text,"Language" text,"Content" text,"DAR" text,"HDTV" text,"PPV" text,"Package/Option" text)
SELECT "Country" FROM table_20398 WHERE "DAR" = '16:9' AND "Language" = 'Italian English' AND "Television service" = 'Disney XD +2'
count the number of patients who had been prescribed albumin human 25 % iv soln within 2 months after having received a orthopedics consultation procedure since 6 years ago.
CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE lab (labid number,patientunitstayid number,labna...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'orthopedics consultation' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-6 year')) AS t...
Visualize a bar chart about the distribution of middle_name and gender_mf .
CREATE TABLE Student_Course_Enrolment (registration_id INTEGER,student_id INTEGER,course_id INTEGER,date_of_enrolment DATETIME,date_of_completion DATETIME)CREATE TABLE Courses (course_id INTEGER,author_id INTEGER,subject_id INTEGER,course_name VARCHAR(120),course_description VARCHAR(255))CREATE TABLE Students (student_...
SELECT middle_name, gender_mf FROM Course_Authors_and_Tutors ORDER BY personal_name
What is Stop No., when Destination is [2778] Claisebrook Station Platforms?
CREATE TABLE table_name_25 (stop_no VARCHAR,destination VARCHAR)
SELECT stop_no FROM table_name_25 WHERE destination = "[2778] claisebrook station platforms"
pulse rate between 45 _ 100 bpm; respirations between 8 _ 20 per minute
CREATE TABLE table_train_143 ("id" int,"gender" string,"systolic_blood_pressure_sbp" int,"agitation" bool,"npi" int,"aggression_domain" bool,"delusions_hallucinations" bool,"pulse_rate" int,"fridericia_corrected_qt_interval_qtcf" int,"diastolic_blood_pressure_dbp" int,"liver_disease" bool,"hallucinations" bool,"kidney_...
SELECT * FROM table_train_143 WHERE (pulse_rate >= 45 AND pulse_rate <= 100) AND (respiratory_rate >= 8 AND respiratory_rate <= 20)
Which Name has a Year larger than 2001, and a Length of 52 x 20 mins?
CREATE TABLE table_name_9 (name VARCHAR,year VARCHAR,length VARCHAR)
SELECT name FROM table_name_9 WHERE year > 2001 AND length = "52 x 20 mins"
Name the position for michael warner
CREATE TABLE table_25017530_6 (position VARCHAR,player VARCHAR)
SELECT position FROM table_25017530_6 WHERE player = "Michael Warner"
what was patient 022-157712's first time of taking po fluid?
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 lab (labid number,patientunitstayid number,labname text,labresult number,l...
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-157712')) AND intakeoutput.cellpath LIKE '%intake...
How many officers o/s were there on the day when the number of USAAF was 2373882?
CREATE TABLE table_23508196_2 (officers_o_s INTEGER,total_usaaf VARCHAR)
SELECT MAX(officers_o_s) FROM table_23508196_2 WHERE total_usaaf = 2373882
what is the number of patients whose hospital stay is above 6 days and with lab test category chemistry?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "6" AND lab."CATEGORY" = "Chemistry"
What is the guardian m t k for the guardian whose consort is Sv h ?
CREATE TABLE table_100518_1 (guardian_mātṛkā VARCHAR,consort VARCHAR)
SELECT guardian_mātṛkā FROM table_100518_1 WHERE consort = "Svāhā"
Return the average number of weeks on top for volumes by artists that are at most 25 years old.
CREATE TABLE music_festival (id number,music_festival text,date_of_ceremony text,category text,volume number,result text)CREATE TABLE artist (artist_id number,artist text,age number,famous_title text,famous_release_date text)CREATE TABLE volume (volume_id number,volume_issue text,issue_date text,weeks_on_top number,son...
SELECT AVG(T2.weeks_on_top) FROM artist AS T1 JOIN volume AS T2 ON T1.artist_id = T2.artist_id WHERE T1.age <= 25
what is the area when the census ranking is 2,290 of 5,008?
CREATE TABLE table_name_49 (area_km_2 VARCHAR,census_ranking VARCHAR)
SELECT area_km_2 FROM table_name_49 WHERE census_ranking = "2,290 of 5,008"
Tell me the power output for total production of 100
CREATE TABLE table_name_38 (power_output_(kw) VARCHAR,total_production VARCHAR)
SELECT power_output_(kw) FROM table_name_38 WHERE total_production = 100
What is the note result when the runner finished 19th in 2008?
CREATE TABLE table_48005 ("Year" real,"Competition" text,"Venue" text,"Position" text,"Event" text,"Notes" text)
SELECT "Notes" FROM table_48005 WHERE "Year" = '2008' AND "Position" = '19th'
Name the 1st person pl for
CREATE TABLE table_27801 ("Case" text,"1st pers. sing." text,"2nd pers. sing." text,"3rd pers. sing." text,"1st pers. pl" text,"2nd pers. pl." text,"3rd pers pl." text)
SELECT "1st pers. pl" FROM table_27801 WHERE "2nd pers. sing." = 'тонэ'
calculate the number of drugs since 2105 patient 033-10593 has been prescribed.
CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,cellla...
SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-10593')) AND STRFTIME('%y', medication.drugstarttime) >= '2105'
How many patients who died in or before the year 2133 had sigmoid diverticulitis, colovestical fistula/sda as their primary disease?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SIGMOID DIVERTICULITIS, COLOVESTICAL FISTULA/SDA" AND demographic.dod_year <= "2133.0"
What is the number of patients less than 20 years of age who had a mchc lab test done?
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 procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "20" AND lab.label = "MCHC"
What is the distance from Jaffa of Jerusalem station?
CREATE TABLE table_35300 ("Name/Location" text,"Other (later) names" text,"Operation" text,"Distance from Jaffa" text,"Elevation" text)
SELECT "Distance from Jaffa" FROM table_35300 WHERE "Name/Location" = 'jerusalem'
What are the winnings for the season where the average finish is 11.1?
CREATE TABLE table_20693 ("Year" real,"Starts" real,"Wins" real,"Top 5" real,"Top 10" real,"Poles" real,"Avg. Start" text,"Avg. Finish" text,"Winnings" text,"Position" text,"Team(s)" text)
SELECT "Winnings" FROM table_20693 WHERE "Avg. Finish" = '11.1'
What was the rank of the team with a run 2 of 1:20.8 and a run 4 of 1:23.0?
CREATE TABLE table_47140 ("Rank" text,"Team" text,"Run 1" text,"Run 2" text,"Run 3" text,"Run 4" text,"Final" text)
SELECT "Rank" FROM table_47140 WHERE "Run 2" = '1:20.8' AND "Run 4" = '1:23.0'
What is the lowest grid with matra as constructor?
CREATE TABLE table_78428 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real)
SELECT MIN("Grid") FROM table_78428 WHERE "Constructor" = 'matra'
What was the result of the april 6, 2002 game against the greensboro prowlers?
CREATE TABLE table_49599 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Record" text,"Game site" text)
SELECT "Result" FROM table_49599 WHERE "Opponent" = 'greensboro prowlers' AND "Date" = 'april 6, 2002'
Which stadium has the date/year of Fri 06/25/82?
CREATE TABLE table_24370 ("Type of Record" text,"Attendance" real,"Date/Year" text,"Stadium" text,"Result/Games" text)
SELECT "Stadium" FROM table_24370 WHERE "Date/Year" = 'Fri 06/25/82'
Question asked by X which were answered by Y.
CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE ...
SELECT q.Id AS "post_link" FROM Posts AS a INNER JOIN Posts AS q ON a.ParentId = q.Id WHERE a.OwnerUserId = '##Answerer##' AND q.OwnerUserId = '##Asker##'
What was the season record when the location attendance was Air Canada Centre 19,800?
CREATE TABLE table_58575 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "Record" FROM table_58575 WHERE "Location Attendance" = 'air canada centre 19,800'
What is Date, when High Rebounds is 'Amar'e Stoudemire (13)'?
CREATE TABLE table_name_28 (date VARCHAR,high_rebounds VARCHAR)
SELECT date FROM table_name_28 WHERE high_rebounds = "amar'e stoudemire (13)"
Find the first names and degree of all professors who are teaching some class in Computer Info. Systems department.
CREATE TABLE enroll (class_code text,stu_num number,enroll_grade text)CREATE TABLE student (stu_num number,stu_lname text,stu_fname text,stu_init text,stu_dob time,stu_hrs number,stu_class text,stu_gpa number,stu_transfer number,dept_code text,stu_phone text,prof_num number)CREATE TABLE course (crs_code text,dept_code ...
SELECT DISTINCT T2.emp_fname, T3.prof_high_degree FROM class AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN professor AS T3 ON T2.emp_num = T3.emp_num JOIN department AS T4 ON T4.dept_code = T3.dept_code WHERE T4.dept_name = 'Computer Info. Systems'
what country hosted david toms
CREATE TABLE table_name_94 (country VARCHAR,player VARCHAR)
SELECT country FROM table_name_94 WHERE player = "david toms"
Which region had a life expectancy at birth of 77.9 from 2001-2002?
CREATE TABLE table_25042332_33 (region VARCHAR,life_expectancy_at_birth__2001_2002_ VARCHAR)
SELECT region FROM table_25042332_33 WHERE life_expectancy_at_birth__2001_2002_ = "77.9"
Show different parties of people along with the number of people in each party with a bar chart.
CREATE TABLE debate_people (Debate_ID int,Affirmative int,Negative int,If_Affirmative_Win bool)CREATE TABLE people (People_ID int,District text,Name text,Party text,Age int)CREATE TABLE debate (Debate_ID int,Date text,Venue text,Num_of_Audience int)
SELECT Party, COUNT(*) FROM people GROUP BY Party
how many patients of black/african american ethnicity are born before 2078?
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 WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.dob_year < "2078"
how many patients are admitted in location transfer within this facility and are born before 2138?
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 lab (subject_id text,hadm_id text,itemid text,charttime te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.dob_year < "2138"
What is the number of wins when the number of third was 1, points were less than 572 and had less than 16 races?
CREATE TABLE table_name_92 (wins VARCHAR,races VARCHAR,third VARCHAR,points VARCHAR)
SELECT wins FROM table_name_92 WHERE third = "1" AND points < 572 AND races < 16
What away team played at Brunswick Street Oval?
CREATE TABLE table_74792 ("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_74792 WHERE "Venue" = 'brunswick street oval'
Who is the director of the episode at entry number 13?
CREATE TABLE table_19804 ("#" real,"Episode" text,"Writer" text,"Director" text,"Original air date" text,"Viewing figure" text)
SELECT "Director" FROM table_19804 WHERE "#" = '13'
Get all the 7 -credit Journalistic Performance courses .
CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE ta (campus_job_id int,studen...
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Journalistic Performance%' OR name LIKE '%Journalistic Performance%') AND credits = 7
If the Away team was south melbourne what Date did they play?
CREATE TABLE table_56399 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Date" FROM table_56399 WHERE "Away team" = 'south melbourne'
What is the class that is the hardest ?
CREATE TABLE course_tags_count (course_id int,clear_grading int,pop_quiz int,group_projects int,inspirational int,long_lectures int,extra_credit int,few_tests int,good_feedback int,tough_tests int,heavy_papers int,cares_for_students int,heavy_assignments int,respected int,participation int,heavy_reading int,tough_grade...
SELECT DISTINCT course.name, course.number, program_course.workload FROM course, program_course WHERE course.department = 'EECS' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MAX(PROGRAM_COURSEalias1.workload) FROM course AS COURSEalias1, program_course AS PROGRAM_COURSEalias1 WH...
What was the highest attendance on December 23?
CREATE TABLE table_12603 ("Date" text,"Opponent" text,"Score" text,"Decision" text,"Attendance" real,"Record" text)
SELECT MAX("Attendance") FROM table_12603 WHERE "Date" = 'december 23'
Who has a hometown of los angeles, ca?
CREATE TABLE table_10921 ("Player" text,"Height" text,"School" text,"Hometown" text,"College" text,"NBA Draft" text)
SELECT "Player" FROM table_10921 WHERE "Hometown" = 'los angeles, ca'
Which Issue date(s) has a Weeks at number one of 5, and a Volume:Issue of 61:17-21?
CREATE TABLE table_49547 ("Volume:Issue" text,"Issue date(s)" text,"Weeks at number one" real,"Song" text,"Artist(s)" text)
SELECT "Issue date(s)" FROM table_49547 WHERE "Weeks at number one" = '5' AND "Volume:Issue" = '61:17-21'
What day was Australia the opposing team and the against 12?
CREATE TABLE table_name_92 (date VARCHAR,opposing_teams VARCHAR,against VARCHAR)
SELECT date FROM table_name_92 WHERE opposing_teams = "australia" AND against = 12
what is the name of the drug that patient 015-180 was prescribed during the same hospital encounter after having received a eeg monitoring procedure since 06/2105.
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 diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,...
SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =...
What date did the episode that had 8.84 million u.s. viewers originally air?
CREATE TABLE table_28768925_1 (original_air_date VARCHAR,us_viewers__million_ VARCHAR)
SELECT original_air_date FROM table_28768925_1 WHERE us_viewers__million_ = "8.84"
In the Spring or Summer , which courses have the ability to meet the Core requirement ?
CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time,monday varchar,tuesday varchar,wednesday varchar,thursday v...
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id...
who was the top winner ?
CREATE TABLE table_203_309 (id number,"team" text,"winners" number,"runners-up" number,"years won" text,"years lost" text)
SELECT "team" FROM table_203_309 ORDER BY id LIMIT 1
Weight of 220 has what class?
CREATE TABLE table_name_5 (class VARCHAR,weight VARCHAR)
SELECT class FROM table_name_5 WHERE weight = 220
What year was someone first elected?
CREATE TABLE table_1342379_45 (first_elected INTEGER)
SELECT MIN(first_elected) FROM table_1342379_45
What is the market value of every comapny in the banking industry? Return a pie chart.
CREATE TABLE company (Company_ID int,Rank int,Company text,Headquarters text,Main_Industry text,Sales_billion real,Profits_billion real,Assets_billion real,Market_Value real)CREATE TABLE gas_station (Station_ID int,Open_Year int,Location text,Manager_Name text,Vice_Manager_Name text,Representative_Name text)CREATE TABL...
SELECT Company, Market_Value FROM company WHERE Main_Industry = 'Banking'
What is the altitude (or elevation) of the airports in the city of New York? Show me a bar chart, order in ascending by the elevation.
CREATE TABLE airports (apid integer,name text,city text,country text,x real,y real,elevation bigint,iata character varchar(3),icao character varchar(4))CREATE TABLE airlines (alid integer,name text,iata varchar(2),icao varchar(3),callsign text,country text,active varchar(2))CREATE TABLE routes (rid integer,dst_apid int...
SELECT name, elevation FROM airports WHERE city = 'New York' ORDER BY elevation
What was 2002, when 2008 was, 'career statistics'?
CREATE TABLE table_42282 ("Tournament" text,"1998" text,"1999" text,"2000" text,"2001" text,"2002" text,"2003" text,"2004" text,"2005" text,"2006" text,"2007" text,"2008" text,"2009" text,"2010" text,"2011" text,"2012" text)
SELECT "2002" FROM table_42282 WHERE "2008" = 'career statistics'
papers with more than 5 citations
CREATE TABLE field (fieldid int)CREATE TABLE paper (paperid int,title varchar,venueid int,year int,numciting int,numcitedby int,journalid int)CREATE TABLE dataset (datasetid int,datasetname varchar)CREATE TABLE keyphrase (keyphraseid int,keyphrasename varchar)CREATE TABLE cite (citingpaperid int,citedpaperid int)CREATE...
SELECT DISTINCT cite.citingpaperid FROM cite, paper WHERE paper.paperid = cite.citedpaperid GROUP BY cite.citingpaperid HAVING COUNT(DISTINCT cite.citedpaperid) > 5
What is every entry for epoch if periselene is 5,454.925?
CREATE TABLE table_206217_2 (epoch__utc_ VARCHAR,periselene__km_ VARCHAR)
SELECT epoch__utc_ FROM table_206217_2 WHERE periselene__km_ = "5,454.925"
What's the hometown of thomas tyner?
CREATE TABLE table_10727 ("Player" text,"Position" text,"School" text,"Hometown" text,"College" text)
SELECT "Hometown" FROM table_10727 WHERE "Player" = 'thomas tyner'
Find the product names whose average product price is below 1000000.
CREATE TABLE ref_service_types (service_type_code text,parent_service_type_code text,service_type_description text)CREATE TABLE invoices (invoice_id number,order_id number,payment_method_code text,product_id number,order_quantity text,other_item_details text,order_item_id number)CREATE TABLE customer_orders (order_id n...
SELECT product_name FROM products GROUP BY product_name HAVING AVG(product_price) < 1000000
how many patients whose age is less than 27 and drug name is meropenem?
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "27" AND prescriptions.drug = "Meropenem"
What IHSAA football class do the Generals play in?
CREATE TABLE table_13817 ("School" text,"Mascot" text,"School Corp." text,"Size" real,"IHSAA Class (Football)" text,"Year Joined" text,"Other Conferences" text)
SELECT "IHSAA Class (Football)" FROM table_13817 WHERE "Mascot" = 'generals'
Name the taxes from brqacket for percentage of income kept being 73%
CREATE TABLE table_22931 ("Currency Bracket:" text,"Dollars Taxed in Bracket:" text,"Rate:" text,"Taxes From Bracket:" text,"After Tax Income:" text,"Percentage of Income Kept:" text)
SELECT "Taxes From Bracket:" FROM table_22931 WHERE "Percentage of Income Kept:" = '73%'
Which club is located in Thomson, Victoria?
CREATE TABLE table_60137 ("Club" text,"Nickname" text,"Location" text,"GFL Premierships" text,"Years in GFL" text)
SELECT "Club" FROM table_60137 WHERE "Location" = 'thomson, victoria'
For those records from the products and each product's manufacturer, find name and the sum of price , and group by attribute name, and visualize them by a bar chart, I want to order by the total number of price in descending.
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 T2.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Price DESC
How many titles were released on 21 October 1992?
CREATE TABLE table_22435 ("Rank" real,"Title" text,"Release Date" text,"Franchise" text,"Developer(s)" text,"Platform" text,"Units sold (in Millions)" text)
SELECT COUNT("Rank") FROM table_22435 WHERE "Release Date" = '21 October 1992'
How many departments whose budget is more than the average budget in each building? Show me a bar chart, and display y axis from high to low order.
CREATE TABLE student (ID varchar(5),name varchar(20),dept_name varchar(20),tot_cred numeric(3,0))CREATE TABLE advisor (s_ID varchar(5),i_ID varchar(5))CREATE TABLE classroom (building varchar(15),room_number varchar(7),capacity numeric(4,0))CREATE TABLE section (course_id varchar(8),sec_id varchar(8),semester varchar(6...
SELECT building, COUNT(building) FROM department WHERE budget > (SELECT AVG(budget) FROM department) GROUP BY building ORDER BY COUNT(building) DESC
what is the least yards when the average is 7 and the long is less than 7?
CREATE TABLE table_name_30 (yards INTEGER,avg VARCHAR,long VARCHAR)
SELECT MIN(yards) FROM table_name_30 WHERE avg = 7 AND long < 7
What is the result the R3 round?
CREATE TABLE table_49440 ("Date" text,"Round" text,"Opponent" text,"Venue" text,"Result" text,"Attendance" real,"Scorers" text)
SELECT "Result" FROM table_49440 WHERE "Round" = 'r3'
how many female patients are admitted before the year 2105?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id 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_fla...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.admityear < "2105"
What was the final rank of the Brewers when they achieved a win percentage of .585?
CREATE TABLE table_name_79 (finish VARCHAR,win__percentage VARCHAR)
SELECT finish FROM table_name_79 WHERE win__percentage = ".585"
what is the verb meaning when the part 1 is lopen?
CREATE TABLE table_44367 ("Class" text,"Part 1" text,"Part 2" text,"Part 3" text,"Part 4" text,"Verb meaning" text)
SELECT "Verb meaning" FROM table_44367 WHERE "Part 1" = 'lopen'
When the value world rank is 7, what is the rank?
CREATE TABLE table_24138 ("Rank" real,"Commodity" text,"Value (Int $1000)" real,"Production (MT)" real,"Quantity world rank" text,"Value world rank" text)
SELECT "Rank" FROM table_24138 WHERE "Value world rank" = '7'
Show me about the correlation between Snatch and Total in a scatter chart.
CREATE TABLE people (People_ID int,Name text,Height real,Weight real,Birth_Date text,Birth_Place text)CREATE TABLE body_builder (Body_Builder_ID int,People_ID int,Snatch real,Clean_Jerk real,Total real)
SELECT Snatch, Total FROM body_builder
How many Goals against have Played more than 34?
CREATE TABLE table_name_97 (goals_against VARCHAR,played INTEGER)
SELECT COUNT(goals_against) FROM table_name_97 WHERE played > 34