instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Which PBA team has a College of nu? | CREATE TABLE table_62717 ("Pick" real,"Player" text,"Country of origin*" text,"PBA team" text,"College" text) | SELECT "PBA team" FROM table_62717 WHERE "College" = 'nu' |
What is Title, when Developer is '2Play Mobile', and when Genre is 'Action'? | CREATE TABLE table_58998 ("Title" text,"Developer" text,"Genre" text,"Release date" text,"Version" real) | SELECT "Title" FROM table_58998 WHERE "Developer" = '2play mobile' AND "Genre" = 'action' |
What was the result of the election in which Lindley Beckworth was the incumbent? | CREATE TABLE table_1341897_45 (result VARCHAR,incumbent VARCHAR) | SELECT result FROM table_1341897_45 WHERE incumbent = "Lindley Beckworth" |
During Spring-Summer 2019 , will I be able to take PHIL 466 ? | CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE comment_instructor (instruc... | SELECT COUNT(*) > 0 FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND NOT COURSEalias0.course_id IN... |
getting a simple query done. | CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE ... | SELECT * FROM PostHistoryTypes |
Name the high points for may 29 | CREATE TABLE table_17622423_12 (high_points VARCHAR,date VARCHAR) | SELECT high_points FROM table_17622423_12 WHERE date = "May 29" |
let me know the death status and days for which patient paul dunn was hospitalized. | 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 demographic.days_stay, demographic.expire_flag FROM demographic WHERE demographic.name = "Paul Dunn" |
provide the number of patients born before 2024 diagnosed with other chronic nonalcoholic liver disease. | 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 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2024" AND diagnoses.short_title = "Chronic liver dis NEC" |
What is Original title, when Film title used in nomination is Train Without A Timetable? | CREATE TABLE table_name_35 (original_title VARCHAR,film_title_used_in_nomination VARCHAR) | SELECT original_title FROM table_name_35 WHERE film_title_used_in_nomination = "train without a timetable" |
Which station that sat 54m above seal level is now Closed? | CREATE TABLE table_name_15 (station VARCHAR,height_above_sea_level__m_ VARCHAR) | SELECT station FROM table_name_15 WHERE height_above_sea_level__m_ = "54m" AND "closed" = "closed" |
What options do I have for my Core in ORTHO ? | CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req 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 int,has_d... | SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE course.department LIKE '%ORTHO%' AND program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id |
what number of patients diagnosed under icd9 code e8786 had abormal lab test result? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "E8786" AND lab.flag = "abnormal" |
give me the number of patients whose admission location is clinic referral/premature and primary disease is atrial fibrillation\thoracoscopic maze procedure bilateral/sda? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.diagnosis = "ATRIAL FIBRILLATION\THORACOSCOPIC MAZE PROCEDURE BILATERAL/SDA" |
Who were the opponents in the final where the score was 6 4, 2 6, 6 4, 7 6(3)? | CREATE TABLE table_26208 ("Outcome" text,"Year" real,"Championship" text,"Surface" text,"Partner" text,"Opponents in the final" text,"Score in the final" text) | SELECT "Opponents in the final" FROM table_26208 WHERE "Score in the final" = '6β4, 2β6, 6β4, 7β6(3)' |
Which round has an Opposing Team of manchester united? | CREATE TABLE table_name_64 (round VARCHAR,opposing_team VARCHAR) | SELECT round FROM table_name_64 WHERE opposing_team = "manchester united" |
Provide me the number of inpatient hospital patients who had an administration of inhaled nitric oxide procedure. | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND procedures.short_title = "Adm inhal nitric oxide" |
Which women's double took place in 2006? | CREATE TABLE table_14865 ("Year" text,"Men's singles" text,"Women's singles" text,"Men's doubles" text,"Women's doubles" text,"Mixed doubles" text) | SELECT "Women's doubles" FROM table_14865 WHERE "Year" = '2006' |
ilm of taukukauppiaat has how many total number of years? | CREATE TABLE table_67189 ("Year" real,"Film" text,"Director" text,"Nationality of director" text,"Award" text) | SELECT COUNT("Year") FROM table_67189 WHERE "Film" = 'taukukauppiaat' |
what is the title when the imprint is dengeki bunko and the artist is kiyotaka haimura? | CREATE TABLE table_name_96 (title VARCHAR,imprint VARCHAR,artist VARCHAR) | SELECT title FROM table_name_96 WHERE imprint = "dengeki bunko" AND artist = "kiyotaka haimura" |
Who visited on April 29? | CREATE TABLE table_75528 ("Date" text,"Home" text,"Score" text,"Visitor" text,"Record" text) | SELECT "Visitor" FROM table_75528 WHERE "Date" = 'april 29' |
what were the four diagnoses that had the highest five year mortality rate? | 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 microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE cost (row_id number... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t4.icd9_code FROM (SELECT t3.icd9_code, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.icd9_code, 100 - SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.chartt... |
Who were the semi finalists when Alexia Dechaume-Balleret Sandrine testud was the runner-up? | CREATE TABLE table_43261 ("Week of" text,"Tier" text,"Winner" text,"Runner-up" text,"Semi finalists" text) | SELECT "Semi finalists" FROM table_43261 WHERE "Runner-up" = 'alexia dechaume-balleret sandrine testud' |
What is the Finish of the Player with a Total of 273? | CREATE TABLE table_name_20 (finish VARCHAR,total VARCHAR) | SELECT finish FROM table_name_20 WHERE total = 273 |
show me round trip flights from BURBANK to SEATTLE | CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE flight_stop (flight_id int,stop_number int,stop_days text,stop_airport text,arrival_time int,arrival_airline text,arrival_flight_number int,departure_time int,departure_airline text,departure_flight_number int,stop_time int)CREATE TABLE 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, fare, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SEATTLE' AND NOT fare.round_trip_cost IS NULL AND flight_fare.fare_id ... |
What college team did Milan Kostolny play for? | CREATE TABLE table_30819 ("Pick" text,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text) | SELECT "College/junior/club team" FROM table_30819 WHERE "Player" = 'Milan Kostolny' |
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about commission_pct over the phone_number , sort in desc by the Y-axis. | CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))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),MANAGE... | SELECT PHONE_NUMBER, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COMMISSION_PCT DESC |
What are the countries of perpetrators? Show each country and the corresponding number of perpetrators there. | CREATE TABLE perpetrator (perpetrator_id number,people_id number,date text,year number,location text,country text,killed number,injured number)CREATE TABLE people (people_id number,name text,height number,weight number,home town text) | SELECT country, COUNT(*) FROM perpetrator GROUP BY country |
What is the US modern rock rank of code bad 0003? | CREATE TABLE table_name_90 (us_modern_rock VARCHAR,code VARCHAR) | SELECT us_modern_rock FROM table_name_90 WHERE code = "bad 0003" |
return me the papers by ' H. V. Jagadish ' on VLDB conference after 2000 . | CREATE TABLE domain (did int,name varchar)CREATE TABLE writes (aid int,pid int)CREATE TABLE keyword (keyword varchar,kid int)CREATE TABLE domain_publication (did int,pid int)CREATE TABLE cite (cited int,citing int)CREATE TABLE conference (cid int,homepage varchar,name varchar)CREATE TABLE author (aid int,homepage varch... | SELECT publication.title FROM author, conference, publication, writes WHERE author.name = 'H. V. Jagadish' AND conference.name = 'VLDB' AND publication.cid = conference.cid AND publication.year > 2000 AND writes.aid = author.aid AND writes.pid = publication.pid |
What year did Cooper Car Company enter? | CREATE TABLE table_name_35 (year INTEGER,entrant VARCHAR) | SELECT AVG(year) FROM table_name_35 WHERE entrant = "cooper car company" |
Which mean total had Tim Sills as a player? | CREATE TABLE table_name_26 (total INTEGER,player VARCHAR) | SELECT AVG(total) FROM table_name_26 WHERE player = "tim sills" |
Which Poll source has a Peg Luksik of 9%, and Dates administered of may 12, 2010? | CREATE TABLE table_name_2 (poll_source VARCHAR,peg_luksik VARCHAR,dates_administered VARCHAR) | SELECT poll_source FROM table_name_2 WHERE peg_luksik = "9%" AND dates_administered = "may 12, 2010" |
when was the last prescription time for morphine sulfate for patient 010-38092 since 97 months ago? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature ... | 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 = '010-38092')) AND medication.drugname = 'morphine sulfate' AND ... |
i would like a morning flight from MILWAUKEE to DENVER COLORADO please | CREATE TABLE compartment_class (compartment varchar,class_type varchar)CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE equipment_sequence (aircraft_code_s... | 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, state WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'MILWAUKEE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name... |
What is the opponent from April 19? | CREATE TABLE table_6049 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Save" text) | SELECT "Opponent" FROM table_6049 WHERE "Date" = 'april 19' |
What date has alamodome, san antonio, united states as the venue? | CREATE TABLE table_75846 ("Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text) | SELECT "Date" FROM table_75846 WHERE "Venue" = 'alamodome, san antonio, united states' |
What is the Week of the game with TV Time of Fox 4:15ET? | CREATE TABLE table_name_81 (week VARCHAR,tv_time VARCHAR) | SELECT COUNT(week) FROM table_name_81 WHERE tv_time = "fox 4:15et" |
When 5 is the rank of 2011 what is the country? | CREATE TABLE table_31107 ("Rank 2011" real,"Country" text,"Production in 2011 (1,000 ton)" real,"Share 2011" text,"Rank 2010" real,"Production in 2010 (1,000 ton)" real) | SELECT "Country" FROM table_31107 WHERE "Rank 2011" = '5' |
Which country is Jay Haas from when he had a to par of E? | CREATE TABLE table_8920 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Country" FROM table_8920 WHERE "To par" = 'e' AND "Player" = 'jay haas' |
If the runner-up is the Fort Lauderdale Strikers, what is the winner (number of titles)? | CREATE TABLE table_26313 ("Year" real,"Winner (number of titles)" text,"Runners-up" text,"Top Team in Regular Season (points)" text,"Top Scorer (points)" text,"Winning Coach" text) | SELECT "Winner (number of titles)" FROM table_26313 WHERE "Runners-up" = 'Fort Lauderdale Strikers' |
When Pat Robertson had 19%, and Bob Dole had 26%, what did George H.W. Bush have? | CREATE TABLE table_name_43 (george_hw_bush VARCHAR,pat_robertson VARCHAR,bob_dole VARCHAR) | SELECT george_hw_bush FROM table_name_43 WHERE pat_robertson = "19%" AND bob_dole = "26%" |
Return a bar chart about the distribution of All_Home and the sum of School_ID , and group by attribute All_Home, and display in asc by the bars please. | CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Perce... | SELECT All_Home, SUM(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home |
What is Bishop Luers IHSAA class in football? | CREATE TABLE table_name_63 (ihsaa_class__football_ VARCHAR,school VARCHAR) | SELECT ihsaa_class__football_ FROM table_name_63 WHERE school = "bishop luers" |
which patients have lab test item id 51200? | 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 lab.itemid = "51200" |
Distribution of the owners of the Epic badge by their estimated rep at the time of getting the badge. | 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... | WITH Raw AS (SELECT Posts.OwnerUserId AS "user_link", SUM(CASE WHEN Votes.VoteTypeId = 1 THEN 15 WHEN Votes.VoteTypeId = 2 THEN 10 ELSE -2 END) AS EstRep FROM Posts, Votes, Users, Badges WHERE Badges.Name = 'Epic' AND Badges.TagBased = 0 AND Badges.UserId = Users.Id AND Posts.OwnerUserId = Users.Id AND Posts.PostTypeId... |
Show the maximum share count of transactions where the amount is smaller than 10000 | CREATE TABLE TRANSACTIONS (share_count INTEGER,amount_of_transaction INTEGER) | SELECT MAX(share_count) FROM TRANSACTIONS WHERE amount_of_transaction < 10000 |
How tall is the 52 story building? | CREATE TABLE table_name_82 (height VARCHAR,stories VARCHAR) | SELECT height FROM table_name_82 WHERE stories = 52 |
did patient 1457 get a lab magnesium test since 2 years ago? | CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE microbiologyevents (ro... | SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'magnesium') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1457) AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-2 year') |
What is the listed crowd when essendon is the away squad? | CREATE TABLE table_name_68 (crowd VARCHAR,away_team VARCHAR) | SELECT COUNT(crowd) FROM table_name_68 WHERE away_team = "essendon" |
provide the number of patients whose item id is 51464? | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51464" |
For each type, how many ships are there. Plot them as bar chart. | CREATE TABLE mission (Mission_ID int,Ship_ID int,Code text,Launched_Year int,Location text,Speed_knots int,Fate text)CREATE TABLE ship (Ship_ID int,Name text,Type text,Nationality text,Tonnage int) | SELECT Type, COUNT(*) FROM ship GROUP BY Type |
what is the lowest grossing film listed before march 3 , 2002 ? | CREATE TABLE table_203_762 (id number,"#" number,"date" text,"film" text,"gross" text,"notes" text) | SELECT "film" FROM table_203_762 WHERE "date" < (SELECT "date" FROM table_203_762 WHERE "date" = 'march 3, 2002') GROUP BY "film" ORDER BY SUM("gross") LIMIT 1 |
What is the number of wins when there are 14 matches, and the No Result was less than 0? | CREATE TABLE table_name_94 (wins INTEGER,matches VARCHAR,no_result VARCHAR) | SELECT AVG(wins) FROM table_name_94 WHERE matches = 14 AND no_result < 0 |
What is the team score of the away team at Junction Oval? | CREATE TABLE table_name_35 (away_team VARCHAR,venue VARCHAR) | SELECT away_team AS score FROM table_name_35 WHERE venue = "junction oval" |
How many scores had an episode of 03x06? | CREATE TABLE table_29141354_3 (scores VARCHAR,episode VARCHAR) | SELECT COUNT(scores) FROM table_29141354_3 WHERE episode = "03x06" |
what is the number of patients whose diagnoses long title is other and unspecified alcohol dependence, unspecified and drug route is pr? | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Other and unspecified alcohol dependence, unspecified" AND prescriptions.route = "PR" |
how many patients whose admission type is urgent and procedure icd9 code is 14? | 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 lab (subject_id text,hadm_id text,itemid text,charttime tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.icd9_code = "14" |
Which Date has a Record of 4 2 0? | CREATE TABLE table_name_68 (date VARCHAR,record VARCHAR) | SELECT date FROM table_name_68 WHERE record = "4β2β0" |
Name the highest Bronze which has a Gold larger than 2 and a Rank of total? | CREATE TABLE table_name_70 (bronze INTEGER,gold VARCHAR,rank VARCHAR) | SELECT MAX(bronze) FROM table_name_70 WHERE gold > 2 AND rank = "total" |
when was the first time when patient 030-30152 was prescribed naloxone 0.4 mg/1 ml sdv inj and sublimaze at the same time in 07/this year? | CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,cul... | SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'naloxone 0.4 mg/1 ml sdv inj' AND patient.uniquepid = '030-30152' AND DATETIME(medication.drugstarttime, 'start of year')... |
How many year locations are there for the womens doubles in jing junhong li jiawei? | CREATE TABLE table_30310 ("Year Location" text,"Mens Singles" text,"Womens Singles" text,"Mens Doubles" text,"Womens Doubles" text) | SELECT COUNT("Year Location") FROM table_30310 WHERE "Womens Doubles" = 'Jing Junhong Li Jiawei' |
Use a bar chart to show the number of start dates of all the apartment bookings made by guests with gender code 'Female' for each weekday, display Y from low to high order. | CREATE TABLE Apartment_Buildings (building_id INTEGER,building_short_name CHAR(15),building_full_name VARCHAR(80),building_description VARCHAR(255),building_address VARCHAR(255),building_manager VARCHAR(50),building_phone VARCHAR(80))CREATE TABLE Apartment_Facilities (apt_id INTEGER,facility_code CHAR(15))CREATE TABLE ... | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T2.gender_code = "Female" ORDER BY COUNT(booking_start_date) |
What is Country, when Total is less than 148, and when Player is 'Gary Player'? | CREATE TABLE table_name_19 (country VARCHAR,total VARCHAR,player VARCHAR) | SELECT country FROM table_name_19 WHERE total < 148 AND player = "gary player" |
Name the highest Comp which has a Yds/game larger than 0, bostick, and a Rating smaller than 91.77? | CREATE TABLE table_43990 ("Name" text,"Rating" real,"Comp" real,"Long" real,"Yds/game" real) | SELECT MAX("Comp") FROM table_43990 WHERE "Yds/game" > '0' AND "Name" = 'bostick' AND "Rating" < '91.77' |
Tell me the highest overall rank for heat rank more than 4 and lane less than 2 | CREATE TABLE table_name_68 (overall_rank INTEGER,heat_rank VARCHAR,lane VARCHAR) | SELECT MAX(overall_rank) FROM table_name_68 WHERE heat_rank > 4 AND lane < 2 |
What is the sum of Overall, when Name is 'Tim Smiley', and when Round is less than 5? | CREATE TABLE table_name_22 (overall INTEGER,name VARCHAR,round VARCHAR) | SELECT SUM(overall) FROM table_name_22 WHERE name = "tim smiley" AND round < 5 |
What details are there on the research staff? List the result in ascending alphabetical order. | CREATE TABLE grants (grant_id number,organisation_id number,grant_amount number,grant_start_date time,grant_end_date time,other_details text)CREATE TABLE organisation_types (organisation_type text,organisation_type_description text)CREATE TABLE research_outcomes (outcome_code text,outcome_description text)CREATE TABLE ... | SELECT staff_details FROM research_staff ORDER BY staff_details |
What is the lowest goal difference of club real betis, who has less than 18 wins? | CREATE TABLE table_62140 ("Position" real,"Club" text,"Played" real,"Points" real,"Wins" real,"Draws" real,"Losses" real,"Goals for" real,"Goals against" real,"Goal Difference" real) | SELECT MIN("Goal Difference") FROM table_62140 WHERE "Club" = 'real betis' AND "Wins" < '18' |
how many times did imamura place at least 5th ? | CREATE TABLE table_204_798 (id number,"year" number,"competition" text,"venue" text,"position" text,"notes" text) | SELECT COUNT(*) FROM table_204_798 WHERE "position" <= 5 |
since 2104, what were the top four most frequent microbiology tests given to patients within 2 months after receiving a other gastrostomy? | CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,fir... | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 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 FR... |
What is Democrat: Carl Levin, when Lead Margin is 22? | CREATE TABLE table_name_88 (democrat VARCHAR,lead_margin VARCHAR) | SELECT democrat AS :_carl_levin FROM table_name_88 WHERE lead_margin = 22 |
What percentage of Asians are there in the year 2004? | CREATE TABLE table_14754471_1 (asian___percentage_ VARCHAR,year VARCHAR) | SELECT asian___percentage_ FROM table_14754471_1 WHERE year = 2004 |
Plot how many country by grouped by country as a bar graph | CREATE TABLE round (Round_ID int,Member_ID int,Decoration_Theme text,Rank_in_Round int)CREATE TABLE college (College_ID int,Name text,Leader_Name text,College_Location text)CREATE TABLE member (Member_ID int,Name text,Country text,College_ID int) | SELECT Country, COUNT(Country) FROM member GROUP BY Country |
List the organisation id with the maximum outcome count, and the count. | CREATE TABLE Project_outcomes (project_id VARCHAR)CREATE TABLE Projects (organisation_id VARCHAR,project_id VARCHAR) | SELECT T1.organisation_id, COUNT(*) FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id GROUP BY T1.organisation_id ORDER BY COUNT(*) DESC LIMIT 1 |
What are December 10's high points? | CREATE TABLE table_29775 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "High points" FROM table_29775 WHERE "Date" = 'December 10' |
When was construction completed that was listed on 09/21/1984 and a Deleted of 11/04/1999? | CREATE TABLE table_name_9 (construction_completed VARCHAR,listed VARCHAR,deleted VARCHAR) | SELECT construction_completed FROM table_name_9 WHERE listed = "09/21/1984" AND deleted = "11/04/1999" |
what are the entries by each specific artist/group? | CREATE TABLE torrents (groupname text,totalsnatched number,artist text,groupyear number,releasetype text,groupid number,id number)CREATE TABLE tags (index number,id number,tag text) | SELECT groupname, artist FROM torrents |
The graduate assistant who was in the 1st year at CU has what experience? | CREATE TABLE table_name_29 (experience VARCHAR,year_at_cu VARCHAR,position VARCHAR) | SELECT experience FROM table_name_29 WHERE year_at_cu = "1st" AND position = "graduate assistant" |
what is the total ondansetron dose that patient 1561 was prescribed in 12/this year? | CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc... | SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1561) AND prescriptions.drug = 'ondansetron' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND ... |
Head Coach casemiro mior is at which Club? | CREATE TABLE table_62637 ("Club" text,"Head Coach" text,"City" text,"Stadium" text,"2002-2003 season" text) | SELECT "Club" FROM table_62637 WHERE "Head Coach" = 'casemiro mior' |
the ffestiniog railway serviced at most how many slate quarries ? | CREATE TABLE table_203_2 (id number,"name" text,"mineral" text,"opened" text,"closed" text,"years connected" text,"notes" text) | SELECT COUNT(*) FROM table_203_2 WHERE "mineral" = 'slate' |
Does GREEKMOD 201 meet in the morning ? | CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE o... | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'GREEKMOD' AND course.number = 201 AND semester.semester = 'WN' AND semester.semester_id = course... |
What is the release date for Eclipse Foundation? | CREATE TABLE table_49692 ("Product" text,"Vendor" text,"Edition" text,"Release date" text,"Java EE compatibility" text,"License" text) | SELECT "Release date" FROM table_49692 WHERE "Vendor" = 'eclipse foundation' |
A bar graph listing the services and how many services provided by all stations, display by the bar in asc please. | CREATE TABLE weekly_weather (station_id int,day_of_week text,high_temperature int,low_temperature int,precipitation real,wind_speed_mph int)CREATE TABLE route (train_id int,station_id int)CREATE TABLE train (id int,train_number int,name text,origin text,destination text,time text,interval text)CREATE TABLE station (id ... | SELECT services, COUNT(services) FROM station GROUP BY services ORDER BY services |
how many days has it been since the last time patient 031-13920 received procedure in their current hospital encounter? | 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 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-13920'... |
Which Overall is the lowest one that has a Round of 3? | CREATE TABLE table_name_87 (overall INTEGER,round VARCHAR) | SELECT MIN(overall) FROM table_name_87 WHERE round = 3 |
give me the number of patients whose admission type is emergency and procedure long title is initial insertion of dual-chamber device? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.long_title = "Initial insertion of dual-chamber device" |
What the highest position when there is 28 against? | CREATE TABLE table_20038 ("Position" real,"Team" text,"Points" real,"Played" real,"Won" real,"Drawn" real,"Lost" real,"For" real,"Against" real,"Difference" text) | SELECT MAX("Position") FROM table_20038 WHERE "Against" = '28' |
What is the number of gold for the country ranked 19? | CREATE TABLE table_65872 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT SUM("Gold") FROM table_65872 WHERE "Rank" = '19' |
2D Histogram of question views vs. score. | CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescript... | SELECT Score, ViewCount / '##dV##' AS "views" FROM Posts WHERE PostTypeId = 1 AND Score >= '##S1##' AND Score < '##S2##' AND ViewCount < '##V2##' |
please list fares for all the flights from ATLANTA to PHILADELPHIA on 8 the 1 | CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE code_description (code varchar,description text)CREATE TABLE month (month_number int,month_name text)CREATE TABLE state (state_code text,state_name text,country_name text... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CI... |
Which Throws have a Position of 3b/rhp? | CREATE TABLE table_37392 ("Surname" text,"First" text,"D.O.B." text,"Bats" text,"Throws" text,"Position" text) | SELECT "Throws" FROM table_37392 WHERE "Position" = '3b/rhp' |
Comments on questions with accepted answers. | CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate ti... | SELECT c.Id AS "comment_link" FROM Comments AS c JOIN Posts AS p ON (p.Id = PostId) WHERE NOT AcceptedAnswerId IS NULL AND c.Score IS NULL AND p.Score > 2 AND (CAST(GETUTCDATE() - c.CreationDate AS INT) > 7) ORDER BY NEWID() LIMIT 10 |
transplant self medication program is which type of drug? | 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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd t... | SELECT prescriptions.drug_type FROM prescriptions WHERE prescriptions.drug = "Transplant Self Medication Program" |
what is the diagnostic cost in pneumothorax - traumatic? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,he... | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 'pneumothorax - traumatic') |
Which tournament was on the week of 24 october and champion is matt doyle 1 6, 6 1, 6 2? | CREATE TABLE table_29296103_10 (tournament VARCHAR,week_of VARCHAR,champion VARCHAR) | SELECT tournament FROM table_29296103_10 WHERE week_of = "24 October" AND champion = "Matt Doyle 1β6, 6β1, 6β2" |
What was the series count at for game 5? | CREATE TABLE table_17326 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Series" text) | SELECT "Series" FROM table_17326 WHERE "Game" = '5' |
what is religion of subject id 3343? | 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.religion FROM demographic WHERE demographic.subject_id = "3343" |
What record has a score of 111-96? | CREATE TABLE table_33956 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location" text,"Record" text) | SELECT "Record" FROM table_33956 WHERE "Score" = '111-96' |
Who was the partner for the match with a score in the final of 4 6, 6 7? | CREATE TABLE table_name_31 (partner VARCHAR,score_in_the_final VARCHAR) | SELECT partner FROM table_name_31 WHERE score_in_the_final = "4β6, 6β7" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.