instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Where did he finish when he started at 21.6? | CREATE TABLE table_2649597_1 (finish VARCHAR,start VARCHAR) | SELECT COUNT(finish) FROM table_2649597_1 WHERE start = "21.6" |
List the number of engineers and group by other details in a pie chart. | CREATE TABLE Fault_Log_Parts (fault_log_entry_id INTEGER,part_fault_id INTEGER,fault_status VARCHAR(10))CREATE TABLE Assets (asset_id INTEGER,maintenance_contract_id INTEGER,supplier_company_id INTEGER,asset_details VARCHAR(255),asset_make VARCHAR(20),asset_model VARCHAR(20),asset_acquired_date DATETIME,asset_disposed_... | SELECT other_details, COUNT(other_details) FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id = T2.engineer_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY other_details |
What is the address of the location 'UK Gallery'? | CREATE TABLE LOCATIONS (Address VARCHAR,Location_Name VARCHAR) | SELECT Address FROM LOCATIONS WHERE Location_Name = "UK Gallery" |
For those employees who was hired before 2002-06-21, give me the comparison about the average of salary over the hire_date bin hire_date by time. | CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar... | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' |
what is the team when the make is dodge and the year is after 2008? | CREATE TABLE table_49779 ("Year" real,"Series" text,"Make" text,"Driver" text,"Team" text,"Schedule" text,"Role" text) | SELECT "Team" FROM table_49779 WHERE "Make" = 'dodge' AND "Year" > '2008' |
Group by the result and count them by a bar chart, rank from low to high by the Y. | CREATE TABLE submission (Submission_ID int,Scores real,Author text,College text)CREATE TABLE Acceptance (Submission_ID int,Workshop_ID int,Result text)CREATE TABLE workshop (Workshop_ID int,Date text,Venue text,Name text) | SELECT Result, COUNT(Result) FROM Acceptance GROUP BY Result ORDER BY COUNT(Result) |
What is the weight with a denomination that is three paise? | CREATE TABLE table_name_41 (weight VARCHAR,denomination VARCHAR) | SELECT weight FROM table_name_41 WHERE denomination = "three paise" |
How many times was the date of vacancy 14 february 2011? | CREATE TABLE table_26693 ("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 COUNT("Position in table") FROM table_26693 WHERE "Date of vacancy" = '14 February 2011' |
Points larger than 108, and a Wins of 0, and a Rank smaller than 8, and a Manufacturer of honda is what rider? | CREATE TABLE table_6021 ("Rank" real,"Rider" text,"Manufacturer" text,"Points" real,"Wins" real) | SELECT "Rider" FROM table_6021 WHERE "Points" > '108' AND "Wins" = '0' AND "Rank" < '8' AND "Manufacturer" = 'honda' |
How many female patients are with lab test name creatinine kinase (ck)? | 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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "F" AND lab.label = "Creatine Kinase (CK)" |
what is the total number of polls published by the company gis xxi ? | CREATE TABLE table_204_639 (id number,"poll company" text,"source" text,"publication date" text,"psuv" number,"opposition" number,"undecided" number) | SELECT COUNT(*) FROM table_204_639 WHERE "poll company" = 'gis xxi' |
Find all dates of the logs for the problem whose id is 10, show me a bar chart that bins the dates into the weekday interval, and counts the dates, and I want to show from high to low by the y axis. | CREATE TABLE Staff (staff_id INTEGER,staff_first_name VARCHAR(80),staff_last_name VARCHAR(80),other_staff_details VARCHAR(255))CREATE TABLE Problems (problem_id INTEGER,product_id INTEGER,closure_authorised_by_staff_id INTEGER,reported_by_staff_id INTEGER,date_problem_reported DATETIME,date_problem_closed DATETIME,prob... | SELECT log_entry_date, COUNT(log_entry_date) FROM Problem_Log WHERE problem_id = 10 ORDER BY COUNT(log_entry_date) DESC |
What is the score of the game on December 22? | CREATE TABLE table_49279 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location/Attendance" text,"Record" text) | SELECT "Score" FROM table_49279 WHERE "Date" = 'december 22' |
significant organ system dysfunction ( e.g., clinically significant pulmonary or cardiovascular disease, anemia [hemoglobin < 10 g / dl], known hemoglobinopathies, and renal dysfunction [egfr < 60 ml / min] ) ; | CREATE TABLE table_dev_14 ("id" int,"anemia" bool,"pulmonary_disease" bool,"c_peptide_level" float,"hemoglobin_a1c_hba1c" float,"renal_disease" bool,"cardiovascular_disease" bool,"estimated_glomerular_filtration_rate_egfr" int,"fasting_c_peptide" float,"organ_failure" bool,"body_mass_index_bmi" float,"hypertension" boo... | SELECT * FROM table_dev_14 WHERE organ_failure = 1 OR pulmonary_disease = 1 OR cardiovascular_disease = 1 OR anemia = 1 OR hemoglobin_a1c_hba1c < 10 OR renal_disease = 1 OR estimated_glomerular_filtration_rate_egfr < 60 |
What is the time of the peachtree road race in kenya? | CREATE TABLE table_name_57 (time VARCHAR,nation VARCHAR,race VARCHAR) | SELECT time FROM table_name_57 WHERE nation = "kenya" AND race = "peachtree road race" |
provide the number of patients whose year of birth is less than 2175 and procedure icd9 code is 9915? | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2175" AND procedures.icd9_code = "9915" |
What is Oklahoma vs. when Current Streak is l 1, and Neutral Site is osu, 7-6? | CREATE TABLE table_50602 ("Oklahoma vs." text,"Overall Record" text,"at Norman" text,"at Opponent's Venue" text,"at Neutral Site" text,"Last 5 Meetings" text,"Last 10 Meetings" text,"Current Streak" text,"Since Beginning of Big 12" text) | SELECT "Oklahoma vs." FROM table_50602 WHERE "Current Streak" = 'l 1' AND "at Neutral Site" = 'osu, 7-6' |
Which pick was MIchael Holper? | CREATE TABLE table_name_42 (pick INTEGER,player VARCHAR) | SELECT MIN(pick) FROM table_name_42 WHERE player = "michael holper" |
What player has a total of 290 points? | CREATE TABLE table_name_46 (player VARCHAR,total VARCHAR) | SELECT player FROM table_name_46 WHERE total = 290 |
Lowest pick for mike flater? | CREATE TABLE table_46121 ("Round" real,"Pick" real,"Overall" real,"Name" text,"Position" text,"College" text) | SELECT MIN("Pick") FROM table_46121 WHERE "Name" = 'mike flater' |
What title was used in the nomination of Una Giornata Particolare? | CREATE TABLE table_name_20 (film_title_used_in_nomination VARCHAR,original_title VARCHAR) | SELECT film_title_used_in_nomination FROM table_name_20 WHERE original_title = "una giornata particolare" |
Which conference has the nickname Chargers? | CREATE TABLE table_2117 ("Institution" text,"Location" text,"Founded" real,"Type" text,"Enrollment" real,"Nickname" text,"Joined" real,"Left" real,"Current Conference" text) | SELECT "Current Conference" FROM table_2117 WHERE "Nickname" = 'Chargers' |
What was the margin of victory at the LPGA Championship? | CREATE TABLE table_name_65 (margin_of_victory VARCHAR,tournament VARCHAR) | SELECT margin_of_victory FROM table_name_65 WHERE tournament = "lpga championship" |
Which highest period's element is platinum? | CREATE TABLE table_43276 ("element" text,"group" real,"period" real,"reaction" text,"potential" text) | SELECT MAX("period") FROM table_43276 WHERE "element" = 'platinum' |
Name the district for john randolph (dr) | CREATE TABLE table_28941 ("District" text,"Incumbent" text,"Party" text,"First elected" text,"Result" text,"Candidates" text) | SELECT "District" FROM table_28941 WHERE "Candidates" = 'John Randolph (DR)' |
tell me the variation in weight of patient 22449 second measured on the last hospital visit compared to the value first measured on the last hospital visit? | CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE d_labitems (row_id number,itemid number,label text)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 ... | SELECT (SELECT chartevents.valuenum 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 = 22449 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)) AND ch... |
Show me a bar chart for how many faculty members does each building have? List the result with the name of the building, show from high to low by the x-axis. | CREATE TABLE Activity (actid INTEGER,activity_name varchar(25))CREATE TABLE Faculty_Participates_in (FacID 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 Participates_in (stuid ... | SELECT Building, COUNT(*) FROM Faculty GROUP BY Building ORDER BY Building DESC |
who are all the runner-up for premier in richmond | CREATE TABLE table_10566855_1 (runner_up VARCHAR,premier VARCHAR) | SELECT runner_up FROM table_10566855_1 WHERE premier = "Richmond" |
what was the medication that patient 035-2057 was prescribed for the first time through the iv push route in 09/this year? | CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labres... | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-2057')) AND medication.routeadmin = 'iv push' AND DATETIME(medi... |
At the rate where 1000 kwh/kwp y is 26.0, what is the value of 1600 kwh/kwp y? | CREATE TABLE table_18912 ("Cost" text,"2400 kWh/kWp\u2022y" text,"2200 kWh/kWp\u2022y" text,"2000 kWh/kWp\u2022y" text,"1800 kWh/kWp\u2022y" text,"1600 kWh/kWp\u2022y" text,"1400 kWh/kWp\u2022y" text,"1200 kWh/kWp\u2022y" text,"1000 kWh/kWp\u2022y" text,"800 kWh/kWp\u2022y" text) | SELECT "1600 kWh/kWp\u2022y" FROM table_18912 WHERE "1000 kWh/kWp\u2022y" = '26.0' |
What is the Part 3 when the Verb meaning is to gather? | CREATE TABLE table_46612 ("Class" text,"Part 1" text,"Part 2" text,"Part 3" text,"Part 4" text,"Verb meaning" text) | SELECT "Part 3" FROM table_46612 WHERE "Verb meaning" = 'to gather' |
Which American has British of m? | CREATE TABLE table_name_62 (american VARCHAR,british VARCHAR) | SELECT american FROM table_name_62 WHERE british = "ɛm" |
Who was the winning driver on 13 August? | CREATE TABLE table_1137718_2 (winning_driver VARCHAR,date VARCHAR) | SELECT winning_driver FROM table_1137718_2 WHERE date = "13 August" |
what are the five most frequently given lab tests for patients who had previously received systemic antibiotics - metronidazole within the same hospital visit? | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE allergy (allergyid number,patientunitst... | SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'systemic antibiot... |
provide the number of patients whose marital status is married and procedure long title is percutaneous (endoscopic) jejunostomy [pej]? | 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 diagnoses (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.marital_status = "MARRIED" AND procedures.long_title = "Percutaneous (endoscopic) jejunostomy [PEJ]" |
what nonstop flights are available from OAKLAND to PITTSBURGH | CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE dual_carrier (main_airline varchar,low_flight_n... | 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 = 'OAKLAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTS... |
What is the year that the issue price (bu) is $26.95? | CREATE TABLE table_17260 ("Year" real,"Theme" text,"Artist" text,"Mintage (Proof)" text,"Issue Price (Proof)" text,"Mintage (BU)[ clarification needed ]" text,"Issue Price (BU)[ clarification needed ]" text) | SELECT "Year" FROM table_17260 WHERE "Issue Price (BU)[ clarification needed ]" = '$26.95' |
tell me the last test that patient 29806 had received on their first hospital visit? | CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE diagnoses_icd (row_id number,subject_id number,... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29806 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) ORDER BY labevents.charttime DE... |
How many directed by have 2.80 as u.s. viewers (in millions)? | CREATE TABLE table_73554 ("No. in series" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"U.S. viewers (in millions)" text) | SELECT COUNT("Directed by") FROM table_73554 WHERE "U.S. viewers (in millions)" = '2.80' |
what is age and gender of subject id 31066? | 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 demographic.age, demographic.gender FROM demographic WHERE demographic.subject_id = "31066" |
Name the city of license for when founded is october 2010 | CREATE TABLE table_15537 ("Call Sign" text,"City of License" text,"Frequency" text,"age Watt" text,"Coverage Area" text,"Founded" text) | SELECT "City of License" FROM table_15537 WHERE "Founded" = 'october 2010' |
What is the IATA of Madrid-Barajas Airport? | CREATE TABLE table_name_8 (iata VARCHAR,airport VARCHAR) | SELECT iata FROM table_name_8 WHERE airport = "madrid-barajas airport" |
What place has a score greater than 68, and camilo villegas as the player? | CREATE TABLE table_name_51 (place VARCHAR,score VARCHAR,player VARCHAR) | SELECT place FROM table_name_51 WHERE score > 68 AND player = "camilo villegas" |
If the season is before 2000, the runner up was north melbourne, and it's the pre-season cup, what's the sum of attendees? | CREATE TABLE table_name_8 (attendance INTEGER,season VARCHAR,premiership VARCHAR,runner_up VARCHAR) | SELECT SUM(attendance) FROM table_name_8 WHERE premiership = "pre-season cup" AND runner_up = "north melbourne" AND season < 2000 |
what are the four most commonly given lab tests for patients of age 20s until 2103? | CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)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,s... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 20 AND 29) AND STRFTIME('%y', labevents.c... |
when was patient 7375's first discharge until 2100 from the hospital? | 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,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admissi... | SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 7375 AND STRFTIME('%y', admissions.dischtime) <= '2100' ORDER BY admissions.dischtime LIMIT 1 |
Who was the winning driver at Okayama International Circuit? | CREATE TABLE table_20944 ("Round" real,"Circuit" text,"Date" text,"Pole Position" text,"Fastest Lap" text,"Winning Driver" text,"Winning Team" text) | SELECT "Winning Driver" FROM table_20944 WHERE "Circuit" = 'Okayama International Circuit' |
since 1 year ago what are the four most frequently given procedures for patients 20s? | CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE d_items (row_id number,itemid number,label text,linksto t... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B... |
What is the Away team at the Wolverhampton Wanderers Home game with a Score of 2 0? | CREATE TABLE table_name_33 (away_team VARCHAR,score VARCHAR,home_team VARCHAR) | SELECT away_team FROM table_name_33 WHERE score = "2–0" AND home_team = "wolverhampton wanderers" |
What is the winner in event number 15h? | CREATE TABLE table_22050544_1 (winner VARCHAR,event__number VARCHAR) | SELECT winner FROM table_22050544_1 WHERE event__number = "15H" |
Which problems were reported by the staff named Dameon Frami or Jolie Weber? Give me the ids of the problems. | CREATE TABLE staff (staff_id number,staff_first_name text,staff_last_name text,other_staff_details text)CREATE TABLE problem_status_codes (problem_status_code text,problem_status_description text)CREATE TABLE problems (problem_id number,product_id number,closure_authorised_by_staff_id number,reported_by_staff_id number... | SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Dameon" AND T2.staff_last_name = "Frami" UNION SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Jolie" AND T2.staff_las... |
what number of patients with elective admission type had procedure title (aorto)coronary bypass of three coronary arteries? | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.long_title = "(Aorto)coronary bypass of three coronary arteries" |
Which steal/intercept ball has no for both the sliding tackle and dump tackle? | CREATE TABLE table_33081 ("sliding tackle" text,"spear tackle" text,"dump tackle" text,"body tackle" text,"ankle tap" text,"diving tackle" text,"bumping/blocking" text,"shoulder charge" text,"steal/intercept ball" text,"Chicken wing" text) | SELECT "steal/intercept ball" FROM table_33081 WHERE "sliding tackle" = 'no' AND "dump tackle" = 'no' |
List the time of elimination of the wrestlers with largest days held. | CREATE TABLE wrestler (wrestler_id number,name text,reign text,days_held text,location text,event text)CREATE TABLE elimination (elimination_id text,wrestler_id text,team text,eliminated_by text,elimination_move text,time text) | SELECT T1.time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.wrestler_id = T2.wrestler_id ORDER BY T2.days_held DESC LIMIT 1 |
what is the maximum number of points? | CREATE TABLE table_27539272_5 (points INTEGER) | SELECT MAX(points) FROM table_27539272_5 |
What position was the player who was drafted by Edmonton? | CREATE TABLE table_30265 ("Pick #" real,"CFL Team" text,"Player" text,"Position" text,"College" text) | SELECT "Position" FROM table_30265 WHERE "CFL Team" = 'Edmonton' |
Which station has 3,871 riders per mile, and an annual ridership in 2012 of larger than 15,399,400? | CREATE TABLE table_57805 ("Annual ridership (2012)" real,"Rider. per mile" real,"Opened" real,"Stations" real,"Lines" real) | SELECT MAX("Stations") FROM table_57805 WHERE "Rider. per mile" = '3,871' AND "Annual ridership (2012)" > '15,399,400' |
Calculate the minimum age of patients admitted to emergency who died before 2154? | 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 MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.dod_year < "2154.0" |
what is the organism that was detected in patient 031-23724's first blood, venipuncture microbiology test in 08/2104? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,disch... | SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23724')) AND microlab.culturesite = 'blood, venipuncture' AND STRFTIM... |
what is procedure icd9 code and drug type of subject id 18480? | 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 procedures.icd9_code, prescriptions.drug_type FROM procedures INNER JOIN prescriptions ON procedures.hadm_id = prescriptions.hadm_id WHERE procedures.subject_id = "18480" |
how many patients was diagnosed with change in mental status during the same hospital visit after being diagnosed with hematological effect of infection - leukocytosis in this year? | 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 COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'change in mental status' AND DATETIME(diagnosis.diagnosistime, 'start of ... |
How many students are enrolled in colleges that have student accepted during tryouts, and in which states are those colleges Show bar chart, and sort by the Y-axis in desc please. | CREATE TABLE College (cName varchar(20),state varchar(2),enr numeric(5,0))CREATE TABLE Player (pID numeric(5,0),pName varchar(20),yCard varchar(3),HS numeric(5,0))CREATE TABLE Tryout (pID numeric(5,0),cName varchar(20),pPos varchar(8),decision varchar(3)) | SELECT state, enr FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes' ORDER BY enr DESC |
I want to see the away team the has a home team of richmond | CREATE TABLE table_name_74 (away_team VARCHAR,home_team VARCHAR) | SELECT away_team FROM table_name_74 WHERE home_team = "richmond" |
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about salary over the email , and display y-axis in ascending 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 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 EMAIL, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SALARY |
what is the water park with the rank 20? | CREATE TABLE table_name_72 (water_park VARCHAR,rank VARCHAR) | SELECT water_park FROM table_name_72 WHERE rank = 20 |
Which team is located in Leicester? | CREATE TABLE table_63462 ("Team" text,"Location" text,"County" text,"Division" text,"Home ground" text,"Coach" text,"Captain" text) | SELECT "Team" FROM table_63462 WHERE "Location" = 'leicester' |
Find the name of airline which runs the most number of routes. | CREATE TABLE airlines (alid number,name text,iata text,icao text,callsign text,country text,active text)CREATE TABLE routes (rid number,dst_apid number,dst_ap text,src_apid number,src_ap text,alid number,airline text,codeshare text)CREATE TABLE airports (apid number,name text,city text,country text,x number,y number,el... | SELECT T1.name FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.name ORDER BY COUNT(*) DESC LIMIT 1 |
WHAT IS THE HIGHEST PLACE AND BEST SCORE BIGGER THAN 10? | CREATE TABLE table_8634 ("Place" real,"Star" text,"Average" real,"Best score" real,"Worst score" real) | SELECT MAX("Place") FROM table_8634 WHERE "Best score" > '10' |
When belgrano is the home (1st leg) what is the home (2nd leg)? | CREATE TABLE table_14219514_2 (home__2nd_leg_ VARCHAR,home__1st_leg_ VARCHAR) | SELECT home__2nd_leg_ FROM table_14219514_2 WHERE home__1st_leg_ = "Belgrano" |
How many lap two's did marco andretti do? | CREATE TABLE table_23018775_3 (lap_two VARCHAR,name VARCHAR) | SELECT COUNT(lap_two) FROM table_23018775_3 WHERE name = "Marco Andretti" |
when was the last hospital admission that patient 035-4428 was admitted to via the floor since 2 years ago? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,... | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '035-4428' AND patient.hospitaladmitsource = 'floor' AND DATETIME(patient.hospitaladmittime) >= DATETIME(CURRENT_TIME(), '-2 year') ORDER BY patient.hospitaladmittime DESC LIMIT 1 |
What is the Romanization for my old sweetheart? | CREATE TABLE table_54992 ("Year" real,"English title" text,"Korean title" text,"Romanization" text,"Role" text,"Director" text) | SELECT "Romanization" FROM table_54992 WHERE "English title" = 'my old sweetheart' |
What is Opponents In The Final, when Surface is 'Carpet', and when Tournament is 'Milan , Italy'? | CREATE TABLE table_name_61 (opponents_in_the_final VARCHAR,surface VARCHAR,tournament VARCHAR) | SELECT opponents_in_the_final FROM table_name_61 WHERE surface = "carpet" AND tournament = "milan , italy" |
Show me a scatter plot of mid and mean stars for . | CREATE TABLE Movie (mID int,title text,year int,director text)CREATE TABLE Rating (rID int,mID int,stars int,ratingDate date)CREATE TABLE Reviewer (rID int,name text) | SELECT mID, AVG(stars) FROM Rating GROUP BY mID |
how many patients have admitted before the year 2112 with 51026 as their item id? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2112" AND lab.itemid = "51026" |
How many points were made when the tries for was 83? | CREATE TABLE table_19101 ("Club" text,"Played" text,"Won" 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 "Points" FROM table_19101 WHERE "Tries for" = '83' |
Give me a bar chart to show how many dates with a max temperature greater than or equal to 80 for each day. | CREATE TABLE trip (id INTEGER,duration INTEGER,start_date TEXT,start_station_name TEXT,start_station_id INTEGER,end_date TEXT,end_station_name TEXT,end_station_id INTEGER,bike_id INTEGER,subscription_type TEXT,zip_code INTEGER)CREATE TABLE station (id INTEGER,name TEXT,lat NUMERIC,long NUMERIC,dock_count INTEGER,city T... | SELECT date, COUNT(date) FROM weather WHERE max_temperature_f >= 80 |
What current conference is Post University a member of? | CREATE TABLE table_12936521_2 (current_conference VARCHAR,institution VARCHAR) | SELECT current_conference FROM table_12936521_2 WHERE institution = "Post University" |
Show the number of date of notes from each date of notes, could you rank in ascending by the total number? | CREATE TABLE Addresses (address_id INTEGER,line_1 VARCHAR(120),line_2 VARCHAR(120),line_3 VARCHAR(120),city VARCHAR(80),zip_postcode VARCHAR(20),state_province_county VARCHAR(50),country VARCHAR(50),other_address_details VARCHAR(255))CREATE TABLE Assessment_Notes (notes_id INTEGER,student_id INTEGER,teacher_id INTEGER,... | SELECT date_of_notes, COUNT(date_of_notes) FROM Assessment_Notes ORDER BY COUNT(date_of_notes) |
What is the number of points for the vehicle with a mp4-17d chassis earlier than 2003? | CREATE TABLE table_name_83 (points INTEGER,chassis VARCHAR,year VARCHAR) | SELECT SUM(points) FROM table_name_83 WHERE chassis = "mp4-17d" AND year < 2003 |
When is the Competition of friendly match with a Result of 2 1? | CREATE TABLE table_name_47 (date VARCHAR,competition VARCHAR,result VARCHAR) | SELECT date FROM table_name_47 WHERE competition = "friendly match" AND result = "2–1" |
What was Yardley-BRM's points high after 1971? | CREATE TABLE table_name_96 (points INTEGER,entrant VARCHAR,year VARCHAR) | SELECT MAX(points) FROM table_name_96 WHERE entrant = "yardley-brm" AND year > 1971 |
give me the number of patients whose primary disease is bradycardia? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "BRADYCARDIA" |
What position(s) did the player(s) with a pick number of 125 play? | CREATE TABLE table_38127 ("Pick #" real,"Round" text,"Player" text,"Position" text,"College" text) | SELECT "Position" FROM table_38127 WHERE "Pick #" = '125' |
Percent of questions with a given tag per day. | CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,Las... | WITH QuesTagInfo(quesId, quesCreationDate, quesHasTag) AS (SELECT Id AS quesId, DATE(CreationDate) AS quesCreationDate, CASE WHEN (Tags LIKE ('%<##TagName##>%')) THEN 1 ELSE 0 END AS quesHasTag FROM Posts WHERE PostTypeId = 1) SELECT quesCreationDate, COUNT(*) AS "total_questions", SUM(quesHasTag) AS "has_tag" FROM Que... |
How may population figures are given for Settimo Torinese | CREATE TABLE table_1449176_1 (population VARCHAR,common_of VARCHAR) | SELECT COUNT(population) FROM table_1449176_1 WHERE common_of = "Settimo Torinese" |
How many patients admitted to emergency died in or before the year 2180? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.dod_year <= "2180.0" |
Name the least runs conceded for brett lee | CREATE TABLE table_20277 ("Name" text,"Overs Bowled" text,"Maidens" real,"Runs Conceded" real,"Wickets" real,"Extras" real,"E.R." text) | SELECT MIN("Runs Conceded") FROM table_20277 WHERE "Name" = 'Brett Lee' |
How many bronze medals did the country with 7 medals and over 5 silver medals receive? | CREATE TABLE table_name_88 (bronze INTEGER,total VARCHAR,silver VARCHAR) | SELECT SUM(bronze) FROM table_name_88 WHERE total = 7 AND silver > 5 |
what is the average daily number of patients had helicobacter pylori since 4 years 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 outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE procedures_icd (row_id ... | SELECT AVG(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'helicobacter pylori') AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-4 year') GRO... |
How many Posts are there on the website?. | CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuida... | SELECT se.OwnerUserId, COUNT(*) FROM SuggestedEdits AS se INNER JOIN Posts AS p ON p.Id = se.PostId WHERE se.OwnerUserId != p.OwnerUserId GROUP BY se.OwnerUserId ORDER BY COUNT(*) DESC |
Which Surname has Throws of l, and a DOB of 5/02/79? | CREATE TABLE table_75192 ("Surname" text,"First" text,"D.O.B." text,"Uni#" real,"Bats" text,"Throws" text,"Position" text) | SELECT "Surname" FROM table_75192 WHERE "Throws" = 'l' AND "D.O.B." = '5/02/79' |
In what year was his money list rank 3? | CREATE TABLE table_25418 ("Year" real,"Majors" real,"ATP wins" real,"Total wins" real,"Earnings ($)" real,"Money list rank" real) | SELECT MIN("Year") FROM table_25418 WHERE "Money list rank" = '3' |
which countries earned the same number of silver medals as germany ? | CREATE TABLE table_204_297 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number) | SELECT COUNT("nation") FROM table_204_297 WHERE "nation" <> 'germany' AND "silver" = (SELECT "silver" FROM table_204_297 WHERE "nation" = 'germany') |
tell me the maximum sao2 in patient 027-214052 on the last intensive care unit visit? | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,... | SELECT MAX(vitalperiodic.sao2) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-214052') AND NOT patient.unitdischargetime IS NULL OR... |
what is a drug that patient 61591 was prescribed for within the same hospital visit after receiving cont inv mec ven 96+ hrs in 05/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 inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE d_items (row_id number,itemid number,label t... | SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 61591 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_proce... |
What year shows 4 points? | CREATE TABLE table_68988 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" real) | SELECT "Year" FROM table_68988 WHERE "Points" = '4' |
until 2103 what are the four most frequently prescribed medications for patients who were also prescribed midazolam (versed) 2 mg/2ml inj 1 mg at the same time? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,discha... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'midazolam (versed) 2 mg/2ml inj 1 mg' AND STRFTIME(... |
What is Opponent, when Attendance is 62,170? | CREATE TABLE table_name_52 (opponent VARCHAR,attendance VARCHAR) | SELECT opponent FROM table_name_52 WHERE attendance = "62,170" |
Paris-Charles de Gaulle airport is in which country? | CREATE TABLE table_name_46 (country VARCHAR,airport VARCHAR) | SELECT country FROM table_name_46 WHERE airport = "paris-charles de gaulle airport" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.