instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Which challenge loser has a Challenge Winner of roseny? | CREATE TABLE table_9340 ("Episode" text,"7 Deadly Sin" text,"Challenge Winner" text,"Challenge Loser" text,"Voted In To 'El Duelo'" text,"Eliminated" text) | SELECT "Challenge Loser" FROM table_9340 WHERE "Challenge Winner" = 'roseny' |
What was the date of the game with a decision of Lehtonen and attended by more than 17,731 people? | CREATE TABLE table_name_70 (date VARCHAR,decision VARCHAR,attendance VARCHAR) | SELECT date FROM table_name_70 WHERE decision = "lehtonen" AND attendance > 17 OFFSET 731 |
state el canal de las estrellas where ma ana es para siempre is impreuna pentru totdeauna | CREATE TABLE table_22375 ("Mexico" text,"Ma\u00f1ana es para siempre" text,"El Canal de las Estrellas" text,"October 20,2008" text,"June 14,2009" text,"Monday to Friday" text) | SELECT "El Canal de las Estrellas" FROM table_22375 WHERE "Ma\u00f1ana es para siempre" = 'Impreuna pentru totdeauna' |
What is Year, when Wins is '0'? | CREATE TABLE table_45795 ("Year" text,"Result" text,"Matches" text,"Wins" text,"Draws" text,"Losses" text) | SELECT "Year" FROM table_45795 WHERE "Wins" = '0' |
Which wheels were built 1920? | CREATE TABLE table_name_33 (wheels VARCHAR,built VARCHAR) | SELECT wheels FROM table_name_33 WHERE built = 1920 |
What team is from the Eastern province? | CREATE TABLE table_19905183_1 (team VARCHAR,province VARCHAR) | SELECT team FROM table_19905183_1 WHERE province = "Eastern" |
Name the theatre name for french | CREATE TABLE table_3097 ("Theatre name" text,"Digital Screens" real,"IMAX Screens" real,"Location" text,"Language of films" text) | SELECT "Theatre name" FROM table_3097 WHERE "Language of films" = 'French' |
when was the first time patient 013-20464 has been diagnosed with suicidal ideation since 3 years ago? | CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text... | SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-20464')) AND diagnosis.diagnosisname = 'suicidal ideation' AN... |
what was the difference between the two scores of the last game ? | CREATE TABLE table_204_897 (id number,"date" text,"opponent#" text,"rank#" text,"site" text,"tv" text,"result" text,"attendance" number) | SELECT ABS("result" - "result") FROM table_204_897 ORDER BY "date" DESC LIMIT 1 |
What was the scale of disaster in Peru? | CREATE TABLE table_17004 ("Disaster" text,"Year" text,"Countries Affected" text,"Scale of Disaster" text,"People Assisted" text,"Nature of Help" text) | SELECT "Scale of Disaster" FROM table_17004 WHERE "Countries Affected" = 'Peru' |
What is Stopping Pattern, when Platform is 4? | CREATE TABLE table_name_92 (stopping_pattern VARCHAR,platform VARCHAR) | SELECT stopping_pattern FROM table_name_92 WHERE platform = "4" |
How many patients taking drug via dwell route are diagnosed with unspecified hereditary and idiopathic peripheral neuropathy? | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Idio periph neurpthy NOS" AND prescriptions.route = "DWELL" |
Show name and distance for all aircrafts. Visualize by bar chart. | CREATE TABLE aircraft (aid number(9,0),name varchar2(30),distance number(6,0))CREATE TABLE certificate (eid number(9,0),aid number(9,0))CREATE TABLE employee (eid number(9,0),name varchar2(30),salary number(10,2))CREATE TABLE flight (flno number(4,0),origin varchar2(20),destination varchar2(20),distance number(6,0),dep... | SELECT name, distance FROM aircraft |
What was the number of matches when the Goals Olimpia was 149? | CREATE TABLE table_18909 ("Tournament" text,"Matches" real,"Wins Olimpia" real,"Empates" real,"Wins Cerro" real,"Goals Olimpia" real,"Goals Cerro" real) | SELECT "Matches" FROM table_18909 WHERE "Goals Olimpia" = '149' |
calculate patient 027-107035's length of stay of the first hospital stay. | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,d... | SELECT STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', patient.hospitaladmittime) FROM patient WHERE patient.uniquepid = '027-107035' AND NOT patient.hospitaladmittime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1 |
Are there any professors that do not teach classes with labs ? | CREATE TABLE area (course_id int,area varchar)CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE gsi (course_offering_id in... | SELECT DISTINCT instructor.name FROM instructor, course, course_offering, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course_offering.offering_id = offering_instructor.offering_id AND instructor.instructor_id = offering_instructor.instructor_id AND NOT instr... |
What's the CR number that has an LMS number less than 14761 and works of Hawthorn Leslie 3100? | CREATE TABLE table_65160 ("HR no." text,"HR name" text,"CR no." real,"LMS no." real,"Built" text,"Works" text,"Withdrawn" text) | SELECT AVG("CR no.") FROM table_65160 WHERE "Works" = 'hawthorn leslie 3100' AND "LMS no." < '14761' |
What is the transfer fee for Helguera? | CREATE TABLE table_65104 ("Nat." text,"Name" text,"Moving from" text,"Type" text,"Transfer window" text,"Ends" real,"Transfer fee" text) | SELECT "Transfer fee" FROM table_65104 WHERE "Name" = 'helguera' |
Which settlement has the cyrillic and other name of (romanian: locve)? | CREATE TABLE table_2562572_44 (settlement VARCHAR,cyrillic_name_other_names VARCHAR) | SELECT settlement FROM table_2562572_44 WHERE cyrillic_name_other_names = "Локве (Romanian: Locve)" |
on UA give me the flight times from BOSTON to DALLAS | CREATE TABLE airport (airport_code varchar,airport_name text,airport_location text,state_code varchar,country_name varchar,time_zone_code varchar,minimum_connect_time int)CREATE TABLE code_description (code varchar,description text)CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE date... | SELECT DISTINCT flight.departure_time 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'D... |
What i/o buses are associated with the LGA 1155 socket, a code name of Sandy Bridge (desktop) and a brand name of Core i3-21xx? | CREATE TABLE table_26910 ("Codename (main article)" text,"Brand name (list)" text,"Cores" real,"L3 Cache" text,"Socket" text,"TDP" text,"I/O Bus" text) | SELECT "I/O Bus" FROM table_26910 WHERE "Socket" = 'LGA 1155' AND "Codename (main article)" = 'Sandy Bridge (Desktop)' AND "Brand name (list)" = 'Core i3-21xx' |
When did the term end for the person who started their term on 28 November 1912? | CREATE TABLE table_name_89 (term_end VARCHAR,term_start VARCHAR) | SELECT term_end FROM table_name_89 WHERE term_start = "28 november 1912" |
what is the name of the medication that patient 006-81423 was prescribed in the same hospital visit after being diagnosed with intracranial injury - with intracerebral hemorrhage until 35 months ago? | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresult... | SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =... |
find a flight from TORONTO to SAN DIEGO with a layover in WASHINGTON on DL | CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_st... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN DIEGO' AND CITY_2... |
what was the minimum monthly number of patients who had late eff accidental fall since 6 years ago? | CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title 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 text)CREATE TABLE d_items (row_id number,itemid number,label text,linksto ... | SELECT MIN(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'late eff accidental fall') AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-6 year'... |
What type of bridge is in Cooperstown? | CREATE TABLE table_name_8 (type VARCHAR,location VARCHAR) | SELECT type FROM table_name_8 WHERE location = "cooperstown" |
For those records from the products and each product's manufacturer, give me the comparison about the sum of price over the name , and group by attribute name by a bar chart, and rank by the y axis from low to high. | 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.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Price |
When did the consort who had talal i as a spouse die? | CREATE TABLE table_9203 ("Born as" text,"Consort as" text,"Born" text,"Marriage" text,"Consort from" text,"Consort to" text,"Died" text,"Spouse to" text) | SELECT "Died" FROM table_9203 WHERE "Spouse to" = 'talal i' |
Which launch date involved the Driade? | CREATE TABLE table_72442 ("Name" text,"Pennant number" text,"Builder" text,"Laid Down" text,"Launched" text,"Commissioned" text,"Current status" text) | SELECT "Launched" FROM table_72442 WHERE "Name" = 'Driade' |
What is the away team at corio oval? | CREATE TABLE table_12019 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Away team" FROM table_12019 WHERE "Venue" = 'corio oval' |
list the top three most frequent prescriptions that a patient has been prescribed with during the same hospital visit after being diagnosed with av block - second degree until 2101. | 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 t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'av block - seco... |
Which College has a Round smaller than 7, and a Pick # smaller than 27, and a Name of anthony maddox? | CREATE TABLE table_39372 ("Round" real,"Pick #" real,"Overall" real,"Name" text,"Position" text,"College" text) | SELECT "College" FROM table_39372 WHERE "Round" < '7' AND "Pick #" < '27' AND "Name" = 'anthony maddox' |
Find questions with one specific tag. | CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE Tags (Id numbe... | SELECT Id AS "post_link", CreationDate FROM Posts WHERE PostTypeId = 1 AND Tags LIKE LOWER('%hard-science%') ORDER BY CreationDate DESC LIMIT 5000 |
What is Score, when High Rebounds is 'Nolan (10)'? | CREATE TABLE table_45649 ("Game" real,"Date" text,"Opponent" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location/Attendance" text,"Record" text) | SELECT "Score" FROM table_45649 WHERE "High rebounds" = 'nolan (10)' |
how many patients aged below 41 years had the lab test pleural? | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "41" AND lab.fluid = "Pleural" |
count the number of people who were prescribed methadone hcl in the same hospital visit after having received a cont inv mec ven 96+ hrs procedure until 2102. | CREATE TABLE d_icd_diagnoses (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 chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number,valueuom text)CREA... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_... |
How many employees are there? | CREATE TABLE lessons (lesson_id number,customer_id number,lesson_status_code text,staff_id number,vehicle_id number,lesson_date time,lesson_time text,price number)CREATE TABLE addresses (address_id number,line_1_number_building text,city text,zip_postcode text,state_province_county text,country text)CREATE TABLE vehicl... | SELECT COUNT(*) FROM staff |
Tell me the category for result of won and year more than 2009 | CREATE TABLE table_4369 ("Year" real,"Association" text,"Category" text,"Nominated work" text,"Result" text) | SELECT "Category" FROM table_4369 WHERE "Result" = 'won' AND "Year" > '2009' |
What format is catalogue 148615 in? | CREATE TABLE table_name_78 (format VARCHAR,catalogue VARCHAR) | SELECT format FROM table_name_78 WHERE catalogue = "148615" |
Which Year is the lowest one that has an Athlete of markus thalmann, and a Time of 23:28:24? | CREATE TABLE table_name_76 (year INTEGER,athlete VARCHAR,time VARCHAR) | SELECT MIN(year) FROM table_name_76 WHERE athlete = "markus thalmann" AND time = "23:28:24" |
What is the maximum total wins he had for any year? | CREATE TABLE table_22839669_12 (total_wins INTEGER) | SELECT MAX(total_wins) FROM table_22839669_12 |
When dydek (8) has the highest rebounds who has the highest amount of points? | CREATE TABLE table_18904831_6 (high_points VARCHAR,high_rebounds VARCHAR) | SELECT high_points FROM table_18904831_6 WHERE high_rebounds = "Dydek (8)" |
How many female Professors do we have? | CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)CREATE TABLE participates_in (stuid number,actid number)CREATE TABLE faculty_participates_in (facid number,actid number)CREATE TABLE faculty (facid number,lname text,fname text,rank text,sex text,phon... | SELECT COUNT(*) FROM faculty WHERE sex = 'F' AND rank = "Professor" |
Visualize the title and and the total star rating of the movie using a bar chart, could you display bars in descending order? | CREATE TABLE Movie (mID int,title text,year int,director text)CREATE TABLE Rating (rID int,mID int,stars int,ratingDate date)CREATE TABLE Reviewer (rID int,name text) | SELECT title, SUM(stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY title ORDER BY title DESC |
What is russ cochran's average margin? | CREATE TABLE table_79645 ("Year" real,"Player" text,"Country" text,"Score" text,"To Par" text,"Margin" real,"Earnings ($)" real) | SELECT AVG("Margin") FROM table_79645 WHERE "Player" = 'russ cochran' |
Return the name and gender of the staff who was assigned in 2016. | CREATE TABLE staff (staff_name VARCHAR,staff_gender VARCHAR,staff_id VARCHAR)CREATE TABLE staff_department_assignments (staff_id VARCHAR,date_assigned_from VARCHAR) | SELECT T1.staff_name, T1.staff_gender FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.date_assigned_from LIKE "2016%" |
Show the number of documents for each location code in a bar chart, and could you rank from low to high by the X? | CREATE TABLE Ref_Calendar (Calendar_Date DATETIME,Day_Number INTEGER)CREATE TABLE Roles (Role_Code CHAR(15),Role_Name VARCHAR(255),Role_Description VARCHAR(255))CREATE TABLE Documents_to_be_Destroyed (Document_ID INTEGER,Destruction_Authorised_by_Employee_ID INTEGER,Destroyed_by_Employee_ID INTEGER,Planned_Destruction_... | SELECT Location_Code, COUNT(Location_Code) FROM Document_Locations GROUP BY Location_Code ORDER BY Location_Code |
report the number of patients with other convulsions diagnoses who had csf lab test done. | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,sho... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Convulsions NEC" AND lab.fluid = "Cerebrospinal Fluid (CSF)" |
For those employees who was hired before 2002-06-21, find job_id and the sum of department_id , and group by attribute job_id, and visualize them by a bar chart, display JOB_ID in ascending order. | 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 job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE departments (D... | SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID |
What was the home teams score agains the team that scored 7.15 (57)? | CREATE TABLE table_33258 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Home team score" FROM table_33258 WHERE "Away team score" = '7.15 (57)' |
find all posts from a user. | CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE VoteTypes (Id number,Name... | SELECT p.Id AS "post_link" FROM Users AS u JOIN Posts AS p ON p.OwnerUserId = u.Id WHERE u.Id = @UserId |
provide the number of patients whose marital status is widowed and diagnoses long title is chronic kidney disease, stage iv (severe)? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "WIDOWED" AND diagnoses.long_title = "Chronic kidney disease, Stage IV (severe)" |
What is the Score of the game with a decision of Lundqvist, the November less than 28, and opponent was Boston Bruins? | CREATE TABLE table_name_31 (score VARCHAR,opponent VARCHAR,decision VARCHAR,november VARCHAR) | SELECT score FROM table_name_31 WHERE decision = "lundqvist" AND november < 28 AND opponent = "boston bruins" |
how many hours have passed since the first time that patient 97330 stayed during their current hospital encounter in the careunit sicu? | 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 icustays (row_id number,subject_id number,hadm_id number,icust... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97330 AND admissions.dischtime IS NULL) AND transfers.careunit = 'sicu' ORDER BY transfers.intime LIMIT 1 |
what flights go from PHILADELPHIA to SAN FRANCISCO via DALLAS | 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 restriction (restriction_code text,advance_purchase int,stopovers text,sat... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CIT... |
What is the number of jews asarb where the metro area is philadelphia? | CREATE TABLE table_1131183_2 (number_of_jews__asarb_ VARCHAR,metro_area VARCHAR) | SELECT number_of_jews__asarb_ FROM table_1131183_2 WHERE metro_area = "Philadelphia" |
What is the name of the club that has ongoing first-team appearances, a midfielder, and whose player is Samir Carruthers? | CREATE TABLE table_51190 ("Player" text,"Position" text,"First-Team Appearances" text,"First-Team Goals" text,"Current Club" text) | SELECT "Current Club" FROM table_51190 WHERE "First-Team Appearances" = 'ongoing' AND "Position" = 'midfielder' AND "Player" = 'samir carruthers' |
What was the money for place t3 and United States? | CREATE TABLE table_name_94 (money___$__ VARCHAR,place VARCHAR,country VARCHAR) | SELECT money___$__ FROM table_name_94 WHERE place = "t3" AND country = "united states" |
For the attribute Sex and the amount of Sex, show their proportion by a pie chart. | CREATE TABLE people (People_ID int,Sex text,Name text,Date_of_Birth text,Height real,Weight real)CREATE TABLE candidate (Candidate_ID int,People_ID int,Poll_Source text,Date text,Support_rate real,Consider_rate real,Oppose_rate real,Unsure_rate real) | SELECT Sex, COUNT(Sex) FROM people GROUP BY Sex |
What date did Mike Rockenfeller have the fastest lap? | CREATE TABLE table_24732149_2 (date VARCHAR,fastest_lap VARCHAR) | SELECT date FROM table_24732149_2 WHERE fastest_lap = "Mike Rockenfeller" |
how many patients whose gender is f and item id is 51345? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "F" AND lab.itemid = "51345" |
What was Kilgore's percentage when Potts (I) had 4% and Kaine (D) 47%, in the poll from October 30, 2005? | CREATE TABLE table_61992 ("Source" text,"Date" text,"Kaine (D)" text,"Kilgore (R)" text,"Potts (I)" text) | SELECT "Kilgore (R)" FROM table_61992 WHERE "Potts (I)" = '4%' AND "Kaine (D)" = '47%' AND "Date" = 'october 30, 2005' |
What did the away team score at Moorabbin Oval? | CREATE TABLE table_name_24 (away_team VARCHAR,venue VARCHAR) | SELECT away_team AS score FROM table_name_24 WHERE venue = "moorabbin oval" |
what is the dicharge time and diagnosis icd9 code of the patient id 93033? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime te... | SELECT demographic.dischtime, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "93033" |
Which competition had a 4-3 score? | CREATE TABLE table_42347 ("Date" text,"Result" text,"Score" text,"Brazil scorers" text,"Competition" text) | SELECT "Competition" FROM table_42347 WHERE "Score" = '4-3' |
Test query - get user count. | CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,W... | SELECT COUNT(*) FROM Users WHERE Location LIKE '%korea%' |
Find the dates of the tests taken with result 'Pass', and count them by a bar chart, and rank names in descending order. | CREATE TABLE Courses (course_id INTEGER,author_id INTEGER,subject_id INTEGER,course_name VARCHAR(120),course_description VARCHAR(255))CREATE TABLE Course_Authors_and_Tutors (author_id INTEGER,author_tutor_ATB VARCHAR(3),login_name VARCHAR(40),password VARCHAR(40),personal_name VARCHAR(80),middle_name VARCHAR(80),family... | SELECT date_test_taken, COUNT(date_test_taken) FROM Student_Tests_Taken WHERE test_result = "Pass" GROUP BY date_test_taken ORDER BY date_test_taken DESC |
patrick murphy and who else was drafted in round seven ? | CREATE TABLE table_203_455 (id number,"round" number,"#" number,"player" text,"nationality" text,"college/junior/club team (league)" text) | SELECT "player" FROM table_203_455 WHERE "player" <> 'patrick murphy' AND "round" = 7 |
find the number of patients admitted in the emergency room under procedure icd9 code 9229. | 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 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND procedures.icd9_code = "9229" |
Tags existing as both tags and as synonyms. | CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,Deletion... | SELECT TagName AS Tag FROM Tags INTERSECT SELECT SourceTagName AS Tag FROM TagSynonyms |
Limiting Posts by Date and Rep, Parameterized, with Links (Tutorial). | CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe te... | SELECT p.Id AS "post_link", u.Id AS "user_link", u.Reputation FROM Posts AS p JOIN Users AS u ON p.OwnerUserId = u.Id WHERE p.CreationDate BETWEEN '##StartDate:string##' AND '##EndDate:string##' AND p.PostTypeId = 1 AND u.Reputation < '##MaxReputation:int##' |
When the away team scored 18.13 (121), what was the largest crowd size? | CREATE TABLE table_10426 ("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_10426 WHERE "Away team score" = '18.13 (121)' |
Which course has km (mi) as a type? | CREATE TABLE table_67816 ("Date" text,"Course" text,"Distance" text,"Type" text,"Winner" text) | SELECT "Course" FROM table_67816 WHERE "Type" = 'km (mi)' |
get me the name of the drug and the drug code that patient with patient id 11221 is taking. | 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 prescriptions.drug, prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.subject_id = "11221" |
When the surface is clay, and the tournament of barcelona what is the score? | CREATE TABLE table_35984 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Opponent" text,"Score" text) | SELECT "Score" FROM table_35984 WHERE "Surface" = 'clay' AND "Tournament" = 'barcelona' |
What is the Average relative annual growth (%) for the country that ranks 41 and has a July 1, 2013 projection larger than 2,204,000? | CREATE TABLE table_46167 ("Rank" text,"July 1,2013 projection" real,"% of pop." real,"Average relative annual growth (%)" real,"Average absolute annual growth" real) | SELECT COUNT("Average relative annual growth (%)") FROM table_46167 WHERE "Rank" = '41' AND "July 1, 2013 projection" > '2,204,000' |
Return a bar chart on what is the number of professors for different school?, and could you list by the bar from low to high? | CREATE TABLE CLASS (CLASS_CODE varchar(5),CRS_CODE varchar(10),CLASS_SECTION varchar(2),CLASS_TIME varchar(20),CLASS_ROOM varchar(8),PROF_NUM int)CREATE TABLE PROFESSOR (EMP_NUM int,DEPT_CODE varchar(10),PROF_OFFICE varchar(50),PROF_EXTENSION varchar(4),PROF_HIGH_DEGREE varchar(5))CREATE TABLE ENROLL (CLASS_CODE varcha... | SELECT SCHOOL_CODE, COUNT(*) FROM DEPARTMENT AS T1 JOIN PROFESSOR AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.SCHOOL_CODE ORDER BY SCHOOL_CODE |
What date was Richmond the home team? | CREATE TABLE table_10638 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Date" FROM table_10638 WHERE "Home team" = 'richmond' |
Which To par is scored at 70? | CREATE TABLE table_name_10 (to_par VARCHAR,score VARCHAR) | SELECT to_par FROM table_name_10 WHERE score = 70 |
calculat the number of patients diagnosed with icd9 code 03849 who were unmarried. | CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.icd9_code = "03849" |
How many climbers are from each country? | CREATE TABLE climber (climber_id number,name text,country text,time text,points number,mountain_id number)CREATE TABLE mountain (mountain_id number,name text,height number,prominence number,range text,country text) | SELECT country, COUNT(*) FROM climber GROUP BY country |
Who was the lyricist for the song with music directed by madan mohan kohli? | CREATE TABLE table_27511 ("Song" text,"Singer" text,"Co-Singers" text,"Music Director" text,"Lyricist" text,"Co-Stars" text,"Movie/Album" text,"Year" real,"Additional Info" text) | SELECT "Lyricist" FROM table_27511 WHERE "Music Director" = 'Madan Mohan Kohli' |
i need a flight from TAMPA to MONTREAL | 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 varchar)CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE state (state_code text,state_name text,country_nam... | 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 = 'TAMPA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MONTREAL... |
Which county is named broderick wood products? | CREATE TABLE table_51655 ("CERCLIS ID" text,"Name" text,"County" text,"Proposed" text,"Listed" text,"Construction completed" text,"Partially deleted" text) | SELECT "County" FROM table_51655 WHERE "Name" = 'broderick wood products' |
What is the visitor team of the game with Chicago as the home team? | CREATE TABLE table_55390 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text) | SELECT "Visitor" FROM table_55390 WHERE "Home" = 'chicago' |
What is the team's record in games against the Hartford Whalers? | CREATE TABLE table_37780 ("Game" real,"October" real,"Opponent" text,"Score" text,"Record" text) | SELECT "Record" FROM table_37780 WHERE "Opponent" = 'hartford whalers' |
what is the only country ranked in the top ten that did not earn a silver medal ? | CREATE TABLE table_203_724 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number) | SELECT "nation" FROM table_203_724 WHERE "rank" <= 10 AND "silver" = 0 |
When 7th bw attached to 43rd sw is the unit what is the b-52 model? | CREATE TABLE table_18933037_3 (b_52_model VARCHAR,unit VARCHAR) | SELECT b_52_model FROM table_18933037_3 WHERE unit = "7th BW attached to 43rd SW" |
What English title for the Romanization of lee jae-su-eui nan? | CREATE TABLE table_name_96 (english_title VARCHAR,romanization VARCHAR) | SELECT english_title FROM table_name_96 WHERE romanization = "lee jae-su-eui nan" |
Which Tournament has a Margin of victory of 7 strokes | CREATE TABLE table_name_38 (tournament VARCHAR,margin_of_victory VARCHAR) | SELECT tournament FROM table_name_38 WHERE margin_of_victory = "7 strokes" |
how many silver medals did venezuela win ? | CREATE TABLE table_204_800 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number) | SELECT "silver" FROM table_204_800 WHERE "nation" = 'venezuela' |
For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of hire_date and the average of employee_id bin hire_date by time. | 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 countries (COUNTRY_ID varchar(2),COUN... | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) |
Plot mean age by grouped by sex as a bar graph | CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1),Major INTEGER,Advisor INTEGER,city_code VARCHAR(3))CREATE TABLE Lives_in (stuid INTEGER,dormid INTEGER,room_number INTEGER)CREATE TABLE Has_amenity (dormid INTEGER,amenid INTEGER)CREATE TABLE Dorm (dormid INTEGER,dorm_nam... | SELECT Sex, AVG(Age) FROM Student GROUP BY Sex |
Name the requirements for CS-LSA degree . | CREATE TABLE program_course (program_id int,course_id int,workload int,category varchar)CREATE TABLE course_tags_count (course_id int,clear_grading int,pop_quiz int,group_projects int,inspirational int,long_lectures int,extra_credit int,few_tests int,good_feedback int,tough_tests int,heavy_papers int,cares_for_students... | SELECT DISTINCT program_requirement.additional_req, program_requirement.category, program_requirement.min_credit, program.name FROM program, program_requirement WHERE program.name LIKE '%CS-LSA%' AND program.program_id = program_requirement.program_id |
Which Country has a Money ($) of 0, and a Place of t10? | CREATE TABLE table_61035 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" real,"Money ($)" real) | SELECT "Country" FROM table_61035 WHERE "Money ( $ )" = '0' AND "Place" = 't10' |
What was the actors name that vadim ilyenko directed? | CREATE TABLE table_16010 ("Nomination" text,"Actors Name" text,"Film Name" text,"Director" text,"Country" text) | SELECT "Actors Name" FROM table_16010 WHERE "Director" = 'Vadim Ilyenko' |
tympanic temperature < 35 c prior to enrolment | CREATE TABLE table_test_11 ("id" int,"left_ventricular_ejection_fraction_lvef" int,"systolic_blood_pressure_sbp" int,"tachycardia" int,"bradycardia" int,"renal_disease" bool,"allergy_to_aspirin" bool,"temperature" float,"creatinine_clearance_cl" float,"diastolic_blood_pressure_dbp" int,"hypotension" bool,"serum_creatin... | SELECT * FROM table_test_11 WHERE temperature < 35 |
how many gold medals did puerto rico earn ? | CREATE TABLE table_203_716 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number) | SELECT "gold" FROM table_203_716 WHERE "nation" = 'puerto rico' |
Show me about the distribution of All_Games and ACC_Percent in a bar chart, and list from low to high by the total number please. | CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Percent int,All_Home text,All_Road text,All_Neutral text)CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,En... | SELECT All_Games, ACC_Percent FROM basketball_match ORDER BY ACC_Percent |
For those employees who did not have any job in the past, give me the trend about employee_id over hire_date , display by the x axis from high to low. | 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 locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),... | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY HIRE_DATE DESC |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.