instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
which boston red sox player got the most career home runs ? | CREATE TABLE table_203_611 (id number,"player" text,"hr" number,"date reached 500 hr" text,"team" text,"seasons played" text) | SELECT "player" FROM table_203_611 WHERE "team" = 'boston red sox' ORDER BY "hr" DESC LIMIT 1 |
When 'jobless' is the title who are the writers? | CREATE TABLE table_24033 ("Ep." real,"Season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Prod. Code" text) | SELECT "Written by" FROM table_24033 WHERE "Title" = 'Jobless' |
What is the name of Aleko Berdzenishvili's song? | CREATE TABLE table_40448 ("Draw" real,"Artist" text,"Song" text,"Result" text,"Place" real) | SELECT "Song" FROM table_40448 WHERE "Artist" = 'aleko berdzenishvili' |
Name the District which has a Reserved for ( SC / ST /None) of sc? | CREATE TABLE table_12422 ("Constituency number" text,"Name" text,"Reserved for (SC / ST /None)" text,"District" text,"Number of electorates (2009)" real) | SELECT "District" FROM table_12422 WHERE "Reserved for ( SC / ST /None)" = 'sc' |
what was the last height of patient 728 until 32 months ago. | 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)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number... | SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 728)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit ht' A... |
What country is Jack Nicklaus from? | CREATE TABLE table_45302 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money ($)" text) | SELECT "Country" FROM table_45302 WHERE "Player" = 'jack nicklaus' |
fasting glucose of 100 _ 125 mg / dl ( impaired fasting glucose tolerance ) and / or 2 _ hour post _ load glucose of 140 _ 199 mg / dl ( impaired glucose tolerance ) | CREATE TABLE table_train_180 ("id" int,"gender" string,"pregnancy_or_lactation" bool,"systolic_blood_pressure_sbp" int,"hemoglobin_a1c_hba1c" float,"diabetic" string,"post_load_glucose" int,"diastolic_blood_pressure_dbp" int,"impaired_glucose_tolerance" bool,"fasting_glucose" int,"age" float,"NOUSE" float) | SELECT * FROM table_train_180 WHERE fasting_glucose >= 100 AND fasting_glucose <= 125 OR impaired_glucose_tolerance = 1 OR (post_load_glucose >= 140 AND post_load_glucose <= 199) OR impaired_glucose_tolerance = 1 |
What has ras bodik published ? | CREATE TABLE writes (paperid int,authorid int)CREATE TABLE paper (paperid int,title varchar,venueid int,year int,numciting int,numcitedby int,journalid int)CREATE TABLE field (fieldid int)CREATE TABLE venue (venueid int,venuename varchar)CREATE TABLE cite (citingpaperid int,citedpaperid int)CREATE TABLE author (authori... | SELECT DISTINCT writes.paperid FROM author, writes WHERE author.authorname = 'ras bodik' AND writes.authorid = author.authorid |
a recent injury to body or limb | CREATE TABLE table_train_268 ("id" int,"basal_rate" float,"systolic_blood_pressure_sbp" int,"renal_disease" bool,"major_illness" bool,"creatinine_clearance_cl" float,"injury_to_body" bool,"diastolic_blood_pressure_dbp" int,"injury_to_limb" bool,"hypertension" bool,"age" float,"NOUSE" float) | SELECT * FROM table_train_268 WHERE injury_to_body = 1 OR injury_to_limb = 1 |
who produced the track no main topic ? | CREATE TABLE table_203_228 (id number,"#" number,"title" text,"songwriters" text,"producer(s)" text,"performer (s)" text) | SELECT "producer(s)" FROM table_203_228 WHERE "title" = '"no main topic"' |
For all employees who have the letters D or S in their first name, give me the comparison about the sum of employee_id over the hire_date bin hire_date by time. | 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 countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME... | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' |
Find the latest logon date of the students whose family name is 'Jaskolski' or 'Langosh', and count them by a bar chart | CREATE TABLE Courses (course_id INTEGER,author_id INTEGER,subject_id INTEGER,course_name VARCHAR(120),course_description VARCHAR(255))CREATE TABLE Subjects (subject_id INTEGER,subject_name VARCHAR(120))CREATE TABLE Student_Tests_Taken (registration_id INTEGER,date_test_taken DATETIME,test_result VARCHAR(255))CREATE TAB... | SELECT date_of_latest_logon, COUNT(date_of_latest_logon) FROM Students WHERE family_name = "Jaskolski" OR family_name = "Langosh" |
How many Februarys have montreal canadiens as the opponent, and 18-25-10 as the record, with a game greater than 53? | CREATE TABLE table_name_32 (february VARCHAR,game VARCHAR,opponent VARCHAR,record VARCHAR) | SELECT COUNT(february) FROM table_name_32 WHERE opponent = "montreal canadiens" AND record = "18-25-10" AND game > 53 |
What location was the campus that has a size of 245 acres? | CREATE TABLE table_name_86 (location VARCHAR,size VARCHAR) | SELECT location FROM table_name_86 WHERE size = "245 acres" |
What team has a year listed of 2008? | CREATE TABLE table_32973 ("Year" real,"Sportsperson" text,"Nation of birth" text,"Team" text,"Competition,federation,or league" text,"Sport" text) | SELECT "Team" FROM table_32973 WHERE "Year" = '2008' |
Which telescopes were sponsored by or originated in Belgium? | CREATE TABLE table_23851574_2 (name VARCHAR,nationality_sponsors VARCHAR) | SELECT name FROM table_23851574_2 WHERE nationality_sponsors = "Belgium" |
Give me the number of male patients who had an endoscopic sphincterotomy and papillotomy procedure. | 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 diagnoses (subject_id text,hadm_id tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.long_title = "Endoscopic sphincterotomy and papillotomy" |
What are the moving parts of lead-acid? | CREATE TABLE table_44923 ("Technology" text,"Moving Parts" text,"Room Temperature" text,"Flammable" text,"Toxic Materials" text,"In production" text,"Rare metals" text) | SELECT "Moving Parts" FROM table_44923 WHERE "Technology" = 'lead-acid' |
what was the age of patient 022-158213 in their last hospital encounter? | 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 patient.age FROM patient WHERE patient.uniquepid = '022-158213' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1 |
Average time to Answer a question. | CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,OwnerUserId number,Comment text,Text text,Title text,Tags text,RevisionGUID other)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE ReviewTaskResults (Id ... | SELECT p1.Id AS "AnsID", p1.ParentId AS "QuestionId", p1.CreationDate AS "AnsCreationdate", p2.CreationDate AS "QuestionCreationdate", CAST((JULIANDAY(CreationDate) - JULIANDAY(p2.CreationDate)) * 1440.0 AS INT) AS Time_Difference FROM Posts AS p1 JOIN Posts AS p2 ON p1.ParentId = p2.Id WHERE p1.PostTypeId = 2 AND p1.P... |
Which home team has a playoff record of (0-0) and played La Crosse Spartans? | CREATE TABLE table_14556 ("Opponent" text,"OVERALL" text,"HOME" text,"AWAY" text,"PLYFF" text) | SELECT "HOME" FROM table_14556 WHERE "PLYFF" = '(0-0)' AND "Opponent" = 'la crosse spartans' |
how many patients of white russian ethnicty are diagnosed with unspecified septicemia? | 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.ethnicity = "WHITE - RUSSIAN" AND diagnoses.long_title = "Unspecified septicemia" |
What is Film Title Used In Nomination, when Primary Language(s) is 'Azerbaijani, Russian'? | CREATE TABLE table_name_83 (film_title_used_in_nomination VARCHAR,primary_language_s_ VARCHAR) | SELECT film_title_used_in_nomination FROM table_name_83 WHERE primary_language_s_ = "azerbaijani, russian" |
What is the date of attack of the Circe Shell Ship? | CREATE TABLE table_44104 ("Date" text,"Name" text,"Nationality" text,"Tonnage (GRT)" real,"Fate" text) | SELECT "Date" FROM table_44104 WHERE "Name" = 'circe shell' |
estimated gfr ( by modified diet in renal disease ) < 45 ml / min / 1.73 m2 ( within 2 weeks of planned cmr ) | CREATE TABLE table_train_278 ("id" int,"gender" string,"supine" bool,"systolic_blood_pressure_sbp" int,"hemoglobin_a1c_hba1c" float,"estimated_glomerular_filtration_rate_egfr" int,"diastolic_blood_pressure_dbp" int,"serum_creatinine" float,"bilirubin" float,"NOUSE" float) | SELECT * FROM table_train_278 WHERE estimated_glomerular_filtration_rate_egfr < 45 |
how many episode have 8.4 millions viewer. | CREATE TABLE table_2112766_1 (episode VARCHAR,viewers__in_millions_ VARCHAR) | SELECT COUNT(episode) FROM table_2112766_1 WHERE viewers__in_millions_ = "8.4" |
what conferences are related to sensor fusion | CREATE TABLE writes (paperid int,authorid int)CREATE TABLE paperfield (fieldid int,paperid int)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE keyphrase (keyphraseid int,keyphrasename varchar)CREATE TABLE venue (venueid int,venuename varchar)CREATE TABLE author (authorid int,authorname varchar)CREA... | SELECT DISTINCT paper.venueid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'sensor fusion' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid |
Name the PATH classes offered in Fall term . | CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE stude... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'PATH' AND semester.semester = 'Fall' |
what were the top three frequently prescribed drugs that were prescribed to patients within the same month after they were prescribed with acetaminophen (tylenol) tab 650 mg until 3 years ago? | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissio... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'acetaminophen (tylenol) tab 650 mg' AND DATETIME(me... |
Where did Ben Gordon (8) have the high assists? | CREATE TABLE table_name_55 (location_attendance VARCHAR,high_assists VARCHAR) | SELECT location_attendance FROM table_name_55 WHERE high_assists = "ben gordon (8)" |
Which Away has an Opponent of slavia prague? | CREATE TABLE table_6713 ("Season" text,"Competition" text,"Round" text,"Opponent" text,"Home" text,"Away" text,"Agg." text) | SELECT "Away" FROM table_6713 WHERE "Opponent" = 'slavia prague' |
Name the capacity for the engine of 2.0 duratorq | CREATE TABLE table_name_84 (capacity VARCHAR,model_engine VARCHAR) | SELECT capacity FROM table_name_84 WHERE model_engine = "2.0 duratorq" |
Which opponent had a round of more than 1 and an even of PFP: ring of fire? | CREATE TABLE table_5168 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Location" text) | SELECT "Opponent" FROM table_5168 WHERE "Round" > '1' AND "Event" = 'pfp: ring of fire' |
how many asian patients died in or before 2154? | 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 diagnoses (subject_id text,hadm_id tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.dod_year <= "2154.0" |
Which extra resulted in 2nd before 2005? | CREATE TABLE table_name_30 (extra VARCHAR,result VARCHAR,year VARCHAR) | SELECT extra FROM table_name_30 WHERE result = "2nd" AND year < 2005 |
How many people witnessed their home team score 13.15 (93)? | CREATE TABLE table_78497 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT MAX("Crowd") FROM table_78497 WHERE "Home team score" = '13.15 (93)' |
What is the name of the location and ship type in the Gulf of Mexico that entered service in 1999? | CREATE TABLE table_name_43 (name VARCHAR,entered_service VARCHAR,location VARCHAR,type VARCHAR) | SELECT name FROM table_name_43 WHERE location = "gulf of mexico" AND type = "ship" AND entered_service = "1999" |
how many of the patients had cardiac mapping on urgent admission? | 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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.long_title = "Cardiac mapping" |
What is the total amount of grid when the laps amount was smaller than 68 and the time/retired was injection? | CREATE TABLE table_name_87 (grid INTEGER,laps VARCHAR,time_retired VARCHAR) | SELECT SUM(grid) FROM table_name_87 WHERE laps < 68 AND time_retired = "injection" |
Which Points for has a Losing bonus of 2, and a Club of bridgend sports rfc? | CREATE TABLE table_8546 ("Club" text,"Played" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Tries for" text,"Tries against" text,"Try bonus" text,"Losing bonus" text,"Points" text) | SELECT "Points for" FROM table_8546 WHERE "Losing bonus" = '2' AND "Club" = 'bridgend sports rfc' |
WHAT TEAM HAS 12TH TABLE POSITION AND REPLACED BY OVE PEDERSEN? | CREATE TABLE table_name_98 (team VARCHAR,position_in_table VARCHAR,replaced_by VARCHAR) | SELECT team FROM table_name_98 WHERE position_in_table = "12th" AND replaced_by = "ove pedersen" |
What is the episode # of the episode that originally aired on January 21, 2001? | CREATE TABLE table_57004 ("Episode #" text,"Title" text,"Directed by" text,"Written by" text,"Original airdate" text) | SELECT "Episode #" FROM table_57004 WHERE "Original airdate" = 'january 21, 2001' |
Display a pie chart for how many gymnasts are from each hometown? | CREATE TABLE gymnast (Gymnast_ID int,Floor_Exercise_Points real,Pommel_Horse_Points real,Rings_Points real,Vault_Points real,Parallel_Bars_Points real,Horizontal_Bar_Points real,Total_Points real)CREATE TABLE people (People_ID int,Name text,Age real,Height real,Hometown text) | SELECT Hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown |
what is the first region on the chart | CREATE TABLE table_204_321 (id number,"community" text,"currency" text,"region" text,"target date" number,"notes" text) | SELECT "region" FROM table_204_321 WHERE id = 1 |
Which Tries has a Goal smaller than 0? | CREATE TABLE table_name_5 (tries INTEGER,goals INTEGER) | SELECT MIN(tries) FROM table_name_5 WHERE goals < 0 |
How many data was given the total electricity in GW-h if the renewable electricity w/o hydro (GW-h) is 3601? | CREATE TABLE table_25244412_2 (total_electricity__gw VARCHAR,renewable_electricity_w_o_hydro__gw·h_ VARCHAR) | SELECT COUNT(total_electricity__gw) AS ·h_ FROM table_25244412_2 WHERE renewable_electricity_w_o_hydro__gw·h_ = 3601 |
For those records from the products and each product's manufacturer, show me about the distribution of name and the sum of code , and group by attribute name in a bar chart, and I want to sort in asc by the Y. | 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.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Code |
What are the complements when the commander is Major William Lloyd? | CREATE TABLE table_17183 ("Unit" text,"Commander" text,"Complement" text,"Killed" text,"Wounded" text,"Missing" text) | SELECT "Complement" FROM table_17183 WHERE "Commander" = 'Major William Lloyd' |
What's the bulgarian word for January? | CREATE TABLE table_name_95 (bulgarian_name VARCHAR,english_name VARCHAR) | SELECT bulgarian_name FROM table_name_95 WHERE english_name = "january" |
what is marital status and primary disease of subject name james cepeda? | 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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob... | SELECT demographic.marital_status, demographic.diagnosis FROM demographic WHERE demographic.name = "James Cepeda" |
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, find hire_date and the amount of hire_date bin hire_date by weekday, and visualize them by a bar chart, and show by the total number in asc please. | 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 decimal(2,2),MANAGER_ID decimal(6,0),DEPARTMENT_ID decimal(4,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGIO... | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY COUNT(HIRE_DATE) |
What January 15-16 is is that corresponds to November 3, 2013? | CREATE TABLE table_25284864_3 (january_15_16 VARCHAR,november_3 VARCHAR) | SELECT january_15_16 FROM table_25284864_3 WHERE november_3 = "november_3, 2013" |
Find ACC_Regular_Season and All_Games_Percent , and visualize them by a bar chart, rank by the Y-axis in descending. | CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Perce... | SELECT ACC_Regular_Season, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent DESC |
How many students live in each city, I want to show total number from high to low order. | CREATE TABLE Has_Allergy (StuID INTEGER,Allergy VARCHAR(20))CREATE TABLE Allergy_Type (Allergy VARCHAR(20),AllergyType VARCHAR(20))CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1),Major INTEGER,Advisor INTEGER,city_code VARCHAR(3)) | SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY COUNT(*) DESC |
Who is the opponent on September 9, 1979? | CREATE TABLE table_name_99 (opponent VARCHAR,date VARCHAR) | SELECT opponent FROM table_name_99 WHERE date = "september 9, 1979" |
Name the number of lost where tries for is 109 | CREATE TABLE table_17625749_1 (lost VARCHAR,tries_for VARCHAR) | SELECT COUNT(lost) FROM table_17625749_1 WHERE tries_for = "109" |
What was the lowest Crowd total from a game in which Essendon was the Away team? | CREATE TABLE table_name_35 (crowd INTEGER,away_team VARCHAR) | SELECT MIN(crowd) FROM table_name_35 WHERE away_team = "essendon" |
What conference has 2009 as the season, with super leg final as the format? | CREATE TABLE table_9254 ("Season" real,"Conference" text,"Champion" text,"Format" text,"Series" text,"Runner-Up" text) | SELECT "Conference" FROM table_9254 WHERE "Season" = '2009' AND "Format" = 'super leg final' |
find out the short title of both diagnoses and procedure for patient with patient id 23602. | 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 diagnoses.short_title, procedures.short_title FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "23602" |
has ever been the sao2 of patient 22897 been ever less than 98.0 until 21 months ago? | CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)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,admissi... | SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22897)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'sao2' AND d_items... |
Who was the home team when the record was 36 21 8? | CREATE TABLE table_70290 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text) | SELECT "Home" FROM table_70290 WHERE "Record" = '36–21–8' |
stroke or recent diagnosis of coronary artery disease | CREATE TABLE table_train_264 ("id" int,"stroke" bool,"hematocrit_hct" float,"serum_psa" float,"coronary_artery_disease_cad" bool,"international_prostate_symptom_score_ipss" int,"hypertension" bool,"NOUSE" float) | SELECT * FROM table_train_264 WHERE stroke = 1 OR coronary_artery_disease_cad = 1 |
How many matches played are associated with 20 losses? | CREATE TABLE table_15493 ("Club" text,"Played" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Points" text) | SELECT "Played" FROM table_15493 WHERE "Lost" = '20' |
what's the yearly maximum dose of pe 20 fs po for patient 4718 until 48 months ago? | 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 transfers (row_id number,subjec... | SELECT MAX(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4718)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.labe... |
What date was the surface hard and Eva Hrdinov was the opponent? | CREATE TABLE table_name_40 (date VARCHAR,surface VARCHAR,opponent VARCHAR) | SELECT date FROM table_name_40 WHERE surface = "hard" AND opponent = "eva hrdinová" |
Which Inhabitants have a Party of democratic party, and a Municipality of florence, and an Election smaller than 2009? | CREATE TABLE table_13602 ("Municipality" text,"Inhabitants" real,"Mayor" text,"Party" text,"Election" real) | SELECT MIN("Inhabitants") FROM table_13602 WHERE "Party" = 'democratic party' AND "Municipality" = 'florence' AND "Election" < '2009' |
What was the competition on 7 June 1999? | CREATE TABLE table_name_84 (competition VARCHAR,date VARCHAR) | SELECT competition FROM table_name_84 WHERE date = "7 june 1999" |
What name was number 7 when Mason was number 1, Owen was number 6, Jackson was number 9, and Logan was number 10? | CREATE TABLE table_name_68 (no_7 VARCHAR,no_6 VARCHAR,no_10 VARCHAR,no_1 VARCHAR,no_9 VARCHAR) | SELECT no_7 FROM table_name_68 WHERE no_1 = "mason" AND no_9 = "jackson" AND no_10 = "logan" AND no_6 = "owen" |
Which away team had a venue of mcg? | CREATE TABLE table_name_90 (away_team VARCHAR,venue VARCHAR) | SELECT away_team FROM table_name_90 WHERE venue = "mcg" |
What is the total number of top-25 that has a top-10 smaller than 4 with 0 cuts? | CREATE TABLE table_name_95 (top_25 VARCHAR,top_10 VARCHAR,cuts_made VARCHAR) | SELECT COUNT(top_25) FROM table_name_95 WHERE top_10 < 4 AND cuts_made > 0 |
how many patients aged below 58 years had the procedure icd9 code 3612? | 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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "58" AND procedures.icd9_code = "3612" |
how many patients who had the lab test named alveolar-arterial gradient had abnormal lab test results? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.flag = "abnormal" AND lab.label = "Alveolar-arterial Gradient" |
What code is used to represent the currency of Croatian Kuna? | CREATE TABLE table_66059 ("Currency" text,"Code" text,"Entry ERM II" text,"Central rate" text,"Official target date" text) | SELECT "Code" FROM table_66059 WHERE "Currency" = 'croatian kuna' |
What shows at 7:30 am when 3:30 pm is Big Guy and Rusty the Boy Robot? | CREATE TABLE table_61199 ("7:00 am" text,"7:30 am" text,"8:00 am" text,"9:00 am" text,"11:00 am" text,"noon" text,"12:30 pm" text,"1:00 pm" text,"1:30 pm" text,"2:00 pm" text,"3:00 pm" text,"3:30 pm" text,"4:00 pm" text,"4:30 pm" text,"5:00 pm" text,"6:30 pm" text) | SELECT "7:30 am" FROM table_61199 WHERE "3:30 pm" = 'big guy and rusty the boy robot' |
What date was the race at Oran Park ran? | CREATE TABLE table_name_25 (date VARCHAR,race_title VARCHAR) | SELECT date FROM table_name_25 WHERE race_title = "oran park" |
Return the themes of farm competitions, sorted by year ascending. | CREATE TABLE farm_competition (competition_id number,year number,theme text,host_city_id number,hosts text)CREATE TABLE city (city_id number,official_name text,status text,area_km_2 number,population number,census_ranking text)CREATE TABLE competition_record (competition_id number,farm_id number,rank number)CREATE TABL... | SELECT theme FROM farm_competition ORDER BY year |
Which team was the home team at Glenferrie Oval? | CREATE TABLE table_name_82 (home_team VARCHAR,venue VARCHAR) | SELECT home_team FROM table_name_82 WHERE venue = "glenferrie oval" |
Who had the lowest field goals but had 10 points and more than 2 touchdowns? | CREATE TABLE table_35970 ("Player" text,"Touchdowns" real,"Extra points" real,"Field goals" real,"Points" real) | SELECT MIN("Field goals") FROM table_35970 WHERE "Points" = '10' AND "Touchdowns" > '2' |
Show the customer id and number of accounts with most accounts. | CREATE TABLE customers (customer_id number,customer_first_name text,customer_last_name text,customer_address text,customer_phone text,customer_email text,other_customer_details text)CREATE TABLE customers_cards (card_id number,customer_id number,card_type_code text,card_number text,date_valid_from time,date_valid_to ti... | SELECT customer_id, COUNT(*) FROM accounts GROUP BY customer_id ORDER BY COUNT(*) DESC LIMIT 1 |
Please show the nominee who has been nominated the greatest number of times. | CREATE TABLE actor (actor_id number,name text,musical_id number,character text,duration text,age number)CREATE TABLE musical (musical_id number,name text,year number,award text,category text,nominee text,result text) | SELECT nominee FROM musical GROUP BY nominee ORDER BY COUNT(*) DESC LIMIT 1 |
My posts which were last edited by someone else. | CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,OwnerUserId number,Comment text,Text text,Title text,Tags text,RevisionGUID other)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE Pos... | SELECT Id AS "post_link", LastEditDate, Body FROM Posts WHERE OwnerUserId = '##UserId##' AND LastEditorUserId != OwnerUserId ORDER BY LastEditDate DESC |
which is the other nation with the second highest sliver medal | CREATE TABLE table_204_107 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number) | SELECT "nation" FROM table_204_107 WHERE "silver" < (SELECT MAX("silver") FROM table_204_107) ORDER BY "silver" DESC LIMIT 1 |
How many tournaments recorded a score of 206 (-7)? | CREATE TABLE table_16958 ("Date" text,"Tournament" text,"Location" text,"Purse($)" real,"Winner" text,"Score" text,"1st Prize($)" real) | SELECT COUNT("Tournament") FROM table_16958 WHERE "Score" = '206 (-7)' |
Name the date with winner outcome and opponent of noppawan lertcheewakarn jessica moore | CREATE TABLE table_6498 ("Outcome" text,"Date" text,"Surface" text,"Partner" text,"Opponent" text,"Score" text) | SELECT "Date" FROM table_6498 WHERE "Outcome" = 'winner' AND "Opponent" = 'noppawan lertcheewakarn jessica moore' |
Who appointed the representative that had a Presentation of Credentials on March 25, 1976? | CREATE TABLE table_80247 ("Representative" text,"Title" text,"Presentation of Credentials" text,"Termination of Mission" text,"Appointed by" text) | SELECT "Appointed by" FROM table_80247 WHERE "Presentation of Credentials" = 'march 25, 1976' |
Which Date has a Record of 36 11 7? | CREATE TABLE table_49083 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Decision" text,"Attendance" real,"Record" text) | SELECT "Date" FROM table_49083 WHERE "Record" = '36–11–7' |
What is the average Fiscal Year of the firm Headquartered in noida, with less than 85,335 employees? | CREATE TABLE table_35239 ("Firm" text,"Revenues" text,"Employees" real,"Fiscal Year" real,"Headquarters" text) | SELECT AVG("Fiscal Year") FROM table_35239 WHERE "Headquarters" = 'noida' AND "Employees" < '85,335' |
For those records from the products and each product's manufacturer, a bar chart shows the distribution of name and the sum of 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 T2.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name |
Which Call Sign that has a Tail Code of oy belong to Weapon Systems Officer Capt Charles B. Debellevue? | CREATE TABLE table_name_37 (call_sign VARCHAR,tail_code VARCHAR,weapon_systems_officer VARCHAR) | SELECT call_sign FROM table_name_37 WHERE tail_code = "oy" AND weapon_systems_officer = "capt charles b. debellevue" |
what's the new south wales with crop (kilotonnes) being canola | CREATE TABLE table_1057262_2 (new_south_wales VARCHAR,crop__kilotonnes_ VARCHAR) | SELECT new_south_wales FROM table_1057262_2 WHERE crop__kilotonnes_ = "Canola" |
What are the names and average salaries for departments with average salary higher than 42000? | CREATE TABLE department (dept_name text,building text,budget number)CREATE TABLE instructor (id text,name text,dept_name text,salary number)CREATE TABLE prereq (course_id text,prereq_id text)CREATE TABLE student (id text,name text,dept_name text,tot_cred number)CREATE TABLE time_slot (time_slot_id text,day text,start_h... | SELECT dept_name, AVG(salary) FROM instructor GROUP BY dept_name HAVING AVG(salary) > 42000 |
What is the status of donor payment in the country where there are 6 children per donor and no data on allowed recipients? | CREATE TABLE table_20598 ("Country" text,"Donor payment" text,"Children per donor" text,"Donor anonymity" text,"Allowed recipients" text) | SELECT "Donor payment" FROM table_20598 WHERE "Children per donor" = '6 children' AND "Allowed recipients" = 'no data' |
What date did Delage win? | CREATE TABLE table_name_34 (date VARCHAR,winning_constructor VARCHAR) | SELECT date FROM table_name_34 WHERE winning_constructor = "delage" |
Which Drawn has a Lost of 19? | CREATE TABLE table_name_61 (drawn VARCHAR,lost VARCHAR) | SELECT drawn FROM table_name_61 WHERE lost = "19" |
Who is the opponent of the match at cua stadium? | CREATE TABLE table_name_7 (opponent VARCHAR,venue VARCHAR) | SELECT opponent FROM table_name_7 WHERE venue = "cua stadium" |
What is Dominik Meichtry's Time in Heat 7 or lower? | CREATE TABLE table_13507 ("Rank" real,"Heat" real,"Lane" real,"Name" text,"Nationality" text,"Time" real) | SELECT COUNT("Time") FROM table_13507 WHERE "Name" = 'dominik meichtry' AND "Heat" < '7' |
give me the number of patients whose admission location is emergency room admit and drug code is esmobase? | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND prescriptions.formulary_drug_cd = "ESMOBASE" |
What was the Result in Green Lane with Kirkburton as the Runner-up? | CREATE TABLE table_38563 ("Season" text,"Winner" text,"Result" text,"Runner-up" text,"Final venue" text) | SELECT "Result" FROM table_38563 WHERE "Runner-up" = 'kirkburton' AND "Final venue" = 'green lane' |
which Record has a Home of ottawa senators on Date of december 21? | CREATE TABLE table_8375 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text) | SELECT "Record" FROM table_8375 WHERE "Home" = 'ottawa senators' AND "Date" = 'december 21' |
when in 05/this year was patient 3939's last test for po2? | 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 labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE inputevents_cv (row_... | SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'po2') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3939) AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.