table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
⌀
CREATE TABLE table_44719 ( "Year" text, "Winner" text, "Country" text, "Score" text, "Runner(s)-up" text )
What are the Runner(s)-up of the 1972 Championship?
SELECT "Runner(s)-up" FROM table_44719 WHERE "Year" = '1972'
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE program ( program_id int, name varchar...
Which Capstone American Culture classes satisfy the ULCS requirement ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Capstone American Culture%' OR course.description LIKE '%Capstone American Culture%' OR course.n...
CREATE TABLE table_name_6 ( decile INTEGER, area VARCHAR )
What is the total Decile with Waikanae Area?
SELECT SUM(decile) FROM table_name_6 WHERE area = "waikanae"
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,...
what is lab test fluid of subject name jerry deberry?
SELECT lab.fluid FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Jerry Deberry"
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0),...
For those employees who was hired before 2002-06-21, draw a line chart about the change of department_id over hire_date , and rank from high to low by the X-axis.
SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE DESC
CREATE TABLE table_11991 ( "Race" text, "Circuit" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Constructor" text, "Tyre" text, "Report" text )
When was the swiss grand prix?
SELECT "Date" FROM table_11991 WHERE "Race" = 'swiss grand prix'
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, ...
what is the number of patients whose age is less than 89 and drug route is pb?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "89" AND prescriptions.route = "PB"
CREATE TABLE table_name_58 ( result VARCHAR, date VARCHAR, venue VARCHAR )
What is Result, when Date is 'June 11, 1994', and when Venue is 'Miami, United States'?
SELECT result FROM table_name_58 WHERE date = "june 11, 1994" AND venue = "miami, united states"
CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIGH_DEGREE varchar(5) ) CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME var...
Draw a pie chart for how many classes are held in each department?
SELECT DEPT_CODE, COUNT(*) FROM CLASS AS T1 JOIN COURSE AS T2 ON T1.CRS_CODE = T2.CRS_CODE GROUP BY DEPT_CODE
CREATE TABLE table_7677 ( "Driver" text, "Entrant" text, "Constructor" text, "Chassis" text, "Engine" text )
Which Entrant had the Bugatti T35B Chassis and the Driver, Heinrich-Joachim Von Morgen?
SELECT "Entrant" FROM table_7677 WHERE "Chassis" = 'bugatti t35b' AND "Driver" = 'heinrich-joachim von morgen'
CREATE TABLE table_name_17 ( rounds VARCHAR, engine_† VARCHAR )
what is the rounds when the engine is mercedes fo110m?
SELECT rounds FROM table_name_17 WHERE engine_† = "mercedes fo110m"
CREATE TABLE table_16642 ( "Rd." real, "Grand Prix" text, "Pole Position" text, "Fastest Lap" text, "Winning Driver" text, "Constructor" text, "Report" text )
What is the pole position for the ferrari at the austrian grand prix?
SELECT "Pole Position" FROM table_16642 WHERE "Constructor" = 'Ferrari' AND "Grand Prix" = 'Austrian Grand Prix'
CREATE TABLE table_name_59 ( year INTEGER, developer_s_ VARCHAR )
What year was the developer(s) Bioware?
SELECT AVG(year) FROM table_name_59 WHERE developer_s_ = "bioware"
CREATE TABLE table_23824 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (in millions)" text )
What is the season number for Series #23, the Runway Job?
SELECT "Season #" FROM table_23824 WHERE "Series #" = '23'
CREATE TABLE table_53997 ( "Frequency" text, "Call sign" text, "Name" text, "Format" text, "Owner" text )
What is the call sign of 1200 am?
SELECT "Call sign" FROM table_53997 WHERE "Frequency" = '1200 am'
CREATE TABLE table_name_42 ( type VARCHAR, year VARCHAR, title VARCHAR )
What is the type earlier than 1968, and a Title of stretchin' out?
SELECT type FROM table_name_42 WHERE year < 1968 AND title = "stretchin' out"
CREATE TABLE table_50926 ( "Winner" text, "Country" text, "Winter Olympics" real, "FIS Nordic World Ski Championships" text, "Holmenkollen" text )
What country was ole ellefs ter from?
SELECT "Country" FROM table_50926 WHERE "Winner" = 'ole ellefsæter'
CREATE TABLE city ( city_id VARCHAR ) CREATE TABLE hosting_city ( host_city VARCHAR )
What are the GDP and population of the city that already served as a host more than once?
SELECT t1.gdp, t1.Regional_Population FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city GROUP BY t2.host_city HAVING COUNT(*) > 1
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 demographic ...
how many patients whose age is less than 36 and lab test name is theophylline?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "36" AND lab.label = "Theophylline"
CREATE TABLE table_27722734_7 ( date VARCHAR, team VARCHAR )
Name the date for washington
SELECT date FROM table_27722734_7 WHERE team = "Washington"
CREATE TABLE table_19897294_8 ( family_families VARCHAR, no_overall VARCHAR )
Name the number of families for uk30
SELECT COUNT(family_families) FROM table_19897294_8 WHERE no_overall = "UK30"
CREATE TABLE table_name_69 ( rating VARCHAR, share VARCHAR, viewers__millions_ VARCHAR )
What is the Rating/Share (18-49) that also has a Share greater than 10 and 12.42 million Viewers?
SELECT rating / SHARE(18 - 49) FROM table_name_69 WHERE share > 10 AND viewers__millions_ = 12.42
CREATE TABLE table_71553 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What venue was the 11 September 2012 game?
SELECT "Venue" FROM table_71553 WHERE "Date" = '11 september 2012'
CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREA...
list flights from MILWAUKEE to SAN JOSE on wednesday
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 = 'SAN JOSE' AND date_day.day_number = 23 AND date_day.month_number = 4 AND ...
CREATE TABLE table_17355820_1 ( title VARCHAR, season__number VARCHAR )
How many episodes were there in season 19?
SELECT COUNT(title) FROM table_17355820_1 WHERE season__number = 19
CREATE TABLE table_60835 ( "Player" text, "Pos." text, "Nationality" text, "Previous team" text, "Years of NBA experience [a ]" real, "Career with the franchise" text )
What is the nationality of the player who was previously with the Detroit Pistons?
SELECT "Nationality" FROM table_60835 WHERE "Previous team" = 'detroit pistons'
CREATE TABLE table_11597 ( "Year" real, "English title" text, "Korean title" text, "Role" text, "Network" text )
What network is the Korean title of mbc - on?
SELECT "Network" FROM table_11597 WHERE "Korean title" = 'mbc 베스트극장 - 작은 도둑'
CREATE TABLE tryout ( cName VARCHAR ) CREATE TABLE college ( cName VARCHAR )
Find the states where have some college students in tryout.
SELECT DISTINCT state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName
CREATE TABLE table_name_96 ( high_assists VARCHAR, record VARCHAR )
Which High assists have a Record of 4-2?
SELECT high_assists FROM table_name_96 WHERE record = "4-2"
CREATE TABLE table_34317 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text )
Which Position has a College/Junior/Club Team (League) of estevan bruins (wchl), and a Round of 3?
SELECT "Position" FROM table_34317 WHERE "College/Junior/Club Team (League)" = 'estevan bruins (wchl)' AND "Round" = '3'
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 ...
provide the number of patients whose year of birth is less than 2087 and lab test fluid is other body fluid?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2087" AND lab.fluid = "Other Body Fluid"
CREATE TABLE table_24600 ( "Season no." real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. Viewers (millions)" text )
What was the number of US Viewers in the episode directed by Steve Shill and having a production code of E2102?
SELECT "U.S. Viewers (millions)" FROM table_24600 WHERE "Directed by" = 'Steve Shill' AND "Production code" = 'E2102'
CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text ) CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text )
What is the total number of captains with different classes?, I want to rank from low to high by the the number of class.
SELECT Class, COUNT(Class) FROM captain GROUP BY Class ORDER BY COUNT(Class)
CREATE TABLE teaches ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0) ) CREATE TABLE time_slot ( time_slot_id varchar(4), day varchar(1), start_hr numeric(2), start_min numeric(2), end_hr numeric(2), end_min numeric(2) ) CREAT...
What are the names and budgets of departments with budgets greater than the average Plot them as bar chart, and could you order Y-axis from high to low order?
SELECT dept_name, budget FROM department WHERE budget > (SELECT AVG(budget) FROM department) ORDER BY budget DESC
CREATE TABLE table_32522 ( "Year" real, "Champion" text, "Score" text, "Runner-Up" text, "Arena" text, "City" text, "Tournament MVP" text )
Which player from Tucson, Arizona won the Championship?
SELECT "Champion" FROM table_32522 WHERE "City" = 'tucson, arizona'
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Show me about the distribution of All_Home and School_ID , and group by attribute ACC_Home in a bar chart, and sort by the y-axis from high to low.
SELECT All_Home, School_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY School_ID DESC
CREATE TABLE table_204_500 ( id number, "year" number, "title" text, "peak chart positions\nus country" number, "peak chart positions\nus" number, "album" text )
which album produced the most singles ?
SELECT "album" FROM table_204_500 GROUP BY "album" ORDER BY COUNT("title") DESC LIMIT 1
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 ( ...
provide the number of patients whose year of birth is less than 2065 and diagnoses short title is int inf clstrdium dfcile?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2065" AND diagnoses.short_title = "Int inf clstrdium dfcile"
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 prescription...
among patients who stayed at hospital for more than 14 days, how many of them had item id 51200?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "14" AND lab.itemid = "51200"
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE SuggestedEdits ( Id number, ...
All my posts from 2016.
SELECT COUNT(*) FROM Posts WHERE Posts.OwnerUserId = 263693 AND TIME_TO_STR(CreationDate, '%YEAR') = 2016
CREATE TABLE table_204_169 ( id number, "athlete" text, "event" text, "race 1\ntime" text, "race 2\ntime" text, "total\ntime" text, "total\nrank" number )
who was last in the slalom overall ?
SELECT "athlete" FROM table_204_169 WHERE "event" = 'slalom' ORDER BY "total\ntime" DESC LIMIT 1
CREATE TABLE table_41485 ( "Date" text, "Location" text, "Country" text, "Event" text, "Winner" text, "Runner-up" text )
What was the location of the tournament held in Spain?
SELECT "Location" FROM table_41485 WHERE "Country" = 'spain'
CREATE TABLE table_6466 ( "English name" text, "Bulgarian name" text, "Bulgarian name ( Transliteration )" text, "Old Bulgarian Names" text, "Old Bulgarian name (Transliteration)" text, "Old Bulgarian name - Meaning" text )
What's the old Bulgarian word for avgust?
SELECT "Old Bulgarian name - Meaning" FROM table_6466 WHERE "Bulgarian name ( Transliteration )" = 'avgust'
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE cost ( costid num...
when was patient 009-11964 last tested in 07/last year for alkaline phos.?
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-11964')) AND lab.labname = 'alkaline phos.' AND DATETIME(lab.labresulttime, 'st...
CREATE TABLE table_name_64 ( fa_cup INTEGER, malaysia_cup INTEGER )
What was the lowest FA Cup for a Malaysia Cup of 0?
SELECT MIN(fa_cup) FROM table_name_64 WHERE malaysia_cup < 0
CREATE TABLE table_22879323_10 ( high_rebounds VARCHAR, date VARCHAR )
What were the high rebounds on April 4?
SELECT high_rebounds FROM table_22879323_10 WHERE date = "April 4"
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 student ( student_id int, lastname varchar, firstname varchar, program_id int, ...
Which 2 -credit courses are available that are on the SW 100 -level ?
SELECT DISTINCT department, name, number FROM course WHERE credits = 2 AND department = 'SW' AND number < 100 + 100 AND number >= 100
CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE writes ( paperid int, authorid int ...
How many papers does Alvin C Haver have in Iv Infusion area ?
SELECT DISTINCT COUNT(DISTINCT writes.paperid) FROM author, keyphrase, paperkeyphrase, writes WHERE author.authorname = 'Alvin C Haver' AND keyphrase.keyphrasename = 'Iv Infusion' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND writes.authorid = author.authorid AND writes.paperid = paperkeyphrase.paperid
CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIGH_DEGREE varchar(5) ) CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varc...
Show the number of courses each instructor taught with a bar chart grouping by course code, show y axis from low to high order.
SELECT CRS_CODE, COUNT(CRS_CODE) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM GROUP BY CRS_CODE ORDER BY COUNT(CRS_CODE)
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, ...
what are the four most frequent laboratory tests patients had in the same hospital visit after they were diagnosed with cl skul base fx-coma nos until 2 years ago?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id W...
CREATE TABLE table_34789 ( "Pick #" text, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
To which college/junior/club team did the player that was Pick 16 belong?
SELECT "College/junior/club team" FROM table_34789 WHERE "Pick #" = '16'
CREATE TABLE table_79870 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" real )
Name the result for kingdome game site and opponent of denver broncos
SELECT "Result" FROM table_79870 WHERE "Game site" = 'kingdome' AND "Opponent" = 'denver broncos'
CREATE TABLE table_21012786_2 ( length_weight_of_missile VARCHAR, diameter_of_torsion_spring VARCHAR )
When the torsion spring diameter is 38.4cm what would be the length or weight of the missile
SELECT length_weight_of_missile FROM table_21012786_2 WHERE diameter_of_torsion_spring = "38.4cm"
CREATE TABLE building ( name VARCHAR, building_id VARCHAR ) CREATE TABLE institution ( name VARCHAR, building_id VARCHAR )
Show the name of buildings that do not have any institution.
SELECT name FROM building WHERE NOT building_id IN (SELECT building_id FROM institution)
CREATE TABLE gas_station ( station_id number, open_year number, location text, manager_name text, vice_manager_name text, representative_name text ) CREATE TABLE station_company ( station_id number, company_id number, rank_of_the_year number ) CREATE TABLE company ( company_id ...
Show the company name and the main industry for all companies whose headquarters are not from USA.
SELECT company, main_industry FROM company WHERE headquarters <> 'USA'
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
Give me the comparison about the average of Weight over the Sex , and group by attribute Sex by a bar chart, and show by the Y-axis from low to high.
SELECT Sex, AVG(Weight) FROM people GROUP BY Sex ORDER BY AVG(Weight)
CREATE TABLE table_444 ( "Year" real, "Mens singles" text, "Womens singles" text, "Mens doubles" text, "Womens doubles" text, "Mixed doubles" text )
What was the women's singles were men's doubles were steen fladberg jens peter nierhoff?
SELECT "Womens singles" FROM table_444 WHERE "Mens doubles" = 'Steen Fladberg Jens Peter Nierhoff'
CREATE TABLE bank ( branch_ID int, bname varchar(20), no_of_customers int, city varchar(10), state varchar(20) ) CREATE TABLE loan ( loan_ID varchar(3), loan_type varchar(15), cust_ID varchar(3), branch_ID varchar(3), amount int ) CREATE TABLE customer ( cust_ID varchar(3),...
What is the average account balance of customers with credit score below 50 for the different account types Visualize by bar chart, and order by the names in ascending please.
SELECT acc_type, AVG(acc_bal) FROM customer WHERE credit_score < 50 GROUP BY acc_type ORDER BY acc_type
CREATE TABLE table_43414 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What is the High assists when the record was 28 40?
SELECT "High assists" FROM table_43414 WHERE "Record" = '28–40'
CREATE TABLE table_63274 ( "Rank" real, "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
What is the highest rank when the lane is larger than 6, and the heat is 3, and the nationality is colombia?
SELECT MAX("Rank") FROM table_63274 WHERE "Lane" > '6' AND "Heat" = '3' AND "Nationality" = 'colombia'
CREATE TABLE table_name_96 ( bronze INTEGER, gold VARCHAR, silver VARCHAR )
What is the average number of bronze of the nation with more than 1 gold and 1 silver medal?
SELECT AVG(bronze) FROM table_name_96 WHERE gold > 1 AND silver = 1
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, ...
what was patient 010-38092's weight the last time since 150 months ago?
SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-38092') AND NOT patient.admissionweight IS NULL AND DATETIME(patient.unitadmittime) >= DATETIME(CURRENT_TIME(), '-150 month') ORDER BY patient.unit...
CREATE TABLE university ( enrollment VARCHAR, primary_conference VARCHAR, founded VARCHAR )
Show the enrollment and primary_conference of the oldest college.
SELECT enrollment, primary_conference FROM university ORDER BY founded LIMIT 1
CREATE TABLE table_11690135_1 ( interview VARCHAR, swimsuit VARCHAR )
Who scored a 9.72 in the swimsuit?
SELECT interview FROM table_11690135_1 WHERE swimsuit = "9.72"
CREATE TABLE table_203_612 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
which country has the most silver medals ?
SELECT "nation" FROM table_203_612 ORDER BY "silver" DESC LIMIT 1
CREATE TABLE table_name_60 ( year INTEGER, number_in_entourage VARCHAR, mission_type VARCHAR )
What is the latest year of a gratitude type mission with 99 in the entourage?
SELECT MAX(year) FROM table_name_60 WHERE number_in_entourage = "99" AND mission_type = "gratitude"
CREATE TABLE table_2076608_3 ( enrollment VARCHAR, location_s_ VARCHAR )
Where are the Alexandria enrollment locations?
SELECT enrollment FROM table_2076608_3 WHERE location_s_ = "Alexandria"
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
For the attribute Sex and the sum of Height, show their proportion by a pie chart.
SELECT Sex, SUM(Height) FROM people GROUP BY Sex
CREATE TABLE table_34854 ( "sSpec number" text, "Frequency" text, "L2 cache" text, "Mult." text, "Voltage" text, "Socket" text, "Release date" text, "Part number(s)" text, "Release price ( USD )" text )
Socket of without quickassist has what release price?
SELECT "Release price ( USD )" FROM table_34854 WHERE "Socket" = 'without quickassist'
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 text ) CREATE TABLE procedures ( ...
Look for the number of patients with brain mass intracranial hemorrhage as their primary disease who were born before 2180.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" AND demographic.dob_year < "2180"
CREATE TABLE table_name_99 ( points INTEGER, home VARCHAR )
What is the lowest amount of points of the game with toronto as the home team?
SELECT MIN(points) FROM table_name_99 WHERE home = "toronto"
CREATE TABLE table_33988 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
Where was home on April 3?
SELECT "Home" FROM table_33988 WHERE "Date" = 'april 3'
CREATE TABLE table_name_35 ( d_41_√ VARCHAR, d_43_√ VARCHAR )
Name the D 41 when it has D 43 of r 18
SELECT d_41_√ FROM table_name_35 WHERE d_43_√ = "r 18"
CREATE TABLE employee ( eid number, name text, salary number ) CREATE TABLE certificate ( eid number, aid number ) CREATE TABLE aircraft ( aid number, name text, distance number ) CREATE TABLE flight ( flno number, origin text, destination text, distance number, de...
Show flight number, origin, destination of all flights in the alphabetical order of the departure cities.
SELECT flno, origin, destination FROM flight ORDER BY origin
CREATE TABLE table_72860 ( "1st throw" real, "2nd throw" real, "3rd throw" text, "Equation" text, "Result" real )
If the equation is all equal, what is the 3rd throw?
SELECT "3rd throw" FROM table_72860 WHERE "Equation" = 'all equal'
CREATE TABLE club ( clubid number, clubname text, clubdesc text, clublocation text ) CREATE TABLE member_of_club ( stuid number, clubid number, position text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advis...
Which club has the most female students as their members? Give me the name of the club.
SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.sex = "F" GROUP BY t1.clubname ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE table_23248940_9 ( score VARCHAR, game VARCHAR )
How did the game number 50 end?
SELECT score FROM table_23248940_9 WHERE game = 50
CREATE TABLE table_69820 ( "Cyclist" text, "Nation" text, "Team" text, "Time" text, "UCI Points" real )
Who was the cyclist from Belgium?
SELECT "Cyclist" FROM table_69820 WHERE "Nation" = 'belgium'
CREATE TABLE table_name_89 ( opponent VARCHAR, h_a_n VARCHAR, score VARCHAR )
What is the Opponent of the game with a H/A/N of H and Score of 120-99?
SELECT opponent FROM table_name_89 WHERE h_a_n = "h" AND score = "120-99"
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varc...
For all employees who have the letters D or S in their first name, return a line chart about the change of department_id over hire_date .
SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
give me the number of patients whose age is less than 68 and lab test fluid is pleural?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "68" AND lab.fluid = "Pleural"
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), ...
Visualize a bar chart for simply displaying the email address of the employee and the corresponding salary, display in descending by the y-axis.
SELECT EMAIL, SALARY FROM employees ORDER BY SALARY DESC
CREATE TABLE table_78167 ( "Number" real, "Name" text, "Team" text, "Position" text, "Years with franchise" text, "Year retired" text )
Which team is number 14 and had a franchise in 1993-2000?
SELECT "Team" FROM table_78167 WHERE "Number" = '14' AND "Years with franchise" = '1993-2000'
CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE paperdataset ( paperid int, datase...
keyphrases used by ras bodik
SELECT DISTINCT keyphrase.keyphraseid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'ras bodik' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
CREATE TABLE table_name_14 ( game INTEGER, opponent VARCHAR )
Which Game has an Opponent of @ pittsburgh penguins?
SELECT MAX(game) FROM table_name_14 WHERE opponent = "@ pittsburgh penguins"
CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_...
give me the cheapest round trip flights from INDIANAPOLIS to ORLANDO around 12 25
SELECT DISTINCT flight_id FROM flight WHERE (((flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 25 AND DATE_DAYalias0.month_number = 12 AND DATE_DAYalias0.year = 1991)) AND f...
CREATE TABLE table_name_82 ( game INTEGER, date VARCHAR )
What is the mean game played on January 9?
SELECT AVG(game) FROM table_name_82 WHERE date = "january 9"
CREATE TABLE table_name_59 ( driver VARCHAR, grid VARCHAR )
I want the driver for grid of 9
SELECT driver FROM table_name_59 WHERE grid = 9
CREATE TABLE table_name_89 ( high_school VARCHAR, utah_mr_basketball VARCHAR, year VARCHAR )
Where did Tyler Haws, 2009 Utah Mr. Basketball, go to high school?
SELECT high_school FROM table_name_89 WHERE utah_mr_basketball = "tyler haws" AND year = 2009
CREATE TABLE complaints ( complaint_type_code VARCHAR )
How many distinct complaint type codes are there in the database?
SELECT COUNT(DISTINCT complaint_type_code) FROM complaints
CREATE TABLE table_name_95 ( game INTEGER, opponent VARCHAR, february VARCHAR )
What is the lowest numbered game with an opponent of Minnesota North Stars earlier than February 25?
SELECT MIN(game) FROM table_name_95 WHERE opponent = "minnesota north stars" AND february < 25
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 )
For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and revenue , and group by attribute founder, could you show total number in ascending order?
SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T2.Revenue
CREATE TABLE accounts ( account_id number, customer_id number, account_name text, other_account_details text ) CREATE TABLE financial_transactions ( transaction_id number, previous_transaction_id number, account_id number, card_id number, transaction_type text, transaction_date ...
What is the card type code with most number of cards?
SELECT card_type_code FROM customers_cards GROUP BY card_type_code ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE table_40876 ( "Year" real, "Winning team" text, "Losing team" text, "Score" text, "Site" text )
What is the Score with a Winning team that is san antonio spurs?
SELECT "Score" FROM table_40876 WHERE "Winning team" = 'san antonio spurs'
CREATE TABLE table_name_2 ( place VARCHAR, player VARCHAR, score VARCHAR, country VARCHAR )
When Jim Thorpe of United States has a score of 71, what is the place?
SELECT place FROM table_name_2 WHERE score = 71 AND country = "united states" AND player = "jim thorpe"
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, ...
what are the four most common diagnoses during this year.
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 4
CREATE TABLE table_name_49 ( ends INTEGER, name VARCHAR )
What is the lowest ends for Dani Alves?
SELECT MIN(ends) FROM table_name_49 WHERE name = "dani alves"
CREATE TABLE table_6504 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text )
What is the position Bill Campbell played before round 6?
SELECT "Position" FROM table_6504 WHERE "Round" < '6' AND "Player" = 'bill campbell'
CREATE TABLE table_33281 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
When was the pre-Week 10 game that had an attendance of over 38,865?
SELECT "Date" FROM table_33281 WHERE "Week" < '10' AND "Attendance" = '38,865'
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
posaconazole suspension is administered via which route?
SELECT prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Posaconazole Suspension"