instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What is the area of the community with a census ranking of 636 of 5,008?
CREATE TABLE table_61983 ("Official Name" text,"Status" text,"Area km 2" real,"Population" real,"Census Ranking" text)
SELECT AVG("Area km 2") FROM table_61983 WHERE "Census Ranking" = '636 of 5,008'
Who will teach Other classes next Winter ?
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 ta (campus_job_id int,student_id int,location varchar)CREATE TABLE program_course (program_id int,course_id int,workload int,categ...
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr...
Draw a bar chart about the distribution of All_Home and the average of School_ID , and group by attribute All_Home, show by the Y in ascending.
CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Percent int,All_Home text,All_Road text,All_Neutral text)CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,En...
SELECT All_Home, AVG(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY AVG(School_ID)
provide the number of patients whose year of birth is less than 2104 and drug type is base?
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2104" AND prescriptions.drug_type = "BASE"
What's the district that Otto Passman is the incumbent of?
CREATE TABLE table_731 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text)
SELECT "District" FROM table_731 WHERE "Incumbent" = 'Otto Passman'
what is the minimum total cost in a hospital that involves a reticulocyte count, automated laboratory test the previous year?
CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name 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,outtime time)...
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'reticulocyte count, automated')) AND DATETIME(cost.chargetime, 'start of year') = DATETIME(CURRENT_TI...
Name the won for played being 22 and points against 511 and lost being 15
CREATE TABLE table_27293285_4 (won VARCHAR,points_against VARCHAR,played VARCHAR,lost VARCHAR)
SELECT won FROM table_27293285_4 WHERE played = "22" AND lost = "15" AND points_against = "511"
What was the highest number of WJC Jews that had a WJC rank of 6 and a ARDA rank of more than 8?
CREATE TABLE table_name_1 (number_of_jews__wjc_ INTEGER,rank___wjc__ VARCHAR,rank__arda_ VARCHAR)
SELECT MAX(number_of_jews__wjc_) FROM table_name_1 WHERE rank___wjc__ = 6 AND rank__arda_ > 8
Which source date has an Internet Explorer usage of 60.2%?
CREATE TABLE table_name_52 (source VARCHAR,internet_explorer VARCHAR)
SELECT source FROM table_name_52 WHERE internet_explorer = "60.2%"
WHich Score has a Record of 31 28 3?
CREATE TABLE table_37298 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text)
SELECT "Score" FROM table_37298 WHERE "Record" = '31–28–3'
What is the Senators' division record?
CREATE TABLE table_name_39 (division_record VARCHAR,team VARCHAR)
SELECT division_record FROM table_name_39 WHERE team = "senators"
what is on the obverse side of each coin ?
CREATE TABLE table_202_68 (id number,"value" text,"diameter" text,"composition" text,"1979-1989\nobverse" text,"1979-1989\nreverse" text)
SELECT DISTINCT "1979-1989\nobverse" FROM table_202_68
Which UK base has 441st tcg Troop carrier group and 14 as their seir serial?
CREATE TABLE table_53226 ("Serial" text,"Airborne Unit" text,"Troop carrier Group" text,"# of C-47s" real,"UK Base" text,"Drop Zone" text,"Drop Zone Time" real)
SELECT "UK Base" FROM table_53226 WHERE "Troop carrier Group" = '441st tcg' AND "Serial" = '14'
Name the qual for year of 1960
CREATE TABLE table_67827 ("Year" text,"Start" text,"Qual" text,"Rank" text,"Finish" text,"Laps" real)
SELECT "Qual" FROM table_67827 WHERE "Year" = '1960'
For each faculty rank, show the number of faculty members who have it. Show bar chart.
CREATE TABLE Participates_in (stuid INTEGER,actid INTEGER)CREATE TABLE Faculty (FacID INTEGER,Lname VARCHAR(15),Fname VARCHAR(15),Rank VARCHAR(15),Sex VARCHAR(1),Phone INTEGER,Room VARCHAR(5),Building VARCHAR(13))CREATE TABLE Activity (actid INTEGER,activity_name varchar(25))CREATE TABLE Student (StuID INTEGER,LName VA...
SELECT Rank, COUNT(*) FROM Faculty GROUP BY Rank
Who was the 2008 club Apure?
CREATE TABLE table_62735 ("Name" text,"Height" text,"Weight" text,"Spike" text,"2008 club" text)
SELECT "Name" FROM table_62735 WHERE "2008 club" = 'apure'
What is the production code of the episode that was watched by 3.81 million U.S. viewers?
CREATE TABLE table_29054902_1 (production_code VARCHAR,us_viewers__million_ VARCHAR)
SELECT production_code FROM table_29054902_1 WHERE us_viewers__million_ = "3.81"
What was the result when incumbent gil gutknecht ran?
CREATE TABLE table_680 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Results" text,"Candidatess" text)
SELECT "Results" FROM table_680 WHERE "Incumbent" = 'Gil Gutknecht'
What titles come out monthly?
CREATE TABLE table_50964 ("Title" text,"Parent magazine" text,"Magazine type" text,"Frequency" text,"Magazine run" text)
SELECT "Title" FROM table_50964 WHERE "Frequency" = 'monthly'
What ist he entrant later than 1963 with an eagle MK1 chassis?
CREATE TABLE table_71154 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Pts." text)
SELECT "Entrant" FROM table_71154 WHERE "Year" > '1963' AND "Chassis" = 'eagle mk1'
What was the score of the game on 27 January 1996?
CREATE TABLE table_54258 ("Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text)
SELECT "Score" FROM table_54258 WHERE "Date" = '27 january 1996'
have a fridericia's corrected qt interval ( qtcf ) greater than ( > ) 450 milliseconds ( ms ) for male or 470 ms for female
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 (gender = 'male' AND fridericia_corrected_qt_interval_qtcf > 450) OR (gender = 'female' AND fridericia_corrected_qt_interval_qtcf > 470)
How many players went to depaul?
CREATE TABLE table_16494599_2 (player VARCHAR,school_club_team VARCHAR)
SELECT COUNT(player) FROM table_16494599_2 WHERE school_club_team = "DePaul"
Tell me the time for buffalo bills
CREATE TABLE table_name_9 (time VARCHAR,opponent VARCHAR)
SELECT time FROM table_name_9 WHERE opponent = "buffalo bills"
give me the number of patients whose drug name is dobutamine?
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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "DOBUTamine"
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, visualize a line chart about the change of commission_pct over hire_date , and sort X-axis from low to high order.
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 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),R...
SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_DATE
all DL flights to everywhere if you can
CREATE TABLE airport (airport_code varchar,airport_name text,airport_location text,state_code varchar,country_name varchar,time_zone_code varchar,minimum_connect_time int)CREATE TABLE month (month_number int,month_name text)CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE ...
SELECT DISTINCT flight_id FROM flight WHERE (airline_code = 'DL')
Tell me the name with best of 58.403
CREATE TABLE table_name_46 (name VARCHAR,best VARCHAR)
SELECT name FROM table_name_46 WHERE best = "58.403"
Name the played with losing bonus of 2 and points for of 706
CREATE TABLE table_name_99 (played VARCHAR,losing_bonus VARCHAR,points_for VARCHAR)
SELECT played FROM table_name_99 WHERE losing_bonus = "2" AND points_for = "706"
Which team of the team 1 column, has a 2nd leg of 1-0?
CREATE TABLE table_66944 ("Team 1" text,"Agg." text,"Team 2" text,"1st leg" text,"2nd leg" text)
SELECT "Team 1" FROM table_66944 WHERE "2nd leg" = '1-0'
What was the record on April 1?
CREATE TABLE table_51374 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text)
SELECT "Record" FROM table_51374 WHERE "Date" = 'april 1'
Which Partner is on 22 april 2002?
CREATE TABLE table_6968 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Partner" text,"Opponents" text,"Score" text)
SELECT "Partner" FROM table_6968 WHERE "Date" = '22 april 2002'
how many patients whose days of hospital stay is greater than 0 and drug route is neb?
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.days_stay > "0" AND prescriptions.route = "NEB"
count the number of patients who were admitted before 2158 and had thyroxine (t4) 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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2158" AND lab.label = "Thyroxine (T4)"
WHAT IS THE 2009 PERFORMANCE FOR TOURNAMENTS PLAYED?
CREATE TABLE table_name_68 (tournament VARCHAR)
SELECT 2009 FROM table_name_68 WHERE tournament = "tournaments played"
What is the title of the episode that originally aired on March 31, 2008?
CREATE TABLE table_58229 ("Production no." real,"Episode no." real,"Original Airdate" text,"Episode Title" text,"Host" text)
SELECT "Episode Title" FROM table_58229 WHERE "Original Airdate" = 'march 31, 2008'
For the tournament played on September 25, 1995, who was the Finals opponent?
CREATE TABLE table_40201 ("Date" text,"Tournament" text,"Surface" text,"Opponent in the final" text,"Score" text)
SELECT "Opponent in the final" FROM table_40201 WHERE "Date" = 'september 25, 1995'
how many patients had a microbiology abscess test 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 outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE patients (row_id number,subject_id number,g...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT microbiologyevents.hadm_id FROM microbiologyevents WHERE microbiologyevents.spec_type_desc = 'abscess' AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year'))
Top Responders to Java questions in the UK or England.
CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate ti...
WITH posts_WITH_java_tags AS (SELECT PostId FROM PostTags AS pt LEFT JOIN Tags AS t ON pt.TagId = t.Id WHERE LOWER(t.TagName) = 'java') SELECT u.Id AS "user_link", u.Reputation, COUNT(*) AS number_of_answers FROM Posts AS p INNER JOIN posts_WITH_java_tags AS pt ON pt.PostId = p.Id INNER JOIN Posts AS a ON a.ParentId = ...
What is the total game number with athlone town as the opponent?
CREATE TABLE table_76496 ("Game" real,"Date" text,"Opponent" text,"Venue" text,"Result" text,"Attendance" text)
SELECT COUNT("Game") FROM table_76496 WHERE "Opponent" = 'athlone town'
What is Away Team, when Home Team is 'Swindon Town'?
CREATE TABLE table_name_3 (away_team VARCHAR,home_team VARCHAR)
SELECT away_team FROM table_name_3 WHERE home_team = "swindon town"
Who are the gt3 pro / am cup winners when the gt3 pro cup winner was no. 1 vita4one?
CREATE TABLE table_31471 ("Event" real,"Circuit" text,"GT3 Pro Cup Winner" text,"GT3 Pro / Am Cup Winner" text,"GT3 Citation Cup Winner" text,"GT4 Cup Winner" text)
SELECT "GT3 Pro / Am Cup Winner" FROM table_31471 WHERE "GT3 Pro Cup Winner" = 'No. 1 Vita4One'
What is the total with lower than rank 8, and higher than 27.6 score and 13.8 difficulty?
CREATE TABLE table_70473 ("Rank" real,"Gymnast" text,"Difficulty score" text,"Routine score" real,"Total" real)
SELECT MIN("Total") FROM table_70473 WHERE "Rank" > '8' AND "Routine score" > '27.6' AND "Difficulty score" = '13.8'
what is the number of patients whose gender is m and primary disease is abdominal pain?
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.gender = "M" AND demographic.diagnosis = "ABDOMINAL PAIN"
show me flights from DENVER to ATLANTA on 6 16
CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE ground_service (city_code text,airport_code text,transport_type text,ground_fare int)CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE restriction (restriction_code text,advance_purchase i...
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 (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND date_day.day_number = 16 AND date_day.month_number = 6 AND d...
what is the total quantity of output that patient 017-36245 has had until 08/23/2102?
CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE patient (uniquepid text,patienthealths...
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-36245')) AND intakeoutput.cellpath LIKE '%ou...
What rank is on the Japanese singles chart?
CREATE TABLE table_10979230_4 (oricon VARCHAR,japanese_title VARCHAR)
SELECT COUNT(oricon) FROM table_10979230_4 WHERE japanese_title = "愛のバカ"
What is the attandance figure on October 7, 1990?
CREATE TABLE table_11803 ("Week" text,"Date" text,"Opponent" text,"Result" text,"Kickoff [a ]" text,"Game site" text,"Attendance" text,"Record" text)
SELECT "Attendance" FROM table_11803 WHERE "Date" = 'october 7, 1990'
What's the value for utah when texas is humphrey?
CREATE TABLE table_name_80 (utah VARCHAR,texas VARCHAR)
SELECT utah FROM table_name_80 WHERE texas = "humphrey"
Posts which used HTML version of FAA P/CG (W/Links).
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 PostHistory (Id number,PostHistoryTypeId number,PostId number,R...
SELECT 'http://aviation.stackexchange.com/' + LOWER(SUBSTRING(pt.Name, 1, 1)) + '/' + CAST(p.Id AS TEXT(255)) AS ID, pt.Name AS PostType, p.CreationDate, u.DisplayName AS PostWrittenBy, p.Title, p.Body FROM Posts AS p JOIN PostTypes AS pt ON p.PostTypeId = pt.Id JOIN Users AS u ON p.OwnerUserId = u.Id WHERE p.Body LIKE...
how many days was the longest season of grande fratello ?
CREATE TABLE table_203_397 (id number,"series" text,"launch date" text,"finale date" text,"days" number,"housemates" number,"winner" text,"main presenter" text,"grand prize" text,"liveshow\naudience\nmillions" number)
SELECT MAX("days") FROM table_203_397
What is the date for the game played on week 8, with an attendance of more than 35,000?
CREATE TABLE table_34531 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real)
SELECT "Date" FROM table_34531 WHERE "Attendance" > '35,000' AND "Week" = '8'
Which ministers are not a part of the Progress Party, and count them by a bar chart, I want to show Y-axis from high to low order.
CREATE TABLE party (Party_ID int,Minister text,Took_office text,Left_office text,Region_ID int,Party_name text)CREATE TABLE region (Region_ID int,Region_name text,Date text,Label text,Format text,Catalogue text)CREATE TABLE member (Member_ID int,Member_Name text,Party_ID text,In_office text)CREATE TABLE party_events (E...
SELECT Minister, COUNT(Minister) FROM party WHERE Party_name <> 'Progress Party' GROUP BY Minister ORDER BY COUNT(Minister) DESC
Which team had an away score of 15.14 (104)?
CREATE TABLE table_11891 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Home team" FROM table_11891 WHERE "Away team score" = '15.14 (104)'
Who was the Pre-Race Host when Mike Joy was the Lap-by-lap in the Year 2005?
CREATE TABLE table_57268 ("Year" real,"Network" text,"Lap-by-lap" text,"s Color commentator" text,"Pre-Race Host" text,"Ratings" text)
SELECT "Pre-Race Host" FROM table_57268 WHERE "Lap-by-lap" = 'mike joy' AND "Year" = '2005'
What is the rank when there are more than 107 laps and the qual is 137.825?
CREATE TABLE table_66835 ("Year" text,"Start" text,"Qual" text,"Rank" text,"Finish" text,"Laps" real)
SELECT "Rank" FROM table_66835 WHERE "Laps" > '107' AND "Qual" = '137.825'
What's the biggest zone?
CREATE TABLE table_15366849_1 (zone INTEGER)
SELECT MAX(zone) FROM table_15366849_1
What's the highest Year Left that's got a Conference Joined of Sagamore with a Year Joined larger than 1942?
CREATE TABLE table_65218 ("School" text,"Location" text,"Mascot" text,"County" text,"Year Joined" real,"Year Left" real,"Conference Joined" text)
SELECT MAX("Year Left") FROM table_65218 WHERE "Conference Joined" = 'sagamore' AND "Year Joined" > '1942'
how much does it cost to have a calcium lab test.
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresul...
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'lab' AND cost.eventid IN (SELECT lab.labid FROM lab WHERE lab.labname = 'calcium')
Where is the first day cover cancellation for the 3 April 2008 IIHF World Championships, Quebec City stamp?
CREATE TABLE table_11900773_6 (first_day_cover_cancellation VARCHAR,date_of_issue VARCHAR,theme VARCHAR)
SELECT first_day_cover_cancellation FROM table_11900773_6 WHERE date_of_issue = "3 April 2008" AND theme = "IIHF World Championships, Quebec City"
what is the total number of patients treated with mupirocin cream 2%?
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Mupirocin Cream 2%"
Which competition was on August 11, 1996?
CREATE TABLE table_name_42 (competition VARCHAR,date VARCHAR)
SELECT competition FROM table_name_42 WHERE date = "august 11, 1996"
Name the antonio thomas for Hikaru Sato of tanaka (8:09)
CREATE TABLE table_name_24 (antonio_thomas VARCHAR,hikaru_sato VARCHAR)
SELECT antonio_thomas FROM table_name_24 WHERE hikaru_sato = "tanaka (8:09)"
give me some good places for arabic in mountain view ?
CREATE TABLE restaurant (id int,name varchar,food_type varchar,city_name varchar,rating "decimal)CREATE TABLE geographic (city_name varchar,county varchar,region varchar)CREATE TABLE location (restaurant_id int,house_number int,street_name varchar,city_name varchar)
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'mountain view' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5
what are the top four drugs most often prescribed for patients of the age 40s until 1 year ago?
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 t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME(), '-1 year') GR...
SELECT TOP 10 * FROM users.
CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,Text text,ContentLicense text)CREATE TABLE Badges (Id...
SELECT CommentCount, ClosedDate, LastActivityDate FROM Posts LIMIT 10
Name the number of airdates for 14
CREATE TABLE table_2409041_4 (original_air_date VARCHAR,no_in_season VARCHAR)
SELECT COUNT(original_air_date) FROM table_2409041_4 WHERE no_in_season = 14
What is the sum of sliver medals when there were 2 gold medals, less than 15 total medals, and the rank is greater than 5?
CREATE TABLE table_name_88 (silver INTEGER,rank VARCHAR,gold VARCHAR,total VARCHAR)
SELECT SUM(silver) FROM table_name_88 WHERE gold = 2 AND total < 15 AND rank > 5
Which 1988 has a 1985 of 2r?
CREATE TABLE table_34847 ("Tournament" text,"1981" text,"1982" text,"1983" text,"1984" text,"1985" text,"1986" text,"1987" text,"1988" text,"1989" text)
SELECT "1988" FROM table_34847 WHERE "1985" = '2r'
is patient 19096's arterial bp [systolic] ever less since 15 months ago than 164.0?
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,outtime time)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text...
SELECT COUNT(*) > 0 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 = 19096)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [syst...
tell me the number of inpatient hospital admission patients who have hyperglycemia; hyponatremia primary disease.
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.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.diagnosis = "HYPERGLYCEMIA;HYPONATREMIA"
how many patients received hypothermia after the first administration of electrolytes - phosphate procedure in the same month until 2104?
CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid num...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'administration of electrolytes - phosphate' AND STRFTIME('%y', treatment.treatmenttime) <= '2104') AS t1 JOI...
What districts does incumbent Curt Weldon hold?
CREATE TABLE table_72371 ("District" text,"Incumbent" text,"Party" text,"Elected" real,"Status" text,"Opponent" text)
SELECT "District" FROM table_72371 WHERE "Incumbent" = 'Curt Weldon'
Draw a scatter chart about the correlation between School_ID and All_Games_Percent , and group by attribute All_Neutral.
CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Percent int,All_Home text,All_Road text,All_Neutral text)CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,En...
SELECT School_ID, All_Games_Percent FROM basketball_match GROUP BY All_Neutral
What is the Attendance after Week 8 with a Result of W 42 0?
CREATE TABLE table_9781 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real)
SELECT MAX("Attendance") FROM table_9781 WHERE "Week" > '8' AND "Result" = 'w 42–0'
What is the pba team for the player who went to santo tomas college?
CREATE TABLE table_65356 ("Pick" real,"Player" text,"Country of origin*" text,"PBA team" text,"College" text)
SELECT "PBA team" FROM table_65356 WHERE "College" = 'santo tomas'
how many first elected with district is kansas 3
CREATE TABLE table_1342359_15 (first_elected VARCHAR,district VARCHAR)
SELECT COUNT(first_elected) FROM table_1342359_15 WHERE district = "Kansas 3"
since 1433 days ago, had patient 22782 had any l groin intake?
CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text...
SELECT COUNT(*) > 0 FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22782)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'l groin'...
How many titles are there with the original air date of august3,2010?
CREATE TABLE table_30030477_1 (title VARCHAR,original_air_date VARCHAR)
SELECT COUNT(title) FROM table_30030477_1 WHERE original_air_date = "August3,2010"
Which athlete is ranked less than 5 with time over 11.22?
CREATE TABLE table_name_15 (athlete VARCHAR,time___sec__ VARCHAR,rank VARCHAR)
SELECT athlete FROM table_name_15 WHERE time___sec__ > 11.22 AND rank < 5
What is the cable rank for bbc three weekly ranking of n/a?
CREATE TABLE table_24399615_3 (cable_rank VARCHAR,bbc_three_weekly_ranking VARCHAR)
SELECT cable_rank FROM table_24399615_3 WHERE bbc_three_weekly_ranking = "N/A"
Which author is located in Mexico?
CREATE TABLE table_name_73 (authors VARCHAR,location VARCHAR)
SELECT authors FROM table_name_73 WHERE location = "mexico"
Which team is located in Lida?
CREATE TABLE table_name_91 (team VARCHAR,location VARCHAR)
SELECT team FROM table_name_91 WHERE location = "lida"
What is the name of the city with a capacity of 41,311?
CREATE TABLE table_41287 ("Team" text,"City" text,"State" text,"Home venue" text,"Capacity" text)
SELECT "City" FROM table_41287 WHERE "Capacity" = '41,311'
what was the name of the organism found at the last pleural fluid test of patient 23070 since 20 months ago?
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 inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE prescriptions (row_i...
SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23070) AND microbiologyevents.spec_type_desc = 'pleural fluid' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.charttime) >=...
give me the number of patients whose procedure icd9 code is 5771 and drug type is additive?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "5771" AND prescriptions.drug_type = "ADDITIVE"
Return a scatter chart about the correlation between ACC_Percent and All_Games_Percent , and group by attribute All_Neutral.
CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Perce...
SELECT ACC_Percent, All_Games_Percent FROM basketball_match GROUP BY All_Neutral
when was the first hospital admission time of patient 81783 that had been admitted on the clinic referral/premature?
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 prescriptions (row_id number,subject_id number,hadm_id number,...
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 81783 AND admissions.admission_location = 'clinic referral/premature' ORDER BY admissions.admittime LIMIT 1
What is the most points when the chassis was Jaguar R3 later than 2002?
CREATE TABLE table_68991 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" real)
SELECT MAX("Points") FROM table_68991 WHERE "Chassis" = 'jaguar r3' AND "Year" > '2002'
i want a evening flight from DALLAS to MILWAUKEE
CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections int,departure_time int,dual_carrier text,flight_days text,flight_id int,flight_number int,from_airport varchar,meal_code text,stop...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MILWAU...
What is the reason for change when maryland 6th is the district?
CREATE TABLE table_73403 ("District" text,"Vacator" text,"Reason for change" text,"Successor" text,"Date successor seated" text)
SELECT "Reason for change" FROM table_73403 WHERE "District" = 'Maryland 6th'
A bar chart showing the sum of capacity of cinemas open for each year, rank by the X from low to high please.
CREATE TABLE film (Film_ID int,Rank_in_series int,Number_in_season int,Title text,Directed_by text,Original_air_date text,Production_code text)CREATE TABLE cinema (Cinema_ID int,Name text,Openning_year int,Capacity int,Location text)CREATE TABLE schedule (Cinema_ID int,Film_ID int,Date text,Show_times_per_day int,Price...
SELECT Openning_year, SUM(Capacity) FROM cinema GROUP BY Openning_year ORDER BY Openning_year
give me the number of patients whose diagnoses long title is unspecified hereditary and idiopathic peripheral neuropathy and drug type is base?
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 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 hereditary and idiopathic peripheral neuropathy" AND prescriptions.drug_type = ...
show me patient 006-13677's monthly average output (ml)-urethral catheter dr wrenn output amount until 09/2105.
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 AVG(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-13677')) AND intakeoutput.celllabel = 'outpu...
What is Television Service, when HDTV is No, and when Language is Italian?
CREATE TABLE table_41068 ("Television service" text,"Country" text,"Language" text,"Content" text,"HDTV" text,"Package/Option" text)
SELECT "Television service" FROM table_41068 WHERE "HDTV" = 'no' AND "Language" = 'italian'
Show all ministers who do not belong to Progress Party, and count them by a bar chart, sort by the x-axis from high to low.
CREATE TABLE member (Member_ID int,Member_Name text,Party_ID text,In_office text)CREATE TABLE party (Party_ID int,Minister text,Took_office text,Left_office text,Region_ID int,Party_name 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 Minister, COUNT(Minister) FROM party WHERE Party_name <> 'Progress Party' GROUP BY Minister ORDER BY Minister DESC
What is the total number of Opponents, when Raiders Points is '42', when Attendance is less than 52,505?
CREATE TABLE table_name_16 (opponents VARCHAR,raiders_points VARCHAR,attendance VARCHAR)
SELECT COUNT(opponents) FROM table_name_16 WHERE raiders_points = 42 AND attendance < 52 OFFSET 505
What is the highest FLT goals with 0 league cup goals, a GK position, and 2 league cup apps?
CREATE TABLE table_62699 ("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 MAX("FLT Goals") FROM table_62699 WHERE "League Cup Goals" = '0' AND "Position" = 'gk' AND "League Cup Apps" = '2'
List all department names ordered by their starting date.
CREATE TABLE department (dname VARCHAR,mgr_start_date VARCHAR)
SELECT dname FROM department ORDER BY mgr_start_date
Does EEB 453 have any prereqs ?
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,predicted_graduation_semester int,degree varchar,minor varchar,internship varc...
SELECT DISTINCT COURSE_1.department, COURSE_1.name, COURSE_1.number FROM course AS COURSE_0 INNER JOIN course_prerequisite ON COURSE_0.course_id = course_prerequisite.course_id INNER JOIN course AS COURSE_1 ON COURSE_1.course_id = course_prerequisite.pre_course_id WHERE COURSE_0.department = 'EEB' AND COURSE_0.number =...