instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
51st position and 31st position were both obtained by this runner at which competition ? | CREATE TABLE table_204_880 (id number,"year" number,"competition" text,"venue" text,"position" text,"event" text,"notes" text) | SELECT "competition" FROM table_204_880 WHERE "position" = 51 |
Which location is in the Belgian Congo Tanganyika? | CREATE TABLE table_12651 ("Perpetrator" text,"Year" text,"Location" text,"Country" text,"Killed" text) | SELECT "Location" FROM table_12651 WHERE "Country" = 'belgian congo tanganyika' |
are there more special indigenous or campesino deputies from cochabamba or chuquisaca ? | CREATE TABLE table_204_246 (id number,"department" text,"total deputies" number,"uninominal deputies" number,"plurinominal deputies" number,"special indigenous\nor campesino deputies" number,"senators" number) | SELECT "department" FROM table_204_246 WHERE "department" IN ('cochabamba', 'chuquisaca') ORDER BY "special indigenous\nor campesino deputies" DESC LIMIT 1 |
On which date was the GT class at Monterey Sports Car Grand Prix? | CREATE TABLE table_5840 ("Race" text,"Length" text,"Class" text,"Circuit" text,"Date" text) | SELECT "Date" FROM table_5840 WHERE "Class" = 'gt' AND "Race" = 'monterey sports car grand prix' |
What was the tries against when they had 32 tries for? | CREATE TABLE table_75126 ("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 "Tries against" FROM table_75126 WHERE "Tries for" = '32' |
What round was matt brait? | CREATE TABLE table_34152 ("Round" text,"Player" text,"Position" text,"Nationality" text,"College/Junior/Club Team (League)" text) | SELECT "Round" FROM table_34152 WHERE "Player" = 'matt brait' |
Who directed the episode that had a production code of 2j5457? | CREATE TABLE table_28171 ("No." real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text,"U.S. viewers (million)" text) | SELECT "Directed by" FROM table_28171 WHERE "Production code" = '2J5457' |
Are the classes that I took considered software classes ? | CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_credit varchar,repeat_term varchar,test_id varchar)CREATE TABLE area (course_id int,area varchar)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE jobs (job_id int,job_title v... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN student_record ON student_record.course_id = course.course_id INNER JOIN area ON student_record.course_id = area.course_id WHERE area.area LIKE '%software%' AND student_record.student_id = 1 |
With an average finish of 29.0, what was the average start? | CREATE TABLE table_2513 ("Year" real,"Starts" real,"Wins" real,"Top 5" real,"Top 10" real,"Poles" real,"Avg. Start" text,"Avg. Finish" text,"Winnings" text,"Position" text,"Team(s)" text) | SELECT "Avg. Start" FROM table_2513 WHERE "Avg. Finish" = '29.0' |
Name the high assists for houston | CREATE TABLE table_1648 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "High assists" FROM table_1648 WHERE "Team" = 'Houston' |
calculate the number of patients staying in ward 664 since 5 years ago. | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 664 AND DATETIME(patient.unitadmittime) >= DATETIME(CURRENT_TIME(), '-5 year') |
Questions with a specific tag at first revision and without that tag now. | CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE PostFeedback (Id number,PostId ... | SELECT Posts.Id AS "post_link", Posts.Tags, PostInits.Text AS "initial_tags", Posts.CreationDate FROM Posts INNER JOIN (SELECT PostId, Text FROM PostHistory WHERE PostHistoryTypeId = 3 AND Text LIKE '%##Tag##%') AS PostInits ON Posts.Id = PostInits.PostId WHERE NOT Posts.Tags LIKE '%##Tag##%' AND (DATEDIFF(month, Posts... |
what was the last time until 50 months ago patient 28966 had the minimum hemoglobin value? | 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 d_icd_diagnoses (row_id number,icd9_code text,short_title text... | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28966) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'hemoglobin') AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '-50... |
What is the release date of the album written by Goss, James James Goss under Audiogo? | CREATE TABLE table_48636 ("Title" text,"Writer" text,"Format" text,"Company" text,"release date" text) | SELECT "release date" FROM table_48636 WHERE "Writer" = 'goss, james james goss' AND "Company" = 'audiogo' |
A bar chart showing the average of capacity of cinemas open for each year, order by the y-axis in descending. | CREATE TABLE cinema (Cinema_ID int,Name text,Openning_year int,Capacity int,Location text)CREATE TABLE schedule (Cinema_ID int,Film_ID int,Date text,Show_times_per_day int,Price float)CREATE TABLE film (Film_ID int,Rank_in_series int,Number_in_season int,Title text,Directed_by text,Original_air_date text,Production_cod... | SELECT Openning_year, AVG(Capacity) FROM cinema GROUP BY Openning_year ORDER BY AVG(Capacity) DESC |
what is age and primary disease of subject id 2560? | CREATE TABLE procedures (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,marita... | SELECT demographic.age, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "2560" |
On what Date prior to Week 14 was the Record 7-1? | CREATE TABLE table_name_31 (date VARCHAR,week VARCHAR,record VARCHAR) | SELECT date FROM table_name_31 WHERE week < 14 AND record = "7-1" |
are there any flights from BOSTON to SAN FRANCISCO which stop in DENVER | 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 aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion varchar,wide_body var... | 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... |
in season 1996/97 was the place above or below 10th ? | CREATE TABLE table_204_415 (id number,"season" text,"tier" number,"division" text,"place" text) | SELECT (SELECT "place" FROM table_204_415 WHERE "season" = '1996/97') < 10 |
Which player scored 71? | CREATE TABLE table_name_4 (player VARCHAR,score VARCHAR) | SELECT player FROM table_name_4 WHERE score = 71 |
What is the Date of the Competition with Man of the Match Ollie Bronnimann? | CREATE TABLE table_7910 ("Date" text,"Opponent" text,"Venue" text,"Result" text,"Attendance" text,"Competition" text,"Man of the Match" text) | SELECT "Date" FROM table_7910 WHERE "Man of the Match" = 'ollie bronnimann' |
Who is the home team when the away team is newcastle united? | CREATE TABLE table_name_16 (home_team VARCHAR,away_team VARCHAR) | SELECT home_team FROM table_name_16 WHERE away_team = "newcastle united" |
How many games were played on May 11? | CREATE TABLE table_25190 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Series" text) | SELECT COUNT("Game") FROM table_25190 WHERE "Date" = 'May 11' |
Which Developer(s) has a Year of 2010? | CREATE TABLE table_name_90 (developer_s_ VARCHAR,year VARCHAR) | SELECT developer_s_ FROM table_name_90 WHERE year = 2010 |
What is the highest episode of Wood Flutes segment c? | CREATE TABLE table_name_65 (episode INTEGER,segment_c VARCHAR) | SELECT MAX(episode) FROM table_name_65 WHERE segment_c = "wood flutes" |
What is the 2010 value with a 1r in 2012 and an A in 2005? | CREATE TABLE table_47286 ("Tournament" text,"2005" text,"2006" text,"2007" text,"2008" text,"2009" text,"2010" text,"2011" text,"2012" text) | SELECT "2010" FROM table_47286 WHERE "2012" = '1r' AND "2005" = 'a' |
Name the % asian american for 23526 | CREATE TABLE table_22723 ("Rank" real,"Metropolitan Statistical Area" text,"Total Population (2010)" real,"Indian American Population (2010)" real,"% Indian American" text,"Asian American Population (2010)" real,"% Asian American" text,"Combined Statistical Area" text) | SELECT "% Asian American" FROM table_22723 WHERE "Indian American Population (2010)" = '23526' |
how many prescriptions was prescribed in 2105 for albuterol-ipratropium? | 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,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid numb... | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'albuterol-ipratropium' AND STRFTIME('%y', prescriptions.startdate) = '2105' |
Find date_address_to and the amount of date_address_to , and group by attribute other_details and bin date_address_to by weekday, and visualize them by a bar chart. | CREATE TABLE Students_in_Detention (student_id INTEGER,detention_id INTEGER,incident_id INTEGER)CREATE TABLE Ref_Address_Types (address_type_code VARCHAR(15),address_type_description VARCHAR(80))CREATE TABLE Detention (detention_id INTEGER,detention_type_code VARCHAR(10),teacher_id INTEGER,datetime_detention_start DATE... | SELECT date_address_to, COUNT(date_address_to) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC |
WHAT IS THE DATE WITH AN AWAY TEAM OF BURTON ALBION? | CREATE TABLE table_name_15 (date VARCHAR,away_team VARCHAR) | SELECT date FROM table_name_15 WHERE away_team = "burton albion" |
Show the names of companies in the banking or retailing industry? | CREATE TABLE company (Name VARCHAR,Industry VARCHAR) | SELECT Name FROM company WHERE Industry = "Banking" OR Industry = "Retailing" |
If the team is Worcestershire and the Matched had were 5, what is the highest score? | CREATE TABLE table_74069 ("Player" text,"Team" text,"Matches" real,"Runs" real,"Average" text,"Strike rate" text,"Highest Score" text,"100s" real,"50s" real) | SELECT "Highest Score" FROM table_74069 WHERE "Matches" = '5' AND "Team" = 'Worcestershire' |
Find the number of checking accounts for each account name. | CREATE TABLE checking (custid number,balance number)CREATE TABLE accounts (custid number,name text)CREATE TABLE savings (custid number,balance number) | SELECT COUNT(*), T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid GROUP BY T1.name |
WHich Year has a Music director(s) of anu malik? | CREATE TABLE table_name_5 (year INTEGER,music_director_s_ VARCHAR) | SELECT SUM(year) FROM table_name_5 WHERE music_director_s_ = "anu malik" |
how long was the big ride ? | CREATE TABLE table_203_570 (id number,"#" number,"title" text,"tpb isbn" text,"tpb release date" text,"tpb page number" number,"collected material" text) | SELECT "tpb page number" FROM table_203_570 WHERE "title" = 'the big ride' |
How many white-russian ethnic background patients have other pulmonary insufficiency not elsewhere classfied diagnoses? | 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.ethnicity = "WHITE - RUSSIAN" AND diagnoses.long_title = "Other pulmonary insufficiency, not elsewhere classified" |
What is the lowest amount of silver medals Iceland, who has less than 87 medals, has? | CREATE TABLE table_name_95 (silver INTEGER,nation VARCHAR,total VARCHAR) | SELECT MIN(silver) FROM table_name_95 WHERE nation = "iceland" AND total < 87 |
What is the smallest number of wins for a top-25 value greater than 5 and more than 38 cuts? | CREATE TABLE table_38402 ("Tournament" text,"Wins" real,"Top-5" real,"Top-10" real,"Top-25" real,"Events" real,"Cuts made" real) | SELECT MIN("Wins") FROM table_38402 WHERE "Top-25" > '5' AND "Cuts made" > '38' |
What was the Nominated Work earlier than 2003? | CREATE TABLE table_name_62 (nominated_work VARCHAR,year INTEGER) | SELECT nominated_work FROM table_name_62 WHERE year < 2003 |
What is the type of the RCA RW-2110, which has 2 MB of storage and a v.90 modem? | CREATE TABLE table_13825 ("Brand" text,"Model" text,"Type" text,"Modem" text,"Storage" text,"CPU speed" text,"CPU chip" text) | SELECT "Type" FROM table_13825 WHERE "Modem" = 'v.90' AND "Storage" = '2 mb' AND "Brand" = 'rca' AND "Model" = 'rw-2110' |
what are the total hospital expenses for patient 016-2639 last year? | CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE treatment (treatmentid number,patientunitstayid ... | SELECT SUM(cost.cost) FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-2639') AND DATETIME(cost.chargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') |
What's the projected population of IN-MI? | CREATE TABLE table_79314 ("Area" text,"State/ Province" text,"CSA/CMA 2009 population" real,"Projected 2025 population" text,"Projected increase 2009-2025" text) | SELECT "Projected 2025 population" FROM table_79314 WHERE "State/ Province" = 'in-mi' |
what is the bore where the vehicle code is t214? | CREATE TABLE table_23722304_2 (bore__mm_ VARCHAR,vehicle_code VARCHAR) | SELECT bore__mm_ FROM table_23722304_2 WHERE vehicle_code = "T214" |
What player has a total of 297? | CREATE TABLE table_name_87 (player VARCHAR,total VARCHAR) | SELECT player FROM table_name_87 WHERE total = 297 |
What Vehicle Flight # has Pilot Peterson and Velocity (km/h) of 649? | CREATE TABLE table_name_31 (vehicle_flight__number VARCHAR,pilot VARCHAR,velocity__km_h_ VARCHAR) | SELECT vehicle_flight__number FROM table_name_31 WHERE pilot = "peterson" AND velocity__km_h_ = 649 |
What are the average and minimum age of captains in different class? | CREATE TABLE captain (CLASS VARCHAR,age INTEGER) | SELECT AVG(age), MIN(age), CLASS FROM captain GROUP BY CLASS |
in this year, had patient 14054 receive a procedure? | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)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 patients (row_id number,subject_id number,gen... | SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14054) AND DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') |
what is the maximum yearly number of patients who suffer from s/p aneurysm resection/repair since 4 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 diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,... | SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 's/p aneurysm resection/repair' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY STRFTIME('%y', diagnosis.diagnosistime)) AS t1 |
What driver has over 19 points and a grid of over 2? | CREATE TABLE table_name_65 (driver VARCHAR,points VARCHAR,grid VARCHAR) | SELECT driver FROM table_name_65 WHERE points > 19 AND grid > 2 |
What is the total word count with a subframe count greater than 3? | CREATE TABLE table_name_43 (word__number INTEGER,subframe__number INTEGER) | SELECT SUM(word__number) FROM table_name_43 WHERE subframe__number > 3 |
Find the list of page size which have more than 3 product listed | CREATE TABLE product (max_page_size VARCHAR) | SELECT max_page_size FROM product GROUP BY max_page_size HAVING COUNT(*) > 3 |
How many teams had an outgoing manager of antonio g mez | CREATE TABLE table_27495117_3 (manner_of_departure VARCHAR,outgoing_manager VARCHAR) | SELECT COUNT(manner_of_departure) FROM table_27495117_3 WHERE outgoing_manager = "Antonio Gómez" |
Which attribute definitions have attribute value 0? Give me the number of attributes in each attribute name, and I want to display the number of attribute name in descending order. | CREATE TABLE Catalogs (catalog_id INTEGER,catalog_name VARCHAR(50),catalog_publisher VARCHAR(80),date_of_publication DATETIME,date_of_latest_revision DATETIME)CREATE TABLE Catalog_Contents (catalog_entry_id INTEGER,catalog_level_number INTEGER,parent_entry_id INTEGER,previous_entry_id INTEGER,next_entry_id INTEGER,cata... | SELECT attribute_name, COUNT(attribute_name) FROM Attribute_Definitions AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.attribute_id = t2.attribute_id WHERE t2.attribute_value = 0 GROUP BY attribute_name ORDER BY COUNT(attribute_name) DESC |
For those employees who was hired before 2002-06-21, give me the comparison about the sum of department_id over the job_id , and group by attribute job_id, could you sort in asc 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 regions (REGION_ID decimal(5,0),REGIO... | SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY SUM(DEPARTMENT_ID) |
what is Peter Little's party? | CREATE TABLE table_2668329_11 (party VARCHAR,incumbent VARCHAR) | SELECT party FROM table_2668329_11 WHERE incumbent = "Peter Little" |
now i need another flight from LAS VEGAS to LOS ANGELES arriving also in the late afternoon what 's available for that | CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE flight_stop (flight_id int,stop_number int,... | 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 ((flight.arrival_time <= 1800 AND flight.arrival_time >= 1600) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LOS ANGELES' AND flight... |
What was the grid for anthony davidson when the laps were less than 8? | CREATE TABLE table_35187 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT COUNT("Grid") FROM table_35187 WHERE "Driver" = 'anthony davidson' AND "Laps" < '8' |
What is the name of the series with an ISBN of 978-1-59582-523-0 (tpb)? | CREATE TABLE table_43047 ("Volume" text,"Series" text,"Title" text,"Cover" text,"Published" text,"ISBN" text) | SELECT "Series" FROM table_43047 WHERE "ISBN" = '978-1-59582-523-0 (tpb)' |
What year was Black Swan up for the Gotham Awards? | CREATE TABLE table_name_47 (year VARCHAR,title VARCHAR,award VARCHAR) | SELECT COUNT(year) FROM table_name_47 WHERE title = "black swan" AND award = "gotham awards" |
select count(Tags) from Posts where Tags like '%<r>%' group by CreationDate. | 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,LastEditorDisplayName text,LastEditDate time,LastActivityDate time,Title text,Tags text,Ans... | SELECT DATE(CreationDate), COUNT(Tags) FROM Posts WHERE Tags LIKE '%r%' GROUP BY DATE(CreationDate) |
how many patients are diagnosed with other drugs and medicinal substances causing adverse effects in therapeutic use? | 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 diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Other drugs and medicinal substances causing adverse effects in therapeutic use" |
What Semimajor axis (AU) has a Mass of 3.5 1.4 m ? | CREATE TABLE table_62083 ("Companion (in order from star)" text,"Mass" text,"Semimajor axis (AU)" text,"Orbital period (s day)" text,"Eccentricity" text,"Inclination" text) | SELECT "Semimajor axis ( AU )" FROM table_62083 WHERE "Mass" = '≥ 3.5 ± 1.4 m⊕' |
How many copies per particle does the protein nsp2 have? | CREATE TABLE table_35831 ("RNA Segment (Gene)" real,"Size (s base pair)" real,"Protein" text,"Molecular weight kDa" text,"Location" text,"Copies per particle" text) | SELECT "Copies per particle" FROM table_35831 WHERE "Protein" = 'nsp2' |
show me fares leaving on TUESDAY from DENVER to go to DALLAS | CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE flight_stop (flight_id int,stop_number int,stop_days text,stop_airport text,arrival_time int,arrival_airline text,arrival_flight_number int,departure_time int,departure_airline text,departure_flight_number int,stop_time int)CR... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND DAYS_1.day_name = ... |
Who is going to teach NURS 579 next semester ? | CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,entered_as varchar,admit_term int,predicted_graduation_semester int,degree varchar,minor varchar,internship varchar)CREATE TABLE program_course (program_id int,course_id int,work... | SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN course ON course.course_id = course_offering.course_id INNER JOIN semester... |
What is the average rating star for each reviewer, and order Y-axis from low to high order please. | CREATE TABLE Movie (mID int,title text,year int,director text)CREATE TABLE Reviewer (rID int,name text)CREATE TABLE Rating (rID int,mID int,stars int,ratingDate date) | SELECT name, AVG(T1.stars) FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T2.name ORDER BY AVG(T1.stars) |
What's the D ERP in San Martin Texmelucan, Puebla? | CREATE TABLE table_name_12 (d_erp VARCHAR,city_of_license VARCHAR) | SELECT d_erp FROM table_name_12 WHERE city_of_license = "san martin texmelucan, puebla" |
what is the daily maximum ph value for patient 64292 until 4 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 d_icd_diagnoses (row_id number,icd9_code text,short_title text... | SELECT MAX(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 64292) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'ph') AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '-4 mont... |
Who is the incumbent that is a republican and first elected before 1864? | CREATE TABLE table_39222 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text) | SELECT "Incumbent" FROM table_39222 WHERE "Party" = 'republican' AND "First elected" < '1864' |
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the trend about department_id over hire_date , sort by the x-axis in descending please. | 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 employees (EMP... | SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE DESC |
find the discharge time of subject name betty campbell. | 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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd t... | SELECT demographic.dischtime FROM demographic WHERE demographic.name = "Betty Campbell" |
Return the description for the courses named 'database'. | CREATE TABLE courses (course_id number,author_id number,subject_id number,course_name text,course_description text)CREATE TABLE student_course_enrolment (registration_id number,student_id number,course_id number,date_of_enrolment time,date_of_completion time)CREATE TABLE student_tests_taken (registration_id number,date... | SELECT course_description FROM courses WHERE course_name = "database" |
What label is from the Region of Spain? | CREATE TABLE table_name_93 (label VARCHAR,region VARCHAR) | SELECT label FROM table_name_93 WHERE region = "spain" |
What is the grid total for kazuyoshi hoshino with under 71 laps? | CREATE TABLE table_55537 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT SUM("Grid") FROM table_55537 WHERE "Driver" = 'kazuyoshi hoshino' AND "Laps" < '71' |
how many teams have ford f-150 as their trucks ? | CREATE TABLE table_204_89 (id number,"team" text,"truck(s)" text,"#" number,"driver(s)" text,"primary sponsor(s)" text,"listed owner(s)" text,"crew chief" text) | SELECT COUNT("team") FROM table_204_89 WHERE "truck(s)" = 'ford f-150' |
how many of the patients with benign neoplasm of spinal meninges were treated with a base drug? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Benign neoplasm of spinal meninges" AND prescriptions.drug_type = "BASE" |
Which date was the x gran premio di napoli? | CREATE TABLE table_name_7 (date VARCHAR,race_name VARCHAR) | SELECT date FROM table_name_7 WHERE race_name = "x gran premio di napoli" |
tell me how long patient 3745 stayed in the hospital last time. | CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE chartevents (row_id number,subject_... | SELECT STRFTIME('%j', admissions.dischtime) - STRFTIME('%j', admissions.admittime) FROM admissions WHERE admissions.subject_id = 3745 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1 |
count the number of hospital visits made to patient 035-11731 since 5 years ago. | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight... | SELECT COUNT(DISTINCT patient.patienthealthsystemstayid) FROM patient WHERE patient.uniquepid = '035-11731' AND DATETIME(patient.hospitaladmittime) >= DATETIME(CURRENT_TIME(), '-5 year') |
is dean winstanley listed above or below kyle anderson ? | CREATE TABLE table_203_20 (id number,"player" text,"year" number,"round" text,"result" text,"opponent" text) | SELECT (SELECT id FROM table_203_20 WHERE "player" = 'dean winstanley') < (SELECT id FROM table_203_20 WHERE "player" = 'kyle anderson') |
/What is Tie No, when Date is 18 February 1956, and when Away Team is Tottenham Hotspur? | CREATE TABLE table_name_44 (tie_no VARCHAR,date VARCHAR,away_team VARCHAR) | SELECT tie_no FROM table_name_44 WHERE date = "18 february 1956" AND away_team = "tottenham hotspur" |
What is Week, when Semi Finalists is Sandrine Testud Yone Kamio? | CREATE TABLE table_41574 ("Week of" text,"Tier" text,"Winner" text,"Runner-up" text,"Semi finalists" text) | SELECT "Week of" FROM table_41574 WHERE "Semi finalists" = 'sandrine testud yone kamio' |
What occupation does Mary Louise Lorefice have? | CREATE TABLE table_55680 ("Riding" text,"Candidate" text,"Gender" text,"Residence" text,"Occupation" text,"Votes" real,"Rank" text) | SELECT "Occupation" FROM table_55680 WHERE "Candidate" = 'mary louise lorefice' |
What is the name of the bank branch that has lended the largest total amount in loans, specifically to customers with credit scores below 100? | CREATE TABLE customer (cust_id text,cust_name text,acc_type text,acc_bal number,no_of_loans number,credit_score number,branch_id number,state text)CREATE TABLE loan (loan_id text,loan_type text,cust_id text,branch_id text,amount number)CREATE TABLE bank (branch_id number,bname text,no_of_customers number,city text,stat... | SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id = T2.branch_id JOIN customer AS T3 ON T1.cust_id = T3.cust_id WHERE T3.credit_score < 100 GROUP BY T2.bname ORDER BY SUM(T1.amount) DESC LIMIT 1 |
When did the episode titled 'Route 666 (part 1)' air for the first time? | CREATE TABLE table_2588 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text) | SELECT "Original air date" FROM table_2588 WHERE "Title" = 'Route 666 (Part 1)' |
Give me a bar chart to show how many days with a max temperature greater than or equal to 80 for each year, and could you list total number in ascending order? | CREATE TABLE status (station_id INTEGER,bikes_available INTEGER,docks_available INTEGER,time TEXT)CREATE TABLE station (id INTEGER,name TEXT,lat NUMERIC,long NUMERIC,dock_count INTEGER,city TEXT,installation_date TEXT)CREATE TABLE trip (id INTEGER,duration INTEGER,start_date TEXT,start_station_name TEXT,start_station_i... | SELECT date, COUNT(date) FROM weather WHERE max_temperature_f >= 80 ORDER BY COUNT(date) |
What is the title written by David Mamet? | CREATE TABLE table_10908676_7 (title VARCHAR,written_by VARCHAR) | SELECT title FROM table_10908676_7 WHERE written_by = "David Mamet" |
until 2100, what are the top four most common procedures? | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,tr... | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE STRFTIME('%y', treatment.treatmenttime) <= '2100' GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 4 |
What is the total administrative population of Shanghai? | CREATE TABLE table_20848 ("City" text,"Chinese" text,"Pinyin" text,"Province" text,"Urban Population (2010)" real,"Administrative Population (2010)" real) | SELECT COUNT("Administrative Population (2010)") FROM table_20848 WHERE "City" = 'Shanghai' |
Where did they play and how many attended in the game against minnesota? | CREATE TABLE table_13619105_3 (location_attendance VARCHAR,team VARCHAR) | SELECT location_attendance FROM table_13619105_3 WHERE team = "Minnesota" |
What shows for 2013 when 2012 is 2r? | CREATE TABLE table_name_16 (Id VARCHAR) | SELECT 2013 FROM table_name_16 WHERE 2012 = "2r" |
Name the order number for the beatles and result is safe | CREATE TABLE table_15796054_3 (order__number VARCHAR,original_artist VARCHAR,result VARCHAR) | SELECT order__number FROM table_15796054_3 WHERE original_artist = "The Beatles" AND result = "Safe" |
What rank did the nation with athlete peter snell category:articles with hcards have? | CREATE TABLE table_2604 ("Rank" real,"Athlete" text,"Nation" text,"Olympics" text,"Gold" real,"Silver" real,"Bronze" real,"Total(min. 2 medals)" real) | SELECT COUNT("Rank") FROM table_2604 WHERE "Athlete" = 'Peter Snell Category:Articles with hCards' |
What is the enrollment associated with a capacity greater then 35,650? | CREATE TABLE table_70070 ("Institution" text,"Team" text,"City" text,"Province" text,"First season" real,"Head coach" text,"Enrollment" real,"Endowment" text,"Football stadium" text,"Capacity" real) | SELECT MIN("Enrollment") FROM table_70070 WHERE "Capacity" > '35,650' |
What is the average React, when Name is 'Candice Davis', and when Lane is less than 3? | CREATE TABLE table_name_91 (react INTEGER,name VARCHAR,lane VARCHAR) | SELECT AVG(react) FROM table_name_91 WHERE name = "candice davis" AND lane < 3 |
How many gold medals for bellbrook HS with less than 1 silver? | CREATE TABLE table_name_73 (gold_medals VARCHAR,ensemble VARCHAR,silver_medals VARCHAR) | SELECT COUNT(gold_medals) FROM table_name_73 WHERE ensemble = "bellbrook hs" AND silver_medals < 1 |
Find the last name and age of the student who has allergy to both milk and cat. Show a bar chart. | CREATE TABLE Has_Allergy (StuID INTEGER,Allergy 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))CREATE TABLE Allergy_Type (Allergy VARCHAR(20),AllergyType VARCHAR(20)) | SELECT LName, Age FROM Student WHERE StuID IN (SELECT StuID FROM Has_Allergy WHERE Allergy = "Milk" INTERSECT SELECT StuID FROM Has_Allergy WHERE Allergy = "Cat") |
what is procedure long title of subject id 84129? | 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 procedures.long_title FROM procedures WHERE procedures.subject_id = "84129" |
what are the top three most frequent specimen tests that patients took within 2 months after being diagnosed with sinus tachycardia since 4 years ago? | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE vitalperiodic (vita... | SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'sinus tachycardia' AND DATETIME(diagnosis.di... |
Bar chart x axis meter 500 y axis meter_100, sort y-axis in ascending order. | CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 text,meter_400 text,meter_500 text,meter_600 text,meter_700 text,Time text)CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Opening_year... | SELECT meter_500, meter_100 FROM swimmer ORDER BY meter_100 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.