instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What is the instrumental for the dative shen?
CREATE TABLE table_name_15 (instrumental VARCHAR,dative VARCHAR)
SELECT instrumental FROM table_name_15 WHERE dative = "shen"
Who is the player from the United States and a place of t2?
CREATE TABLE table_49935 ("Place" text,"Player" text,"Country" text,"Score" real,"To par" text)
SELECT "Player" FROM table_49935 WHERE "Country" = 'united states' AND "Place" = 't2'
How many professors whose office is located in DRE 102 are hired in each month? Return a bar chart, and show y-axis in desc order.
CREATE TABLE EMPLOYEE (EMP_NUM int,EMP_LNAME varchar(15),EMP_FNAME varchar(12),EMP_INITIAL varchar(1),EMP_JOBCODE varchar(5),EMP_HIREDATE datetime,EMP_DOB datetime)CREATE TABLE DEPARTMENT (DEPT_CODE varchar(10),DEPT_NAME varchar(30),SCHOOL_CODE varchar(8),EMP_NUM int,DEPT_ADDRESS varchar(20),DEPT_EXTENSION varchar(4))C...
SELECT EMP_HIREDATE, COUNT(EMP_HIREDATE) FROM EMPLOYEE AS T1 JOIN PROFESSOR AS T2 ON T1.EMP_NUM = T2.EMP_NUM WHERE T2.PROF_OFFICE = 'DRE 102' ORDER BY COUNT(EMP_HIREDATE) DESC
Who is the home team when the score is 81-80?
CREATE TABLE table_41821 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Leading scorer" text,"Attendance" text,"Record" text)
SELECT "Home" FROM table_41821 WHERE "Score" = '81-80'
provide the number of patients whose drug code is bag and lab test category is chemistry?
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 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,sho...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "BAG" AND lab."CATEGORY" = "Chemistry"
Closed or downvoted questions without comments.
CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE Users (Id number,Reputation number,Creati...
SELECT Posts.Id, Posts.Score FROM Posts WHERE (Score < 0 OR NOT ClosedDate IS NULL) AND (SELECT COUNT(*) FROM Comments WHERE Comments.PostId = Posts.Id) = 0
What is the km2 area for the population of 311?
CREATE TABLE table_78026 ("Code" real,"Type" text,"Name" text,"Area (km 2)" real,"Population" real,"Regional County Municipality" text,"Region" real)
SELECT AVG("Area (km 2 )") FROM table_78026 WHERE "Population" = '311'
show me the flights from PITTSBURGH to SAN FRANCISCO on friday
CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum_stay int,application text,no_discounts text)C...
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 FRANCISCO' AND date_day.day_number = 25 AND date_day.month_number = 6...
WHo is the Winner of andre agassi Finalist?
CREATE TABLE table_50865 ("Tournament" text,"Surface" text,"Week" text,"Winner" text,"Finalist" text,"Semifinalists" text)
SELECT "Winner" FROM table_50865 WHERE "Finalist" = 'andre agassi'
Show the sum of account details for different statement details in a pie chart.
CREATE TABLE Statements (Statement_ID INTEGER,Statement_Details VARCHAR(255))CREATE TABLE Documents (Document_ID INTEGER,Document_Type_Code CHAR(15),Project_ID INTEGER,Document_Date DATETIME,Document_Name VARCHAR(255),Document_Description VARCHAR(255),Other_Details VARCHAR(255))CREATE TABLE Documents_with_Expenses (Doc...
SELECT Statement_Details, SUM(Account_Details) FROM Accounts AS T1 JOIN Statements AS T2 ON T1.Statement_ID = T2.Statement_ID GROUP BY Statement_Details
Who is the winning team when max busnelli is the winning driver?
CREATE TABLE table_23315271_2 (winning_team VARCHAR,winning_driver VARCHAR)
SELECT winning_team FROM table_23315271_2 WHERE winning_driver = "Max Busnelli"
Find the number of funiture types produced by each manufacturer as well as the company names Show bar chart, and show by the Y-axis in ascending.
CREATE TABLE furniture (Furniture_ID int,Name text,Num_of_Component int,Market_Rate real)CREATE TABLE furniture_manufacte (Manufacturer_ID int,Furniture_ID int,Price_in_Dollar real)CREATE TABLE manufacturer (Manufacturer_ID int,Open_Year real,Name text,Num_of_Factories int,Num_of_Shops int)
SELECT Name, COUNT(*) FROM manufacturer AS t1 JOIN furniture_manufacte AS t2 ON t1.Manufacturer_ID = t2.Manufacturer_ID GROUP BY t1.Manufacturer_ID ORDER BY COUNT(*)
What manufacturer has a year made of 1883?
CREATE TABLE table_name_76 (manufacturer VARCHAR,year_made VARCHAR)
SELECT manufacturer FROM table_name_76 WHERE year_made = "1883"
Give me the comparison about ACC_Percent over the All_Road by a bar chart, show bar in desc order.
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_Road, ACC_Percent FROM basketball_match ORDER BY All_Road DESC
What is the id and last name of the driver who participated in the most races after 2010?
CREATE TABLE drivers (driverid VARCHAR,surname VARCHAR)CREATE TABLE results (driverid VARCHAR,raceid VARCHAR)CREATE TABLE races (raceid VARCHAR,year INTEGER)
SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid WHERE T3.year > 2010 GROUP BY T1.driverid ORDER BY COUNT(*) DESC LIMIT 1
What is the original Release date of the Track written by Dallas Frazier?
CREATE TABLE table_64501 ("Track" text,"Song Title" text,"Writer(s)" text,"Original Artist" text,"Original Release" real,"Length" text)
SELECT "Original Release" FROM table_64501 WHERE "Writer(s)" = 'dallas frazier'
Count the number of entrepreneurs.
CREATE TABLE entrepreneur (entrepreneur_id number,people_id number,company text,money_requested number,investor text)CREATE TABLE people (people_id number,name text,height number,weight number,date_of_birth text)
SELECT COUNT(*) FROM entrepreneur
Name the number of bush % for elko
CREATE TABLE table_23014476_1 (bush__percentage VARCHAR,county VARCHAR)
SELECT COUNT(bush__percentage) FROM table_23014476_1 WHERE county = "Elko"
What is Neighborhood, when Branch is Hollywood Library?
CREATE TABLE table_name_92 (neighborhood VARCHAR,branch VARCHAR)
SELECT neighborhood FROM table_name_92 WHERE branch = "hollywood library"
What was the smallest lead margin when the source of polls came from Strategic Vision and Democrat Carl Levin had 57%?
CREATE TABLE table_21055 ("Poll Source" text,"Dates administered" text,"Democrat: Carl Levin" text,"Republican: Jack Hoogendyk" text,"Lead Margin" real)
SELECT MIN("Lead Margin") FROM table_21055 WHERE "Poll Source" = 'Strategic Vision' AND "Democrat: Carl Levin" = '57%'
What was the earliest week the Titans played at Ford Field?
CREATE TABLE table_name_62 (week INTEGER,game_site VARCHAR)
SELECT MIN(week) FROM table_name_62 WHERE game_site = "ford field"
Where the away team is Bradford City, who is the home team?
CREATE TABLE table_41723 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text,"Attendance" text)
SELECT "Home team" FROM table_41723 WHERE "Away team" = 'bradford city'
what is the number of patients whose admission type is urgent and diagnoses long title is ostium secundum type atrial septal defect?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_fla...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "URGENT" AND diagnoses.long_title = "Ostium secundum type atrial septal defect"
When zachary sanders is the performer how many people is the music by?
CREATE TABLE table_191105_2 (music_by VARCHAR,performed_by VARCHAR)
SELECT COUNT(music_by) FROM table_191105_2 WHERE performed_by = "Zachary Sanders"
What is the number of laps for the honda vehicle, with a grid of 13?
CREATE TABLE table_name_17 (laps VARCHAR,constructor VARCHAR,grid VARCHAR)
SELECT laps FROM table_name_17 WHERE constructor = "honda" AND grid = "13"
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and manufacturer , and group by attribute name, and I want to list y axis from low to high order please.
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.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Manufacturer
What is the most wins when the number of losses was less than 4 and there was more than 0 ties?
CREATE TABLE table_75725 ("Pos." real,"Team" text,"Wins" real,"Ties" real,"Losses" real,"Goals" text,"Diff." text,"Points" text)
SELECT MAX("Wins") FROM table_75725 WHERE "Losses" < '4' AND "Ties" > '0'
What record had an alca-271 cd?
CREATE TABLE table_14912 ("Region" text,"Date" text,"Label" text,"Format" text,"Catalog" text)
SELECT "Region" FROM table_14912 WHERE "Format" = 'cd' AND "Catalog" = 'alca-271'
Show me about the distribution of meter_200 and the amount of meter_200 , and group by attribute meter_200 in a bar chart, I want to sort the number of meter 200 in ascending order.
CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Opening_year int)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 text,meter_400 text,meter_500 text,meter_600 text,meter_700 text,Time text)CREATE TABLE record (ID int,Result text,Swimmer_ID int,Ev...
SELECT meter_200, COUNT(meter_200) FROM swimmer GROUP BY meter_200 ORDER BY COUNT(meter_200)
I want the average bronze for total of 19 and silver of 8 with rank of 31
CREATE TABLE table_name_12 (bronze INTEGER,rank VARCHAR,total VARCHAR,silver VARCHAR)
SELECT AVG(bronze) FROM table_name_12 WHERE total = 19 AND silver = 8 AND rank = "31"
Which Year Joined has an Enrollment smaller than 726, and a School of tri-west?
CREATE TABLE table_name_97 (year_joined INTEGER,enrollment VARCHAR,school VARCHAR)
SELECT MAX(year_joined) FROM table_name_97 WHERE enrollment < 726 AND school = "tri-west"
What is the average Ends with a Since of 2003, and a Name with m rquez?
CREATE TABLE table_11368 ("Nat." text,"Name" text,"Since" real,"Goals" real,"Ends" real,"Transfer fee" text)
SELECT AVG("Ends") FROM table_11368 WHERE "Since" = '2003' AND "Name" = 'márquez'
In which women's doubles did Wang Junjie play men's singles?
CREATE TABLE table_79916 ("Year" real,"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_79916 WHERE "Men's singles" = 'wang junjie'
What is the to par that has more than $122,591 in Sweden and had Annika S renstam play?
CREATE TABLE table_36068 ("Place" text,"Player" text,"Nation" text,"Score" text,"To par" text,"Money ($)" real)
SELECT "To par" FROM table_36068 WHERE "Money ( $ )" > '122,591' AND "Nation" = 'sweden' AND "Player" = 'annika sörenstam'
List the number of winery of the wines whose price is bigger than 100 in a bar chart, could you display in descending by the total number please?
CREATE TABLE wine (No INTEGER,Grape TEXT,Winery TEXT,Appelation TEXT,State TEXT,Name TEXT,Year INTEGER,Price INTEGER,Score INTEGER,Cases INTEGER,Drink TEXT)CREATE TABLE grapes (ID INTEGER,Grape TEXT,Color TEXT)CREATE TABLE appellations (No INTEGER,Appelation TEXT,County TEXT,State TEXT,Area TEXT,isAVA TEXT)
SELECT Winery, COUNT(Winery) FROM wine WHERE Price > 100 GROUP BY Winery ORDER BY COUNT(Winery) DESC
What film earmed p3.2 million on December 25?
CREATE TABLE table_31004 ("Movies" text,"December 25" text,"December 26" text,"December 27" text,"December 28" text,"December 25-28 total" text,"Total 2-week Gross" text)
SELECT "Movies" FROM table_31004 WHERE "December 25" = 'P3.2 million'
subject states that he / she has current hepatic disease.
CREATE TABLE table_dev_2 ("id" int,"nutrient_absorption" bool,"systolic_blood_pressure_sbp" int,"active_metabolic" bool,"hepatic_disease" bool,"surgery" bool,"diastolic_blood_pressure_dbp" int,"gastrointestinal_disease" bool,"organ_failure" bool,"NOUSE" float)
SELECT * FROM table_dev_2 WHERE hepatic_disease = 1
How many points categories are there when the losing bonus is 2 and points for are 642?
CREATE TABLE table_21850 ("Club" text,"Played" text,"Won" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Tries for" text,"Tries against" text,"Try bonus" text,"Losing bonus" text,"Points" text)
SELECT COUNT("Points") FROM table_21850 WHERE "Losing bonus" = '2' AND "Points for" = '642'
What is the smallest amount of points for parmalat forti ford entrant later than 1995?
CREATE TABLE table_70753 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" real)
SELECT MIN("Points") FROM table_70753 WHERE "Entrant" = 'parmalat forti ford' AND "Year" > '1995'
How many clubs were founded in the westfalenstadion stadium?
CREATE TABLE table_26218124_1 (founded VARCHAR,stadium VARCHAR)
SELECT COUNT(founded) FROM table_26218124_1 WHERE stadium = "Westfalenstadion"
What is the nationality of the person with number 27?
CREATE TABLE table_name_96 (nationality VARCHAR,jersey_number_s_ VARCHAR)
SELECT nationality FROM table_name_96 WHERE jersey_number_s_ = "27"
What is the record when the method is decision and the location is Martigues, France?
CREATE TABLE table_name_86 (record VARCHAR,method VARCHAR,location VARCHAR)
SELECT record FROM table_name_86 WHERE method = "decision" AND location = "martigues, france"
Name the league for 1994
CREATE TABLE table_name_16 (league VARCHAR,year VARCHAR)
SELECT league FROM table_name_16 WHERE year = "1994"
which canton falls under the date of law of 24 february 1843 and has a population of 3,966 ?
CREATE TABLE table_201_43 (id number,"name" text,"canton" text,"district" text,"area\n(km2)" number,"population\n(as of 2005)" number,"date of law" text)
SELECT "canton" FROM table_201_43 WHERE "date of law" = '24 february 1843' AND "population\n(as of 2005)" = '3966'
list departure times from DENVER to PHILADELPHIA which are later than 1000 o'clock and earlier than 1400
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 flight_fare (flight_id int,fare_id int)CREATE TABLE time_interval (per...
SELECT DISTINCT flight.departure_time FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((flight.departure_time <= 1400 AND flight.departure_time >= 1000) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' ...
Bar chart x axis date of birth y axis height, order by the y axis in ascending.
CREATE TABLE people (People_ID int,Sex text,Name text,Date_of_Birth text,Height real,Weight real)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)
SELECT Date_of_Birth, Height FROM people ORDER BY Height
Name the average React of the Time smaller than 20.05 in jamaica with a Lane larger than 5?
CREATE TABLE table_65453 ("Lane" real,"Name" text,"Nationality" text,"React" real,"Time" real)
SELECT AVG("React") FROM table_65453 WHERE "Time" < '20.05' AND "Nationality" = 'jamaica' AND "Lane" > '5'
What is the total number played with a difference of 22 and less than 34 against?
CREATE TABLE table_name_76 (played VARCHAR,difference VARCHAR,against VARCHAR)
SELECT COUNT(played) FROM table_name_76 WHERE difference = "22" AND against < 34
Which time has a local/networked value of Local, ad frequency of every 20 minutes, and news frequency of n/a after 7PM news?
CREATE TABLE table_62802 ("Time" text,"Show Name" text,"Local/Networked" text,"Ad Freq" text,"News Freq" text)
SELECT "Time" FROM table_62802 WHERE "Local/Networked" = 'local' AND "Ad Freq" = '20 minutes' AND "News Freq" = 'n/a after 7pm news'
What is Game, when Team is 'Philadelphia
CREATE TABLE table_name_48 (game VARCHAR,team VARCHAR)
SELECT game FROM table_name_48 WHERE team = "philadelphia"
Draw a bar chart of name versus age, and I want to list in desc by the x axis.
CREATE TABLE journal (Journal_ID int,Date text,Theme text,Sales int)CREATE TABLE editor (Editor_ID int,Name text,Age real)CREATE TABLE journal_committee (Editor_ID int,Journal_ID int,Work_Type text)
SELECT Name, Age FROM editor ORDER BY Name DESC
how many elections saw the share of votes more than 15 % ?
CREATE TABLE table_204_690 (id number,"election" number,"party name" text,"total votes" number,"share of votes" text,"seats" number,"share of seats" text,"party leader(s)" text,"notes" text)
SELECT COUNT("election") FROM table_204_690 WHERE "share of votes" > 15
what was the first time patient 65582 this month received a lab test?
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 admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_locatio...
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65582) AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') ORDER BY labevents.charttime LIMIT 1
what is the name of the treatment which has been given to patient 005-77687 two times in the last month?
CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,obs...
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, COUNT(treatment.treatmenttime) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ...
Name the result for william j. driver
CREATE TABLE table_18721 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text)
SELECT "Result" FROM table_18721 WHERE "Incumbent" = 'William J. Driver'
Top viewed questions by year.
CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score number,ApprovedByUserId number,ApprovalDate time)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text...
SELECT Id AS "post_link", ViewCount FROM Posts AS p WHERE YEAR(CreationDate) = '##year?2016##' AND PostTypeId = 1 ORDER BY ViewCount DESC LIMIT 10
When did the airplane with tail number RA-85282 crash?
CREATE TABLE table_229917_2 (date__ddmmyyyy_ VARCHAR,tail_number VARCHAR)
SELECT date__ddmmyyyy_ FROM table_229917_2 WHERE tail_number = "RA-85282"
Who won the 350cc at Sachsenring?
CREATE TABLE table_49528 ("Year" text,"Designated Grand Prix" text,"Track" text,"250 cc" text,"350 cc" text,"500 cc" text,"Report" text)
SELECT "350 cc" FROM table_49528 WHERE "Track" = 'sachsenring'
What is 2001, when 1999 is '2R', and when 1992 is '3R'?
CREATE TABLE table_name_12 (Id VARCHAR)
SELECT 2001 FROM table_name_12 WHERE 1999 = "2r" AND 1992 = "3r"
hematology: white blood cells ( wbc ) < 300000 / l; platelets < 100000 / l; hemoglobin < 10 g / dl.
CREATE TABLE table_train_145 ("id" int,"gender" string,"white_blood_cell_count_wbc" int,"elevated_intraocular_pressure" bool,"systolic_blood_pressure_sbp" int,"hemoglobin_a1c_hba1c" float,"stroke" bool,"platelets" int,"intraocular_pressure" int,"hematologic_disease" bool,"visual_impairment" bool,"diastolic_blood_pressu...
SELECT * FROM table_train_145 WHERE hematologic_disease = 1 OR (white_blood_cell_count_wbc < 300000 OR platelets < 100000 OR hemoglobin_a1c_hba1c < 10)
Which has and average less than 3 and the lowest yards?
CREATE TABLE table_name_56 (yards INTEGER,avg INTEGER)
SELECT MIN(yards) FROM table_name_56 WHERE avg < 3
which competition was shi dongpeng in before the world junior championships ?
CREATE TABLE table_203_539 (id number,"year" number,"competition" text,"venue" text,"position" text,"event" text,"notes" number)
SELECT "competition" FROM table_203_539 WHERE "year" < (SELECT "year" FROM table_203_539 WHERE "competition" = 'world junior championships') ORDER BY "year" LIMIT 1
Which Ofsted has a School of marple hall school, and a Capacity larger than 1711?
CREATE TABLE table_76734 ("School" text,"Locality" text,"Ages" text,"Capacity" real,"Ofsted" real)
SELECT MIN("Ofsted") FROM table_76734 WHERE "School" = 'marple hall school' AND "Capacity" > '1711'
When the home team was carlton how many people were in the crowd?
CREATE TABLE table_name_29 (crowd VARCHAR,home_team VARCHAR)
SELECT crowd FROM table_name_29 WHERE home_team = "carlton"
What opera has 19.87% as the firefox?
CREATE TABLE table_name_48 (opera VARCHAR,firefox VARCHAR)
SELECT opera FROM table_name_48 WHERE firefox = "19.87%"
What is Senyi N'Diaye's Position?
CREATE TABLE table_5407 ("Number" real,"Name" text,"Position" text,"Date of birth" text,"Height" text)
SELECT "Position" FROM table_5407 WHERE "Name" = 'senyi n''diaye'
what is two year survival rate of patients diagnosed with pneumococcal septicemia?
CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,sh...
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.charttime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id...
What is Australian, when Examples is 'elysium, emeritus, epitome, erotica'?
CREATE TABLE table_12343 ("17th c." text,"American" text,"British" text,"Australian" text,"Examples" text)
SELECT "Australian" FROM table_12343 WHERE "Examples" = 'elysium, emeritus, epitome, erotica'
what is the one thing patient 7533 was diagnosed with in the last hospital visit for the last time?
CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE ...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT diagnoses_icd.icd9_code FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7533 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DE...
Which game site has a recap as the match report for week 7?
CREATE TABLE table_43098 ("Week" real,"Date" text,"Opponent" text,"Time" text,"Game Site" text,"Result/Score" text,"Record" text,"Match Report" text)
SELECT "Game Site" FROM table_43098 WHERE "Match Report" = 'recap' AND "Week" = '7'
In what year was player Bruce Graham acquired?
CREATE TABLE table_name_18 (acquired VARCHAR,player VARCHAR)
SELECT acquired FROM table_name_18 WHERE player = "bruce graham"
What is the 1st leg when club is a.c. libertas?
CREATE TABLE table_1233026_4 (club VARCHAR)
SELECT 1 AS st_leg FROM table_1233026_4 WHERE club = "A.C. Libertas"
How many have are model 2.4 awd?
CREATE TABLE table_16816 ("model" text,"max. motive power" text,"max. torque at rpm" text,"engine displacement" text,"engine type" text,"engine configuration & notes 0-100km/h" text)
SELECT COUNT("engine type") FROM table_16816 WHERE "model" = '2.4 AWD'
what is the number of the rank of the team on october 7 ?
CREATE TABLE table_203_809 (id number,"date" text,"time" text,"opponent#" text,"rank#" text,"site" text,"tv" text,"result" text,"attendance" number)
SELECT "rank#" FROM table_203_809 WHERE "date" = 'october 7'
A scatter chart shows the correlation between ACC_Percent and All_Games_Percent , and group by attribute ACC_Regular_Season.
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 ACC_Percent, All_Games_Percent FROM basketball_match GROUP BY ACC_Regular_Season
name of the drug that patient 035-4312 is allergic to since 92 months ago?
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 allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-4312')) AND DATETIME(allergy.allergytime) >= DATETIME(CURRENT_TIME(), '-...
A bar chart for listing the number of the names of patients who have made appointments.
CREATE TABLE Nurse (EmployeeID INTEGER,Name VARCHAR(30),Position VARCHAR(30),Registered BOOLEAN,SSN INTEGER)CREATE TABLE Medication (Code INTEGER,Name VARCHAR(30),Brand VARCHAR(30),Description VARCHAR(30))CREATE TABLE Affiliated_With (Physician INTEGER,Department INTEGER,PrimaryAffiliation BOOLEAN)CREATE TABLE Stay (St...
SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Patient AS T2 ON T1.Patient = T2.SSN GROUP BY Name
What is the Score of game 35?
CREATE TABLE table_45968 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Record" text)
SELECT "Score" FROM table_45968 WHERE "Game" = '35'
What is Surface, when Championship is Australian Open?
CREATE TABLE table_name_49 (surface VARCHAR,championship VARCHAR)
SELECT surface FROM table_name_49 WHERE championship = "australian open"
What was the fastest lap for Grand Prix dutch tt?
CREATE TABLE table_61285 ("Round" real,"Date" text,"Grand Prix" text,"Circuit" text,"Pole Position" text,"Fastest Lap" text,"Race Winner" text)
SELECT "Fastest Lap" FROM table_61285 WHERE "Grand Prix" = 'dutch tt'
How many times did Silas leave as a team manager?
CREATE TABLE table_29414946_3 (manner_of_departure VARCHAR,outgoing_manager VARCHAR)
SELECT COUNT(manner_of_departure) FROM table_29414946_3 WHERE outgoing_manager = "Silas"
Count the number of people of each sex who have a weight higher than 85, order y axis from low to high order.
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 real)
SELECT Sex, COUNT(*) FROM people WHERE Weight > 85 GROUP BY Sex ORDER BY COUNT(*)
What country has the t7 place, and player Peter Oosterhuis?
CREATE TABLE table_name_48 (country VARCHAR,place VARCHAR,player VARCHAR)
SELECT country FROM table_name_48 WHERE place = "t7" AND player = "peter oosterhuis"
What is the total tenure rank of the person with an uninterrupted time of 49 years, 349 days?
CREATE TABLE table_32512 ("Total tenure rank" real,"Uninterrupted rank" real,"Name" text,"State represented" text,"Total tenure time" text,"Uninterrupted time" text)
SELECT "Total tenure rank" FROM table_32512 WHERE "Uninterrupted time" = '49 years, 349 days'
How many votes do I receive per answer?. On average, how many upvotes do I receive for each answer I give?
CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModera...
WITH VotesOnPosts AS (SELECT v.Id AS VoteId, p.Id AS PostId, p.PostTypeId AS PostTypeId, p.OwnerUserId AS UserId, vt.Name AS VoteTypeName FROM Votes AS v INNER JOIN Posts AS p ON v.PostId = p.Id INNER JOIN VoteTypes AS vt ON v.VoteTypeId = vt.Id), Answers AS (SELECT OwnerUserId AS UserId, Id AS PostId FROM Posts WHERE ...
Next semester , what classes will Dr. James Grotberg teach ?
CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time,monday varchar,tuesday varchar,wednesday varchar,thursday varchar,friday varchar,saturday varchar,sunday varchar,has_final_project varchar,has_final_exam varchar,textbook varchar,class_address varch...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%James Grotberg%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.of...
which athlete had the fastest time for the 20km ?
CREATE TABLE table_204_712 (id number,"rank" number,"athlete" text,"nationality" text,"time" text,"notes" text)
SELECT "athlete" FROM table_204_712 ORDER BY "time" LIMIT 1
Who is the competitor with a downhill of more than 55, and 1st DQ run?
CREATE TABLE table_50574 ("Place" text,"Downhill" real,"Competitor" text,"1st run" text,"2nd run" text,"Points" text)
SELECT "Competitor" FROM table_50574 WHERE "Downhill" > '55' AND "1st run" = 'dq'
Scatter plot to show classroom on x axis and grade on y axis.
CREATE TABLE teachers (LastName TEXT,FirstName TEXT,Classroom INTEGER)CREATE TABLE list (LastName TEXT,FirstName TEXT,Grade INTEGER,Classroom INTEGER)
SELECT Classroom, Grade FROM list
What is footscray's away team score?
CREATE TABLE table_name_66 (away_team VARCHAR,home_team VARCHAR)
SELECT away_team AS score FROM table_name_66 WHERE home_team = "footscray"
Name the kickoff for rheinstadion
CREATE TABLE table_27690037_2 (kickoff VARCHAR,game_site VARCHAR)
SELECT kickoff FROM table_27690037_2 WHERE game_site = "Rheinstadion"
What's the elevator of Jacques D'euse?
CREATE TABLE table_63142 ("Elector" text,"Nationality" text,"Faction" text,"Elevated" text,"Elevator" text)
SELECT "Elevator" FROM table_63142 WHERE "Elector" = 'jacques d''euse'
For each director, return the director's name together with the highest rating among all of their movies and ignore movies whose director is NULL Could you plot the result with a bar chart?, and I want to list x-axis in ascending order.
CREATE TABLE Rating (rID int,mID int,stars int,ratingDate date)CREATE TABLE Movie (mID int,title text,year int,director text)CREATE TABLE Reviewer (rID int,name text)
SELECT director, MAX(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director <> "null" GROUP BY director ORDER BY director
Votes: Biggest downvoters among top users.
CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,Text text,ContentLicense text)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE FlagTypes (Id number,Na...
SELECT Id AS "user_link", Reputation, UpVotes, DownVotes, ROUND(CAST(100 * DownVotes AS FLOAT) / (UpVotes + DownVotes), 1) AS "%_of_downvotes" FROM Users WHERE Reputation > 3000 AND DownVotes > 0 ORDER BY 'downvotes' DESC
What is the unformatted capacity per side if the size is 8in?
CREATE TABLE table_64893 ("Size" text,"Density" text,"Tracks" real,"Coercivity" text,"Unformatted capacity per side" text)
SELECT "Unformatted capacity per side" FROM table_64893 WHERE "Size" = '8in'
Which state has the most customers?
CREATE TABLE customers (customer_id number,customer_type_code text,address_line_1 text,address_line_2 text,town_city text,state text,email_address text,phone_number text)CREATE TABLE complaints (complaint_id number,product_id number,customer_id number,complaint_outcome_code text,complaint_status_code text,complaint_typ...
SELECT state FROM customers GROUP BY state ORDER BY COUNT(*) LIMIT 1
For those records from the products and each product's manufacturer, a scatter chart shows the correlation between price and revenue , and group by attribute headquarter.
CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)
SELECT Price, Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter
Who was the game played against on October 9, 1966?
CREATE TABLE table_12995 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text)
SELECT "Opponent" FROM table_12995 WHERE "Date" = 'october 9, 1966'
renal insufficiency ( serum creatinine > 1.5 mg / dl for male ; > 1.2 mg / dl for female )
CREATE TABLE table_train_254 ("id" int,"gender" string,"systolic_blood_pressure_sbp" int,"heart_disease" bool,"hgba1c" float,"renal_disease" bool,"creatinine_clearance_cl" float,"diastolic_blood_pressure_dbp" int,"diabetes" bool,"hypertension" bool,"fasting_glucose" int,"NOUSE" float)
SELECT * FROM table_train_254 WHERE renal_disease = 1 OR ((creatinine_clearance_cl > 1.5 AND gender = 'male') OR (creatinine_clearance_cl > 1.5 AND gender = 'female'))
Return a bar chart about the distribution of All_Games and All_Games_Percent , I want to display total number in descending order.
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 (School_ID int,School text,Location text,Founded real,Affiliation text,En...
SELECT All_Games, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent DESC