instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
Show the number of companies in each headquarter with a bar chart, show y-axis from low to high order please.
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 Headquarters, COUNT(Headquarters) FROM company GROUP BY Headquarters ORDER BY COUNT(Headquarters)
What is the Score of the game against Philadelphia 76ers?
CREATE TABLE table_45625 ("Date" text,"H/A/N" text,"Opponent" text,"Score" text,"Record" text)
SELECT "Score" FROM table_45625 WHERE "Opponent" = 'philadelphia 76ers'
What is the total number of patients who had their calcium urine tested by lab and remained admitted in hospital for more than 15 days?
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 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,marita...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "15" AND lab.label = "Calcium, Urine"
What is the power in kW corresponding to the station that covers General Santos?
CREATE TABLE table_name_63 (power__kw_ VARCHAR,coverage VARCHAR)
SELECT power__kw_ FROM table_name_63 WHERE coverage = "general santos"
How many Field goals have Touchdowns smaller than 3, and a Player of willis ward, and an Extra points smaller than 0?
CREATE TABLE table_34682 ("Player" text,"Touchdowns" real,"Extra points" real,"Field goals" real,"Points" real)
SELECT SUM("Field goals") FROM table_34682 WHERE "Touchdowns" < '3' AND "Player" = 'willis ward' AND "Extra points" < '0'
How many times was alex snoeren cited ?
CREATE TABLE field (fieldid int)CREATE TABLE dataset (datasetid int,datasetname varchar)CREATE TABLE author (authorid int,authorname varchar)CREATE TABLE venue (venueid int,venuename varchar)CREATE TABLE paperfield (fieldid int,paperid int)CREATE TABLE paperdataset (paperid int,datasetid int)CREATE TABLE keyphrase (key...
SELECT DISTINCT COUNT(cite.citedpaperid) FROM author, cite, paper, writes WHERE author.authorname = 'alex snoeren' AND paper.paperid = cite.citedpaperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
For those records from the products and each product's manufacturer, what is the relationship between price and code , and group by attribute founder?
CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)
SELECT T1.Price, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder
patients unable to provide consent such as non english speaking patients or patient / health care proxy unable to give consent
CREATE TABLE table_train_55 ("id" int,"ejection_fraction_ef" int,"systolic_dysfunction" bool,"language" string,"valvular_dysfunction" bool,"consent" bool,"heart_disease" bool,"left_bundle_branch_block" bool,"trauma" bool,"pericardial_disease" bool,"complete_fluid_challenge" bool,"receiving_vasopressor" bool,"pulmonary_...
SELECT * FROM table_train_55 WHERE consent = 0 OR language <> 'english'
which flights go from PHILADELPHIA to SAN FRANCISCO
CREATE TABLE code_description (code varchar,description text)CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum_stay int,application text,no_discounts ...
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 = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'S...
give me the number of patients whose admission type is emergency and item id is 51256?
CREATE TABLE procedures (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,do...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.itemid = "51256"
how many patients born before the year 2080 had drug code posa2001?
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2080" AND prescriptions.formulary_drug_cd = "POSA200L"
What was the venue where Fitzroy played as the home team?
CREATE TABLE table_74640 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Venue" FROM table_74640 WHERE "Home team" = 'fitzroy'
how many times has patient 005-9883 got an enteral tube intake: nasoduodenal nostril, r until 03/13/2101?
CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissio...
SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-9883')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.cel...
what is the number of emergency hospital admission patients who had aortography?
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 WHERE demographic.admission_type = "EMERGENCY" AND procedures.long_title = "Aortography"
What is the year when the performance is 60.73m and the age (years) is more than 45?
CREATE TABLE table_54891 ("Year" real,"Place" text,"Event" text,"Performance" text,"Age (years)" real)
SELECT COUNT("Year") FROM table_54891 WHERE "Performance" = '60.73m' AND "Age (years)" > '45'
did patient 025-27850 ever have oxygen therapy (40% to 60%) - face mask during this year?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,cultu...
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-27850')) AND treatment.treatmentname = 'oxygen therapy (40% to 60%) - fa...
With 10 as matches, and 469 runs, what is the strike rate?
CREATE TABLE table_64701 ("Player" text,"Matches" text,"Runs" text,"Balls" text,"Strike Rate" text,"Average" text,"100s" text)
SELECT "Strike Rate" FROM table_64701 WHERE "Matches" = '10' AND "Runs" = '469'
what is patient 64983's maximum po2 value in 10/this year?
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 labevents (row_id number,subject_id number,hadm_id number,item...
SELECT MAX(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 64983) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'po2') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT...
when was the last time that patient 003-33922 had a maximum systemicsystolic.
CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-33922')) AND NOT vitalperiodic.systemicsystolic...
what round saw wakefield trinity wildcats u21 as the opponenet at belle vue?
CREATE TABLE table_10811 ("Round" text,"Opponent" text,"Date" text,"Venue" text,"Competition" text)
SELECT "Round" FROM table_10811 WHERE "Opponent" = 'wakefield trinity wildcats u21' AND "Venue" = 'belle vue'
How many papers have Dan Suciu and Magdalena Balazinska ?
CREATE TABLE writes (paperid int,authorid int)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE field (fieldid int)CREATE TABLE dataset (datasetid int,datasetname varchar)CREATE TABLE author (authorid int,authorname varchar)CREATE TABLE paperdataset (paperid int,datasetid int)CREATE TABLE paperfield ...
SELECT DISTINCT COUNT(1) FROM author AS AUTHOR_0, author AS AUTHOR_1, writes AS WRITES_0, writes AS WRITES_1 WHERE AUTHOR_0.authorname = 'Dan Suciu' AND AUTHOR_1.authorname = 'Magdalena Balazinska' AND WRITES_0.authorid = AUTHOR_0.authorid AND WRITES_1.authorid = AUTHOR_1.authorid AND WRITES_1.paperid = WRITES_0.paperi...
find duplicates that have their targets as duplicates.
CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,LastEditorUserId number,LastEditorDisplayName text,LastEditDate time,LastActivityDate time,Title text,Ta...
SELECT MONTH(CURRENT_TIMESTAMP())
how many patients use the drug code phos250?
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 diagnoses (subject_id text,hadm_id tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "PHOS250"
What is the most common result of the music festival?
CREATE TABLE music_festival (RESULT VARCHAR)
SELECT RESULT FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC LIMIT 1
Pie chart, group and count the decor of rooms that have a king bed.
CREATE TABLE Reservations (Code INTEGER,Room TEXT,CheckIn TEXT,CheckOut TEXT,Rate REAL,LastName TEXT,FirstName TEXT,Adults INTEGER,Kids INTEGER)CREATE TABLE Rooms (RoomId TEXT,roomName TEXT,beds INTEGER,bedType TEXT,maxOccupancy INTEGER,basePrice INTEGER,decor TEXT)
SELECT decor, COUNT(decor) FROM Rooms WHERE bedType = 'King' GROUP BY decor
nonstop flights from SEATTLE to DENVER
CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE compartment_class (compartment varchar,class_type varchar)CREATE TABLE fare_basis (fare_basis_code text,booking_class text,class_type text,premium text,e...
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 = 'SEATTLE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVE...
Calculate the number of actors in each duration of actors using a bar chart.
CREATE TABLE actor (Actor_ID int,Name text,Musical_ID int,Character text,Duration text,age int)CREATE TABLE musical (Musical_ID int,Name text,Year int,Award text,Category text,Nominee text,Result text)
SELECT Duration, COUNT(Duration) FROM actor GROUP BY Duration
How many laps did Duke Nelson complete when his qualifying time was 136.498?
CREATE TABLE table_name_9 (laps INTEGER,qual VARCHAR)
SELECT MAX(laps) FROM table_name_9 WHERE qual = "136.498"
the last time the previous month, when was patient 19175 prescribed d5w and pantoprazole at the same time?
CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE transfers (row_id num...
SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'd5w' AND admissions.subject_id = 19175 AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of...
tell me the price for bilirubin, total, pleural?
CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREATE TABLE labevents (row_id number,subject_id number,hadm_id numb...
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bilirubin, total, pleural'))
state the number of location attendance where record is 15 10 (5 7)
CREATE TABLE table_20010140_10 (location_attendance VARCHAR,record VARCHAR)
SELECT COUNT(location_attendance) FROM table_20010140_10 WHERE record = "15–10 (5–7)"
what procedure was last taken to patient 25796 on their first hospital visit?
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 d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25796 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admit...
Which publication happened in the UK?
CREATE TABLE table_name_75 (publication VARCHAR,country VARCHAR)
SELECT publication FROM table_name_75 WHERE country = "uk"
Which Played has a Team of cerro cor , and Losses larger than 4?
CREATE TABLE table_name_55 (played INTEGER,team VARCHAR,losses VARCHAR)
SELECT AVG(played) FROM table_name_55 WHERE team = "cerro corá" AND losses > 4
Which college did Dennis Byrd come from?
CREATE TABLE table_17507 ("Overall Pick #" real,"AFL Team" text,"Player" text,"Position" text,"College" text)
SELECT "College" FROM table_17507 WHERE "Player" = 'Dennis Byrd'
What is the PA when skip (club) is mary-anne arsenault (nsca)?
CREATE TABLE table_3377 ("Skip (Club)" text,"W" real,"L" real,"PF" real,"PA" real,"Ends Won" real,"Ends Lost" real,"Blank Ends" real,"Stolen Ends" real)
SELECT MIN("PA") FROM table_3377 WHERE "Skip (Club)" = 'Mary-Anne Arsenault (NSCA)'
What is the size of the 445 class ?
CREATE TABLE gsi (course_offering_id int,student_id int)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,respe...
SELECT DISTINCT num_enrolled FROM course WHERE department = 'EECS' AND number = 445
Name the Nationality / Opponent of the Competition of welsh rugby union challenge trophy and a Result of 38-29?
CREATE TABLE table_name_63 (nationality___opponent VARCHAR,competition VARCHAR,result VARCHAR)
SELECT nationality___opponent FROM table_name_63 WHERE competition = "welsh rugby union challenge trophy" AND result = "38-29"
How many paper does samia razaq have ?
CREATE TABLE keyphrase (keyphraseid int,keyphrasename varchar)CREATE TABLE paperkeyphrase (paperid int,keyphraseid int)CREATE TABLE paper (paperid int,title varchar,venueid int,year int,numciting int,numcitedby int,journalid int)CREATE TABLE paperfield (fieldid int,paperid int)CREATE TABLE venue (venueid int,venuename ...
SELECT DISTINCT COUNT(DISTINCT writes.paperid) FROM author, writes WHERE author.authorname = 'samia razaq' AND writes.authorid = author.authorid
When will Developmental Disturbances of Childhood be offered next ?
CREATE TABLE gsi (course_offering_id int,student_id int)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,respe...
SELECT DISTINCT semester.semester, semester.year FROM semester INNER JOIN course_offering ON semester.semester_id = course_offering.semester INNER JOIN course ON course.course_id = course_offering.course_id WHERE course.name LIKE '%Developmental Disturbances of Childhood%' AND semester.semester_id > (SELECT SEMESTERali...
How many fatalities shows for the lockheed l-1049g?
CREATE TABLE table_78732 ("Date" text,"Airline" text,"Aircraft type" text,"Registration" text,"People on board" real,"Fatalities" real)
SELECT SUM("Fatalities") FROM table_78732 WHERE "Aircraft type" = 'lockheed l-1049g'
For all employees who have the letters D or S in their first name, a bar chart shows the distribution of hire_date and the sum of manager_id bin hire_date by weekday, display by the y axis in asc.
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 employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JO...
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(MANAGER_ID)
What region is William R. Johnson Coliseum in?
CREATE TABLE table_name_30 (region VARCHAR,venue VARCHAR)
SELECT region FROM table_name_30 WHERE venue = "william r. johnson coliseum"
What is the highest pick of scott turner, who has a round greater than 2?
CREATE TABLE table_44851 ("Round" real,"Pick" real,"Overall" real,"Name" text,"Position" text,"College" text)
SELECT MAX("Pick") FROM table_44851 WHERE "Round" > '2' AND "Name" = 'scott turner'
Who did Yugoslavia play against that led to a result of 2:3?
CREATE TABLE table_38725 ("Date" text,"City" text,"Opponent" text,"Results\u00b9" text,"Type of game" text)
SELECT "Opponent" FROM table_38725 WHERE "Results\u00b9" = '2:3'
For those records from the products and each product's manufacturer, show me about the distribution of name and manufacturer , and group by attribute founder in a bar chart, and sort X-axis from high to low order please.
CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)
SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Name DESC
What is the Theme when the Original artist was carole king, and a Week # shows hollywood?
CREATE TABLE table_name_85 (theme VARCHAR,original_artist VARCHAR,week__number VARCHAR)
SELECT theme FROM table_name_85 WHERE original_artist = "carole king" AND week__number = "hollywood"
What are the death/2012 number when death/2013 is 140 and January September 2013 is Moscow Oblast?
CREATE TABLE table_25703_1 (death_2012 VARCHAR,death_2013 VARCHAR,january_september_2013 VARCHAR)
SELECT death_2012 FROM table_25703_1 WHERE death_2013 = 140 AND january_september_2013 = "Moscow Oblast"
what are the flights from BOSTON to WASHINGTON
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 restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum_stay int,application ...
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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHING...
Which city includes the Target Center arena?
CREATE TABLE table_name_62 (city VARCHAR,home_arena VARCHAR)
SELECT city FROM table_name_62 WHERE home_arena = "target center"
Negatively scored answers that have been recently undeleted.
CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId num...
SELECT e.PostId AS "post_link", p.Score, e.CreationDate AS "undeletion_date", p.Body FROM PostHistory AS e INNER JOIN Posts AS p ON e.PostId = p.Id WHERE p.PostTypeId = 2 AND p.Score < 0 AND e.PostHistoryTypeId = 13 ORDER BY e.CreationDate DESC
How many rides did it take Ray Day to get 274 points in total with less than 3 bonus points?
CREATE TABLE table_name_16 (rides VARCHAR,bonus_pts VARCHAR,total_points VARCHAR,rider VARCHAR)
SELECT COUNT(rides) FROM table_name_16 WHERE total_points < 274 AND rider = "ray day" AND bonus_pts > 3
How many airports are there per city in the United States? Order the cities by decreasing number of airports.
CREATE TABLE airports (city VARCHAR,country VARCHAR)
SELECT COUNT(*), city FROM airports WHERE country = 'United States' GROUP BY city ORDER BY COUNT(*) DESC
What is Player, when Score is '68-71=139'?
CREATE TABLE table_name_80 (player VARCHAR,score VARCHAR)
SELECT player FROM table_name_80 WHERE score = 68 - 71 = 139
What city is fuhlsb ttel airport in?
CREATE TABLE table_80190 ("City" text,"Country" text,"IATA" text,"ICAO" text,"Airport" text)
SELECT "City" FROM table_80190 WHERE "Airport" = 'fuhlsbüttel airport'
among patients treated with main drug, calculate the number of those who had icd9 code 7291
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethni...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "7291" AND prescriptions.drug_type = "MAIN"
Show id and location of railways that are associated with more than one train. Visualize by bar chart.
CREATE TABLE train (Train_ID int,Train_Num text,Name text,From text,Arrival text,Railway_ID int)CREATE TABLE manager (Manager_ID int,Name text,Country text,Working_year_starts text,Age int,Level int)CREATE TABLE railway_manage (Railway_ID int,Manager_ID int,From_Year text)CREATE TABLE railway (Railway_ID int,Railway te...
SELECT T1.Location, T1.Railway_ID FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID
count the number of patients who have had an glucose, body fluid test this year.
CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'glucose, body fluid') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME...
What's the title of the episode directed by David von Ancken, with a episode number bigger than 16.0?
CREATE TABLE table_13336122_3 (title VARCHAR,directed_by VARCHAR,no_in_series VARCHAR)
SELECT title FROM table_13336122_3 WHERE directed_by = "David Von Ancken" AND no_in_series > 16.0
give me the number of patients whose primary disease is t5 fracture and procedure icd9 code is 8105?
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 diagnoses (subject_id text,hadm_id tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "T5 FRACTURE" AND procedures.icd9_code = "8105"
In how many districts was the democratic incumbent elected in 1974?
CREATE TABLE table_1341568_34 (district VARCHAR,party VARCHAR,elected VARCHAR)
SELECT COUNT(district) FROM table_1341568_34 WHERE party = "Democratic" AND elected = 1974
is the rf for wivm ld 39 or 29 ?
CREATE TABLE table_204_793 (id number,"call-sign" text,"location" text,"rf" number,"psip" number,"programming" text)
SELECT "rf" FROM table_204_793 WHERE "rf" IN (39, 29) AND "call-sign" = 'wivm-ld'
Which classes next semester can be taken as ULCS ?
CREATE TABLE area (course_id int,area varchar)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE course (course_id int,name varchar,department varchar,number varchar,credits varchar,advisory_requirement varchar,enforced_requirement varchar,description varchar,num_semesters int,num_enrolled ...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program, program_course, semester WHERE course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_...
What is the finish when there was more than 192 laps and a qual of 135.736?
CREATE TABLE table_68144 ("Year" text,"Start" text,"Qual" text,"Rank" text,"Finish" text,"Laps" real)
SELECT "Finish" FROM table_68144 WHERE "Laps" > '192' AND "Qual" = '135.736'
Who is the opponent of the match with an attendance larger than 59,000?
CREATE TABLE table_name_89 (opponent VARCHAR,attendance INTEGER)
SELECT opponent FROM table_name_89 WHERE attendance > 59 OFFSET 000
What was the score for the opponent against Katerina Maleeva in the final?
CREATE TABLE table_name_83 (score VARCHAR,opponent_in_the_final VARCHAR)
SELECT score FROM table_name_83 WHERE opponent_in_the_final = "katerina maleeva"
Who is the player for the School/Club team in Georgia?
CREATE TABLE table_name_73 (player VARCHAR,school_club_team VARCHAR)
SELECT player FROM table_name_73 WHERE school_club_team = "georgia"
Who from your location is better than you?.
CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE CloseRea...
SELECT U2.* FROM Users AS U1 JOIN Users AS U2 ON U1.Location = U2.Location WHERE 1 = 1 AND U1.DisplayName = 'jyparask' AND U1.Reputation <= U2.Reputation ORDER BY U2.Reputation DESC, U2.DisplayName
2nd Runner-up larger than 4, and a Country/Territory of israel, and a 4th Runner-up smaller than 0 has which sum of 6th Runner-up?
CREATE TABLE table_39339 ("Rank" real,"Country/Territory" text,"Miss World" real,"1st Runner-up" real,"2nd Runner-up" real,"3rd Runner-up" real,"4th Runner-up" real,"5th Runner-up" real,"6th Runner-up" real,"Semifinalists" real,"Total" real)
SELECT SUM("6th Runner-up") FROM table_39339 WHERE "2nd Runner-up" > '4' AND "Country/Territory" = 'israel' AND "4th Runner-up" < '0'
how many guards were picked ?
CREATE TABLE table_203_815 (id number,"pick #" number,"nfl team" text,"player" text,"position" text,"college" text)
SELECT COUNT(*) FROM table_203_815 WHERE "position" = 'guard'
When the Away team was hawthorn, what's the Home team?
CREATE TABLE table_name_84 (home_team VARCHAR,away_team VARCHAR)
SELECT home_team FROM table_name_84 WHERE away_team = "hawthorn"
How many patients with icd9 code 5732 received IM therapy?
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 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 procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "5732" AND prescriptions.route = "IM"
how many hours has it been since the first time that patient 6170 on the current icu visit received a .9% normal saline intake?
CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title 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)CREATE TABLE patients (row_id number,...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) 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 = 6170) AND icustays.outtime IS NULL) ...
Name the 1999-2000 for 1993-94 of did not participate
CREATE TABLE table_67076 ("Competition" text,"1993\u2013 94" text,"1994\u2013 95" text,"1995\u2013 96" text,"1996\u2013 97" text,"1997\u2013 98" text,"1998\u2013 99" text,"1999\u2013 2000" text,"2000\u2013 01" text,"2001\u2013 02" text,"2002\u2013 03" text,"2003\u2013 04" text,"2005" text,"2006" text,"2007" text,"2008"...
SELECT "1999\u2013 2000" FROM table_67076 WHERE "1993\u2013 94" = 'did not participate'
Find the number of students in each department that has the top 3 highest number of students. Show the department address and number of students with a pie chart.
CREATE TABLE COURSE (CRS_CODE varchar(10),DEPT_CODE varchar(10),CRS_DESCRIPTION varchar(35),CRS_CREDIT float(8))CREATE TABLE DEPARTMENT (DEPT_CODE varchar(10),DEPT_NAME varchar(30),SCHOOL_CODE varchar(8),EMP_NUM int,DEPT_ADDRESS varchar(20),DEPT_EXTENSION varchar(4))CREATE TABLE PROFESSOR (EMP_NUM int,DEPT_CODE varchar...
SELECT DEPT_ADDRESS, COUNT(*) FROM STUDENT AS T1 JOIN DEPARTMENT AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.DEPT_CODE ORDER BY COUNT(*) DESC LIMIT 3
Find all actors born in Milan
CREATE TABLE producer (pid int,gender text,name text,nationality text,birth_city text,birth_year int)CREATE TABLE copyright (id int,msid int,cid int)CREATE TABLE writer (wid int,gender text,name text,nationality text,birth_city text,birth_year int)CREATE TABLE company (id int,name text,country_code varchar)CREATE TABLE...
SELECT name FROM actor WHERE birth_city = 'Milan'
which clubs did not score more than 50 points ?
CREATE TABLE table_203_322 (id number,"club" text,"played" number,"won" number,"drawn" number,"lost" number,"points for" number,"points against" number,"bonus points" number,"points" number)
SELECT "club" FROM table_203_322 WHERE "points" <= 50
what is the cheapest flight on AA from CLEVELAND to MIAMI
CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum_stay int,application text,no_discounts text)CREATE TABLE compartment_class (compartment varchar,class_type varchar)CREATE TABLE fli...
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, fare, flight, flight_fare WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'CLEVELAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CIT...
how many patients in 2105 have undergone packed cell transfusion in the same month following the first hemodialysis?
CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE d_items (row_id number,i...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'hemodialysi...
What is the time/retired for the driver with 16 grids?
CREATE TABLE table_name_81 (time_retired VARCHAR,grid VARCHAR)
SELECT time_retired FROM table_name_81 WHERE grid = 16
What is the episode title of the episode with Ben Okri as the presenter?
CREATE TABLE table_name_74 (episode_title VARCHAR,presenter VARCHAR)
SELECT episode_title FROM table_name_74 WHERE presenter = "ben okri"
what is the number of patients whose primary disease is coronary artery disease and admission year is less than 2195?
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 WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE" AND demographic.admityear < "2195"
Top 10 tags and associated tags.
CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TA...
SELECT TagName FROM Tags GROUP BY TagName LIMIT 10
What is the relationship between ACC_Percent and All_Games_Percent , and group by attribute Team_Name?
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 ACC_Percent, All_Games_Percent FROM basketball_match GROUP BY Team_Name
when was the last time that patient 028-55503 on last month/06 had the minimum sao2 value.
CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean num...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-55503')) AND NOT vitalperiodic.sao2 IS NULL AND...
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, a bar chart shows the distribution of job_id and the sum of salary , and group by attribute job_id, and order by the JOB_ID from low to high.
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 regions (REGION_ID decimal(5,0),REGIO...
SELECT JOB_ID, SUM(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID
What place is Fred Funk in?
CREATE TABLE table_12330 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text)
SELECT "Place" FROM table_12330 WHERE "Player" = 'fred funk'
What period was the life expectancy at 62.4?
CREATE TABLE table_27434_2 (period VARCHAR,life_expectancy_total VARCHAR)
SELECT period FROM table_27434_2 WHERE life_expectancy_total = "62.4"
What is the occupation of the candidate that has a riding of labrador?
CREATE TABLE table_name_11 (occupation VARCHAR,riding VARCHAR)
SELECT occupation FROM table_name_11 WHERE riding = "labrador"
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of job_id and salary in a bar chart, and could you order Y-axis in ascending order?
CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal...
SELECT JOB_ID, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SALARY
How many flights in each destination city? Return a bar chart, and I want to rank y-axis in asc order please.
CREATE TABLE employee (eid number(9,0),name varchar2(30),salary number(10,2))CREATE TABLE flight (flno number(4,0),origin varchar2(20),destination varchar2(20),distance number(6,0),departure_date date,arrival_date date,price number(7,2),aid number(9,0))CREATE TABLE certificate (eid number(9,0),aid number(9,0))CREATE TA...
SELECT destination, COUNT(destination) FROM flight GROUP BY destination ORDER BY COUNT(destination)
How much was spent in 1949/50 (in $ millions) in the country where the cumulative expenditure is $376 millions?
CREATE TABLE table_2152 ("Country" text,"1948/49 ($ millions)" real,"1949/50 ($ millions)" real,"1950/51 ($ millions)" real,"Cumulative ($ millions)" real)
SELECT MIN("1949/50 ($ millions)") FROM table_2152 WHERE "Cumulative ($ millions)" = '376'
what is patient 005-48105's first output amt-chest tube a output time a day before?
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 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 = '005-48105')) AND intakeoutput.cellpath LIKE '%output%...
what is the tourney where the winner is kevin mckinlay?
CREATE TABLE table_12755786_8 (league VARCHAR,player VARCHAR)
SELECT league AS Cup FROM table_12755786_8 WHERE player = "Kevin McKinlay"
when did patient 022-158475 receive the last prescription in their last hospital visit for morphine sulfate 2 mg/ml ij soln?
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 microlab (microlabid number,patientunitstayid number,culturesite text,orga...
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-158475' AND NOT patient.hospitaldischargetime IS NULL ORDE...
What was album of the year after 2009?
CREATE TABLE table_name_99 (result VARCHAR,year VARCHAR,category VARCHAR)
SELECT result FROM table_name_99 WHERE year > 2009 AND category = "album of the year"
how many teams had an appointment date of 11 april 2011
CREATE TABLE table_27495117_3 (team VARCHAR,date_of_appointment VARCHAR)
SELECT COUNT(team) FROM table_27495117_3 WHERE date_of_appointment = "11 April 2011"
What is the lowest year that has lola t93/00 as the chassis with a start leas than 14?
CREATE TABLE table_42848 ("Year" real,"Chassis" text,"Engine" text,"Start" real,"Finish" real,"Entrant" text)
SELECT MIN("Year") FROM table_42848 WHERE "Chassis" = 'lola t93/00' AND "Start" < '14'
What is the Years for Jazz Club at Oregon State?
CREATE TABLE table_52026 ("Player" text,"Nationality" text,"Position" text,"Years for Jazz" text,"School/Club Team" text)
SELECT "Years for Jazz" FROM table_52026 WHERE "School/Club Team" = 'oregon state'
Which episode in year 2003 that have Gary Murphy and Neil Thompson?
CREATE TABLE table_14081 ("Year" real,"Category" text,"Nominee(s)" text,"Episode" text,"Result" text)
SELECT "Episode" FROM table_14081 WHERE "Nominee(s)" = 'gary murphy and neil thompson' AND "Year" = '2003'