instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Tell me the 2.4km run for points less than 2 | CREATE TABLE table_78265 ("Grade" text,"Points" real,"Sit-up (reps)" text,"Standing Broad Jump (cm)" text,"Chin-up (reps)" text,"Shuttle Run (sec)" text,"2.4km Run (min:sec)" text) | SELECT "2.4km Run (min:sec)" FROM table_78265 WHERE "Points" < '2' |
What is the protein identity with a length of 5304bp/377aa? | CREATE TABLE table_16849531_2 (protein_identity VARCHAR,length__bp_aa_ VARCHAR) | SELECT protein_identity FROM table_16849531_2 WHERE length__bp_aa_ = "5304bp/377aa" |
what is the number of 1500 meter runners that came from italy ? | CREATE TABLE table_204_726 (id number,"rank" number,"athlete" text,"country" text,"time" text,"behind" number,"points" number) | SELECT COUNT("athlete") FROM table_204_726 WHERE "country" = 'italy' |
What school classifications have trappers as mascot? | CREATE TABLE table_22058547_1 (type VARCHAR,mascot VARCHAR) | SELECT type FROM table_22058547_1 WHERE mascot = "Trappers" |
what is the unabbreviated version of the malig neopl pleura nos? | 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 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_... | SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'malig neopl pleura nos' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'malig neopl pleura nos' |
Which example has rx as the formula? | CREATE TABLE table_name_36 (example VARCHAR,formula VARCHAR) | SELECT example FROM table_name_36 WHERE formula = "rx" |
How many patients with secondary neuroendocrine tumor of bone had a blood gas test? | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Secondary neuroendocrine tumor of bone" AND lab."CATEGORY" = "Blood Gas" |
Find the names of the swimmers who have no record. | CREATE TABLE record (name VARCHAR,id VARCHAR,swimmer_id VARCHAR)CREATE TABLE swimmer (name VARCHAR,id VARCHAR,swimmer_id VARCHAR) | SELECT name FROM swimmer WHERE NOT id IN (SELECT swimmer_id FROM record) |
What was the score when andray blatche , al thornton (20) had the high points? | CREATE TABLE table_27721131_6 (score VARCHAR,high_points VARCHAR) | SELECT score FROM table_27721131_6 WHERE high_points = "Andray Blatche , Al Thornton (20)" |
what was the score of the parallel bars with a floor exercise score more than 9.137, vault more than 9.5 and horizontal bar of 9.225? | CREATE TABLE table_54115 ("Gymnast" text,"Floor Exercise" real,"Pommel Horse" real,"Rings" real,"Vault" real,"Parallel Bars" real,"Horizontal Bar" real,"Total" real) | SELECT SUM("Parallel Bars") FROM table_54115 WHERE "Floor Exercise" > '9.137' AND "Horizontal Bar" = '9.225' AND "Vault" > '9.5' |
What is the original air date of the episode titled 'Mom at the Bar/Train Buddy' that was written b Adrienne Carter? | CREATE TABLE table_25346 ("Series #" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Prod. code" real) | SELECT "Original air date" FROM table_25346 WHERE "Written by" = 'Adrienne Carter' AND "Title" = 'Mom at the Bar/Train Buddy' |
What is the time of Troy Bayliss with less than 8 grids? | CREATE TABLE table_name_96 (time VARCHAR,grid VARCHAR,rider VARCHAR) | SELECT time FROM table_name_96 WHERE grid < 8 AND rider = "troy bayliss" |
Who is the guest 2 in the episode where guest 4 is Iyare Igiehon and guest 3 is John Oliver? | CREATE TABLE table_20466963_4 (guest_2 VARCHAR,guest_4 VARCHAR,guest_3 VARCHAR) | SELECT guest_2 FROM table_20466963_4 WHERE guest_4 = "Iyare Igiehon" AND guest_3 = "John Oliver" |
Name the english name for | CREATE TABLE table_1638437_2 (english_name VARCHAR,simplified VARCHAR) | SELECT english_name FROM table_1638437_2 WHERE simplified = "崖城镇" |
what are the five most common medications that followed within the same month for patients who received sm bowel endoscopy nec until 2102? | 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 d_labitems (row_id number,itemid number,label text)CREATE TABLE cost (row_id number,subject_id number,hadm_id number... | SELECT t3.drug FROM (SELECT t2.drug, 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 FROM d_icd_procedures ... |
Name the barrel twist for colt model mt6400 | CREATE TABLE table_17840 ("Colt model no." text,"Name" text,"Stock" text,"Fire control" text,"Rear sight" text,"Forward assist" text,"Case deflector" text,"Barrel length" text,"Barrel profile" text,"Barrel twist" text,"Hand guards" text,"Bayonet Lug" text,"Muzzle device" text) | SELECT "Barrel twist" FROM table_17840 WHERE "Colt model no." = 'MT6400' |
What is the Week of the game with an Attendance of 64,900 and a Result of L 34-13? | CREATE TABLE table_13709 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text) | SELECT MAX("Week") FROM table_13709 WHERE "Attendance" = '64,900' AND "Result" = 'l 34-13' |
what is the minimum total hospital cost which involves c1-c4 fx-cl/cord inj nos since 2105? | CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)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 ... | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT diagnoses_icd.hadm_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 = 'c1-c4 fx-cl/cord inj nos')) AND STRFTIME('%y', cost.chargetime)... |
Find the parties associated with the delegates from district 1 or 2 Who served as comptrollers of the parties, and count them by a bar chart, sort in descending by the y-axis. | CREATE TABLE party (Party_ID int,Year real,Party text,Governor text,Lieutenant_Governor text,Comptroller text,Attorney_General text,US_Senate text)CREATE TABLE election (Election_ID int,Counties_Represented text,District int,Delegate text,Party int,First_Elected real,Committee text)CREATE TABLE county (County_Id int,Co... | SELECT Comptroller, COUNT(Comptroller) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 OR T1.District = 2 GROUP BY Comptroller ORDER BY COUNT(Comptroller) DESC |
What is the general classification with the winner being evgeni berzin? | CREATE TABLE table_12261926_2 (general_classification VARCHAR,winner VARCHAR) | SELECT COUNT(general_classification) FROM table_12261926_2 WHERE winner = "Evgeni Berzin" |
What is 2006, when Team is 'Tacuary'? | CREATE TABLE table_name_13 (team VARCHAR) | SELECT 2006 FROM table_name_13 WHERE team = "tacuary" |
A bar chart for finding the number of the name of all students who were in the tryout sorted in alphabetic order. | 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))CREATE TABLE College (cName varchar(20),state varchar(2),enr numeric(5,0)) | SELECT pName, COUNT(pName) FROM Player AS T1 JOIN Tryout AS T2 ON T1.pID = T2.pID GROUP BY pName ORDER BY T1.pName |
What is the score of the game before January 22 with a 30-7-7 record? | CREATE TABLE table_name_54 (score VARCHAR,january VARCHAR,record VARCHAR) | SELECT score FROM table_name_54 WHERE january < 22 AND record = "30-7-7" |
Which Opponent has Location Wonju Chiak Indoor Gym, South Korea? | CREATE TABLE table_name_16 (opponent VARCHAR,location VARCHAR) | SELECT opponent FROM table_name_16 WHERE location = "wonju chiak indoor gym, south korea" |
What is the original air date for episode 17 in the season? | CREATE TABLE table_1245 ("No. in season" real,"No. disc" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text) | SELECT "Original air date" FROM table_1245 WHERE "No. in season" = '17' |
Driving Force EX of no, and a Driving Force GT of yes, and a Driving Force Pro of yes has what feature? | CREATE TABLE table_6410 ("Feature" text,"GT Force" text,"Driving Force EX" text,"Driving Force Pro" text,"Driving Force GT" text,"G25 Racing Wheel" text,"G27 Racing Wheel" text) | SELECT "Feature" FROM table_6410 WHERE "Driving Force EX" = 'no' AND "Driving Force GT" = 'yes' AND "Driving Force Pro" = 'yes' |
What is the Country, when Place is '1'? | CREATE TABLE table_name_46 (country VARCHAR,place VARCHAR) | SELECT country FROM table_name_46 WHERE place = "1" |
When was the school whose students are nicknamed Rams founded? | CREATE TABLE table_23157 ("Institution" text,"Nickname" text,"Location" text,"Founded" real,"Type" text,"Enrollment" real,"Joined" real,"Left" real,"Current Conference" text) | SELECT MAX("Founded") FROM table_23157 WHERE "Nickname" = 'Rams' |
Which student visited restaurant most often? List student's first name and last name. | CREATE TABLE Visits_Restaurant (Id VARCHAR)CREATE TABLE Student (Id VARCHAR) | SELECT Student.Fname, Student.Lname FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID GROUP BY Student.StuID ORDER BY COUNT(*) DESC LIMIT 1 |
When did the episode titled 'Bad dreams' air for the first time? | CREATE TABLE table_30370 ("No. in series" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" real) | SELECT "Original air date" FROM table_30370 WHERE "Title" = 'Bad Dreams' |
A bar chart for finding the number of the country of the airlines whose name starts with 'Orbit', display y-axis in asc order please. | CREATE TABLE airlines (alid integer,name text,iata varchar(2),icao varchar(3),callsign text,country text,active varchar(2))CREATE TABLE airports (apid integer,name text,city text,country text,x real,y real,elevation bigint,iata character varchar(3),icao character varchar(4))CREATE TABLE routes (rid integer,dst_apid int... | SELECT country, COUNT(country) FROM airlines WHERE name LIKE 'Orbit%' GROUP BY country ORDER BY COUNT(country) |
Name the points for thomas morgenstern | CREATE TABLE table_26880 ("Rank" real,"Name" text,"Nationality" text,"1st (m)" text,"2nd (m)" text,"Points" text,"Overall FHT Points" text,"Overall WC points (Rank)" text) | SELECT "Points" FROM table_26880 WHERE "Name" = 'Thomas Morgenstern' |
Name the si prefix for thousand chuquet | CREATE TABLE table_260938_1 (si_prefix VARCHAR,chuquet VARCHAR) | SELECT si_prefix FROM table_260938_1 WHERE chuquet = "thousand" |
How many prefectures have an area of 361.719 kilometers squared? | CREATE TABLE table_2555 ("Number in map" text,"Prefecture" text,"Area (km\u00b2)" text,"Population (2001)" real,"Pop. density (/km\u00b2)" text) | SELECT COUNT("Prefecture") FROM table_2555 WHERE "Area (km\u00b2)" = '361.719' |
Which match did FCR 2001 Duisburg participate as the opponent? | CREATE TABLE table_79656 ("Match" real,"Date" text,"Opponent" text,"Venue" text,"Result" text,"Attnd." real,"Report" text) | SELECT SUM("Match") FROM table_79656 WHERE "Opponent" = 'fcr 2001 duisburg' |
Which games saw a record set in the long jump event? | CREATE TABLE table_13474 ("Event" text,"Record" text,"Nationality" text,"Date" text,"Games" text) | SELECT "Games" FROM table_13474 WHERE "Event" = 'long jump' |
what is the total number of gold medals won by jamaica ? | CREATE TABLE table_204_595 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number) | SELECT "gold" FROM table_204_595 WHERE "nation" = 'jamaica' |
How many manners of departure did peter voets have? | CREATE TABLE table_17125 ("Team" text,"Outgoing manager" text,"Manner of departure" text,"Date of vacancy" text,"Replaced by" text,"Date of appointment" text) | SELECT COUNT("Manner of departure") FROM table_17125 WHERE "Outgoing manager" = 'Peter Voets' |
What was the date for Round 2r? | CREATE TABLE table_name_5 (date VARCHAR,round VARCHAR) | SELECT date FROM table_name_5 WHERE round = "2r" |
What is the latest death with a description of BR-Built inspection saloon? | CREATE TABLE table_name_4 (date INTEGER,description VARCHAR) | SELECT MAX(date) FROM table_name_4 WHERE description = "br-built inspection saloon" |
List the weight of the body builders who have snatch score higher than 140 or have the height greater than 200. | CREATE TABLE people (weight VARCHAR,people_id VARCHAR,height VARCHAR)CREATE TABLE body_builder (people_id VARCHAR,snatch VARCHAR) | SELECT T2.weight FROM body_builder AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id WHERE T1.snatch > 140 OR T2.height > 200 |
calculate the total amount of input of patient 007-4371 on 01/30/2105. | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number... | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-4371')) AND intakeoutput.cellpath LIKE '%int... |
provide the number of patients whose days of hospital stay is greater than 20 and diagnoses short title is critical illness myopthy? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "20" AND diagnoses.short_title = "Critical illness myopthy" |
What is the visitor team of the game with Rudy Gay (18) as the leading scorer? | CREATE TABLE table_name_96 (visitor VARCHAR,leading_scorer VARCHAR) | SELECT visitor FROM table_name_96 WHERE leading_scorer = "rudy gay (18)" |
what is the minimum age of patients of asian ethnicity who stayed in hospital for 29 days? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE 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 MIN(demographic.age) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.days_stay = "29" |
What CFL Team was Barry Jamieson a part of? | CREATE TABLE table_26996293_1 (cfl_team VARCHAR,player VARCHAR) | SELECT cfl_team FROM table_26996293_1 WHERE player = "Barry Jamieson" |
What is the total number of # Of Prefectural Votes, when % Of Prefectural Vote is 48.4%, and when # Of Seats Won is greater than 61? | CREATE TABLE table_48595 ("Election" real,"Leader" text,"# of seats won" real,"# of National votes" real,"% of National vote" text,"# of Prefectural votes" real,"% of Prefectural vote" text) | SELECT COUNT("# of Prefectural votes") FROM table_48595 WHERE "% of Prefectural vote" = '48.4%' AND "# of seats won" > '61' |
What is the drawn when there are 402 points? | CREATE TABLE table_47109 ("Club" text,"Played" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Tries for" text,"Tries against" text,"Try bonus" text) | SELECT "Drawn" FROM table_47109 WHERE "Points for" = '402' |
tell me patient 17694's average value of heart rate since 1708 days ago? | 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 text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,a... | SELECT AVG(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 = 17694)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'hear... |
Find all the zip codes in which the max dew point have never reached 70. | CREATE TABLE trip (id number,duration number,start_date text,start_station_name text,start_station_id number,end_date text,end_station_name text,end_station_id number,bike_id number,subscription_type text,zip_code number)CREATE TABLE status (station_id number,bikes_available number,docks_available number,time text)CREA... | SELECT DISTINCT zip_code FROM weather EXCEPT SELECT DISTINCT zip_code FROM weather WHERE max_dew_point_f >= 70 |
What is the NBA draft for ohio state? | CREATE TABLE table_name_58 (nba_draft VARCHAR,college VARCHAR) | SELECT nba_draft FROM table_name_58 WHERE college = "ohio state" |
Who had a function of explorator? | CREATE TABLE table_name_9 (name VARCHAR,function VARCHAR) | SELECT name FROM table_name_9 WHERE function = "explorator" |
What is the Name of the Player with a Rank of 23 or less, Heat of 4 and Result of 55.91? | CREATE TABLE table_name_84 (name VARCHAR,result VARCHAR,heat VARCHAR,rank VARCHAR) | SELECT name FROM table_name_84 WHERE heat = 4 AND rank < 23 AND result = "55.91" |
tell me the only song to get on the us rap chart . | CREATE TABLE table_204_613 (id number,"title" text,"year" number,"peak chart positions\nus" number,"peak chart positions\nus\nr&b" number,"peak chart positions\nus\nrap" number,"album" text) | SELECT "title" FROM table_204_613 WHERE NOT "peak chart positions\nus\nrap" IS NULL |
Do you know if 800 has a lab ? | CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_credit varchar,repeat_term varchar,test_id varchar)CREATE TABLE area (course_id int,area varchar)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE jobs (job_id int,job_title v... | SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 800 |
Which Grid has Laps larger than 26, and a Time/Retired of 44:39.467? | CREATE TABLE table_name_16 (grid INTEGER,laps VARCHAR,time_retired VARCHAR) | SELECT MIN(grid) FROM table_name_16 WHERE laps > 26 AND time_retired = "44:39.467" |
Who's the Socialist ticket with a Socialist Labor ticket of charles m. carlson? | CREATE TABLE table_name_89 (socialist_ticket VARCHAR,socialist_labor_ticket VARCHAR) | SELECT socialist_ticket FROM table_name_89 WHERE socialist_labor_ticket = "charles m. carlson" |
What team has more than 32 games and 311 rebounds? | CREATE TABLE table_name_27 (team VARCHAR,games VARCHAR,rebounds VARCHAR) | SELECT team FROM table_name_27 WHERE games > 32 AND rebounds = 311 |
Are there any Core classes offered during the Winter ? | CREATE TABLE program_course (program_id int,course_id int,workload int,category 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 requirement (require... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour... |
what are the flights on tuesday 10 1 from ATLANTA to BALTIMORE | CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE code_description (code varchar,description text)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,r... | 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 = 'BALTIMORE' AND date_day.day_number = 1 AND date_day.month_number = 10 AND... |
How many region 1's did back to earth have? | CREATE TABLE table_28058 ("Release" text,"# of discs" real,"Region 1" text,"Region 2" text,"Region 4" text) | SELECT COUNT("Region 1") FROM table_28058 WHERE "Release" = 'Back to Earth' |
Who was the incumbent of district Georgia 2? | CREATE TABLE table_1341472_12 (incumbent VARCHAR,district VARCHAR) | SELECT incumbent FROM table_1341472_12 WHERE district = "Georgia 2" |
Who replaced the outgoing manager H sn zkara? | CREATE TABLE table_27091128_3 (replaced_by VARCHAR,outgoing_manager VARCHAR) | SELECT replaced_by FROM table_27091128_3 WHERE outgoing_manager = "Hüsnü Özkara" |
what are the prices of a antibacterials - penicillins? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissio... | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'treatment' AND cost.eventid IN (SELECT treatment.treatmentid FROM treatment WHERE treatment.treatmentname = 'antibacterials - penicillins') |
A bar chart for what are the number of the completion dates of all the tests that have result 'Fail'?, sort bars in desc order. | CREATE TABLE Student_Course_Enrolment (registration_id INTEGER,student_id INTEGER,course_id INTEGER,date_of_enrolment DATETIME,date_of_completion DATETIME)CREATE TABLE Subjects (subject_id INTEGER,subject_name VARCHAR(120))CREATE TABLE Course_Authors_and_Tutors (author_id INTEGER,author_tutor_ATB VARCHAR(3),login_name ... | SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail" GROUP BY date_of_completion ORDER BY date_of_completion DESC |
Which airport is in Saudi Arabia when the ICAO is oejn? | CREATE TABLE table_11590 ("City" text,"Country" text,"IATA" text,"ICAO" text,"Airport" text) | SELECT "Airport" FROM table_11590 WHERE "Country" = 'saudi arabia' AND "ICAO" = 'oejn' |
Which League from has a NHL team of san jose sharks (from carolina) 3? | CREATE TABLE table_name_13 (league_from VARCHAR,nhl_team VARCHAR) | SELECT league_from FROM table_name_13 WHERE nhl_team = "san jose sharks (from carolina) 3" |
Who is the player from the United States with a 4 to par and a 74-73-72-69=288 score? | CREATE TABLE table_name_20 (player VARCHAR,country VARCHAR,to_par VARCHAR,score VARCHAR) | SELECT player FROM table_name_20 WHERE country = "united states" AND to_par = 4 AND score = 74 - 73 - 72 - 69 = 288 |
Are 500 -level classes available in Spring or Summer term ? | CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE student (student_id int,lastname va... | SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number BETWEEN 500 AND 500 + 100 AND semester.semester IN ('SP', 'SS', 'SU') AND semester.semester_id = cou... |
Which top ten, having less than 12 cuts less than 2 top five, and events smaller than 14, is the highest? | CREATE TABLE table_name_92 (top_10 INTEGER,events VARCHAR,cuts_made VARCHAR,top_5 VARCHAR) | SELECT MAX(top_10) FROM table_name_92 WHERE cuts_made < 12 AND top_5 < 2 AND events < 14 |
How many premierships for the commonwealth bank trophy league? | CREATE TABLE table_57932 ("Club/Team" text,"League" text,"Venue" text,"Established" real,"Premierships" text) | SELECT "Premierships" FROM table_57932 WHERE "League" = 'commonwealth bank trophy' |
Name the score for 21 may 2011 | CREATE TABLE table_name_35 (score VARCHAR,date VARCHAR) | SELECT score FROM table_name_35 WHERE date = "21 may 2011" |
For those records from the products and each product's manufacturer, show me about the distribution of name and the sum of code , and group by attribute name in a bar chart, order x axis from high to low order. | CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL) | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC |
How much was the in-county tuition per credit hour at the Mercer College by the fall of 2009? | CREATE TABLE table_22308881_2 (in_county_tuition_per_credit_hour__fall_2009_ VARCHAR,college VARCHAR) | SELECT in_county_tuition_per_credit_hour__fall_2009_ FROM table_22308881_2 WHERE college = "Mercer" |
Which Wins is the highest one that has a Country of united states, and a Player of andy bean, and a Rank smaller than 4? | CREATE TABLE table_name_66 (wins INTEGER,rank VARCHAR,country VARCHAR,player VARCHAR) | SELECT MAX(wins) FROM table_name_66 WHERE country = "united states" AND player = "andy bean" AND rank < 4 |
What is the lowest enrollment for Eastern Michigan University? | CREATE TABLE table_26351260_1 (enrollment INTEGER,institution VARCHAR) | SELECT MIN(enrollment) FROM table_26351260_1 WHERE institution = "Eastern Michigan University" |
How many companies each investor has invested? Show me a pie chart. | CREATE TABLE entrepreneur (Entrepreneur_ID int,People_ID int,Company text,Money_Requested real,Investor text)CREATE TABLE people (People_ID int,Name text,Height real,Weight real,Date_of_Birth text) | SELECT Investor, COUNT(Investor) FROM entrepreneur GROUP BY Investor |
What was the Result at Strathclyde Homes Stadium? | CREATE TABLE table_59293 ("Date" text,"Opponent" text,"Venue" text,"Result" text,"St. Mirren Scorer(s)" text) | SELECT "Result" FROM table_59293 WHERE "Venue" = 'strathclyde homes stadium' |
get me the number of patients admitted before 2203 who had coronary artery primary disease. | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE" AND demographic.admityear < "2203" |
What is the Airport in Singapore? | CREATE TABLE table_name_77 (airport VARCHAR,country VARCHAR) | SELECT airport FROM table_name_77 WHERE country = "singapore" |
Among patients who had icd9 code 5771, how many of them were a divorcee? | 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.marital_status = "DIVORCED" AND procedures.icd9_code = "5771" |
how many black/haitian patients were aged below 80 years? | 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.ethnicity = "BLACK/HAITIAN" AND demographic.age < "80" |
Combined PostHistory (question and all the answers). | CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE PendingFlags (Id num... | SELECT p.Id, CASE WHEN (p.ParentId IS NULL) THEN 'Question' ELSE 'Answer' END, ph.PostHistoryTypeId, CASE ph.PostHistoryTypeId WHEN 1 THEN 'Initial Title' WHEN 2 THEN 'Initial Body' WHEN 3 THEN 'Initial Tags' WHEN 4 THEN 'Edit Title' WHEN 5 THEN 'Edit Body' WHEN 6 THEN 'Edit Tags' WHEN 7 THEN 'Initial Title' WHEN 8 THE... |
how many historic sites were listed in 1988 ? | CREATE TABLE table_204_423 (id number,"name" text,"location" text,"city" text,"listing date" text) | SELECT COUNT("name") FROM table_204_423 WHERE "listing date" = 1988 |
what the last height of patient 9038 during their first hospital encounter. | CREATE TABLE d_icd_diagnoses (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 prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx ... | 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 = 9038 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartevents.item... |
What is the Location when the opponent shows vs. ole miss, and a Loss of mckean (4-1)? | CREATE TABLE table_41740 ("Date" text,"Opponent" text,"Location" text,"Score" text,"Loss" text,"Record" text) | SELECT "Location" FROM table_41740 WHERE "Opponent" = 'vs. ole miss' AND "Loss" = 'mckean (4-1)' |
what were the five most ordered microbiology tests for patients who have previously received beta blocker - metoprolol in the same month until 2104? | 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 t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'beta blocker - metoprolol' AND STRFTIME('%y'... |
How many patients had s/p fall as their primary disease? | 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.diagnosis = "S/P FALL" |
What is the Date of the 1999 fifa confederations cup? | CREATE TABLE table_40346 ("Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text) | SELECT "Date" FROM table_40346 WHERE "Competition" = '1999 fifa confederations cup' |
What was Swish's corrected time? | CREATE TABLE table_27780 ("Position" real,"Sail number" text,"Yacht" text,"State/country" text,"Yacht type" text,"LOA (Metres)" text,"Skipper" text,"Corrected time d:hh:mm:ss" text) | SELECT "Corrected time d:hh:mm:ss" FROM table_27780 WHERE "Yacht" = 'Swish' |
Who was the winner on the Symmons Plains Raceway? | CREATE TABLE table_19077 ("Rd." real,"Race Title" text,"Circuit" text,"City / State" text,"Date" text,"Winner" text,"Team" text,"Report" text) | SELECT "Winner" FROM table_19077 WHERE "Circuit" = 'Symmons Plains Raceway' |
How many places have more than 33 points? | CREATE TABLE table_name_96 (place VARCHAR,points VARCHAR) | SELECT COUNT(place) FROM table_name_96 WHERE points = 33 |
Return a bar chart on what are the countries of perpetrators? Show each country and the corresponding number of perpetrators there. | CREATE TABLE perpetrator (Perpetrator_ID int,People_ID int,Date text,Year real,Location text,Country text,Killed int,Injured int)CREATE TABLE people (People_ID int,Name text,Height real,Weight real,"Home Town" text) | SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country |
What Viewers (m) has an Episode of school council? | CREATE TABLE table_name_82 (viewers__m_ INTEGER,episode VARCHAR) | SELECT AVG(viewers__m_) FROM table_name_82 WHERE episode = "school council" |
What is the date of the game with less than 35 points and chicago as the home team? | CREATE TABLE table_50077 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text,"Points" real) | SELECT "Date" FROM table_50077 WHERE "Points" < '35' AND "Home" = 'chicago' |
List the name of artworks that are not nominated. | CREATE TABLE Artwork (Name VARCHAR,Artwork_ID VARCHAR)CREATE TABLE nomination (Name VARCHAR,Artwork_ID VARCHAR) | SELECT Name FROM Artwork WHERE NOT Artwork_ID IN (SELECT Artwork_ID FROM nomination) |
what is the name of the courthouse listed after federal building ? | CREATE TABLE table_204_87 (id number,"courthouse" text,"city" text,"street address" text,"jurisdiction" text,"dates of use" text,"named for" text) | SELECT "courthouse" FROM table_204_87 WHERE id = (SELECT id FROM table_204_87 WHERE "courthouse" = 'federal building' ORDER BY id DESC LIMIT 1) + 1 |
What is the team name that as games of 7? | CREATE TABLE table_name_32 (team VARCHAR,games VARCHAR) | SELECT team FROM table_name_32 WHERE games = "7" |
Find the name of accounts whose checking balance is below the average checking balance. | CREATE TABLE checking (balance INTEGER)CREATE TABLE accounts (name VARCHAR,custid VARCHAR) | SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT AVG(balance) FROM checking) |
Name the city that has singapore changi airport | CREATE TABLE table_name_15 (city VARCHAR,airport VARCHAR) | SELECT city FROM table_name_15 WHERE airport = "singapore changi airport" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.