instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
How many vacators have October 22, 1808 as date successor seated?
CREATE TABLE table_73399 ("District" text,"Vacator" text,"Reason for change" text,"Successor" text,"Date successor seated" text)
SELECT COUNT("Vacator") FROM table_73399 WHERE "Date successor seated" = 'October 22, 1808'
Give me a histogram for how many climbers are from each country?, and could you rank in descending by the x axis?
CREATE TABLE mountain (Mountain_ID int,Name text,Height real,Prominence real,Range text,Country text)CREATE TABLE climber (Climber_ID int,Name text,Country text,Time text,Points real,Mountain_ID int)
SELECT Country, COUNT(*) FROM climber GROUP BY Country ORDER BY Country DESC
What is Minister, when Portfolio is 'Minister of Pubblic Administration', and when Took Office is '14 November 2002'?
CREATE TABLE table_name_97 (minister VARCHAR,portfolio VARCHAR,took_office VARCHAR)
SELECT minister FROM table_name_97 WHERE portfolio = "minister of pubblic administration" AND took_office = "14 november 2002"
Which capital has a Hangul of ?
CREATE TABLE table_name_97 (capital VARCHAR,hangul_chosongul VARCHAR)
SELECT capital FROM table_name_97 WHERE hangul_chosongul = "경상남도"
Visualize a bar chart for what is average age for different job title?, and display by the Y-axis from high to low.
CREATE TABLE Person (name varchar(20),age INTEGER,city TEXT,gender TEXT,job TEXT)CREATE TABLE PersonFriend (name varchar(20),friend varchar(20),year INTEGER)
SELECT job, AVG(age) FROM Person GROUP BY job ORDER BY AVG(age) DESC
How many enrolment students in each day? Return a bar chart binning date of enrolment by weekday, rank the number of date of enrolment from high to low 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 Course_Authors_and_Tutors (author_id INTEGER,author_tutor_ATB VARCHAR(3),login_name VARCHAR(40),password VARCHAR(40),personal_name VARCHAR(80),middle_na...
SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment ORDER BY COUNT(date_of_enrolment) DESC
what is maximum age of patients whose insurance is government and days of hospital stay is 3?
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 MAX(demographic.age) FROM demographic WHERE demographic.insurance = "Government" AND demographic.days_stay = "3"
how long was the first hospital stay of patient 65883?
CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,chartt...
SELECT STRFTIME('%j', admissions.dischtime) - STRFTIME('%j', admissions.admittime) FROM admissions WHERE admissions.subject_id = 65883 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1
How many times did the Wildcats play a game 11 regardless of points scored?
CREATE TABLE table_24105 ("Game" real,"Date" text,"Opponent" text,"Result" text,"Wildcats points" real,"Opponents" real,"Record" text)
SELECT COUNT("Wildcats points") FROM table_24105 WHERE "Game" = '11'
What is the lowest total medals when there were 0 gold medals, 0 silver medals, and more than 1 bronze medal?
CREATE TABLE table_name_77 (total INTEGER,gold VARCHAR,bronze VARCHAR,silver VARCHAR)
SELECT MIN(total) FROM table_name_77 WHERE bronze > 1 AND silver = 0 AND gold < 0
What is the listed Status that has the Province of Ontario and Rank of 86?
CREATE TABLE table_75663 ("Rank" real,"Municipality" text,"Province" text,"Status" text,"Area (km 2)" real)
SELECT "Status" FROM table_75663 WHERE "Province" = 'ontario' AND "Rank" = '86'
Draw a bar chart about the distribution of Date_of_Birth and Height .
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
What opera has 19.87% as the firefox?
CREATE TABLE table_79302 ("Period" text,"Internet Explorer" text,"Firefox" text,"Chrome" text,"Safari" text,"Opera" text,"Other" text)
SELECT "Opera" FROM table_79302 WHERE "Firefox" = '19.87%'
If the longitude is 158.091 e, what is the depth?
CREATE TABLE table_25675509_1 (depth VARCHAR,longitude VARCHAR)
SELECT depth FROM table_25675509_1 WHERE longitude = "158.091° E"
Give me the comparison about School_ID over the Team_Name , order X-axis from high to low 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 Team_Name, School_ID FROM basketball_match ORDER BY Team_Name DESC
What is the time of Max Biaggi with more than 2 grids, 20 laps?
CREATE TABLE table_78577 ("Rider" text,"Bike" text,"Laps" real,"Time" text,"Grid" real)
SELECT "Time" FROM table_78577 WHERE "Grid" > '2' AND "Laps" = '20' AND "Rider" = 'max biaggi'
what is the number of patients who prefer spanish language?
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 WHERE demographic.language = "SPAN"
When the time is 1:36.30 what shows as winner?
CREATE TABLE table_1360997_3 (winner_2nd VARCHAR,time VARCHAR)
SELECT winner_2nd FROM table_1360997_3 WHERE time = "1:36.30"
what is diagnoses short title and diagnoses long title of subject id 18077?
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 diagnoses.short_title, diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "18077"
When the Nokia corporation had an accreditation level of joyn, what was the accreditation type?
CREATE TABLE table_name_5 (accreditation_type VARCHAR,accreditation_level VARCHAR,company_name VARCHAR)
SELECT accreditation_type FROM table_name_5 WHERE accreditation_level = "joyn" AND company_name = "nokia corporation"
How much average Finish has Starts of 9, and a Top 10 smaller than 0?
CREATE TABLE table_44981 ("Year" real,"Starts" real,"Wins" real,"Top 5" real,"Top 10" real,"Poles" real,"Avg. Start" real,"Avg. Finish" real,"Winnings" text,"Position" text)
SELECT SUM("Avg. Finish") FROM table_44981 WHERE "Starts" = '9' AND "Top 10" < '0'
when did patient 022-87224 receive the last lab test?
CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname te...
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 = '022-87224')) ORDER BY lab.labresulttime DESC LIMIT 1
what are the top four most frequent diagnoses that patients have received in the same month after receiving a replace trach tube?
CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)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,ethnicit...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, 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 = admissi...
What was John Watson's total laps with a grid of less than 7?
CREATE TABLE table_name_21 (laps VARCHAR,driver VARCHAR,grid VARCHAR)
SELECT COUNT(laps) FROM table_name_21 WHERE driver = "john watson" AND grid < 7
Who was the pitcher on June 8, 1961?
CREATE TABLE table_name_88 (pitcher VARCHAR,date VARCHAR)
SELECT pitcher FROM table_name_88 WHERE date = "june 8, 1961"
give the number of patients whose primary disease is st elevated myocardial infarction/ cardiac cath and procedure short title is cont inv mec ven less than 96 hours.
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" AND procedures.short_title = "Cont inv mec ven <96 hrs"
For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of first_name and manager_id , and show by the X in ascending.
CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decima...
SELECT FIRST_NAME, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY FIRST_NAME
What are the names of all the playlists?
CREATE TABLE invoice_lines (id number,invoice_id number,track_id number,unit_price number,quantity number)CREATE TABLE employees (id number,last_name text,first_name text,title text,reports_to number,birth_date time,hire_date time,address text,city text,state text,country text,postal_code text,phone text,fax text,email...
SELECT name FROM playlists
tell me the daily maximum respiration of patient 005-12192 since 12/26/2102.
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 MAX(vitalperiodic.respiration) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-12192')) AND NOT vitalperiodic.respiration IS ...
What was the results for the candidates listed as bart gordon (d) 76.5% wallace embry (r) 23.5%?
CREATE TABLE table_18247 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text)
SELECT "Result" FROM table_18247 WHERE "Candidates" = 'Bart Gordon (D) 76.5% Wallace Embry (R) 23.5%'
What location had 1:59:12 in time?
CREATE TABLE table_51749 ("Year" real,"Athlete" text,"Nation" text,"Time" text,"Location" text)
SELECT "Location" FROM table_51749 WHERE "Time" = '1:59:12'
When salt of this sea is the english title who is the director?
CREATE TABLE table_28781 ("Year (Ceremony)" text,"English title" text,"Arabic title" text,"Director" text,"Result" text)
SELECT "Director" FROM table_28781 WHERE "English title" = 'Salt of this Sea'
What's the bus width (in bit) of the model whose core is 650 MHz?
CREATE TABLE table_22857 ("Model" text,"Year" text,"Code name" text,"Fab (nm)" real,"Bus interface" text,"Transistor count (Millions)" real,"Memory max (MiB)" text,"Core (MHz)" real,"Memory (MHz)" text,"Type" text,"Bus Width (Bit)" real,"DirectX" text,"Shader Model" text,"OpenGL" text,"Maximum Resolution" text,"IceQ4 C...
SELECT COUNT("Bus Width ( Bit )") FROM table_22857 WHERE "Core ( MHz )" = '650'
What Social AO has a President of harm van leeuwen?
CREATE TABLE table_61961 ("President" text,"Treasurer" text,"Secretary" text,"Social AO" text,"Academic AO" text,"Internal CO" text,"External CO" text)
SELECT "Social AO" FROM table_61961 WHERE "President" = 'harm van leeuwen'
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, draw a bar chart about the distribution of hire_date and the average of salary bin hire_date by time, sort by the Y-axis in descending.
CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,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 varchar(2))CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPART...
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(SALARY) DESC
When n is 3, what are all the coaliton parties?
CREATE TABLE table_21422977_1 (coalition_parties VARCHAR,nº VARCHAR)
SELECT coalition_parties FROM table_21422977_1 WHERE nº = 3
What is the relationship between Clean_Jerk and Total ?
CREATE TABLE body_builder (Body_Builder_ID int,People_ID int,Snatch real,Clean_Jerk real,Total real)CREATE TABLE people (People_ID int,Name text,Height real,Weight real,Birth_Date text,Birth_Place text)
SELECT Clean_Jerk, Total FROM body_builder
Which state has a Term in office of 1984 1996, a Party of labor, and a Member of robert tickner?
CREATE TABLE table_name_48 (state VARCHAR,member VARCHAR,term_in_office VARCHAR,party VARCHAR)
SELECT state FROM table_name_48 WHERE term_in_office = "1984–1996" AND party = "labor" AND member = "robert tickner"
Which Tracking Method has a Latest stable release of n/a, and a Price in USD of from $202/month?
CREATE TABLE table_8260 ("Name" text,"Company" text,"Tracking Method" text,"Latest stable release" text,"Price in USD" text)
SELECT "Tracking Method" FROM table_8260 WHERE "Latest stable release" = 'n/a' AND "Price in USD" = 'from $202/month'
What is the unit price of the tune 'Fast As a Shark'?
CREATE TABLE employees (id number,last_name text,first_name text,title text,reports_to number,birth_date time,hire_date time,address text,city text,state text,country text,postal_code text,phone text,fax text,email text)CREATE TABLE albums (id number,title text,artist_id number)CREATE TABLE customers (id number,first_n...
SELECT unit_price FROM tracks WHERE name = "Fast As a Shark"
how many patients are admitted in emergency room and diagnosed primarily for transient ischemic attack?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.diagnosis = "TRANSIENT ISCHEMIC ATTACK"
What is the lowest average parish size with 47.2% of adherents and 4,936 regular attendees?
CREATE TABLE table_32871 ("Adherents" real,"Regular Attendees" real,"% of adherents" text,"Monasteries" real,"Parishes" real,"Average Parish Size" real)
SELECT MIN("Average Parish Size") FROM table_32871 WHERE "% of adherents" = '47.2%' AND "Regular Attendees" > '4,936'
On what surface was the tournament with opponents kathleen horvath marcella mesker in the finals?
CREATE TABLE table_11598 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Partner" text,"Opponents in the final" text,"Score in the final" text)
SELECT "Surface" FROM table_11598 WHERE "Opponents in the final" = 'kathleen horvath marcella mesker'
If grid is 2, what is the minimum fin. pos number?
CREATE TABLE table_21571 ("Fin. Pos" real,"Car No." real,"Driver" text,"Team" text,"Laps" real,"Time/Retired" text,"Grid" real,"Laps Led" real,"Points" text)
SELECT MIN("Fin. Pos") FROM table_21571 WHERE "Grid" = '2'
What is the total number of gold medals of slovakia, which has less than 1 silver medal?
CREATE TABLE table_8307 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT COUNT("Gold") FROM table_8307 WHERE "Silver" < '1' AND "Nation" = 'slovakia'
is there any results of the microbiology test carried out for patient 031-1337 in 05/this year?
CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE medication (medicationid number,patient...
SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-1337')) AND DATETIME(microlab.culturetakentime, 'start of year') = DATETIM...
Name the international tourist arrivals for arrivals 2011 for 8.1 million
CREATE TABLE table_1109 ("Rank" real,"Country" text,"International tourist arrivals (2011)" text,"International tourist arrivals (2010)" text,"Change (2010 to 2011)" text,"Change (2009 to 2010)" text)
SELECT "International tourist arrivals (2010)" FROM table_1109 WHERE "International tourist arrivals (2011)" = '8.1 million'
saint lucia has how many districts with a population density below 200 persons per square kilometer ?
CREATE TABLE table_203_212 (id number,"#" number,"district" text,"land area (km2)" number,"population\n(2010 census)" number,"density (persons/km2)" number)
SELECT COUNT("district") FROM table_203_212 WHERE "density (persons/km2)" < 200
Name the average week for result of l 28 17
CREATE TABLE table_38644 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Game site" text,"Attendance" real)
SELECT AVG("Week") FROM table_38644 WHERE "Result" = 'l 28–17'
Show the names and heights of buildings with at least two institutions founded after 1880 Plot them as bar chart, and I want to show Y-axis in descending order.
CREATE TABLE Institution (Institution_id text,Institution text,Location text,Founded real,Type text,Enrollment int,Team text,Primary_Conference text,building_id text)CREATE TABLE protein (common_name text,protein_name text,divergence_from_human_lineage real,accession_number text,sequence_length real,sequence_identity_t...
SELECT Name, Height_feet FROM building AS T1 JOIN Institution AS T2 ON T1.building_id = T2.building_id WHERE T2.Founded > 1880 ORDER BY Height_feet DESC
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of founder and the average of code , and group by attribute founder, rank y-axis in asc 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 T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T1.Code
When the girls doubles is ayu pratiwi anggi widia what is the boys doubles?
CREATE TABLE table_19248 ("Year" real,"Boys singles" text,"Girls singles" text,"Boys doubles" text,"Girls doubles" text,"Mixed doubles" text)
SELECT "Boys doubles" FROM table_19248 WHERE "Girls doubles" = 'Ayu Pratiwi Anggi Widia'
Draw a bar chart about the distribution of ACC_Road and the amount of ACC_Road , and group by attribute ACC_Road, and order by the ACC_Road in desc.
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 ACC_Road, COUNT(ACC_Road) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road DESC
What is Equipment, when Position is greater than 28, and when Points is greater than 10?
CREATE TABLE table_name_51 (equipment VARCHAR,position VARCHAR,points VARCHAR)
SELECT equipment FROM table_name_51 WHERE position > 28 AND points > 10
when did patient 007-2498 last receive a diagnosis of encephalopathy since 5 years ago?
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 medication (medicationid number,patientunitstayid number,drugname text,dos...
SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-2498')) AND diagnosis.diagnosisname = 'encephalopathy' AND DA...
On which dates was the value of Bada 0.05%?
CREATE TABLE table_11381701_3 (date VARCHAR,bada VARCHAR)
SELECT date FROM table_11381701_3 WHERE bada = "0.05%"
Which Year has a Date of 5 6 february?
CREATE TABLE table_61900 ("Year" real,"Edition" text,"Round" text,"Date" text,"Location" text,"Surface" text,"Against" text,"Opponent(s)" text,"Score" text,"Result" text)
SELECT AVG("Year") FROM table_61900 WHERE "Date" = '5–6 february'
Name the erin and jake for week 4
CREATE TABLE table_2311410_5 (erin_and_jake VARCHAR,week VARCHAR)
SELECT erin_and_jake FROM table_2311410_5 WHERE week = 4
Name the nationality of the player with an overall of 74
CREATE TABLE table_51527 ("Round" real,"Overall" real,"Player" text,"Nationality" text,"Club team" text)
SELECT "Nationality" FROM table_51527 WHERE "Overall" = '74'
Show the number of headquarters from each headquarters
CREATE TABLE employment (Company_ID int,People_ID int,Year_working int)CREATE TABLE company (Company_ID real,Name text,Headquarters text,Industry text,Sales_in_Billion real,Profits_in_Billion real,Assets_in_Billion real,Market_Value_in_Billion real)CREATE TABLE people (People_ID int,Age int,Name text,Nationality text,G...
SELECT Headquarters, COUNT(Headquarters) FROM company GROUP BY Headquarters
What are the LOA (metres) of boat with sail number M10?
CREATE TABLE table_23952 ("Position" real,"Race number" text,"Sail number" text,"Yacht" text,"State/country" text,"Yacht type" text,"LOA (Metres)" text,"Skipper" text,"Elapsed time d:hh:mm:ss" text)
SELECT "LOA (Metres)" FROM table_23952 WHERE "Sail number" = 'M10'
What venue were the 1986 Asian games resulting in 2-0 played at?
CREATE TABLE table_name_44 (venue VARCHAR,competition VARCHAR,result VARCHAR)
SELECT venue FROM table_name_44 WHERE competition = "1986 asian games" AND result = "2-0"
When is every date that control site condition or owner is machine shop on Martin Dr.?
CREATE TABLE table_24899 ("Code & location" text,"Missile Type" text,"Defense Area" text,"Dates" text,"Control Site condition/owner" text,"Launch Site condition/owner" text)
SELECT "Dates" FROM table_24899 WHERE "Control Site condition/owner" = 'machine shop on Martin Dr.'
how many city with name being providence tower
CREATE TABLE table_13463790_2 (city VARCHAR,name VARCHAR)
SELECT COUNT(city) FROM table_13463790_2 WHERE name = "Providence Tower"
What's Bulgaria's lane?
CREATE TABLE table_65129 ("Heat" real,"Lane" real,"Name" text,"Nationality" text,"Time" text)
SELECT AVG("Lane") FROM table_65129 WHERE "Nationality" = 'bulgaria'
What is the NFL club of the cornerback player with a pick greater than 63?
CREATE TABLE table_name_34 (nfl_club VARCHAR,pick VARCHAR,position VARCHAR)
SELECT nfl_club FROM table_name_34 WHERE pick > 63 AND position = "cornerback"
What was the outcome in mari andersson's tournament?
CREATE TABLE table_name_41 (outcome VARCHAR,opponent VARCHAR)
SELECT outcome FROM table_name_41 WHERE opponent = "mari andersson"
Find the total number of students in each department. Show bar chart.
CREATE TABLE student (ID varchar(5),name varchar(20),dept_name varchar(20),tot_cred numeric(3,0))CREATE TABLE advisor (s_ID varchar(5),i_ID varchar(5))CREATE TABLE instructor (ID varchar(5),name varchar(20),dept_name varchar(20),salary numeric(8,2))CREATE TABLE course (course_id varchar(8),title varchar(50),dept_name v...
SELECT dept_name, COUNT(*) FROM student GROUP BY dept_name
the subject has a recent history ( within 2 years ) of alcohol or substance abuse / dependence.
CREATE TABLE table_train_94 ("id" int,"mini_mental_state_examination_mmse" int,"substance_dependence" bool,"psychiatric_disease" bool,"modified_hachinski_ischemia_scale" int,"smoking" bool,"alcohol_abuse" bool,"NOUSE" float)
SELECT * FROM table_train_94 WHERE alcohol_abuse = 1 OR substance_dependence = 1 OR substance_dependence = 1
What is the Date of Shooter New Targets from 1989's record?
CREATE TABLE table_name_39 (date VARCHAR,shooter VARCHAR)
SELECT date FROM table_name_39 WHERE shooter = "new targets from 1989"
What are the song titles on the album 'A Kiss Before You Go: Live in Hamburg'?
CREATE TABLE instruments (songid number,bandmateid number,instrument text)CREATE TABLE tracklists (albumid number,position number,songid number)CREATE TABLE band (id number,firstname text,lastname text)CREATE TABLE performance (songid number,bandmate number,stageposition text)CREATE TABLE albums (aid number,title text,...
SELECT T3.title FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE T1.title = "A Kiss Before You Go: Live in Hamburg"
What were the goals on 3/10/97?
CREATE TABLE table_78212 ("Date" text,"Competition" text,"Venue" text,"Result" text,"Score" text,"Tries" text,"Goals" text)
SELECT "Goals" FROM table_78212 WHERE "Date" = '3/10/97'
what is the debut when the play er is radoslava topalova and the years played is less than 2?
CREATE TABLE table_name_33 (debut INTEGER,player VARCHAR,years_played VARCHAR)
SELECT AVG(debut) FROM table_name_33 WHERE player = "radoslava topalova" AND years_played < 2
What is the average age of captains in different classes?, order by the bars from high to low.
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)
SELECT Class, AVG(age) FROM captain GROUP BY Class ORDER BY Class DESC
What is the score of the match played on a hard surface with an opponent in the final of Elena Likhovtseva?
CREATE TABLE table_name_2 (score VARCHAR,surface VARCHAR,opponent_in_the_final VARCHAR)
SELECT score FROM table_name_2 WHERE surface = "hard" AND opponent_in_the_final = "elena likhovtseva"
A bar chart about the number of end dates for incidents with incident type code 'NOISE' and bin by month.
CREATE TABLE Addresses (address_id INTEGER,line_1 VARCHAR(120),line_2 VARCHAR(120),line_3 VARCHAR(120),city VARCHAR(80),zip_postcode VARCHAR(20),state_province_county VARCHAR(50),country VARCHAR(50),other_address_details VARCHAR(255))CREATE TABLE Behavior_Incident (incident_id INTEGER,incident_type_code VARCHAR(10),stu...
SELECT date_incident_end, COUNT(date_incident_end) FROM Behavior_Incident WHERE incident_type_code = "NOISE"
Test - top 20 viewcount.
CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUser...
SELECT Id AS "post_link", Score, Tags, OwnerUserId, OwnerDisplayName, ParentId FROM Posts ORDER BY ViewCount DESC LIMIT 20
What was the production in 2002-03 for the commodity that produced 1,725 in 2001-02?
CREATE TABLE table_4572 ("Commodity" text,"2001-02" text,"2002-03" text,"2003-04" text,"2004-05" text,"2005-06" text,"2006-07" text)
SELECT "2002-03" FROM table_4572 WHERE "2001-02" = '1,725'
Name the race name for june 6
CREATE TABLE table_22669375_1 (race_name VARCHAR,date VARCHAR)
SELECT race_name FROM table_22669375_1 WHERE date = "June 6"
What were the points for a team that 414 points against?
CREATE TABLE table_37314 ("Club" text,"Played" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Tries for" text,"Tries against" text,"Try bonus" text)
SELECT "Points for" FROM table_37314 WHERE "Points against" = '414'
How many votes did Other receive where Bush received less than 154,204 votes, and Kerry received 41.7% and more than 98,066 votes?
CREATE TABLE table_15329 ("County" text,"Kerry %" text,"Kerry #" real,"Bush %" text,"Bush #" real,"Others %" text,"Others #" real)
SELECT COUNT("Others #") FROM table_15329 WHERE "Bush #" < '154,204' AND "Kerry %" = '41.7%' AND "Kerry #" > '98,066'
Which driver for Bob Holden Motors has fewer than 36 points and placed 7 in race 1?
CREATE TABLE table_76670 ("Driver" text,"Team" text,"Race 1" text,"Race 2" text,"Points" real)
SELECT "Driver" FROM table_76670 WHERE "Points" < '36' AND "Team" = 'bob holden motors' AND "Race 1" = '7'
What are the names of stations that are located in Palo Alto city but have never been the ending point of trips more than 100 times?
CREATE TABLE station (id number,name text,lat number,long number,dock_count number,city text,installation_date text)CREATE TABLE weather (date text,max_temperature_f number,mean_temperature_f number,min_temperature_f number,max_dew_point_f number,mean_dew_point_f number,min_dew_point_f number,max_humidity number,mean_h...
SELECT name FROM station WHERE city = "Palo Alto" EXCEPT SELECT end_station_name FROM trip GROUP BY end_station_name HAVING COUNT(*) > 100
provide the number of patients whose ethnicity is asian and drug name is talc?
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "ASIAN" AND prescriptions.drug = "Talc"
Show the number of courses for each instructor in a bar chart.
CREATE TABLE COURSE (CRS_CODE varchar(10),DEPT_CODE varchar(10),CRS_DESCRIPTION varchar(35),CRS_CREDIT float(8))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 var...
SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY EMP_FNAME
how many pick# does the chivas usa mls team have
CREATE TABLE table_29626583_1 (pick__number INTEGER,mls_team VARCHAR)
SELECT MAX(pick__number) FROM table_29626583_1 WHERE mls_team = "Chivas USA"
what were the first potassium from patient 29309 since 01/2103?
CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod 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 outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,chartt...
SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29309) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'potassium') AND STRFTIME('%y-%m', labevents.charttime) >= '2103-01' ORDER BY lab...
What is the lowest Goals, when Played is greater than 30?
CREATE TABLE table_50767 ("Position" real,"Played" real,"Points" real,"Wins" real,"Draws" real,"Losses" real,"Goals for" real,"Goals against" real,"Goal Difference" real)
SELECT MIN("Goals for") FROM table_50767 WHERE "Played" > '30'
How many students taking a course who received an A or C? Group by students' last name with a bar chart, and display by the STU_LNAME in desc.
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 PROFESSOR (EMP_NUM int,DEPT_CODE varchar(10),PROF_OFFICE varchar(50),PROF_EXTENSION varchar(4),PROF_HIGH_DEGREE varchar(5))CREATE TABLE CLASS (...
SELECT STU_LNAME, COUNT(STU_LNAME) FROM STUDENT AS T1 JOIN ENROLL AS T2 ON T1.STU_NUM = T2.STU_NUM WHERE T2.ENROLL_GRADE = 'C' OR T2.ENROLL_GRADE = 'A' GROUP BY STU_LNAME ORDER BY STU_LNAME DESC
What is the zan 1 that has 11 as the nor 1?
CREATE TABLE table_name_34 (zan_1 VARCHAR,nor_1 VARCHAR)
SELECT zan_1 FROM table_name_34 WHERE nor_1 = "11"
How many primers annulus colors were there when the color of the bullet tip was white?
CREATE TABLE table_16083 ("Headstamp ID" text,"Primer Annulus Color" text,"Bullet Tip Color" text,"Other Features" text,"Functional Type" text)
SELECT COUNT("Primer Annulus Color") FROM table_16083 WHERE "Bullet Tip Color" = 'White'
How many values for points have Sophia Witherspoon as the player?
CREATE TABLE table_25352324_5 (points VARCHAR,player VARCHAR)
SELECT COUNT(points) FROM table_25352324_5 WHERE player = "Sophia Witherspoon"
What episode number of the series is 'open water'?
CREATE TABLE table_30090 ("No. in series" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"U.S. viewers (millions)" text)
SELECT "No. in series" FROM table_30090 WHERE "Title" = 'Open Water'
How long is the total lesson time taught by staff with first name as Janessa and last name as Sawayn?
CREATE TABLE addresses (address_id number,line_1_number_building text,city text,zip_postcode text,state_province_county text,country text)CREATE TABLE customers (customer_id number,customer_address_id number,customer_status_code text,date_became_customer time,date_of_birth time,first_name text,last_name text,amount_out...
SELECT SUM(lesson_time) FROM lessons AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn"
Please draw a bar chart to show the total number of different color.
CREATE TABLE mountain (id int,name text,Height real,Prominence real,Range text,Country text)CREATE TABLE camera_lens (id int,brand text,name text,focal_length_mm real,max_aperture real)CREATE TABLE photos (id int,camera_lens_id int,mountain_id int,color text,name text)
SELECT color, COUNT(color) FROM photos GROUP BY color
What is the date of the match where vampiro was the winner in Mexico City?
CREATE TABLE table_64581 ("Wager" text,"Winner" text,"Loser" text,"Location" text,"Date" text)
SELECT "Date" FROM table_64581 WHERE "Location" = 'mexico city' AND "Winner" = 'vampiro'
how many games was loss ?
CREATE TABLE table_204_833 (id number,"game" number,"date" text,"team" text,"score" text,"high points" text,"high rebounds" text,"high assists" text,"location\nattendance" text,"record" text)
SELECT COUNT(*) FROM table_204_833 WHERE "score" = 'l'
When the Runners-Up is larger than 0, what's the sum of winners?
CREATE TABLE table_50336 ("Team" text,"Winners" real,"Runners-Up" real,"Years Won" text,"Years Runner-Up" text)
SELECT SUM("Winners") FROM table_50336 WHERE "Runners-Up" > '0'
how many parishes had fr frank thorpe as their parish priest ?
CREATE TABLE table_203_36 (id number,"parish" text,"locality" text,"parish priest" text,"founded" number,"closed" number)
SELECT COUNT("parish") FROM table_203_36 WHERE "parish priest" = 'fr frank thorpe'
Which Australian has British of s?
CREATE TABLE table_78709 ("Ending" text,"American" text,"British" text,"Australian" text,"Examples" text)
SELECT "Australian" FROM table_78709 WHERE "British" = 'ɒs'