instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
what was the name of procedure that patient 24894 were first received until 2103? | CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)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... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24894) AND STRFTIME('%y', procedures_icd.charttime) <= '2103' ORDER ... |
who is the constructor when the free practice driver(s) is n/a, the chassis is 005 and the driver is takuma sato? | CREATE TABLE table_55151 ("Entrant" text,"Constructor" text,"Chassis" text,"Engine \u2020" text,"Tyre" text,"Driver" text,"Rounds" text,"Free Practice driver(s)" text) | SELECT "Constructor" FROM table_55151 WHERE "Free Practice driver(s)" = 'n/a' AND "Chassis" = '005' AND "Driver" = 'takuma sato' |
Glenys Bakker was second for which nation? | CREATE TABLE table_6953 ("Nation" text,"Skip" text,"Third" text,"Second" text,"Lead" text,"Alternate" text,"Club" text) | SELECT "Nation" FROM table_6953 WHERE "Second" = 'glenys bakker' |
What is required for MCDB 680 and 489 ? | CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE area (course_id int,area varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TAB... | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE (COURSE_1.number = 680 OR COURSE_1.number = 489) AND COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.depar... |
how many of the patients with icd9 code 69514 have an unspecified death status? | 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 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 ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.icd9_code = "69514" |
For those employees who did not have any job in the past, give me the comparison about the sum of employee_id over the hire_date bin hire_date by weekday by a bar chart. | 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 jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY dec... | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) |
Which Record has Points smaller than 40, and a Game larger than 25, and a Score of 2 0? | CREATE TABLE table_name_49 (record VARCHAR,score VARCHAR,points VARCHAR,game VARCHAR) | SELECT record FROM table_name_49 WHERE points < 40 AND game > 25 AND score = "2–0" |
what is the company with the parent company wrightbus? | CREATE TABLE table_27297 ("Company" text,"Parent company" text,"Parent headquarters" text,"Plant" text,"Models produced" text,"Production (latest figures)" text) | SELECT "Company" FROM table_27297 WHERE "Parent company" = 'Wrightbus' |
What was the engine of the Hoover Motor Express after 1955 with greater than 0 points? | CREATE TABLE table_name_42 (engine VARCHAR,entrant VARCHAR,year VARCHAR,points VARCHAR) | SELECT engine FROM table_name_42 WHERE year > 1955 AND points > 0 AND entrant = "hoover motor express" |
Answers per day on [rust]: total vs. Shepmaster's answers. | CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,UpVotes number,DownVotes number,ProfileImageUrl text,EmailHash text,AccountId number)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteT... | SELECT MIN(answers.CreationDate), (COUNT(*) + 0.0) / TIME_TO_STR(LAST_DATE_OF_MONTH(MIN(answers.CreationDate)), '%d') AS "answers per day", COUNT(CASE answers.OwnerDisplayName WHEN 'Shepmaster' THEN 1 ELSE NULL END) + 0.0 / TIME_TO_STR(LAST_DATE_OF_MONTH(MIN(answers.CreationDate)), '%d') AS "shepmasters answers per day... |
Name the location for chattahoochee technical college | CREATE TABLE table_16734640_1 (location VARCHAR,institution VARCHAR) | SELECT location FROM table_16734640_1 WHERE institution = "Chattahoochee Technical College" |
What is the weekly rank with an air date is november 12, 2007? | CREATE TABLE table_11178271_1 (weekly_rank VARCHAR,air_date VARCHAR) | SELECT weekly_rank FROM table_11178271_1 WHERE air_date = "November 12, 2007" |
autoencoder papers | CREATE TABLE writes (paperid int,authorid int)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE keyphrase (keyphraseid int,keyphrasename varchar)CREATE TABLE paper (paperid int,title varchar,venueid int,year int,numciting int,numcitedby int,journalid int)CREATE TABLE cite (citingpaperid int,citedpape... | SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'autoencoder' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid |
give me the number of patients whose admission location is emergency room admit and primary disease is transient ischemic attack? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.diagnosis = "TRANSIENT ISCHEMIC ATTACK" |
Name the Drawn for tries against of 36 and points of 66 | CREATE TABLE table_68939 ("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 "Drawn" FROM table_68939 WHERE "Tries against" = '36' AND "Points" = '66' |
List the companies of entrepreneurs in descending order of money requested. | CREATE TABLE people (people_id number,name text,height number,weight number,date_of_birth text)CREATE TABLE entrepreneur (entrepreneur_id number,people_id number,company text,money_requested number,investor text) | SELECT company FROM entrepreneur ORDER BY money_requested DESC |
what number of patients admitted in urgent care had their route mentioned as ivpca? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.route = "IVPCA" |
find the program owners that have some programs in both morning and night time. | CREATE TABLE broadcast (program_id VARCHAR,Time_of_day VARCHAR)CREATE TABLE program (owner VARCHAR,program_id VARCHAR) | SELECT t1.owner FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id WHERE t2.Time_of_day = "Morning" INTERSECT SELECT t1.owner FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id WHERE t2.Time_of_day = "Night" |
How many different items appear in the enrollment column that joined in 1931, 1949 1? | CREATE TABLE table_28404 ("Institution" text,"Location" text,"Nickname" text,"Founded" real,"Type" text,"Enrollment" real,"Joined" text) | SELECT COUNT("Enrollment") FROM table_28404 WHERE "Joined" = '1931, 1949 1' |
what is the college/junior/club team (league) when the round is less than 7? | CREATE TABLE table_name_82 (college_junior_club_team__league_ VARCHAR,round INTEGER) | SELECT college_junior_club_team__league_ FROM table_name_82 WHERE round < 7 |
What is the high grid total for maserati with under 35 laps? | CREATE TABLE table_name_64 (grid INTEGER,laps VARCHAR,constructor VARCHAR) | SELECT MAX(grid) FROM table_name_64 WHERE laps < 35 AND constructor = "maserati" |
Tell me the player for pick of 145 | CREATE TABLE table_4356 ("Pick" text,"Player" text,"Position" text,"Nationality" text,"NHL team" text) | SELECT "Player" FROM table_4356 WHERE "Pick" = '145' |
What is the date of the game when the Rockies had a record of 61 66? | CREATE TABLE table_name_91 (date VARCHAR,record VARCHAR) | SELECT date FROM table_name_91 WHERE record = "61–66" |
What was the country with a population density per km of 3.5/km (/sqmi)? | CREATE TABLE table_3647 ("Country or territory with flag" text,"Area (km\u00b2) (per sqmi)" text,"Population (July 2009 est.)" real,"Population density per km\u00b2" text,"Capital" text) | SELECT "Country or territory with flag" FROM table_3647 WHERE "Population density per km\u00b2" = '3.5/km² (/sqmi)' |
how many of the patients with icd9 code 3532 died in the year less than 2174? | 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 procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2174.0" AND procedures.icd9_code = "3532" |
Which cage dive has none as a 3-person dive? | CREATE TABLE table_70262 ("1-person dive" text,"2-person dive" text,"3-person dive" text,"Surface" text,"Cage dive" text,"Seal/turtle decoy" text,"Catch release" text,"Attached camera" text,"Remote camera" text) | SELECT "Cage dive" FROM table_70262 WHERE "3-person dive" = 'none' |
when patient 025-24306 was admitted to the hospital via the emergency department for the first time until 2104? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE medication (medicationid number,patientunitstayid num... | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '025-24306' AND patient.hospitaladmitsource = 'emergency department' AND STRFTIME('%y', patient.hospitaladmittime) <= '2104' ORDER BY patient.hospitaladmittime LIMIT 1 |
Who got the gold in seoul before 2002? | CREATE TABLE table_36780 ("Year" real,"Location" text,"Gold" text,"Silver" text,"Bronze" text) | SELECT "Gold" FROM table_36780 WHERE "Year" < '2002' AND "Location" = 'seoul' |
What class has less than 12 numbers built operated by southern? | CREATE TABLE table_51458 ("Class" text,"Operator" text,"No. Built" real,"Year Built" text,"Cars per Set" real,"Unit nos." text) | SELECT "Class" FROM table_51458 WHERE "No. Built" < '12' AND "Operator" = 'southern' |
Which date had a sport of Academics? | CREATE TABLE table_33973 ("Date" text,"Site" text,"Sport" text,"Winning team" text,"Series" text) | SELECT "Date" FROM table_33973 WHERE "Sport" = 'academics' |
How many accounts are there in total? | CREATE TABLE accounts (Id VARCHAR) | SELECT COUNT(*) FROM accounts |
Bar chart x axis venue y axis how many venue | CREATE TABLE debate_people (Debate_ID int,Affirmative int,Negative int,If_Affirmative_Win bool)CREATE TABLE people (People_ID int,District text,Name text,Party text,Age int)CREATE TABLE debate (Debate_ID int,Date text,Venue text,Num_of_Audience int) | SELECT Venue, COUNT(Venue) FROM debate GROUP BY Venue |
Bin the claim date into the Day of Week interval and count them for visualizing a bar chart, display by the y axis in ascending. | CREATE TABLE Claims (Claim_ID INTEGER,Policy_ID INTEGER,Date_Claim_Made DATE,Date_Claim_Settled DATE,Amount_Claimed INTEGER,Amount_Settled INTEGER)CREATE TABLE Customer_Policies (Policy_ID INTEGER,Customer_ID INTEGER,Policy_Type_Code CHAR(15),Start_Date DATE,End_Date DATE)CREATE TABLE Settlements (Settlement_ID INTEGER... | SELECT Date_Claim_Made, COUNT(Date_Claim_Made) FROM Settlements ORDER BY COUNT(Date_Claim_Made) |
What score has zadar as the tournament? | CREATE TABLE table_name_27 (score VARCHAR,tournament VARCHAR) | SELECT score FROM table_name_27 WHERE tournament = "zadar" |
What is the region for tv uskana? | CREATE TABLE table_name_5 (region VARCHAR,name VARCHAR) | SELECT region FROM table_name_5 WHERE name = "tv uskana" |
Tag Wiki edits owned by Community. | CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,U... | SELECT * FROM Posts AS p JOIN PostHistory ON PostId = p.Id WHERE UserId = -1 AND PostTypeId IN (4, 5) |
For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of job_id and the sum of salary , and group by attribute job_id, and display by the JOB_ID in desc. | CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE ... | SELECT JOB_ID, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID DESC |
What is the highest rank with the notes of sa/b, and a time of 6:39.07? | CREATE TABLE table_63806 ("Rank" real,"Rowers" text,"Country" text,"Time" text,"Notes" text) | SELECT MAX("Rank") FROM table_63806 WHERE "Notes" = 'sa/b' AND "Time" = '6:39.07' |
How many staff in total? | CREATE TABLE vehicles (vehicle_id number,vehicle_details text)CREATE TABLE customers (customer_id number,customer_address_id number,customer_status_code text,date_became_customer time,date_of_birth time,first_name text,last_name text,amount_outstanding number,email_address text,phone_number text,cell_mobile_phone_numbe... | SELECT COUNT(*) FROM staff |
What is the package/option for Italy when the language is italian? | CREATE TABLE table_40744 ("Television service" text,"Country" text,"Language" text,"Content" text,"HDTV" text,"Package/Option" text) | SELECT "Package/Option" FROM table_40744 WHERE "Country" = 'italy' AND "Language" = 'italian' |
What is the average base price of rooms, for each bed type Plot them as bar chart, and display in asc by the bedType please. | CREATE TABLE Rooms (RoomId TEXT,roomName TEXT,beds INTEGER,bedType TEXT,maxOccupancy INTEGER,basePrice INTEGER,decor TEXT)CREATE TABLE Reservations (Code INTEGER,Room TEXT,CheckIn TEXT,CheckOut TEXT,Rate REAL,LastName TEXT,FirstName TEXT,Adults INTEGER,Kids INTEGER) | SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType ORDER BY bedType |
what number of patients have been discharged from the hospital since 3 years ago? | 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 COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND DATETIME(patient.hospitaldischargetime) >= DATETIME(CURRENT_TIME(), '-3 year') |
What is the fewest number of draws for teams with more than 0 byes? | CREATE TABLE table_name_75 (draws INTEGER,byes INTEGER) | SELECT MIN(draws) FROM table_name_75 WHERE byes > 0 |
What are the original air date(s) for season episode 20? | CREATE TABLE table_26866519_1 (original_airdate VARCHAR,season__number VARCHAR) | SELECT original_airdate FROM table_26866519_1 WHERE season__number = 20 |
among patients admitted on phys referral/normal deli, calculate the total number of those treated with glycerin (ped) | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND prescriptions.drug = "Glycerin (Ped)" |
Return the first names and last names of employees who earn more than 30000 in salary. | CREATE TABLE employee (fname text,minit text,lname text,ssn number,bdate text,address text,sex text,salary number,super_ssn number,dno number)CREATE TABLE dept_locations (dnumber number,dlocation text)CREATE TABLE project (pname text,pnumber number,plocation text,dnum number)CREATE TABLE dependent (essn number,dependen... | SELECT fname, lname FROM employee WHERE salary > 30000 |
Show all branch names with the number of members in each branch registered after 2015. | CREATE TABLE branch (name VARCHAR,branch_id VARCHAR)CREATE TABLE membership_register_branch (branch_id VARCHAR,register_year INTEGER) | SELECT T2.name, COUNT(*) FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T1.register_year > 2015 GROUP BY T2.branch_id |
who are the candidates with district being kansas 4 | CREATE TABLE table_18673 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT "Candidates" FROM table_18673 WHERE "District" = 'Kansas 4' |
What is the total number of first prizes in USD for the Canadian Open? | CREATE TABLE table_name_68 (tournament VARCHAR) | SELECT SUM(1 AS st_prize___) AS $__ FROM table_name_68 WHERE tournament = "canadian open" |
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of hire_date and the amount of hire_date bin hire_date by time, and I want to rank from high to low by the y-axis. | 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 jobs (JOB_ID varchar(10),JOB_TITLE va... | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COUNT(HIRE_DATE) DESC |
List the state names and the number of customers living in each state with a bar chart, order by the bars from low to high please. | CREATE TABLE Products (product_id INTEGER,product_name VARCHAR(20),product_price DECIMAL(19,4),product_description VARCHAR(255))CREATE TABLE Delivery_Routes (route_id INTEGER,route_name VARCHAR(50),other_route_details VARCHAR(255))CREATE TABLE Delivery_Route_Locations (location_code VARCHAR(10),route_id INTEGER,locatio... | SELECT state_province_county, COUNT(*) FROM Customer_Addresses AS t1 JOIN Addresses AS t2 ON t1.address_id = t2.address_id GROUP BY t2.state_province_county ORDER BY state_province_county |
Find all students taught by OTHA MOYER. Output the first and last names of the students. | CREATE TABLE teachers (lastname text,firstname text,classroom number)CREATE TABLE list (lastname text,firstname text,grade number,classroom number) | SELECT T1.firstname, T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "OTHA" AND T2.lastname = "MOYER" |
Name the total number for score l 110-112 | CREATE TABLE table_22871239_8 (_number VARCHAR,score VARCHAR) | SELECT COUNT(_number) FROM table_22871239_8 WHERE score = "L 110-112" |
Bar chart x axis country y axis the average of age | 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 Country, AVG(Age) FROM artist GROUP BY Country |
Who was the opponent in the game with save ||33,389||87 62? | CREATE TABLE table_56291 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Save" text) | SELECT "Opponent" FROM table_56291 WHERE "Save" = '||33,389||87–62' |
tell me the total number of patients in the 498 wards until 1 year ago? | CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyna... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 498 AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-1 year') |
What are the High points for Team @ portland? | CREATE TABLE table_name_75 (high_points VARCHAR,team VARCHAR) | SELECT high_points FROM table_name_75 WHERE team = "@ portland" |
Name the w/l for czech republic | CREATE TABLE table_22825058_23 (w_l VARCHAR,against VARCHAR) | SELECT w_l FROM table_22825058_23 WHERE against = "Czech Republic" |
Wat was the result for the 20 km after 2008 when the venue was Metz, France? | CREATE TABLE table_name_13 (result VARCHAR,venue VARCHAR,year VARCHAR,event VARCHAR) | SELECT result FROM table_name_13 WHERE year > 2008 AND event = "20 km" AND venue = "metz, france" |
how many patients whose year of death is less than or equal to 2179 and procedure icd9 code is 3972? | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2179.0" AND procedures.icd9_code = "3972" |
What is the most recent year where the average start is 8.5? | CREATE TABLE table_73352 ("Year" real,"Starts" real,"Wins" real,"Top 10" real,"Poles" real,"Avg. Start" text,"Avg. Finish" text,"Winnings" text,"Position" text,"Team(s)" text) | SELECT MAX("Year") FROM table_73352 WHERE "Avg. Start" = '8.5' |
How many nhl teams are listed when college/junior/club team is listed as newton north high school (ushs-ma)? | CREATE TABLE table_30582 ("Pick #" real,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text) | SELECT COUNT("NHL team") FROM table_30582 WHERE "College/junior/club team" = 'Newton North High School (USHS-MA)' |
What is the SDLP of Belfast? | CREATE TABLE table_28005809_2 (sdlp INTEGER,council VARCHAR) | SELECT MAX(sdlp) FROM table_28005809_2 WHERE council = "Belfast" |
What was the score of the away team at the the glenferrie oval? | CREATE TABLE table_58148 ("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_58148 WHERE "Venue" = 'glenferrie oval' |
What track number is 4:29 in length? | CREATE TABLE table_19583 ("#" real,"Title" text,"Length" text,"Writer" text,"Composer" text,"Arranger" text,"Dialect" text,"Mix Engineer" text) | SELECT "#" FROM table_19583 WHERE "Length" = '4:29' |
Which catalog contents have length below 3 or above 5? Find the catalog entry names. | CREATE TABLE catalogs (catalog_id number,catalog_name text,catalog_publisher text,date_of_publication time,date_of_latest_revision time)CREATE TABLE catalog_contents (catalog_entry_id number,catalog_level_number number,parent_entry_id number,previous_entry_id number,next_entry_id number,catalog_entry_name text,product_... | SELECT catalog_entry_name FROM catalog_contents WHERE length < 3 OR width > 5 |
what is maximum age of patients whose marital status is widowed and death status is 0? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.expire_flag = "0" |
When has Result of 2 0, and a Score of 2 0? | CREATE TABLE table_name_38 (date VARCHAR,result VARCHAR,score VARCHAR) | SELECT date FROM table_name_38 WHERE result = "2–0" AND score = "2 – 0" |
What is the lowest total when arabs is 4000? | CREATE TABLE table_25947046_1 (total INTEGER,arabs VARCHAR) | SELECT MIN(total) FROM table_25947046_1 WHERE arabs = 4000 |
Show the average price of hotels for each star rating code. | CREATE TABLE HOTELS (star_rating_code VARCHAR,price_range INTEGER) | SELECT star_rating_code, AVG(price_range) FROM HOTELS GROUP BY star_rating_code |
how many mayors were either fisherman or farmers ? | CREATE TABLE table_201_10 (id number,"#" number,"name" text,"office" text,"political party" text,"occupation" text) | SELECT COUNT("name") FROM table_201_10 WHERE "occupation" IN ('fisherman', 'farmer') |
Name the decision for boston bruins visitor | CREATE TABLE table_56040 ("Date" text,"Venue" text,"Visitor" text,"Score" text,"Home" text,"Decision" text,"Attendance" real,"Series" text) | SELECT "Decision" FROM table_56040 WHERE "Visitor" = 'boston bruins' |
how many hours have passed since the first time patient 99883 during their current hospital visit received a mch lab test? | 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 cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,c... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'mch') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 99883 AND admissions.dis... |
Users with most reputation from single post. | CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,LastEditorUserId number... | SELECT p.OwnerUserId AS "user_link", u.Reputation FROM Posts AS p INNER JOIN Users AS u ON p.OwnerUserId = u.Id GROUP BY p.OwnerUserId, u.Reputation HAVING COUNT(p.Id) = 1 ORDER BY u.Reputation DESC LIMIT 100 |
Which 2013 has a 2010 of 1r? | CREATE TABLE table_name_98 (Id VARCHAR) | SELECT 2013 FROM table_name_98 WHERE 2010 = "1r" |
Calculate the average age of russian speaking patients who have sepsis as primary disease. | 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 AVG(demographic.age) FROM demographic WHERE demographic.language = "RUSS" AND demographic.diagnosis = "SEPSIS" |
when did patient 004-93782 for the last time since 2102 get discharged from the hospital? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number... | SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '004-93782' AND STRFTIME('%y', patient.hospitaldischargetime) >= '2102' ORDER BY patient.hospitaldischargetime DESC LIMIT 1 |
give me the number of patients whose diagnoses icd9 code is v4364 and drug route is ivpca? | 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 demographic (subject_id text,hadm_id text,name text,marital... | 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.icd9_code = "V4364" AND prescriptions.route = "IVPCA" |
what are the DINNER flights from INDIANAPOLIS to SAN DIEGO on wednesday may twelfth | CREATE TABLE month (month_number int,month_name text)CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,fare_airline text,restriction_code text,one_direction_cost int,round_trip_cost int,round_trip_required var... | 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, food_service WHERE ((date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.... |
count how many drugs are prescribed to patient 030-44598 in 12/this year. | CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dos... | SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-44598')) AND DATETIME(medication.drugstarttime, 'start of year') = DATETIM... |
What is the mixed doubles in the year 2007 when the men's singles is eduards loze? | CREATE TABLE table_39160 ("Year" real,"Men's singles" text,"Women's singles" text,"Men's doubles" text,"Women's doubles" text,"Mixed doubles" text) | SELECT "Mixed doubles" FROM table_39160 WHERE "Year" > '2007' AND "Men's singles" = 'eduards loze' |
Which album was on June 1998? | CREATE TABLE table_11244 ("Year" text,"Title" text,"US 100" text,"US AC" text,"Lead singer" text,"Album" text,"Label and cat#" text) | SELECT "Album" FROM table_11244 WHERE "Year" = 'june 1998' |
How many entries are there for total drivers when the Last driver for september 22, 2013 was gianmarco raimondo? | CREATE TABLE table_72373 ("Country" text,"Total Drivers" real,"Champions" text,"Championships" text,"Current September 22,2013" real,"First driver(s)" text,"Last/Current driver(s) September 22,2013" text) | SELECT "Total Drivers" FROM table_72373 WHERE "Last/Current driver(s) September 22, 2013" = 'Gianmarco Raimondo' |
What is the name of the school with the Tornadoes Lady Tornadoes? | CREATE TABLE table_name_41 (school VARCHAR,nickname_s_ VARCHAR) | SELECT school FROM table_name_41 WHERE nickname_s_ = "tornadoes lady tornadoes" |
provide the number of patients whose diagnoses long title is unspecified septicemia and lab test category is blood gas? | 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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Unspecified septicemia" AND lab."CATEGORY" = "Blood Gas" |
What is the final score of the game at lambeau field? | CREATE TABLE table_57149 ("Date" text,"Visiting Team" text,"Final Score" text,"Host Team" text,"Stadium" text) | SELECT "Final Score" FROM table_57149 WHERE "Stadium" = 'lambeau field' |
What is the time of the Ghantoot Racing and Polo Club? | CREATE TABLE table_name_4 (time VARCHAR,ground VARCHAR) | SELECT time FROM table_name_4 WHERE ground = "ghantoot racing and polo club" |
How many wins did the 8 time runner-up have? | CREATE TABLE table_name_33 (wins VARCHAR,runners_up VARCHAR) | SELECT wins FROM table_name_33 WHERE runners_up = "8" |
What was the lowest Attendance when the Opponent was Maryland? | CREATE TABLE table_40035 ("Date" text,"Opponent" text,"Location" text,"Result" text,"Attendance" real) | SELECT MIN("Attendance") FROM table_40035 WHERE "Opponent" = 'maryland' |
What is the to par value for the game with a winning score of 71-69-71-70=281? | CREATE TABLE table_15460 ("Date" text,"Tournament" text,"Winning score" text,"To par" text,"Margin of victory" text,"Runner(s)-up" text) | SELECT "To par" FROM table_15460 WHERE "Winning score" = '71-69-71-70=281' |
how many patients died after being diagnosed with hypocalcemia during the same month? | 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 t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hypocalcemia') AS t1 GROUP BY t1.uniquepid HAVING MIN(t1.diagnos... |
Return the code of the document type that is most common. | CREATE TABLE ref_budget_codes (budget_type_code text,budget_type_description text)CREATE TABLE documents (document_id number,document_type_code text,project_id number,document_date time,document_name text,document_description text,other_details text)CREATE TABLE statements (statement_id number,statement_details text)CR... | SELECT document_type_code FROM documents GROUP BY document_type_code ORDER BY COUNT(*) DESC LIMIT 1 |
What driver has points less than 17? | CREATE TABLE table_name_94 (driver VARCHAR,points INTEGER) | SELECT driver FROM table_name_94 WHERE points < 17 |
What is the TV Time of the game on December 27, 2003? | CREATE TABLE table_65091 ("Week" real,"Date" text,"Opponent" text,"Result" text,"TV Time" text,"Attendance" text) | SELECT "TV Time" FROM table_65091 WHERE "Date" = 'december 27, 2003' |
What is the relationship between card number and card id? Return a scatter chart. | CREATE TABLE Customers_Cards (card_id INTEGER,customer_id INTEGER,card_type_code VARCHAR(15),card_number VARCHAR(80),date_valid_from DATETIME,date_valid_to DATETIME,other_card_details VARCHAR(255))CREATE TABLE Financial_Transactions (transaction_id INTEGER,previous_transaction_id INTEGER,account_id INTEGER,card_id INTE... | SELECT card_id, card_number FROM Customers_Cards |
Which player is from England? | CREATE TABLE table_name_16 (player VARCHAR,country VARCHAR) | SELECT player FROM table_name_16 WHERE country = "england" |
Show the order ids and the number of items in each order with a scatter chart. | CREATE TABLE Order_Items (order_item_id INTEGER,order_id INTEGER,product_id INTEGER,product_quantity VARCHAR(50),other_order_item_details VARCHAR(255))CREATE TABLE Products (product_id INTEGER,parent_product_id INTEGER,production_type_code VARCHAR(15),unit_price DECIMAL(19,4),product_name VARCHAR(80),product_color VARC... | SELECT order_id, COUNT(*) FROM Order_Items GROUP BY order_id |
Which Tie no that has an Away team of altrincham? | CREATE TABLE table_9173 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text) | SELECT "Tie no" FROM table_9173 WHERE "Away team" = 'altrincham' |
What is the To Par that has a 69-69-73=211 score? | CREATE TABLE table_name_35 (to_par VARCHAR,score VARCHAR) | SELECT to_par FROM table_name_35 WHERE score = 69 - 69 - 73 = 211 |
What as the production code for the episode directed by Robert Duncan McNeill? | CREATE TABLE table_24319661_5 (production_code VARCHAR,directed_by VARCHAR) | SELECT production_code FROM table_24319661_5 WHERE directed_by = "Robert Duncan McNeill" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.