instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
what is the party where the incumbent is edward boland? | CREATE TABLE table_1341690_21 (party VARCHAR,incumbent VARCHAR) | SELECT party FROM table_1341690_21 WHERE incumbent = "Edward Boland" |
which game had a higher attendance : 11/09/2013 or 12/20/2013 ? | CREATE TABLE table_204_459 (id number,"date" text,"time" text,"opponent" text,"site" text,"tv" text,"result" text,"attendance" number,"record" text) | SELECT "date" FROM table_204_459 WHERE "date" IN ('11/09/2013', '12/20/2013') ORDER BY "attendance" DESC LIMIT 1 |
How many floors does the building on 800 Boylston Street have? | CREATE TABLE table_name_52 (floors INTEGER,street_address VARCHAR) | SELECT MAX(floors) FROM table_name_52 WHERE street_address = "800 boylston street" |
provide the number of patients whose gender is m and diagnoses short title is injury femoral nerve? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.short_title = "Injury femoral nerve" |
Who is The Spouse of the Duchess that has a Became Duchess on 31 october 1733 husband's accession? | CREATE TABLE table_6451 ("Birth" text,"Marriage" text,"Became Duchess" text,"Ceased to be Duchess" text,"Death" text,"Spouse" text) | SELECT "Spouse" FROM table_6451 WHERE "Became Duchess" = '31 october 1733 husband''s accession' |
What are the names of wrestlers days held less than 100? | CREATE TABLE wrestler (Name VARCHAR,Days_held INTEGER) | SELECT Name FROM wrestler WHERE Days_held < 100 |
What is the place number for adrian vasile with less than 127.74 points? | CREATE TABLE table_55519 ("Rank" real,"Name" text,"Nation" text,"SP+FS" real,"Points" real,"Places" real) | SELECT SUM("Places") FROM table_55519 WHERE "Name" = 'adrian vasile' AND "Points" < '127.74' |
Which theme has a Episode of top 6? | CREATE TABLE table_name_79 (theme VARCHAR,episode VARCHAR) | SELECT theme FROM table_name_79 WHERE episode = "top 6" |
How many different products are produced in each headquarter city? | CREATE TABLE products (code number,name text,price number,manufacturer number)CREATE TABLE manufacturers (code number,name text,headquarter text,founder text,revenue number) | SELECT COUNT(DISTINCT T1.name), T2.headquarter FROM products AS T1 JOIN manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.headquarter |
what was the win for the 6 matches? | CREATE TABLE table_name_17 (wins VARCHAR,matches VARCHAR) | SELECT wins FROM table_name_17 WHERE matches = "6" |
Which courses are useful to take before taking MEDCHEM 528 ? | CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,entered_as varchar,admit_term int,predicted_graduation_semester int,degree varchar,minor va... | SELECT DISTINCT advisory_requirement FROM course WHERE department = 'MEDCHEM' AND number = 528 |
Which game type has least number of games? | CREATE TABLE Video_games (gtype VARCHAR) | SELECT gtype FROM Video_games GROUP BY gtype ORDER BY COUNT(*) LIMIT 1 |
For all employees who have the letters D or S in their first name, give me the comparison about the sum of department_id over the hire_date bin hire_date by weekday by a bar chart. | CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CO... | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' |
What is the smallest year when Ubisoft Montreal was the developer (s)? | CREATE TABLE table_64968 ("Year" real,"Game" text,"Genre" text,"Platform(s)" text,"Developer(s)" text) | SELECT MIN("Year") FROM table_64968 WHERE "Developer(s)" = 'ubisoft montreal' |
what is average age of patients whose death status is 0 and primary disease is pneumonia;human immunodefiency virus;rule out tuberculosis? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.diagnosis = "PNEUMONIA;HUMAN IMMUNODEFIENCY VIRUS;RULE OUT TUBERCULOSIS" |
What was Bill Glasson's score to par after 2 rounds? | CREATE TABLE table_name_76 (to_par VARCHAR,player VARCHAR) | SELECT to_par FROM table_name_76 WHERE player = "bill glasson" |
which driver drove the same car as luis serrado ? | CREATE TABLE table_204_538 (id number,"pos." number,"driver" text,"co-driver" text,"car" text,"time" text) | SELECT "driver" FROM table_204_538 WHERE "driver" <> 'luis serrado' AND "car" = (SELECT "car" FROM table_204_538 WHERE "driver" = 'luis serrado') |
how much is the cost of the cholelith w ac cholecyst diagnosing? | CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)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 admissions (row_id number,subje... | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'cholelith w ac cholecyst')) |
whare are al of the launche dates where th carrier is orange and the up is 5.76 mbit/s | CREATE TABLE table_22905 ("Carrier" text,"Standard" text,"Frequency" text,"(down)" text,"(up)" text,"Launch date (dd.mm.yyyy)" text) | SELECT "Launch date (dd.mm.yyyy)" FROM table_22905 WHERE "(up)" = '5.76 Mbit/s' AND "Carrier" = 'Orange' |
what is the unabbreviated version of the nephritis nos in oth dis? | CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,chart... | SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'nephritis nos in oth dis' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'nephritis nos in oth dis' |
what was the title of terence cuneo 's first work ? | CREATE TABLE table_204_106 (id number,"year" number,"title" text,"image" text,"dimensions" text,"collection" text,"comments" text) | SELECT "title" FROM table_204_106 ORDER BY "year" LIMIT 1 |
count the number of black/haitian patients who were injected oxazolidinone. | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "BLACK/HAITIAN" AND procedures.short_title = "Injection oxazolidinone" |
who is the opponent after march 21 and the game is 75? | CREATE TABLE table_name_93 (opponent VARCHAR,march VARCHAR,game VARCHAR) | SELECT opponent FROM table_name_93 WHERE march > 21 AND game = 75 |
What was the result of the race that was a 2000m distance? | CREATE TABLE table_42531 ("Result" text,"Date" text,"Race" text,"Venue" text,"Group" text,"Distance" text,"Weight (kg)" real,"Time" text,"Jockey" text,"Winner/2nd" text) | SELECT "Result" FROM table_42531 WHERE "Distance" = '2000m' |
View count, raw, by Post Type. | CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance te... | SELECT CASE WHEN (GROUPING(pt.Name) = 1) THEN 'Grand Total:' ELSE COALESCE(pt.Name, 'UNKNOWN') END AS "post_type", SUM(COALESCE(1.0 * p.ViewCount, 0)) AS Views FROM Posts AS p LEFT JOIN PostTypes AS pt ON pt.Id = p.PostTypeId GROUP BY pt.Name WITH ROLLUP |
What was the team's playoff status in 2011? | CREATE TABLE table_20941 ("Year" text,"Division" real,"League" text,"Regular Season" text,"Playoffs" text,"Open Cup" text) | SELECT "Playoffs" FROM table_20941 WHERE "Year" = '2011' |
What is the name of the visitor on January 24? | CREATE TABLE table_6482 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text) | SELECT "Visitor" FROM table_6482 WHERE "Date" = 'january 24' |
What region has the symbol ? | CREATE TABLE table_name_71 (region VARCHAR,japanese VARCHAR) | SELECT region FROM table_name_71 WHERE japanese = "八尾" |
Draw a bar chart of main industry versus total number of market value, I want to show by the X-axis from low to high. | CREATE TABLE gas_station (Station_ID int,Open_Year int,Location text,Manager_Name text,Vice_Manager_Name text,Representative_Name text)CREATE TABLE station_company (Station_ID int,Company_ID int,Rank_of_the_Year int)CREATE TABLE company (Company_ID int,Rank int,Company text,Headquarters text,Main_Industry text,Sales_bi... | SELECT Main_Industry, SUM(Market_Value) FROM company GROUP BY Main_Industry ORDER BY Main_Industry |
calculate the number of patients who underwent a laboratory test for cd4 cells, percent since 2100. | 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 outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE d_icd_procedures... | 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 = 'cd4 cells, percent') AND STRFTIME('%y', labevents.charttime) >= '2100') |
What is the number of prerequisites for RCNSCI 419 that I have completed ? | 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 varchar)CREATE TABLE comment_instructor (instructor_id int,student_id ... | SELECT COUNT(DISTINCT COURSE_1.department, COURSE_0.number) FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite, student_record WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.department = 'RCNSCI' AND COURSE_1.number = 419 AN... |
Bar chart x axis nationality y axis mean meter 100, rank from low to high by the bars. | CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 text,meter_400 text,meter_500 text,meter_600 text,meter_700 text,Time text)CREATE TABLE stadiu... | SELECT Nationality, AVG(meter_100) FROM swimmer GROUP BY Nationality ORDER BY Nationality |
What are the id and name of the mountains that have at least 2 photos Show bar chart, and list by the bar in descending please. | CREATE TABLE photos (id int,camera_lens_id int,mountain_id int,color text,name text)CREATE TABLE camera_lens (id int,brand text,name text,focal_length_mm real,max_aperture real)CREATE TABLE mountain (id int,name text,Height real,Prominence real,Range text,Country text) | SELECT T1.name, T1.id FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id ORDER BY T1.name DESC |
Which Lost has Points larger than 13? | CREATE TABLE table_name_91 (lost INTEGER,points INTEGER) | SELECT AVG(lost) FROM table_name_91 WHERE points > 13 |
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of hire_date and the sum of salary bin hire_date by time, and order total number in asc order. | CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGER_ID decimal(6,0),DEPARTMENT_ID decimal(4,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),S... | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(SALARY) |
what is diagnoses short title and diagnoses long title of diagnoses icd9 code 7596? | 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 diagnoses.short_title, diagnoses.long_title FROM diagnoses WHERE diagnoses.icd9_code = "7596" |
What week had an attendance of 27,262? | CREATE TABLE table_name_66 (week VARCHAR,attendance VARCHAR) | SELECT week FROM table_name_66 WHERE attendance = "27,262" |
Find all actors born in ' Los Angeles | CREATE TABLE made_by (id int,msid int,pid int)CREATE TABLE directed_by (id int,msid int,did int)CREATE TABLE classification (id int,msid int,gid int)CREATE TABLE tv_series (sid int,title text,release_year int,num_of_seasons int,num_of_episodes int,title_aka text,budget text)CREATE TABLE tags (id int,msid int,kid int)CR... | SELECT name FROM actor WHERE birth_city = 'Los Angeles' |
tell me the patient ids who are diagnosed with increased intracranial pressure in 2102. | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,c... | SELECT patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'increased intracranial pressure' AND STRFTIME('%y', diagnosis.diagnosistime) = '2102') |
What is the circuit of round 5? | CREATE TABLE table_24732149_2 (circuit VARCHAR,round VARCHAR) | SELECT circuit FROM table_24732149_2 WHERE round = 5 |
When did the term end for the term that had government 27 and Minister Tzachi Hanegbi? | CREATE TABLE table_68359 ("Minister" text,"Party" text,"Governments" text,"Term start" text,"Term end" text) | SELECT "Term end" FROM table_68359 WHERE "Governments" = '27' AND "Minister" = 'tzachi hanegbi' |
what was the date of the first speed recorded that was over 450 km/h ? | CREATE TABLE table_204_821 (id number,"speed [km/h (mph)]" text,"train" text,"type" text,"location" text,"date" text,"comments" text) | SELECT "date" FROM table_204_821 WHERE "speed [km/h (mph)]" > 450 ORDER BY "date" LIMIT 1 |
give me the number of patients whose admission location is transfer from hosp/extram and procedure long title is implant of pulsation balloon? | 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.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND procedures.long_title = "Implant of pulsation balloon" |
tell me what the total output on 12/18/2105 is for patient 28443. | 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 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,inti... | SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28443)) AND STRFTIME('%y-%m-%d', outputevents.charttime) = '2105-12-18' |
What is the qual when there are 125 laps? | CREATE TABLE table_66834 ("Year" text,"Start" text,"Qual" text,"Rank" text,"Finish" text,"Laps" real) | SELECT "Qual" FROM table_66834 WHERE "Laps" = '125' |
What is 1997, when 2003 is 0 / 4? | CREATE TABLE table_41092 ("Tournament" text,"1987" text,"1988" text,"1989" text,"1990" text,"1991" text,"1992" text,"1993" text,"1994" text,"1995" text,"1996" text,"1997" text,"1998" text,"1999" text,"2000" text,"2001" text,"2002" text,"2003" text,"Career SR" text,"Career Win-Loss" text) | SELECT "1997" FROM table_41092 WHERE "2003" = '0 / 4' |
Find the number of patients who are not using the medication of Procrastin-X. | CREATE TABLE Medication (Code VARCHAR,name VARCHAR)CREATE TABLE patient (SSN VARCHAR)CREATE TABLE Prescribes (patient VARCHAR,Medication VARCHAR) | SELECT COUNT(*) FROM patient WHERE NOT SSN IN (SELECT T1.patient FROM Prescribes AS T1 JOIN Medication AS T2 ON T1.Medication = T2.Code WHERE T2.name = 'Procrastin-X') |
List the rider for the doncaster handicap compeition. | CREATE TABLE table_31480 ("Result" text,"Date" text,"Race" text,"Venue" text,"Group" text,"Distance" text,"Weight (kg)" text,"Jockey" text,"Winner/2nd" text) | SELECT "Jockey" FROM table_31480 WHERE "Race" = 'Doncaster Handicap' |
the least amount of points scored by phoenix during the season is ... | CREATE TABLE table_203_689 (id number,"date" text,"opponent" text,"score" text,"result" text,"record" text) | SELECT MIN("score") FROM table_203_689 |
what were the meds that were added today to patient 016-22566 compared to that yesterday? | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,syst... | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '016-22566') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medica... |
What is Gold, when Rank is 7? | CREATE TABLE table_name_38 (gold VARCHAR,rank VARCHAR) | SELECT gold FROM table_name_38 WHERE rank = "7" |
Shirt number of 18, and a Height larger than 195 has how much weight? | CREATE TABLE table_name_63 (weight VARCHAR,shirt_no VARCHAR,height VARCHAR) | SELECT COUNT(weight) FROM table_name_63 WHERE shirt_no = 18 AND height > 195 |
Provide the list of patients younger than 68 years who have lab test item id 51221. | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "68" AND lab.itemid = "51221" |
What is the name of the suburb with a roll of 741? | CREATE TABLE table_name_60 (suburb VARCHAR,roll VARCHAR) | SELECT suburb FROM table_name_60 WHERE roll = 741 |
Name the coach for may 20, 2010 | CREATE TABLE table_2140071_10 (coach VARCHAR,premier_date VARCHAR) | SELECT coach FROM table_2140071_10 WHERE premier_date = "May 20, 2010" |
What was the date for no. 7? | CREATE TABLE table_247955_2 (date VARCHAR,no VARCHAR) | SELECT date FROM table_247955_2 WHERE no = 7 |
What is the total goals with 12 assists, and less than 291 apps? | CREATE TABLE table_name_52 (goals INTEGER,assists VARCHAR,apps VARCHAR) | SELECT SUM(goals) FROM table_name_52 WHERE assists = 12 AND apps < 291 |
What is the highest week that was played against the Minnesota Vikings? | CREATE TABLE table_name_5 (week INTEGER,opponent VARCHAR) | SELECT MAX(week) FROM table_name_5 WHERE opponent = "minnesota vikings" |
Number of questions in MSE. | CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModeratorId number,ApprovalDate time,ApprovalModeratorId number,DeactivationDat... | SELECT COUNT(*) AS count FROM Posts WHERE PostTypeId = 1 |
Who was the home team when the away team scored 10.15 (75)? | CREATE TABLE table_10140 ("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_10140 WHERE "Away team score" = '10.15 (75)' |
how many patients whose admission year is less than 2166 and lab test name is absolute cd4 count? | 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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2166" AND lab.label = "Absolute CD4 Count" |
What is the name of the driver in 1955? | CREATE TABLE table_name_18 (driver VARCHAR,year VARCHAR) | SELECT driver FROM table_name_18 WHERE year = "1955" |
find the primary disease and lab test fluid of subject id 2560. | 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 demographic.diagnosis, lab.fluid FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "2560" |
For those employees who did not have any job in the past, visualize a scatter chart about the correlation between manager_id and department_id . | CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID varchar(2))CREATE TABLE jobs (JOB_I... | SELECT MANAGER_ID, DEPARTMENT_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) |
Dubai users rank with reputation. | CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,OwnerUserId number,Comment text,Text text,Title text,Tags text,RevisionGUID other)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwne... | SELECT Ranking = ROW_NUMBER() OVER (ORDER BY Reputation DESC), * FROM Users WHERE Location LIKE '%Dubai%' OR Location LIKE '%dubai%' ORDER BY Reputation DESC |
Wha is the average number of bronze of hungary, which has less than 1 silver? | CREATE TABLE table_name_51 (bronze INTEGER,nation VARCHAR,silver VARCHAR) | SELECT AVG(bronze) FROM table_name_51 WHERE nation = "hungary" AND silver < 1 |
Who was playing when the score was 5 7, 6 7 (4 7)? | CREATE TABLE table_24654 ("Outcome" text,"Year" real,"Championship" text,"Surface" text,"Partner" text,"Opponents" text,"Score" text) | SELECT "Opponents" FROM table_24654 WHERE "Score" = '5–7, 6–7 (4–7)' |
What is the theme when the date of issue is 11 january 2010? | CREATE TABLE table_25468520_1 (theme VARCHAR,date_of_issue VARCHAR) | SELECT theme FROM table_25468520_1 WHERE date_of_issue = "11 January 2010" |
i need a flight from DENVER to WASHINGTON on wednesday | CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion varchar,wide_body varchar,wing_span int,length int,weight int,capacity int,pay_load int,cruising_speed int,range_miles int,pressurized varchar)CREATE TABLE airport_service (city_code ... | 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 = 'WASHINGTON' AND date_day.day_number = 23 AND date_day.month_number = 4 AN... |
Tags which no longer exists. | CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE PostHisto... | WITH tagshistory_cte AS (SELECT Id AS phid, REPLACE(value, '>', '') AS TagName FROM PostHistory JOIN LATERAL STRING_SPLIT(Text, '<') WHERE PostHistoryTypeId IN (3, 6, 9) AND LENGTH(value) > 0) SELECT DISTINCT (th.TagName) FROM tagshistory_cte AS th WHERE (th.TagName NOT IN (SELECT TagName FROM Tags)) ORDER BY th.TagNam... |
Name the average round for jacksonville | CREATE TABLE table_name_89 (round INTEGER,place VARCHAR) | SELECT AVG(round) FROM table_name_89 WHERE place = "jacksonville" |
Visualize a bar chart for what is the average salary for each job title?, and sort by the Y from high to low. | 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_TITLE, AVG(SALARY) FROM employees AS T1 JOIN jobs AS T2 ON T1.JOB_ID = T2.JOB_ID GROUP BY T2.JOB_TITLE ORDER BY AVG(SALARY) DESC |
What is the Time/Retired when lotus - ford was constructor and the laps were less than 17? | CREATE TABLE table_name_99 (time_retired VARCHAR,constructor VARCHAR,laps VARCHAR) | SELECT time_retired FROM table_name_99 WHERE constructor = "lotus - ford" AND laps < 17 |
How many fans were at Essendon? | CREATE TABLE table_53295 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT COUNT("Crowd") FROM table_53295 WHERE "Home team" = 'essendon' |
What is 18-49, when Weekly Winner is 'Youth Counselor Justin Meece'? | CREATE TABLE table_61839 ("Air Date" text,"Rating" text,"18-49" text,"Viewers" text,"Weekly Winner" text) | SELECT "18-49" FROM table_61839 WHERE "Weekly Winner" = 'youth counselor justin meece' |
What is the destination of the route kulitthurai,neyyattinkara? | CREATE TABLE table_4242 ("Train number" real,"Train name" text,"Origin" text,"Destination" text,"Service" text,"Route/Via." text) | SELECT "Destination" FROM table_4242 WHERE "Route/Via." = 'Kulitthurai,Neyyattinkara' |
Which call sign, broadcast at less than 103.5MHz, has an ERP W of 50? | CREATE TABLE table_name_43 (call_sign VARCHAR,erp_w VARCHAR,frequency_mhz VARCHAR) | SELECT call_sign FROM table_name_43 WHERE erp_w = 50 AND frequency_mhz < 103.5 |
When Cathi O'Malley was featured in Week 3, who was the cyber girl for Week 5? | CREATE TABLE table_59175 ("Week 1" text,"Week 2" text,"Week 3" text,"Week 4" text,"Week 5" text) | SELECT "Week 5" FROM table_59175 WHERE "Week 3" = 'cathi o''malley' |
What are the dates of death of those politicians whose date of birth 1938-08-30 30 august 1938? | CREATE TABLE table_3261 ("#" real,"Chief Justice" text,"Date of birth" text,"Appointed by" text,"Date of appointment" text,"Age at appointment" text,"Date of retirement" text,"Age at retirement" text,"Date of death" text,"Lifespan" text) | SELECT COUNT("Date of death") FROM table_3261 WHERE "Date of birth" = '1938-08-30 30 August 1938' |
Closed questions with negative score favorited only by the OP. | CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)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,LastEditorDi... | SELECT Posts.Id AS "post_link", Posts.FavoriteCount, Posts.Score, Posts.CreationDate, Votes.UserId AS "user_link" FROM Votes JOIN Posts ON (Posts.Id = Votes.PostId) WHERE Posts.FavoriteCount = 1 AND Posts.Score < 0 AND NOT Posts.ClosedDate IS NULL AND VoteTypeId = 5 AND Posts.PostTypeId = 1 AND Posts.OwnerUserId = Vote... |
What is Place, when Country is 'United States', and when Player is 'Lee Trevino'? | CREATE TABLE table_77401 ("Place" text,"Player" text,"Country" text,"Score" real,"To par" text) | SELECT "Place" FROM table_77401 WHERE "Country" = 'united states' AND "Player" = 'lee trevino' |
Which city had a gross revenue in 2011 of $739,578? | CREATE TABLE table_name_92 (city VARCHAR,gross_revenue__2011_ VARCHAR) | SELECT city FROM table_name_92 WHERE gross_revenue__2011_ = "$739,578" |
What Outgoing manager left at his end of tenure as caretaker and was Replaced by Jesper Hansen? | CREATE TABLE table_59780 ("Team" text,"Outgoing manager" text,"Manner of departure" text,"Date of vacancy" text,"Replaced by" text,"Date of appointment" text,"Position in table" text) | SELECT "Outgoing manager" FROM table_59780 WHERE "Manner of departure" = 'end of tenure as caretaker' AND "Replaced by" = 'jesper hansen' |
tell me the three most common intakes in 2100? | CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location t... | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT inputevents_cv.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM inputevents_cv WHERE STRFTIME('%y', inputevents_cv.charttime) = '2100' GROUP BY inputevents_cv.itemid) AS t1 WHERE t1.c1 <= 3) |
How many Gold for the Nation in Rank 15 with 0 Silver? | CREATE TABLE table_name_34 (gold INTEGER,rank VARCHAR,silver VARCHAR) | SELECT MAX(gold) FROM table_name_34 WHERE rank = "15" AND silver > 0 |
how many jewish patients were admitted to the hospital before the year 2146? | 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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.religion = "JEWISH" AND demographic.admityear < "2146" |
What city has the home team of the brisbane broncos? | CREATE TABLE table_66329 ("Stadium" text,"Capacity" real,"City" text,"Country" text,"Home team/s" text,"Closed (as a RL stadium)" real) | SELECT "City" FROM table_66329 WHERE "Home team/s" = 'brisbane broncos' |
What is the league goals when the league cup goals is less than 0 and 16 (1) league apps? | CREATE TABLE table_name_95 (league_goals INTEGER,league_apps VARCHAR,league_cup_goals VARCHAR) | SELECT AVG(league_goals) FROM table_name_95 WHERE league_apps = "16 (1)" AND league_cup_goals < 0 |
What is the 2.15 for Tom Parsons? | CREATE TABLE table_name_9 (athlete VARCHAR) | SELECT 215 FROM table_name_9 WHERE athlete = "tom parsons" |
airlines that fly to MIAMI from NEW YORK on friday | 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 food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE ground_service (city_code text,airport_code t... | SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MIAMI' AND date_day.day_number = 25 AND date_day.month_numbe... |
Show all branch names with the number of members in each branch registered after 2015 with a bar chart, and list in descending by the total number. | CREATE TABLE member (Member_ID int,Card_Number text,Name text,Hometown text,Level int)CREATE TABLE branch (Branch_ID int,Name text,Open_year text,Address_road text,City text,membership_amount text)CREATE TABLE membership_register_branch (Member_ID int,Branch_ID text,Register_Year text)CREATE TABLE purchase (Member_ID i... | SELECT Name, COUNT(*) FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.Branch_ID = T2.Branch_ID WHERE T1.Register_Year > 2015 GROUP BY T2.Branch_ID ORDER BY COUNT(*) DESC |
What was the date that ended in a record of 8-25-7? | CREATE TABLE table_78393 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text) | SELECT "Date" FROM table_78393 WHERE "Record" = '8-25-7' |
Which manufacturer has 23 laps and a time of +45.195? | CREATE TABLE table_56387 ("Rider" text,"Manufacturer" text,"Laps" real,"Time/Retired" text,"Grid" text) | SELECT "Manufacturer" FROM table_56387 WHERE "Laps" = '23' AND "Time/Retired" = '+45.195' |
give me the number of patients whose primary disease is left colon cancer and age is less than 76? | 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 WHERE demographic.diagnosis = "LEFT COLON CANCER" AND demographic.age < "76" |
What is the rank in 1940? | CREATE TABLE table_name_26 (rank VARCHAR,year VARCHAR) | SELECT rank FROM table_name_26 WHERE year = "1940" |
What is the losing bonus with 1 draw and 13 losses? | CREATE TABLE table_5365 ("Club" text,"Played" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Tries for" text,"Tries against" text,"Try bonus" text,"Losing bonus" text,"Points" text) | SELECT "Losing bonus" FROM table_5365 WHERE "Drawn" = '1' AND "Lost" = '13' |
What was the percentage in 2011 of the province that had 2.4% population in 2001? | CREATE TABLE table_1717824_1 (_percentage_2011 VARCHAR,_percentage_2001 VARCHAR) | SELECT _percentage_2011 FROM table_1717824_1 WHERE _percentage_2001 = "2.4%" |
what flights are between BOSTON and ATLANTA on 7 31 | CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,fare_airline text,restriction_code text,one_direction_cost int,round_trip_cost int,round_trip_required varchar)CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE state (state_code text,state_name text,country_nam... | 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 = 31 AND date_day.month_number = 7 AND d... |
What is the highest number of cuts made when her best finish is t4? | CREATE TABLE table_19602 ("Year" real,"Tournaments played" real,"Cuts made" real,"Wins" real,"2nd" real,"3rd" real,"Top 10s" real,"Best finish" text,"Earnings ($)" real,"Money list rank" text,"Scoring average" text,"Scoring rank" text) | SELECT MAX("Cuts made") FROM table_19602 WHERE "Best finish" = 'T4' |
count the number of patients whose diagnosis short title is chr syst/diastl hrt fail and drug route is left eye. | CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Chr syst/diastl hrt fail" AND prescriptions.route = "LEFT EYE" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.