instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
what were the four most common lab tests that patients were given in the same month after being diagnosed with speech disturbance nec since 2 years ago?
CREATE TABLE d_items (row_id number,itemid number,label text,linksto 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,ethnicity text,age number)C...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.i...
tell me the total number of patients who were discharged from the hospital?
CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL
what are the top five most frequently prescribed medications until 2100?
CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim...
SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE STRFTIME('%y', medication.drugstarttime) <= '2100' GROUP BY medication.drugname) AS t1 WHERE t1.c1 <= 5
what percentile is the value of the rdw of 14.3 among patients of the same age as patient 25723 when they visited the hospital first time?
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 admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,disc...
SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'rdw') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age = (SE...
What is Notes, when Silver is 'Jarkko Huovila'?
CREATE TABLE table_name_3 (notes VARCHAR,silver VARCHAR)
SELECT notes FROM table_name_3 WHERE silver = "jarkko huovila"
Which Years in Orlando has a Nationality of united states, a Position of center, and a Player of jawann oldham?
CREATE TABLE table_39896 ("Player" text,"Nationality" text,"Position" text,"Years in Orlando" text,"School/Club Team" text)
SELECT "Years in Orlando" FROM table_39896 WHERE "Nationality" = 'united states' AND "Position" = 'center' AND "Player" = 'jawann oldham'
What was the result for Steve & Anna when the score was 21 (7, 7, 7)?
CREATE TABLE table_36666 ("Couple" text,"Score" text,"Style" text,"Music" text,"Result" text)
SELECT "Result" FROM table_36666 WHERE "Score" = '21 (7, 7, 7)' AND "Couple" = 'steve & anna'
How many starts did Hendrick motorsports have?
CREATE TABLE table_1012730_1 (starts INTEGER,team_s_ VARCHAR)
SELECT MIN(starts) FROM table_1012730_1 WHERE team_s_ = "Hendrick Motorsports"
what is the number of patients whose admission year is less than 2190 and procedure long title is spinal tap?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,sho...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2190" AND procedures.long_title = "Spinal tap"
For short patent type of protections, what type of PCT route is available?
CREATE TABLE table_25305 ("Country" text,"Type of Protection" text,"Maximum Term" text,"PCT route available" text,"Conversion from Patent Application" text)
SELECT "PCT route available" FROM table_25305 WHERE "Type of Protection" = 'short patent'
What was the 1989 result for the tournament with 1984 of a, 1985 of a, and 1990 of a?
CREATE TABLE table_46599 ("Tournament" text,"1983" text,"1984" text,"1985" text,"1986" text,"1987" text,"1988" text,"1989" text,"1990" text,"Career SR" text)
SELECT "1989" FROM table_46599 WHERE "1984" = 'a' AND "1985" = 'a' AND "1990" = 'a'
Which Semifinalists has a Champions of michael chang 6-0 6-4?
CREATE TABLE table_37815 ("Week of" text,"Tournament" text,"Champions" text,"Runners-up" text,"Semifinalists" text)
SELECT "Semifinalists" FROM table_37815 WHERE "Champions" = 'michael chang 6-0 6-4'
what is the average days of hospital stay for the patients born after 2180?
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 AVG(demographic.days_stay) FROM demographic WHERE demographic.dob_year > "2180"
give me the number of patients whose admission year is less than 2172 and lab test name is fibrin degradation products?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2172" AND lab.label = "Fibrin Degradation Products"
list DAILY flights from ATLANTA to DENVER
CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE ground_service (city_code text,airport_code text,transport_type text,ground_fare int)CREATE TABLE class_of_servi...
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, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVE...
In 2010 are there computational science courses offered in Winter or Fall ?
CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE program_course (program_id int,course_id int,workload int,category varchar)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE course_tags_count (course_id int,clear_grading int,pop_quiz int,gr...
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE area.area LIKE '%compu...
What is the population of the East Kilbride urban sub-area?
CREATE TABLE table_name_61 (population VARCHAR,urban_sub_area VARCHAR)
SELECT population FROM table_name_61 WHERE urban_sub_area = "east kilbride"
What is Event, when Position is 6th, and when Year is after 2006?
CREATE TABLE table_49682 ("Year" real,"Competition" text,"Venue" text,"Position" text,"Event" text)
SELECT "Event" FROM table_49682 WHERE "Position" = '6th' AND "Year" > '2006'
how many total goals were scored ?
CREATE TABLE table_204_371 (id number,"team" text,"competition" text,"category" text,"appearances\nstart" number,"appearances\nsub" number,"goals" number,"team record" text)
SELECT SUM("goals") FROM table_204_371
When is the finish of the season that started on September 25?
CREATE TABLE table_24967 ("No." real,"Season" text,"Championship" real,"No. of teams" real,"Start (reg. season)" text,"Finish (incl. championship)" text,"Top record" text,"National Champion" text)
SELECT "Finish (incl. championship)" FROM table_24967 WHERE "Start (reg. season)" = 'September 25'
What is John Oxendine at in the poll where Karen Handel is at 38%?
CREATE TABLE table_34638 ("Poll source" text,"Dates administered" text,"John Oxendine" text,"Karen Handel" text,"Nathan Deal" text,"Eric Johnson" text,"Ray McBerry" text,"Undecided" text)
SELECT "John Oxendine" FROM table_34638 WHERE "Karen Handel" = '38%'
did tianjin teda or qingdao jonoon have a higher average attendance ?
CREATE TABLE table_203_581 (id number,"club" text,"chinese" text,"city" text,"home stadium" text,"capacity" number,"average attendance" number)
SELECT "club" FROM table_203_581 WHERE "club" IN ('tianjin teda', 'qingdao jonoon') ORDER BY "average attendance" DESC LIMIT 1
For each position, what is the average number of points for players in that position Plot them as bar chart, order by the x axis in descending.
CREATE TABLE player (Player_ID int,name text,Position text,Club_ID int,Apps real,Tries real,Goals text,Points real)CREATE TABLE competition (Competition_ID int,Year real,Competition_type text,Country text)CREATE TABLE club_rank (Rank real,Club_ID int,Gold real,Silver real,Bronze real,Total real)CREATE TABLE club (Club_...
SELECT Position, AVG(Points) FROM player GROUP BY Position ORDER BY Position DESC
For those employees who was hired before 2002-06-21, visualize a bar chart about the distribution of hire_date and the sum of manager_id bin hire_date by time, and rank by the Y in asc.
CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))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 employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAI...
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(MANAGER_ID)
which club had the least amount of points ?
CREATE TABLE table_203_322 (id number,"club" text,"played" number,"won" number,"drawn" number,"lost" number,"points for" number,"points against" number,"bonus points" number,"points" number)
SELECT "club" FROM table_203_322 ORDER BY "points" LIMIT 1
Find the average price of wines that are not produced from Sonoma county.
CREATE TABLE wine (no number,grape text,winery text,appelation text,state text,name text,year number,price number,score number,cases number,drink text)CREATE TABLE grapes (id number,grape text,color text)CREATE TABLE appellations (no number,appelation text,county text,state text,area text,isava text)
SELECT AVG(price) FROM wine WHERE NOT appelation IN (SELECT T1.appelation FROM appellations AS T1 JOIN wine AS T2 ON T1.appelation = T2.appelation WHERE T1.county = 'Sonoma')
What is the Original name of empire of passion?
CREATE TABLE table_name_17 (original_name VARCHAR,film_title_used_in_nomination VARCHAR)
SELECT original_name FROM table_name_17 WHERE film_title_used_in_nomination = "empire of passion"
What Authority has a decile greater than 5, with a roll of 170?
CREATE TABLE table_67096 ("Name" text,"Years" text,"Area" text,"Authority" text,"Decile" real,"Roll" real)
SELECT "Authority" FROM table_67096 WHERE "Decile" > '5' AND "Roll" = '170'
when was the first time patient 012-20116 had urine catheter output since 12/29/2103?
CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicm...
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-20116')) AND intakeoutput.cellpath LIKE '%output%...
What time was the game played against Cagliari that lasted 16 rounds?
CREATE TABLE table_name_32 (time VARCHAR,opponent VARCHAR,round VARCHAR)
SELECT time FROM table_name_32 WHERE opponent = "cagliari" AND round = "16"
What is the Catch-up period for UTV?
CREATE TABLE table_name_30 (catch_up_period VARCHAR,owner VARCHAR)
SELECT catch_up_period FROM table_name_30 WHERE owner = "utv"
Show all product names and the total quantity ordered for each product name in a bar chart.
CREATE TABLE Orders (order_id INTEGER,customer_id INTEGER,date_order_placed DATETIME,order_details VARCHAR(255))CREATE TABLE Product_Categories (production_type_code VARCHAR(15),product_type_description VARCHAR(80),vat_rating DECIMAL(19,4))CREATE TABLE Financial_Transactions (transaction_id INTEGER,account_id INTEGER,i...
SELECT product_name, SUM(T1.product_quantity) FROM Order_Items AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_name
when did last patient 83358 receive a procedure in the last hospital visit?
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 procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83358 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) ORDER BY procedures_icd.charttime DESC LIMIT 1
When did fitzroy play at home?
CREATE TABLE table_10906 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Date" FROM table_10906 WHERE "Home team" = 'fitzroy'
Which average Winner's share ($) has a Score of 281 ( 7), and a Player of hale irwin, and a Year smaller than 1983?
CREATE TABLE table_36109 ("Year" real,"Player" text,"Country" text,"Score" text,"Margin of victory" text,"Winner's share ($)" real)
SELECT AVG("Winner's share ( $ )") FROM table_36109 WHERE "Score" = '281 (−7)' AND "Player" = 'hale irwin' AND "Year" < '1983'
Which season has flora as the runner-up, tvmk as the 3rd position, and narva trans as the top goalscorer (s)?
CREATE TABLE table_40545 ("Season" text,"Champion" text,"Runner-Up" text,"3rd Position" text,"Top Goalscorer(s)" text,"Team(s)" real)
SELECT "Season" FROM table_40545 WHERE "Runner-Up" = 'flora' AND "3rd Position" = 'tvmk' AND "Top Goalscorer(s)" = 'narva trans'
what is the pick # when the nhl team is montreal canadiens and the college/junior/club team is trois-rivi res draveurs (qmjhl)?
CREATE TABLE table_74028 ("Pick #" real,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text)
SELECT MIN("Pick #") FROM table_74028 WHERE "NHL team" = 'Montreal Canadiens' AND "College/junior/club team" = 'Trois-Rivières Draveurs (QMJHL)'
Who was the home team that played at Moorabbin Oval?
CREATE TABLE table_name_17 (home_team VARCHAR,venue VARCHAR)
SELECT home_team FROM table_name_17 WHERE venue = "moorabbin oval"
Which Date has Points smaller than 85 and a Game # of 74?
CREATE TABLE table_5685 ("Game #" real,"Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text,"Points" real)
SELECT "Date" FROM table_5685 WHERE "Points" < '85' AND "Game #" = '74'
What is the class/type at Trieste?
CREATE TABLE table_name_32 (class___type VARCHAR,location VARCHAR)
SELECT class___type FROM table_name_32 WHERE location = "trieste"
I want the team with replaced by being csaba l szl
CREATE TABLE table_name_24 (team VARCHAR,replaced_by VARCHAR)
SELECT team FROM table_name_24 WHERE replaced_by = "csaba lászló"
What is the date of game 7?
CREATE TABLE table_2302 ("#" text,"Date" text,"at/vs." text,"Opponent" text,"Score" text,"Attendance" real,"Record" text)
SELECT "Date" FROM table_2302 WHERE "#" = '7'
What is the highest rank team akasvayu girona had with less than 311 rebounds?
CREATE TABLE table_8568 ("Rank" real,"Name" text,"Team" text,"Games" real,"Rebounds" real)
SELECT MAX("Rank") FROM table_8568 WHERE "Team" = 'akasvayu girona' AND "Rebounds" < '311'
What was the score when the record was 39-62?
CREATE TABLE table_name_29 (score VARCHAR,record VARCHAR)
SELECT score FROM table_name_29 WHERE record = "39-62"
may i fly from SAN FRANCISCO to BALTIMORE
CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE month (month_number int,month_name text)CREATE TABLE ground_service (city_code text,airport_code text,transport_type text,ground_fare int)CREATE TABLE fa...
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, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '...
For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and price , and group by attribute headquarter, and rank y-axis from low to high order please.
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 T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Price
How many grids does Ducati have with Casey Stoner as a rider with fewer than 27 laps?
CREATE TABLE table_name_11 (grid VARCHAR,laps VARCHAR,manufacturer VARCHAR,rider VARCHAR)
SELECT COUNT(grid) FROM table_name_11 WHERE manufacturer = "ducati" AND rider = "casey stoner" AND laps < 27
in which city was charter date december 4, 2011
CREATE TABLE table_22169 ("Greek Designation" text,"Collegiate Institution" text,"Charter Date" text,"Status" text,"City" text,"U.S. State/District" text)
SELECT "City" FROM table_22169 WHERE "Charter Date" = 'December 4, 2011'
what are the ways to consume acular?
CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outtime time)CREATE TABLE admissions (row_id number,subje...
SELECT DISTINCT prescriptions.route FROM prescriptions WHERE prescriptions.drug = 'acular'
Tell me the average heat rank for time less than 24.02 and lane of 1
CREATE TABLE table_4397 ("Heat Rank" real,"Lane" real,"Swimmer" text,"Country" text,"Time" real,"Overall Rank" text)
SELECT AVG("Heat Rank") FROM table_4397 WHERE "Time" < '24.02' AND "Lane" = '1'
What is the y = 2011 when the y = 2009 is 6 april 2009?
CREATE TABLE table_73294 ("Expression" text,"Y = 2008" text,"Y = 2009" text,"Y = 2010" text,"Y = 2011" text)
SELECT "Y = 2011" FROM table_73294 WHERE "Y = 2009" = '6 April 2009'
For all employees in the same department as Clara excluding Clara, bin their hire date into the day of week interval, and count how many employees in each month for a bar chart, and I want to sort Y-axis from high to low order.
CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))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...
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE DEPARTMENT_ID = (SELECT DEPARTMENT_ID FROM employees WHERE FIRST_NAME = "Clara") AND FIRST_NAME <> "Clara" ORDER BY COUNT(HIRE_DATE) DESC
Who Playoffs has a Regular Season of on hiatus.?
CREATE TABLE table_42257 ("Year" real,"Division" text,"League" text,"Regular Season" text,"Playoffs" text,"Open Cup" text)
SELECT "Playoffs" FROM table_42257 WHERE "Regular Season" = 'on hiatus.'
What county has an IHSAA Football Class of A, and a Mascot of royals?
CREATE TABLE table_name_36 (county VARCHAR,ihsaa_football_class VARCHAR,mascot VARCHAR)
SELECT county FROM table_name_36 WHERE ihsaa_football_class = "a" AND mascot = "royals"
For those records from the products and each product's manufacturer, return a scatter chart about the correlation between price and revenue , and group by attribute headquarter.
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, Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter
Witch opponent has a loss of Glynn (0-2)?
CREATE TABLE table_68145 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text)
SELECT "Opponent" FROM table_68145 WHERE "Loss" = 'glynn (0-2)'
Me & my competitors answers.
CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuida...
SELECT *, Accepted * 100.0 / Answers AS Ratio FROM (SELECT U.Id, U.DisplayName, U.Reputation, COUNT(*) AS Answers, COUNT(*) - COUNT(NULLIF(A.Id, Q.AcceptedAnswerId)) AS Accepted FROM Posts AS MyA JOIN Posts AS Q ON Q.Id = MyA.ParentId JOIN Posts AS A ON A.ParentId = Q.Id JOIN Users AS U ON U.Id = A.OwnerUserId WHERE My...
who is the the mixed doubles with mens singles being peter moritz
CREATE TABLE table_19793 ("Year" real,"Mens singles" text,"Womens singles" text,"Mens doubles" text,"Womens doubles" text,"Mixed doubles" text)
SELECT "Mixed doubles" FROM table_19793 WHERE "Mens singles" = 'Peter Moritz'
How many games were lost where the win percentage is smaller than 16.7 and the played games is 3?
CREATE TABLE table_54068 ("Name" text,"Coaching career" text,"Played" real,"Drawn" real,"Lost" real,"Win %" real,"Points per game" real)
SELECT COUNT("Lost") FROM table_54068 WHERE "Win %" < '16.7' AND "Played" = '3'
what is the listing date for nuckolls county?
CREATE TABLE table_name_79 (listed VARCHAR,county VARCHAR)
SELECT listed FROM table_name_79 WHERE county = "nuckolls"
Which Played has a Position of 3, and a Points smaller than 15?
CREATE TABLE table_43759 ("Position" real,"Name" text,"Played" real,"Drawn" real,"Lost" real,"Points" real)
SELECT COUNT("Played") FROM table_43759 WHERE "Position" = '3' AND "Points" < '15'
on 09/26/last year, when did patient 015-76706 have the first urinary catheter output: indwelling/continuous ure output?
CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,cultu...
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-76706')) AND intakeoutput.cellpath LIKE '%output%...
How many points were there for 15 losses?
CREATE TABLE table_name_28 (points_for VARCHAR,lost VARCHAR)
SELECT points_for FROM table_name_28 WHERE lost = "15"
What was the Total the Year Yugoslavia had 0 Silver medals and 31 Competitors?
CREATE TABLE table_name_5 (total VARCHAR,silver VARCHAR,competitors VARCHAR)
SELECT total FROM table_name_5 WHERE silver = "0" AND competitors = "31"
Bin the installation date into the day of week interval, and then you can draw a bar chart to tell me how many stations each year, sort from low to high by the y axis please.
CREATE TABLE status (station_id INTEGER,bikes_available INTEGER,docks_available INTEGER,time TEXT)CREATE TABLE station (id INTEGER,name TEXT,lat NUMERIC,long NUMERIC,dock_count INTEGER,city TEXT,installation_date TEXT)CREATE TABLE trip (id INTEGER,duration INTEGER,start_date TEXT,start_station_name TEXT,start_station_i...
SELECT installation_date, COUNT(installation_date) FROM station ORDER BY COUNT(installation_date)
vitamin d level as measured by 25 _ hydroxyvitamin d ( 25 _ oh d ) < 32 ng / ml
CREATE TABLE table_train_172 ("id" int,"systolic_blood_pressure_sbp" int,"c_peptide_level" float,"hemoglobin_a1c_hba1c" float,"peak_stimulated_c_peptide" float,"diastolic_blood_pressure_dbp" int,"mixed_meal_tolerance_test_mmtt" bool,"vitamin_d" int,"NOUSE" float)
SELECT * FROM table_train_172 WHERE vitamin_d < 32
What is the score for the away team, Ipswich Town?
CREATE TABLE table_9134 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text)
SELECT "Score" FROM table_9134 WHERE "Away team" = 'ipswich town'
For those employees who was hired before 2002-06-21, return a bar chart about the distribution of hire_date and the average of department_id bin hire_date by time.
CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))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 employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME var...
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21'
Which country is the ICAO vvts?
CREATE TABLE table_name_80 (country VARCHAR,icao VARCHAR)
SELECT country FROM table_name_80 WHERE icao = "vvts"
Who was the artist with a mintage of 40,000 and an issue price of $45.95?
CREATE TABLE table_51186 ("Year" real,"Theme" text,"Artist" text,"Mintage" text,"Issue Price" text)
SELECT "Artist" FROM table_51186 WHERE "Mintage" = '40,000' AND "Issue Price" = '45.95'
What is the name of the tourist attraction that is associated with the photo 'game1'?
CREATE TABLE staff (staff_id number,tourist_attraction_id number,name text,other_details text)CREATE TABLE royal_family (royal_family_id number,royal_family_details text)CREATE TABLE street_markets (market_id number,market_details text)CREATE TABLE hotels (hotel_id number,star_rating_code text,pets_allowed_yn text,pric...
SELECT T2.name FROM photos AS T1 JOIN tourist_attractions AS T2 ON T1.tourist_attraction_id = T2.tourist_attraction_id WHERE T1.name = "game1"
What are the downhill points for the skier with total of 9.31 points?
CREATE TABLE table_59063 ("Place" text,"Competitor" text,"Downhill points" real,"Slalom points" text,"Total" text)
SELECT SUM("Downhill points") FROM table_59063 WHERE "Total" = '9.31'
What is the Date of the game with a Result of L 33 14?
CREATE TABLE table_name_89 (date VARCHAR,result VARCHAR)
SELECT date FROM table_name_89 WHERE result = "l 33–14"
What is the most silver medals won among nations that won more than 40 medals total, less than 25 of them being gold, and more than 15 of them being bronze?
CREATE TABLE table_62460 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT MAX("Silver") FROM table_62460 WHERE "Total" > '40' AND "Gold" < '25' AND "Bronze" > '15'
Name the most year when population of woocoo is 2700
CREATE TABLE table_537 ("Year" real,"Population (Region total)" real,"Population (Maryborough)" real,"Population (Hervey Bay)" real,"Population (Woocoo)" real,"Population (Tiaro)" real)
SELECT MAX("Year") FROM table_537 WHERE "Population (Woocoo)" = '2700'
Can you tell me if CS offers any upper elective courses ?
CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREAT...
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id
Who is the director of the best foreign film?
CREATE TABLE table_68615 ("Year" text,"English title" text,"Original title" text,"Country" text,"Director" text)
SELECT "Director" FROM table_68615 WHERE "Original title" = 'best foreign film'
What is the frequency of number 161?
CREATE TABLE table_name_59 (frequency VARCHAR,number VARCHAR)
SELECT frequency FROM table_name_59 WHERE number = 161
Which Date has a Partner of daniella dominikovic?
CREATE TABLE table_39297 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Partner" text,"Opponents in the final" text,"Score" text)
SELECT "Date" FROM table_39297 WHERE "Partner" = 'daniella dominikovic'
was chile below or above the gold medal count for panama ?
CREATE TABLE table_204_232 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number)
SELECT (SELECT "gold" FROM table_204_232 WHERE "nation" = 'chile') > (SELECT "gold" FROM table_204_232 WHERE "nation" = 'panama')
What was the result of t.u.f.f. puppy?
CREATE TABLE table_53715 ("Year" real,"Award" text,"Category" text,"Work" text,"Result" text)
SELECT "Result" FROM table_53715 WHERE "Work" = 't.u.f.f. puppy'
what is the earliest flight from OAKLAND to WASHINGTON on sunday
CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections int,departure_time int,dual_carrier text,flight_days text,flight_id int,flight_number int,from_airport varchar,meal_code text,stops int,time_elapsed ...
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 = 'WASHINGTON' AND date_day.day_number = 27 AND date_day.month_number = 8 A...
what is the frequency when the city of license is belleville?
CREATE TABLE table_name_42 (frequency VARCHAR,city_of_license VARCHAR)
SELECT frequency FROM table_name_42 WHERE city_of_license = "belleville"
What are the names and ages of artists? Show the result in a bar graph, and show x axis in asc order.
CREATE TABLE artist (Artist_ID int,Name text,Country text,Year_Join int,Age int)CREATE TABLE exhibition (Exhibition_ID int,Year int,Theme text,Artist_ID int,Ticket_Price real)CREATE TABLE exhibition_record (Exhibition_ID int,Date text,Attendance int)
SELECT Name, Age FROM artist ORDER BY Name
What is the number for combaya municipality when quiabaya municipality is 33?
CREATE TABLE table_27403 ("Language" text,"Sorata Municipality" text,"Guanay Municipality" text,"Tacacoma Municipality" text,"Quiabaya Municipality" text,"Combaya Municipality" text,"Tipuani Municipality" text,"Mapiri Municipality" text,"Teoponte Municipality" text)
SELECT "Combaya Municipality" FROM table_27403 WHERE "Quiabaya Municipality" = '33'
Who wrote episode 26 in the series?
CREATE TABLE table_28328 ("Episode #" real,"Series #" real,"Title" text,"Director" text,"Writer" text,"Original airdate" text,"Viewers (in millions)" text)
SELECT "Writer" FROM table_28328 WHERE "Episode #" = '26'
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a scatter chart about the correlation between commission_pct and manager_id .
CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))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 regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE cou...
SELECT COMMISSION_PCT, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
chronic or persistent alcohol or drug abuse
CREATE TABLE table_train_189 ("id" int,"alt" float,"hyperglycemia" bool,"liver_disease" bool,"smoking" bool,"alcohol_abuse" bool,"drug_abuse" bool,"triglyceride_tg" float,"NOUSE" float)
SELECT * FROM table_train_189 WHERE alcohol_abuse = 1 OR drug_abuse = 1
show me flights from MILWAUKEE to ORLANDO on thursday morning
CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE restriction (restriction_code...
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 = 'ORLANDO' AND date_day.day_number = 24 AND date_day.month_number = 5 AND ...
Name the Date when has robert smith (7)?
CREATE TABLE table_76444 ("Date" text,"Event" text,"City" text,"Oil Pattern" text,"Winner (Title #)" text,"Runner-up" text,"Score" text)
SELECT "Date" FROM table_76444 WHERE "Winner (Title #)" = 'robert smith (7)'
For those records from the products and each product's manufacturer, show me about the correlation between code and price , and group by attribute headquarter in a scatter chart.
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.Code, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter
Show the smallest enrollment of each state using a bar chart, show in ascending by the y axis.
CREATE TABLE College (cName varchar(20),state varchar(2),enr numeric(5,0))CREATE TABLE Tryout (pID numeric(5,0),cName varchar(20),pPos varchar(8),decision varchar(3))CREATE TABLE Player (pID numeric(5,0),pName varchar(20),yCard varchar(3),HS numeric(5,0))
SELECT state, MIN(enr) FROM College GROUP BY state ORDER BY MIN(enr)
What team did they lose to when they had a 28-22 record?
CREATE TABLE table_80259 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" text,"Record" text)
SELECT "Loss" FROM table_80259 WHERE "Record" = '28-22'
since 2102, patient 021-250695 underwent any procedure?
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 COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-250695')) AND STRFTIME('%y', treatment.treatmenttime) >= '2102'
What players played the position of left tackle?
CREATE TABLE table_14342592_5 (player VARCHAR,position VARCHAR)
SELECT player FROM table_14342592_5 WHERE position = "Left tackle"
Name the course for 24 july
CREATE TABLE table_34999 ("Date" text,"Course" text,"Distance" text,"Type" text,"Winner" text)
SELECT "Course" FROM table_34999 WHERE "Date" = '24 july'
Could you tell me about NERS 583 ?
CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time,monday varchar,tuesday...
SELECT DISTINCT description, name FROM course WHERE department = 'NERS' AND number = 583
What was the away team for the game in Slough Town?
CREATE TABLE table_name_75 (away_team VARCHAR,home_team VARCHAR)
SELECT away_team FROM table_name_75 WHERE home_team = "slough town"
what was the total number of patients on careunit csru last year?
CREATE TABLE d_labitems (row_id number,itemid number,label text)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 inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,chart...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'csru' AND DATETIME(transfers.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year'))
please show me flights from DALLAS FORT WORTH to ATLANTA on monday
CREATE TABLE fare_basis (fare_basis_code text,booking_class text,class_type text,premium text,economy text,discounted text,night text,season text,basis_days text)CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE flight...
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 = 'ATLANTA' AND date_day.day_number = 21 AND date_day.month_number = 2 AND d...