instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What was the total attendance for a result of 7-23 before 1960?
CREATE TABLE table_name_19 (attendance INTEGER,result VARCHAR,year VARCHAR)
SELECT SUM(attendance) FROM table_name_19 WHERE result = "7-23" AND year < 1960
What is the constructor where the circuit is Silverstone?
CREATE TABLE table_name_8 (constructor VARCHAR,circuit VARCHAR)
SELECT constructor FROM table_name_8 WHERE circuit = "silverstone"
Which population has a GDP (nominal) of $6.4 billion?
CREATE TABLE table_57856 ("Country" text,"Population" text,"Area (km\u00b2)" text,"GDP (nominal)" text,"GDP per capita (nominal)" text)
SELECT "Population" FROM table_57856 WHERE "GDP (nominal)" = '$6.4 billion'
When did the Indians play a game with a record of 28-41?
CREATE TABLE table_5970 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Record" text)
SELECT "Date" FROM table_5970 WHERE "Record" = '28-41'
What is the surface of the match with Brian Gottfried as the runner-up?
CREATE TABLE table_36732 ("Year" text,"Champion" text,"Runner-up" text,"Score" text,"Surface" text)
SELECT "Surface" FROM table_36732 WHERE "Runner-up" = 'brian gottfried'
What are the downloaded numbers and their release types?
CREATE TABLE tags (index number,id number,tag text)CREATE TABLE torrents (groupname text,totalsnatched number,artist text,groupyear number,releasetype text,groupid number,id number)
SELECT SUM(totalsnatched), releasetype FROM torrents GROUP BY releasetype
What is the Record with an attendance of more than 54,761, and a Result of loss?
CREATE TABLE table_41717 ("Date" text,"Opponent" text,"Result" text,"Score" text,"Record" text,"attendance" real)
SELECT "Record" FROM table_41717 WHERE "attendance" > '54,761' AND "Result" = 'loss'
Which City has the Bahawalpur Stags Team?
CREATE TABLE table_40577 ("Team" text,"City" text,"Inaugural season" text,"Final season" text,"Captain" text,"Coach" text)
SELECT "City" FROM table_40577 WHERE "Team" = 'bahawalpur stags'
Which Nationality has a Pick larger than 109, and a Round smaller than 5?
CREATE TABLE table_46044 ("Round" real,"Pick" real,"Player" text,"Position" text,"Nationality" text,"Club team" text)
SELECT "Nationality" FROM table_46044 WHERE "Pick" > '109' AND "Round" < '5'
Highest number of comments on a post.
CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId numbe...
SELECT 'site:///a/' + CAST(p.Id AS TEXT) + '/4918|' + CAST(p.Id AS TEXT) AS pLink, COUNT(*) AS cCount FROM Comments AS c LEFT JOIN Posts AS p ON c.PostId = p.Id GROUP BY p.Id HAVING '##limit?30##' <= COUNT(*) ORDER BY 2 DESC
what is the method for round 1 and the opponent is bobby mcmaster?
CREATE TABLE table_name_97 (method VARCHAR,round VARCHAR,opponent VARCHAR)
SELECT method FROM table_name_97 WHERE round = 1 AND opponent = "bobby mcmaster"
show me a list of flights from DENVER to BALTIMORE on UA for 8 3
CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE ground_service (city_code text,airport_code text,transport_type text,ground_fare int)CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE air...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND date_day.day_number = 3 AND date_day.month_number = 8 AND...
give me the number of patients whose diagnoses short title is backache nos and drug type is main?
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 procedures (subject_id text,hadm_id text,icd9_code text,sho...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Backache NOS" AND prescriptions.drug_type = "MAIN"
which of these countries was ranked next after yugoslavia ?
CREATE TABLE table_203_113 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number)
SELECT "nation" FROM table_203_113 WHERE "rank" = (SELECT "rank" FROM table_203_113 WHERE "nation" = 'yugoslavia') + 1
What is team 2 where the result is ICL world by 8 wickets?
CREATE TABLE table_17103566_1 (team_2 VARCHAR,result VARCHAR)
SELECT team_2 FROM table_17103566_1 WHERE result = "ICL World by 8 wickets"
The engine family MaxxForce 5 in the years produced 2007-current, have what cylinder layout?
CREATE TABLE table_28591 ("Engine Family" text,"Cylinder Layout" text,"Displacement(s)" text,"Injection type" text,"Years produced" text)
SELECT "Cylinder Layout" FROM table_28591 WHERE "Years produced" = '2007-current' AND "Engine Family" = 'MaxxForce 5'
What seed was California?
CREATE TABLE table_26423157_2 (seed VARCHAR,school VARCHAR)
SELECT seed FROM table_26423157_2 WHERE school = "California"
What is the location of the ivy club?
CREATE TABLE table_38394 ("Name" text,"Years of Operation" text,"Location" text,"Historical Photos" text,"Year Clubhouse Constructed" text,"Sign-in/Bicker" text,"Year co-ed" text)
SELECT "Location" FROM table_38394 WHERE "Name" = 'the ivy club'
Show me a bar chart for what are the different product names? What is the average product price for each of them?, order by the X-axis from low to high.
CREATE TABLE Customer_Orders (Order_ID INTEGER,Customer_ID INTEGER,Store_ID INTEGER,Order_Date DATETIME,Planned_Delivery_Date DATETIME,Actual_Delivery_Date DATETIME,Other_Order_Details VARCHAR(255))CREATE TABLE Ref_Service_Types (Service_Type_Code CHAR(15),Parent_Service_Type_Code CHAR(15),Service_Type_Description VARC...
SELECT Product_Name, AVG(Product_Price) FROM Products GROUP BY Product_Name ORDER BY Product_Name
I need the FCC info on the radio Frequency MHz 107.5?
CREATE TABLE table_name_64 (fcc_info VARCHAR,frequency_mhz VARCHAR)
SELECT fcc_info FROM table_name_64 WHERE frequency_mhz = 107.5
What is the status when sd is 15?
CREATE TABLE table_26218783_7 (status VARCHAR,sd VARCHAR)
SELECT status FROM table_26218783_7 WHERE sd = 15
What is the screen size and pixel amount of model p5000 when the dimensions are 98 64.5 41?
CREATE TABLE table_32080 ("Model" text,"Release date" text,"Sensor res.,size" text,"Lens(35mmequiv.) zoom,aperture" text,"Screen size,pixels" text,"Dimensions W\u00d7H\u00d7D (mm)" text,"Weight" text)
SELECT "Screen size,pixels" FROM table_32080 WHERE "Dimensions W\u00d7H\u00d7D (mm)" = '98×64.5×41' AND "Model" = 'p5000'
What week had a lower attendance than 51,423 but was still higher than the other weeks?
CREATE TABLE table_37952 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Game site" text,"Attendance" real)
SELECT MAX("Week") FROM table_37952 WHERE "Attendance" < '51,423'
Which round was Brian Elder taken in?
CREATE TABLE table_35055 ("Round" real,"Player" text,"Position" text,"Nationality" text,"College/Junior/Club Team" text)
SELECT MIN("Round") FROM table_35055 WHERE "Player" = 'brian elder'
How many lap two's did marco andretti do?
CREATE TABLE table_2756 ("Pos" text,"##" real,"Name" text,"Team" text,"Lap One" text,"Lap Two" text,"Lap Three" text,"Lap Four" text,"Total Time" text,"Avg. Speed" text)
SELECT COUNT("Lap Two") FROM table_2756 WHERE "Name" = 'Marco Andretti'
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, visualize a line chart about the change of employee_id over hire_date .
CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))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),EMAI...
SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
Name the circuit for darracq and name of cuban race
CREATE TABLE table_name_63 (circuit VARCHAR,winning_constructor VARCHAR,name VARCHAR)
SELECT circuit FROM table_name_63 WHERE winning_constructor = "darracq" AND name = "cuban race"
What was the average money for United States when Lanny Wadkins played?
CREATE TABLE table_name_94 (money___ INTEGER,country VARCHAR,player VARCHAR)
SELECT AVG(money___) AS $__ FROM table_name_94 WHERE country = "united states" AND player = "lanny wadkins"
Name the cfl team for steven turner
CREATE TABLE table_27275 ("Pick #" real,"CFL Team" text,"Player" text,"Position" text,"College" text)
SELECT "CFL Team" FROM table_27275 WHERE "Player" = 'Steven Turner'
What is Downstream, when Upstream is '384 kbit'?
CREATE TABLE table_50856 ("Internet Plan" text,"Downstream" text,"Upstream" text,"Bandwidth Included" text,"Price" text)
SELECT "Downstream" FROM table_50856 WHERE "Upstream" = '384 kbit'
Between November 25 30, 2008 the sellout rate was at 75%, indicating that the ration between shows to sellout was what?
CREATE TABLE table_24775 ("Dates (MDY)" text,"Gross Sales" text,"Tickets Sold / Available" text,"Shows / Sellout" text,"Sellout (%)" text)
SELECT "Shows / Sellout" FROM table_24775 WHERE "Sellout (%)" = '75%'
what was the name of the lab test that patient 59728 had received last until 02/2104?
CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid numbe...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 59728) AND STRFTIME('%y-%m', labevents.charttime) <= '2104-02' ORDER BY labevents.charttime DESC LIMIT 1)
For those products with a price between 60 and 120, what is the relationship between price and manufacturer , and group by attribute name?
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 Price, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120 GROUP BY Name
How many answers are there for a tag?.
CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE Comments (...
SELECT COUNT(p1.Id) FROM Posts AS p1 INNER JOIN PostTags AS pt ON pt.TagId = @TagId INNER JOIN Posts AS p2 ON p1.ParentId = p2.Id WHERE p1.PostTypeId = 2 AND pt.PostId = p2.Id
What is the length of the version from 2003?
CREATE TABLE table_name_3 (length VARCHAR,year VARCHAR)
SELECT length FROM table_name_3 WHERE year = 2003
Which episode was directed by Jeff Woolnough and written by Christopher Ambrose?
CREATE TABLE table_26824484_1 (title VARCHAR,directed_by VARCHAR,written_by VARCHAR)
SELECT title FROM table_26824484_1 WHERE directed_by = "Jeff Woolnough" AND written_by = "Christopher Ambrose"
For cities with a census of 74000 in 1920, what was their census in 1890?
CREATE TABLE table_23345 ("Rank" real,"City" text,"1890 census" text,"1910 census" real,"1920 census" real,"1930 census" real,"1940 census" real)
SELECT "1890 census" FROM table_23345 WHERE "1920 census" = '74000'
Can you give a histogram to compare the number of flights to each destination city?, show in asc by the x-axis.
CREATE TABLE aircraft (aid number(9,0),name varchar2(30),distance number(6,0))CREATE TABLE certificate (eid number(9,0),aid number(9,0))CREATE TABLE flight (flno number(4,0),origin varchar2(20),destination varchar2(20),distance number(6,0),departure_date date,arrival_date date,price number(7,2),aid number(9,0))CREATE T...
SELECT destination, COUNT(destination) FROM flight GROUP BY destination ORDER BY destination
known bleeding diathesis or dyscrasia
CREATE TABLE table_train_197 ("id" int,"dyscrasia" bool,"gender" string,"bleeding" int,"hemoglobin_a1c_hba1c" float,"diabetic" string,"body_mass_index_bmi" float,"age" float,"NOUSE" float)
SELECT * FROM table_train_197 WHERE bleeding = 1 OR dyscrasia = 1
Are there any Teams after 1997?
CREATE TABLE table_name_21 (team VARCHAR,year INTEGER)
SELECT team FROM table_name_21 WHERE year > 1997
What is the Set 1 with a Score with 3 2?
CREATE TABLE table_name_96 (set_1 VARCHAR,score VARCHAR)
SELECT set_1 FROM table_name_96 WHERE score = "3–2"
Before taking SWC 200 , what are some other courses that might be useful to take ?
CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,entered_as varchar,admit_term int,predicted_graduation_...
SELECT DISTINCT advisory_requirement FROM course WHERE department = 'SWC' AND number = 200
What is the season where the episode 'when worlds collide' was shown?
CREATE TABLE table_72256 ("Series #" real,"Season #" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text)
SELECT MAX("Season #") FROM table_72256 WHERE "Title" = 'When Worlds Collide'
Tell me the pole position for graham hill the fastest lap and winning driver of him on 30 may
CREATE TABLE table_10967 ("Race" text,"Circuit" text,"Date" text,"Pole position" text,"Fastest lap" text,"Winning driver" text,"Constructor" text,"Tyre" text,"Report" text)
SELECT "Pole position" FROM table_10967 WHERE "Fastest lap" = 'graham hill' AND "Winning driver" = 'graham hill' AND "Date" = '30 may'
how many patients whose diagnoses short title is chr syst/diastl hrt fail?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Chr syst/diastl hrt fail"
What are the mm dimensions of the Plustek Mobileoffice D28 Corporate?
CREATE TABLE table_16409745_1 (dimensions__mm_ VARCHAR,product VARCHAR)
SELECT dimensions__mm_ FROM table_16409745_1 WHERE product = "Plustek MobileOffice D28 Corporate"
What is the dage of catalog asw 28033?
CREATE TABLE table_61514 ("Region" text,"Date" text,"Label" text,"Format(s)" text,"Catalog" text)
SELECT "Date" FROM table_61514 WHERE "Catalog" = 'asw 28033'
How many females are in the network?
CREATE TABLE person (name text,age number,city text,gender text,job text)CREATE TABLE personfriend (name text,friend text,year number)
SELECT COUNT(*) FROM person WHERE gender = 'female'
find out the number of patients who have liver transplant primary disease and were admitted for more than 8 days in hospital.
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 lab (subject_id text,hadm_id text,itemid text,charttime te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "LIVER TRANSPLANT" AND demographic.days_stay > "8"
until 2104 what are the top three most frequent procedures that patients received in the same hospital encounter after the diagnosis of disease of pharynx nec?
CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE patients (row_id number,subject_id number,...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.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, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_i...
since 05/2103, what was the monthly minimum dose of enteral tube feeds via gt of patient 030-10559?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage tex...
SELECT MIN(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-10559')) AND intakeoutput.celllabel = 'enter...
Name the being for having things of language, religions, work, customs, values, norms?
CREATE TABLE table_name_52 (being__qualities_ VARCHAR,having__things_ VARCHAR)
SELECT being__qualities_ FROM table_name_52 WHERE having__things_ = "language, religions, work, customs, values, norms"
How many fast laps are in 6 races with 30 points in the World Series by Nissan?
CREATE TABLE table_name_28 (fast_laps VARCHAR,points VARCHAR,series VARCHAR,races VARCHAR)
SELECT fast_laps FROM table_name_28 WHERE series = "world series by nissan" AND races = "6" AND points = "30"
Return the name of the member who is in charge of the most events.
CREATE TABLE party (party_id number,minister text,took_office text,left_office text,region_id number,party_name text)CREATE TABLE party_events (event_id number,event_name text,party_id number,member_in_charge_id number)CREATE TABLE region (region_id number,region_name text,date text,label text,format text,catalogue tex...
SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id GROUP BY T2.member_in_charge_id ORDER BY COUNT(*) DESC LIMIT 1
There is a building at 800 Boylston Street, how many floors does it have?
CREATE TABLE table_51944 ("Name" text,"Street address" text,"Years as tallest" text,"Height ft (m)" text,"Floors" real)
SELECT SUM("Floors") FROM table_51944 WHERE "Street address" = '800 boylston street'
How many times was the high rebounds by marcus camby (18)?
CREATE TABLE table_27734769_8 (date VARCHAR,high_rebounds VARCHAR)
SELECT COUNT(date) FROM table_27734769_8 WHERE high_rebounds = "Marcus Camby (18)"
tell me the yearly maximum amount of volume expanders in patient 016-27397's body since 05/09/2103?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labres...
SELECT MAX(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-27397')) AND intakeoutput.celllabel = 'volum...
To which political party did the prime minister who served under George V and was born in Manchester belong?
CREATE TABLE table_55889 ("Name" text,"Entered office" text,"Left office" text,"Political party" text,"Monarchs served" text,"Birth Place" text)
SELECT "Political party" FROM table_55889 WHERE "Monarchs served" = 'george v' AND "Birth Place" = 'manchester'
How many of 3:26.00 when hicham el guerrouj ( mar ) is hudson de souza ( bra )?
CREATE TABLE table_23987362_2 (hicham_el_guerrouj___mar__ VARCHAR)
SELECT COUNT(3) AS :2600 FROM table_23987362_2 WHERE hicham_el_guerrouj___mar__ = "Hudson de Souza ( BRA )"
When was Color of green last issued?
CREATE TABLE table_name_26 (first_issued INTEGER,color VARCHAR)
SELECT MAX(first_issued) FROM table_name_26 WHERE color = "green"
what is the number of patients whose age is less than 54 and diagnoses icd9 code is 7470?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethni...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "54" AND diagnoses.icd9_code = "7470"
Who is the professor for PreMajor classes next Winter ?
CREATE TABLE program_course (program_id int,course_id int,workload int,category varchar)CREATE TABLE course_tags_count (course_id int,clear_grading int,pop_quiz int,group_projects int,inspirational int,long_lectures int,extra_credit int,few_tests int,good_feedback int,tough_tests int,heavy_papers int,cares_for_students...
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr...
What's the school of the player with a hometown of little rock, arkansas?
CREATE TABLE table_10726 ("Player" text,"Position" text,"School" text,"Hometown" text,"College" text)
SELECT "School" FROM table_10726 WHERE "Hometown" = 'little rock, arkansas'
give me the number of patients diagnosed with unspecified hypertensive heart disease with heart failure who had joint fluid lab test.
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 (subject_id text,hadm_id text,name text,marital_status text,age text,dob...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Hyp ht dis NOS w ht fail" AND lab.fluid = "Joint Fluid"
When birkenhead is the city/town and merseyside is the county and england is the country how many ranks are there?
CREATE TABLE table_25790 ("Rank" real,"City/Town" text,"County" text,"Region/Province" text,"Population" real,"Country" text)
SELECT COUNT("Rank") FROM table_25790 WHERE "Country" = 'England' AND "County" = 'Merseyside' AND "City/Town" = 'Birkenhead'
For those employees who did not have any job in the past, draw a bar chart about the distribution of hire_date and the sum of manager_id bin hire_date by time, and rank from high to low by the Y.
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 HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(MANAGER_ID) DESC
Quality of tag over a weekly cycle. The average score of a question with a specified tag over one hour, for every hour in the week, in the range [0, 168). The idea was to test whether certain times of the week produce better questions than other times.
CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time...
SELECT AVG(CAST(Score AS FLOAT)) AS score, DH FROM (SELECT TagName, Tags.Id, (TIME_TO_STR(CreationDate, '%W') - 1) * 24 + TIME_TO_STR(CreationDate, '%h') AS DH, Score FROM Tags INNER JOIN PostTags ON TagId = Tags.Id INNER JOIN Posts ON PostId = Posts.Id WHERE Posts.ParentId IS NULL AND TagName = '##TagName##') AS sq GR...
What team had a net run rate of 0.134?
CREATE TABLE table_27605 ("Team" text,"Played" real,"Won" real,"Lost" real,"No-Result" real,"Abandoned" real,"Bonus Points" real,"Total Points" real,"Net Run Rate" text)
SELECT "Team" FROM table_27605 WHERE "Net Run Rate" = '0.134'
Where was the competition with a qualifying score of 58.425?
CREATE TABLE table_25143284_1 (location VARCHAR,score_qualifying VARCHAR)
SELECT location FROM table_25143284_1 WHERE score_qualifying = "58.425"
how many patients whose admission year is less than 2194 and diagnoses short title is diabetic retinopathy nos?
CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2194" AND diagnoses.short_title = "Diabetic retinopathy NOS"
What is the total number of names of products?, order in descending by the the number of product name.
CREATE TABLE Parties (Party_ID INTEGER,Party_Details VARCHAR(255))CREATE TABLE Events (Event_ID INTEGER,Address_ID INTEGER,Channel_ID INTEGER,Event_Type_Code CHAR(15),Finance_ID INTEGER,Location_ID INTEGER)CREATE TABLE Products (Product_ID INTEGER,Product_Type_Code CHAR(15),Product_Name VARCHAR(255),Product_Price DECIM...
SELECT Product_Name, COUNT(Product_Name) FROM Products GROUP BY Product_Name ORDER BY COUNT(Product_Name) DESC
what are the three lab tests that are most common until 2 years ago?
CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid n...
SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE DATETIME(lab.labresulttime) <= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 3
what is the number of patients whose year of birth is less than 2071?
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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dob_year < "2071"
What is the Time of the Great Britain players with Notes of SA/B?
CREATE TABLE table_64791 ("Rank" real,"Rowers" text,"Country" text,"Time" text,"Notes" text)
SELECT "Time" FROM table_64791 WHERE "Notes" = 'sa/b' AND "Country" = 'great britain'
when was the first time patient 015-23047's heartrate was greater than 104.0 on the current icu visit.
CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE cost (costid number,uniquepid text,patientheal...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-23047') AND patient.unitdischargetime IS NULL) ...
How many U.S. viewers, in millions, watched the episode that aired on November 13, 2007?
CREATE TABLE table_18042 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" real,"U.S. viewers (millions)" text)
SELECT "U.S. viewers (millions)" FROM table_18042 WHERE "Original air date" = 'November 13, 2007'
What is every TV network with a weekly schedule of Monday to Thursday @ 11:00 pm?
CREATE TABLE table_22621 ("Country" text,"TV Network(s)" text,"Series Premiere" text,"Weekly Schedule" text,"Status" text)
SELECT "TV Network(s)" FROM table_22621 WHERE "Weekly Schedule" = 'Monday to Thursday @ 11:00 pm'
what is drug name of drug code mago140?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id te...
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.formulary_drug_cd = "MAGO140"
how many surfaces are grass ?
CREATE TABLE table_204_94 (id number,"outcome" text,"date" text,"tournament" text,"surface" text,"partnering" text,"opponent in the final" text,"score in the final" text)
SELECT COUNT("surface") FROM table_204_94 WHERE "surface" = 'grass'
until 2 years ago what were the top three most frequent procedures that patients received in the same hospital visit after the diagnosis of traumatic subdural hem?
CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)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 tex...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.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, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_i...
count the number of patients whose admission location is clinic referral/premature and diagnoses icd9 code is 25541?
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_location = "CLINIC REFERRAL/PREMATURE" AND diagnoses.icd9_code = "25541"
What is the margin of victory in a semgroup championship?
CREATE TABLE table_name_39 (margin_of_victory VARCHAR,tournament VARCHAR)
SELECT margin_of_victory FROM table_name_39 WHERE tournament = "semgroup championship"
Which team had a year entering the league under 2009, located in Bath?
CREATE TABLE table_name_21 (team VARCHAR,year_entered_league VARCHAR,location VARCHAR)
SELECT team FROM table_name_21 WHERE year_entered_league < 2009 AND location = "bath"
Which player is from Dartmouth?
CREATE TABLE table_name_41 (player VARCHAR,school_club_team VARCHAR)
SELECT player FROM table_name_41 WHERE school_club_team = "dartmouth"
Where was a game played on 23,24,25,26 july 1992?
CREATE TABLE table_14725 ("Date" text,"Home captain" text,"Away captain" text,"Venue" text,"Result" text)
SELECT "Venue" FROM table_14725 WHERE "Date" = '23,24,25,26 july 1992'
What is the sum of all domestic passengers with 10.9% change and less than 4,022 tonnes in freight?
CREATE TABLE table_name_38 (domestic_passengers INTEGER,_percentage_change_2005_2006 VARCHAR,freight__metric_tonnes_ VARCHAR)
SELECT SUM(domestic_passengers) FROM table_name_38 WHERE _percentage_change_2005_2006 = "10.9%" AND freight__metric_tonnes_ < 4 OFFSET 022
What is the lowest first half when the score is larger than 621 and the rank 35?
CREATE TABLE table_66025 ("Rank" real,"Archer" text,"1st Half" real,"2nd Half" real,"Score" real)
SELECT MIN("1st Half") FROM table_66025 WHERE "Score" > '621' AND "Rank" = '35'
Who's the writer of the episode see by 12.13 million US viewers?
CREATE TABLE table_17476 ("Series #" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text,"U.S. viewers (millions)" text)
SELECT "Written by" FROM table_17476 WHERE "U.S. viewers (millions)" = '12.13'
keyphrases by stefan savage
CREATE TABLE paperkeyphrase (paperid int,keyphraseid int)CREATE TABLE cite (citingpaperid int,citedpaperid int)CREATE TABLE paper (paperid int,title varchar,venueid int,year int,numciting int,numcitedby int,journalid int)CREATE TABLE writes (paperid int,authorid int)CREATE TABLE field (fieldid int)CREATE TABLE author (...
SELECT DISTINCT keyphrase.keyphraseid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'stefan savage' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
When did Fitzroy play as the away team?
CREATE TABLE table_53649 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Date" FROM table_53649 WHERE "Away team" = 'fitzroy'
What music is in the film with an Uncut run time of 95 minutes?
CREATE TABLE table_name_63 (music VARCHAR,uncut_run_time VARCHAR)
SELECT music FROM table_name_63 WHERE uncut_run_time = "95 minutes"
Who was the opponent when Footscray played as the home team?
CREATE TABLE table_53566 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Away team score" FROM table_53566 WHERE "Home team" = 'footscray'
What was the loss of the Mariners game when they had a record of 22-35?
CREATE TABLE table_name_96 (loss VARCHAR,record VARCHAR)
SELECT loss FROM table_name_96 WHERE record = "22-35"
What is the team name from Hammond Bishop Noll?
CREATE TABLE table_name_42 (team_name VARCHAR,school VARCHAR)
SELECT team_name FROM table_name_42 WHERE school = "hammond bishop noll"
D'Oyly Carte 1920 Tour of james turnbull is what D'Oyly Carte 1945 Tour?
CREATE TABLE table_39564 ("Role" text,"D'Oyly Carte 1920 Tour" text,"D'Oyly Carte 1930 Tour" text,"D'Oyly Carte 1939 Tour" text,"D'Oyly Carte 1945 Tour" text,"D'Oyly Carte 1950 Tour" text)
SELECT "D'Oyly Carte 1945 Tour" FROM table_39564 WHERE "D'Oyly Carte 1920 Tour" = 'james turnbull'
How much Bronze has a Gold larger than 0, and a Total smaller than 1?
CREATE TABLE table_36605 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT COUNT("Bronze") FROM table_36605 WHERE "Gold" > '0' AND "Total" < '1'
What is the Japanese title with an average rating of 11.6%?
CREATE TABLE table_73023 ("Japanese Title" text,"Romaji Title" text,"TV Station" text,"Time Frame" text,"Starring Actors" text,"Theme Song(s)" text,"Episodes" real,"Average Ratings" text)
SELECT "Japanese Title" FROM table_73023 WHERE "Average Ratings" = '11.6%'
what is the total amount of games activision developed ?
CREATE TABLE table_203_489 (id number,"year" number,"title" text,"system" text,"developer" text,"publisher" text)
SELECT COUNT("title") FROM table_203_489 WHERE "developer" = 'activision'
A bar chart for what are the number of the descriptions of the categories that products with product descriptions that contain the letter t are in?, and list names in ascending order.
CREATE TABLE Product_Characteristics (product_id INTEGER,characteristic_id INTEGER,product_characteristic_value VARCHAR(50))CREATE TABLE Ref_Product_Categories (product_category_code VARCHAR(15),product_category_description VARCHAR(80),unit_of_measure VARCHAR(20))CREATE TABLE Ref_Characteristic_Types (characteristic_ty...
SELECT product_category_description, COUNT(product_category_description) FROM Ref_Product_Categories AS T1 JOIN Products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' GROUP BY product_category_description ORDER BY product_category_description
What rank has skyfall as the title?
CREATE TABLE table_45663 ("Rank" real,"Title" text,"Studio" text,"Director(s)" text,"Worldwide Gross" text)
SELECT "Rank" FROM table_45663 WHERE "Title" = 'skyfall'