instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
What's the agency of the member born on 1998.11.09? | CREATE TABLE table_name_32 (agency VARCHAR,birthday VARCHAR) | SELECT agency FROM table_name_32 WHERE birthday = "1998.11.09" |
What is the sum of losses when wins is more than 6, club is camperdown and against is more than 1238? | CREATE TABLE table_name_6 (losses INTEGER,against VARCHAR,wins VARCHAR,club VARCHAR) | SELECT SUM(losses) FROM table_name_6 WHERE wins > 6 AND club = "camperdown" AND against > 1238 |
Who were all the pictorials when the centerfold model was Rebekka Armstrong? | CREATE TABLE table_1566848_7 (pictorials VARCHAR,centerfold_model VARCHAR) | SELECT COUNT(pictorials) FROM table_1566848_7 WHERE centerfold_model = "Rebekka Armstrong" |
Name the period for south korea with peak position of #1 | CREATE TABLE table_name_90 (period VARCHAR,country VARCHAR,peak_position VARCHAR) | SELECT period FROM table_name_90 WHERE country = "south korea" AND peak_position = "#1" |
What Week 4 has a Week 2 of samantha speer? | CREATE TABLE table_12982 ("Week 1" text,"Week 2" text,"Week 3" text,"Week 4" text,"Week 5" text) | SELECT "Week 4" FROM table_12982 WHERE "Week 2" = 'samantha speer' |
EECS 487 and EECS 521 , which one is easier ? | 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 comment_instructor (instructor_id int,student_id ... | SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 487 OR course.number = 521) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ... |
which Copa Libertadores 1996 has round 1 Supercopa 1995 and argentinos juniors team ? | CREATE TABLE table_38605 ("Team" text,"Recopa 1995" text,"Supercopa 1995" text,"CONMEBOL 1995" text,"Copa Libertadores 1996" text) | SELECT "Copa Libertadores 1996" FROM table_38605 WHERE "Supercopa 1995" = 'round 1' AND "Team" = 'argentinos juniors' |
Name the date for visiting team of denver broncos | CREATE TABLE table_67107 ("Date" text,"Visiting Team" text,"Final Score" text,"Host Team" text,"Stadium" text) | SELECT "Date" FROM table_67107 WHERE "Visiting Team" = 'denver broncos' |
What was the game number of the game played against Charlotte? | CREATE TABLE table_7818 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT COUNT("Game") FROM table_7818 WHERE "Team" = 'charlotte' |
Compare the total number of different job titles for all those jobs in department 80 using a bar chart. | 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 locations (LOCATION_ID decimal(4,0),S... | SELECT JOB_TITLE, COUNT(JOB_TITLE) FROM employees AS T1 JOIN jobs AS T2 ON T1.JOB_ID = T2.JOB_ID WHERE T1.DEPARTMENT_ID = 80 GROUP BY JOB_TITLE |
What was Fuzzy Zoeller's score in the United States? | CREATE TABLE table_9624 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Score" FROM table_9624 WHERE "Country" = 'united states' AND "Player" = 'fuzzy zoeller' |
what is the number of live action american superhero movies released in 1978 ? | CREATE TABLE table_203_79 (id number,"year" number,"film" text,"publisher" text,"director" text,"distributor" text,"worldwide gross" text,"notes" text) | SELECT COUNT("film") FROM table_203_79 WHERE "year" = 1978 |
what are the four most common medicines that patients were prescribed during the same month after they were prescribed rufinamide until 2101? | CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE admissions (row_id number,subject_id number,hadm_id numb... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'rufinamide' AND STRFTIME('%y', prescriptions.startdate) <= '2101'... |
name the total number of timeslot for number 1 | CREATE TABLE table_19834691_4 (timeslot VARCHAR,_number VARCHAR) | SELECT COUNT(timeslot) FROM table_19834691_4 WHERE _number = 1 |
What is the low bronze total for the team with 4 total and under 1 gold? | CREATE TABLE table_name_66 (bronze INTEGER,total VARCHAR,gold VARCHAR) | SELECT MIN(bronze) FROM table_name_66 WHERE total = 4 AND gold < 1 |
Bar chart of minimal salary from each dept name, order dept_name in ascending order please. | CREATE TABLE instructor (ID varchar(5),name varchar(20),dept_name varchar(20),salary numeric(8,2))CREATE TABLE prereq (course_id varchar(8),prereq_id varchar(8))CREATE TABLE student (ID varchar(5),name varchar(20),dept_name varchar(20),tot_cred numeric(3,0))CREATE TABLE takes (ID varchar(5),course_id varchar(8),sec_id ... | SELECT dept_name, MIN(salary) FROM instructor GROUP BY dept_name ORDER BY dept_name |
What was the B segmint for Netlix S03E01? | CREATE TABLE table_35545 ("Series Ep." text,"Episode" real,"Netflix" text,"Segment A" text,"Segment B" text,"Segment C" text,"Segment D" text) | SELECT "Segment B" FROM table_35545 WHERE "Netflix" = 's03e01' |
in ATLANTA i would like information on ground transportation | 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 varchar)CREATE TABLE compartment_class (compartment varc... | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'ATLANTA' AND ground_service.city_code = city.city_code |
GENERATE HTML PAGE SHOWING (mostly) ANIMATED GIFS posted in specified # of days. Creates HTML to paste into blank .html file showing .GIF images (mostly animated GIFs) linked to Q&A posts within 'the past number of days specified'. Looks for the first occurrence of `.gif` in the post body and searches backwards for `ht... | CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModeratorId number,ApprovalDate time,ApprovalModeratorId number,DeactivationDat... | SELECT SUBSTRING(Body, CHARINDEX(@stEnd, Body) + LEN(@stStart) - (CHARINDEX(REVERSE(@stStart), REVERSE(LEFT(Body, CHARINDEX(@stEnd, Body) + LEN(@stStart) - 1))) + LEN(@stStart) - 1), CHARINDEX(REVERSE(@stStart), REVERSE(LEFT(Body, CHARINDEX(@stEnd, Body) + LEN(@stStart) - 1))) + LEN(@stStart) - 1) AS "gif_url", CASE WH... |
Who was the arranger of ' '? | CREATE TABLE table_76990 ("Title" text,"Lyricist(s)" text,"Composer(s)" text,"Arranger(s)" text,"Length" text) | SELECT "Arranger(s)" FROM table_76990 WHERE "Title" = 'ขอโทษ' |
Which highest number of Seats has votes of 244,867? | CREATE TABLE table_52371 ("Party" text,"Leader" text,"Votes" real,"Percentage" text,"Seats" real) | SELECT MAX("Seats") FROM table_52371 WHERE "Votes" = '244,867' |
When did the peterborough phantoms play at a venue of home? | CREATE TABLE table_62049 ("Date" text,"Opponent" text,"Venue" text,"Result" text,"Competition" text) | SELECT "Date" FROM table_62049 WHERE "Venue" = 'home' AND "Opponent" = 'peterborough phantoms' |
How many rooms does each block floor have? | CREATE TABLE patient (ssn number,name text,address text,phone text,insuranceid number,pcp number)CREATE TABLE medication (code number,name text,brand text,description text)CREATE TABLE prescribes (physician number,patient number,medication number,date time,appointment number,dose text)CREATE TABLE trained_in (physician... | SELECT COUNT(*), T1.blockfloor FROM block AS T1 JOIN room AS T2 ON T1.blockfloor = T2.blockfloor AND T1.blockcode = T2.blockcode GROUP BY T1.blockfloor |
When is 511 offered next semester ? | 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 int,heavy_assignments int,respected int,participation int,heavy_reading int,tough_grade... | SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course, course_offering, semester WHERE course.course_id = course_offe... |
What name ran for the Prohibition ticket when the Progressive ticket was Eugene M. Travis? | CREATE TABLE table_name_14 (prohibition_ticket VARCHAR,progressive_ticket VARCHAR) | SELECT prohibition_ticket FROM table_name_14 WHERE progressive_ticket = "eugene m. travis" |
Which Proto-Oceanic has a Proto-Polynesian of *lima? | CREATE TABLE table_name_48 (proto_oceanic VARCHAR,proto_polynesian VARCHAR) | SELECT proto_oceanic FROM table_name_48 WHERE proto_polynesian = "*lima" |
What is the average number of drawn with a difference of 17 and 22 points? | CREATE TABLE table_41538 ("Position" real,"Team" text,"Points" real,"Played" real,"Drawn" real,"Lost" real,"Against" real,"Difference" text) | SELECT AVG("Drawn") FROM table_41538 WHERE "Difference" = '17' AND "Points" = '22' |
what is patient 015-7988's first diagnosis until 4 years ago? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE microlab ... | SELECT diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-7988')) AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CUR... |
Which Species Specific has a Comparative of no, and an Intra-molecular structure of no, and a Link of sourcecode? | CREATE TABLE table_36079 ("Name" text,"Species Specific" text,"Intra-molecular structure" text,"Comparative" text,"Link" text) | SELECT "Species Specific" FROM table_36079 WHERE "Comparative" = 'no' AND "Intra-molecular structure" = 'no' AND "Link" = 'sourcecode' |
What is the lowest overall with more than 17 rounds? | CREATE TABLE table_70973 ("Round" real,"Overall" real,"Player" text,"Position" text,"College" text) | SELECT MIN("Overall") FROM table_70973 WHERE "Round" > '17' |
what is the marital status of patient 19894 in their first hospital encounter. | CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status ... | SELECT admissions.marital_status FROM admissions WHERE admissions.subject_id = 19894 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1 |
when did patient 92788 get white blood cells lab test for the last time during their current hospital visit? | CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABL... | SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'white blood cells') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 92788 AND admissions.dischtime IS NULL) ORDER BY labevents.chartti... |
What are the number of the names of all the Japanese constructors that have earned more than 5 points?, display in ascending by the x-axis please. | CREATE TABLE drivers (driverId INTEGER,driverRef TEXT,number TEXT,code TEXT,forename TEXT,surname TEXT,dob TEXT,nationality TEXT,url TEXT)CREATE TABLE pitStops (raceId INTEGER,driverId INTEGER,stop INTEGER,lap INTEGER,time TEXT,duration TEXT,milliseconds INTEGER)CREATE TABLE seasons (year INTEGER,url TEXT)CREATE TABLE ... | SELECT name, COUNT(name) FROM constructors AS T1 JOIN constructorStandings AS T2 ON T1.constructorId = T2.constructorId WHERE T1.nationality = "Japanese" AND T2.points > 5 GROUP BY name ORDER BY name |
What is the first class team of the player born on 23 February 1973? | CREATE TABLE table_name_70 (first_class_team VARCHAR,date_of_birth VARCHAR) | SELECT first_class_team FROM table_name_70 WHERE date_of_birth = "23 february 1973" |
what is the difference in kw between naga and bacolod radio ? | CREATE TABLE table_204_164 (id number,"branding" text,"callsign" text,"frequency" text,"power (kw)" text,"location" text) | SELECT ABS((SELECT "power (kw)" FROM table_204_164 WHERE "location" = 'naga') - (SELECT "power (kw)" FROM table_204_164 WHERE "location" = 'bacolod')) |
For those products with a price between 60 and 120, give me the comparison about manufacturer over the name , and rank x axis from low to high order. | 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 Name, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Name |
WHAT IS THE AVERAGE WEEK WITH A DATE OF JULY 25? | CREATE TABLE table_name_5 (week INTEGER,date VARCHAR) | SELECT AVG(week) FROM table_name_5 WHERE date = "july 25" |
Who won Women's doubles when Zen Yaqiong won Women's singles? | CREATE TABLE table_71772 ("Year" real,"Men's singles" text,"Women's singles" text,"Men's doubles" text,"Women's doubles" text,"Mixed doubles" text) | SELECT "Women's doubles" FROM table_71772 WHERE "Women's singles" = 'zen yaqiong' |
has patient 013-29856 received any diagnoses on the last hospital encounter? | 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 microlab (microlabid number,patientunitstayid number,culturesite text,orga... | SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-29856' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.ho... |
Give me the comparison about the average of School_ID over the All_Home , and group by attribute All_Home by a bar chart, I want to display by the x axis from low to high. | 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_Home, AVG(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home |
Who had a score of 77-69-70-71=287? | CREATE TABLE table_name_91 (player VARCHAR,score VARCHAR) | SELECT player FROM table_name_91 WHERE score = 77 - 69 - 70 - 71 = 287 |
How tall is the Street address of 07.0 200 east washington street? | CREATE TABLE table_name_10 (height_ft___m__ VARCHAR,street_address VARCHAR) | SELECT height_ft___m__ FROM table_name_10 WHERE street_address = "07.0 200 east washington street" |
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about salary over the job_id , rank by the Y-axis in ascending. | CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE ... | SELECT JOB_ID, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SALARY |
Which teachers teach in classroom 109? Give me their last names. | CREATE TABLE teachers (lastname text,firstname text,classroom number)CREATE TABLE list (lastname text,firstname text,grade number,classroom number) | SELECT lastname FROM teachers WHERE classroom = 109 |
what is marital status and diagnoses short title of subject id 42067? | 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 procedures (subject_id text,hadm_id text,icd9_code text,sho... | SELECT demographic.marital_status, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "42067" |
i need a flight from OAKLAND to SALT LAKE CITY on wednesday departing after 1800 | 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 flight_fare (flight_id int,fare_id int)CREATE TABLE month (month_number int,month_name text)CREATE TABLE date_day (month_number int,day_number in... | SELECT DISTINCT flight_id FROM flight WHERE (((departure_time > 1800 AND flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 23 AND DATE_DAYalias0.month_number = 4 AND DATE_DAYa... |
What is the official target date for the Swedish Krona? | CREATE TABLE table_70218 ("Currency" text,"Code" text,"Entry ERM II" text,"Central rate" text,"Official target date" text) | SELECT "Official target date" FROM table_70218 WHERE "Currency" = 'swedish krona' |
Where was the location for Arras Paul Arras? | CREATE TABLE table_7194 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Location" text) | SELECT "Location" FROM table_7194 WHERE "Opponent" = 'arras paul arras' |
What was the record on March 22? | CREATE TABLE table_51373 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text) | SELECT "Record" FROM table_51373 WHERE "Date" = 'march 22' |
how many patients died in or befor 2186 with diagnosis icd9 code 42613? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_fla... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dod_year <= "2186.0" AND diagnoses.icd9_code = "42613" |
Which Name has a League Cup Goals of 0, and League Apps of 1? | CREATE TABLE table_name_75 (name VARCHAR,league_cup_goals VARCHAR,league_apps VARCHAR) | SELECT name FROM table_name_75 WHERE league_cup_goals = 0 AND league_apps = "1" |
on this month/21, was arterial bp [diastolic] of patient 10855 ever less than 61.0? | CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)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... | SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10855)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [dias... |
what was the first time that patient 025-64321 had the maximum sao2 since 08/21/2102? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,disch... | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-64321')) AND NOT vitalperiodic.sao2 IS NULL AND... |
When was the song by Andy Gibb issued? | CREATE TABLE table_39490 ("Volume:Issue" text,"Issue Date(s)" text,"Weeks on Top" real,"Song" text,"Artist" text) | SELECT "Issue Date(s)" FROM table_39490 WHERE "Artist" = 'andy gibb' |
give me the number of patients whose insurance is medicaid and procedure icd9 code is 331? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicaid" AND procedures.icd9_code = "331" |
What is every value when Mitchell is 676? | CREATE TABLE table_1818471_1 (value VARCHAR,mitchell VARCHAR) | SELECT value FROM table_1818471_1 WHERE mitchell = 676 |
what are the top four most common lab tests until 4 years ago? | CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim... | SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE DATETIME(lab.labresulttime) <= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 4 |
give me the number of patients whose ethnicity is black/cape verdean and primary disease is colangitis? | 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 WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.diagnosis = "COLANGITIS" |
When 142900 is the population what is the highest rank? | CREATE TABLE table_25794 ("Rank" real,"City/Town" text,"County" text,"Region/Province" text,"Population" real,"Country" text) | SELECT MAX("Rank") FROM table_25794 WHERE "Population" = '142900' |
With which association did estribillo ii run as Horse 1? | CREATE TABLE table_10578 ("Year" real,"City" text,"Rider 1" text,"Rider 2" text,"Horse 1" text,"Horse 2" text,"Association" text) | SELECT "Association" FROM table_10578 WHERE "Horse 1" = 'estribillo ii' |
how many latitudes have 0.081 (sqmi) of water? | CREATE TABLE table_22459 ("Township" text,"County" text,"Pop. (2010)" real,"Land (sqmi)" text,"Water (sqmi)" text,"Latitude" text,"Longitude" text,"GEO ID" real,"ANSI code" real) | SELECT COUNT("Latitude") FROM table_22459 WHERE "Water (sqmi)" = '0.081' |
What is the amount of trees, that require replacement when district is leninsky? | CREATE TABLE table_72090 ("District" text,"Total amount of trees" real,"Prevailing types,%" text,"Amount of old trees" text,"Amount of trees,that require replacement" text) | SELECT "Amount of trees, that require replacement" FROM table_72090 WHERE "District" = 'Leninsky' |
please give me flights from ATLANTA to BOSTON on wednesday afternoon and thursday morning | 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)CREATE TABLE month (month_number int,month_name text)CREATE TABLE flight_fare (flig... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((((flight.departure_time BETWEEN 0 AND 1200) AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_na... |
what are the numbers of patients who have had a diuretic - spironolactone two or more times? | 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 t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'diuretic - spironolactone') GROUP BY patient.uniquepid) AS t1 WHERE t1.c1 >= 2 |
what television service are in the united kingdom and n is greater than 854.0? | CREATE TABLE table_15887683_15 (television_service VARCHAR,country VARCHAR,n° VARCHAR) | SELECT television_service FROM table_15887683_15 WHERE country = "United Kingdom" AND n° > 854.0 |
what kinds of ground transportation is available in DALLAS FORT WORTH | CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_requi... | SELECT DISTINCT ground_service.transport_type FROM city AS CITY_0, city AS CITY_1, ground_service WHERE (ground_service.city_code = CITY_0.city_code AND CITY_0.city_name = 'DALLAS') OR (ground_service.city_code = CITY_1.city_code AND CITY_1.city_name = 'FORT WORTH') |
How many people are women's singles in the season of 2000/01? | CREATE TABLE table_30407 ("Season" text,"Host" text,"Mens Singles" text,"Womens Singles" text,"Mens Doubles" text,"Womens Doubles" text) | SELECT COUNT("Womens Singles") FROM table_30407 WHERE "Season" = '2000/01' |
Who was in 4th when in 6th is Air Traffic? | CREATE TABLE table_72843 ("Poll Year" text,"Winner" text,"Second" text,"Third" text,"Fourth" text,"Fifth" text,"Sixth" text,"Seventh" text,"Eighth" text,"Ninth" text,"Tenth" text) | SELECT "Fourth" FROM table_72843 WHERE "Sixth" = 'Air Traffic' |
Which Share has a weekly Rank of 8 and is dated 15 June? | CREATE TABLE table_59559 ("Show" text,"Date" text,"Official ratings (millions)" real,"Weekly rank" text,"Share" text) | SELECT "Share" FROM table_59559 WHERE "Weekly rank" = '8' AND "Date" = '15 june' |
our lady of the assumption catholic church started the same year as what church ? | CREATE TABLE table_203_387 (id number,"parish est" number,"church" text,"city" text,"current bldg begun" number,"weekly collections" text,"notes" number) | SELECT "church" FROM table_203_387 WHERE "church" <> 'our lady of the assumption catholic church' AND "current bldg begun" = (SELECT "current bldg begun" FROM table_203_387 WHERE "church" = 'our lady of the assumption catholic church') |
how many winnings does jeff gordon have? | CREATE TABLE table_3897 ("Position" real,"Driver" text,"Points" real,"Winnings" text,"Series" text) | SELECT "Winnings" FROM table_3897 WHERE "Driver" = 'Jeff Gordon' |
What is the time/s of team Triumph in those races in which Triumph ranked higher than 4? | CREATE TABLE table_31826 ("Rank" real,"Rider" text,"Team" text,"Speed" text,"Time" text) | SELECT "Time" FROM table_31826 WHERE "Team" = 'triumph' AND "Rank" < '4' |
did patient 24268 excreted any of his urine . on the first icu visit? | 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_labitems (row_id number,itemid number,label text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,chartt... | SELECT COUNT(*) > 0 FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24268) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND outputevents.itemid IN (SELECT... |
University of Minnesota of had what Deloria & Boas? | CREATE TABLE table_6745 ("Buechel & Manhart spelling (pronunciation)" text,"Ullrich" text,"Brandon University" text,"Deloria & Boas" text,"Dakota Mission" text,"Rood & Taylor" text,"Riggs" text,"Williamson" text,"University of Minnesota" text,"White Hat" text) | SELECT "Deloria & Boas" FROM table_6745 WHERE "University of Minnesota" = 'ṭ' |
What Site had an Attendance of 45,000? | CREATE TABLE table_name_20 (site VARCHAR,attendance VARCHAR) | SELECT site FROM table_name_20 WHERE attendance = "45,000" |
Which celebrity who was famous for being the ex busted member and TV presenter exited on day 19? | CREATE TABLE table_6581 ("Celebrity" text,"Famous for" text,"Entered" text,"Exited" text,"Finished" text) | SELECT "Celebrity" FROM table_6581 WHERE "Exited" = 'day 19' AND "Famous for" = 'ex busted member and tv presenter' |
Answers to Delphi Posts with Accepted Answer and Fav Count>2. Enter Query Description | CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE PostNotices (Id n... | SELECT * FROM Posts WHERE ParentId IN (SELECT Id FROM Posts WHERE FavoriteCount > 2 AND NOT AcceptedAnswerId IS NULL AND Id IN (SELECT PostId FROM PostTags WHERE TagId IN (SELECT Id FROM Tags WHERE TagName LIKE '%delphi%'))) |
give the number of patients whose drug code is posa200l and lab test fluid is urine? | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "POSA200L" AND lab.fluid = "Urine" |
What was the lowest attendance at a week 15 game? | CREATE TABLE table_41737 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real) | SELECT MIN("Attendance") FROM table_41737 WHERE "Week" = '15' |
On what date did Fleetcenter have a game lower than 9 with a score of 104-94? | CREATE TABLE table_76887 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location" text,"Record" text) | SELECT "Date" FROM table_76887 WHERE "Location" = 'fleetcenter' AND "Game" < '9' AND "Score" = '104-94' |
Are there certain professors who do not teach any classes with labs ? | CREATE TABLE course (course_id int,name varchar,department varchar,number varchar,credits varchar,advisory_requirement varchar,enforced_requirement varchar,description varchar,num_semesters int,num_enrolled int,has_discussion varchar,has_lab varchar,has_projects varchar,has_exams varchar,num_reviews int,clarity_score i... | 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... |
Which Podium has 1 Race and a Final Place of 5th? | CREATE TABLE table_name_11 (podiums VARCHAR,races VARCHAR,final_placing VARCHAR) | SELECT podiums FROM table_name_11 WHERE races = "1" AND final_placing = "5th" |
Find the minimum salary for the departments whose average salary is above the average payment of all instructors Plot them as bar chart, display in ascending by the Y-axis. | CREATE TABLE prereq (course_id varchar(8),prereq_id varchar(8))CREATE TABLE advisor (s_ID varchar(5),i_ID varchar(5))CREATE TABLE section (course_id varchar(8),sec_id varchar(8),semester varchar(6),year numeric(4,0),building varchar(15),room_number varchar(7),time_slot_id varchar(4))CREATE TABLE department (dept_name v... | SELECT dept_name, MIN(salary) FROM instructor GROUP BY dept_name ORDER BY MIN(salary) |
What is the average lifespan of a baseball player? | CREATE TABLE salary (year number,team_id text,league_id text,player_id text,salary number)CREATE TABLE player (player_id text,birth_year text,birth_month text,birth_day text,birth_country text,birth_state text,birth_city text,death_year text,death_month text,death_day text,death_country text,death_state text,death_city... | SELECT AVG(death_year - birth_year) FROM player |
Which Tournament has a 1984 of 1r? | CREATE TABLE table_34849 ("Tournament" text,"1981" text,"1982" text,"1983" text,"1984" text,"1985" text,"1986" text,"1987" text,"1988" text,"1989" text) | SELECT "Tournament" FROM table_34849 WHERE "1984" = '1r' |
How many wines are there for each grape, and I want to display by the X in ascending. | CREATE TABLE grapes (ID INTEGER,Grape TEXT,Color TEXT)CREATE TABLE appellations (No INTEGER,Appelation TEXT,County TEXT,State TEXT,Area TEXT,isAVA TEXT)CREATE TABLE wine (No INTEGER,Grape TEXT,Winery TEXT,Appelation TEXT,State TEXT,Name TEXT,Year INTEGER,Price INTEGER,Score INTEGER,Cases INTEGER,Drink TEXT) | SELECT Grape, COUNT(*) FROM wine GROUP BY Grape ORDER BY Grape |
Which Bronze is the lowest one that has a Rank of 3, and a Silver smaller than 2? | CREATE TABLE table_name_7 (bronze INTEGER,rank VARCHAR,silver VARCHAR) | SELECT MIN(bronze) FROM table_name_7 WHERE rank = "3" AND silver < 2 |
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of email and manager_id in a bar chart, display by the bar 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 departments (D... | SELECT EMAIL, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMAIL DESC |
provide the number of patients whose primary disease is ruq pain and year of birth is less than 2041? | 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 WHERE demographic.diagnosis = "RUQ PAIN" AND demographic.dob_year < "2041" |
What is the rank of Manuel Cortina Mart nez? | CREATE TABLE table_name_46 (rank VARCHAR,athletes VARCHAR) | SELECT rank FROM table_name_46 WHERE athletes = "manuel cortina martínez" |
how many patients had a diagnosis short title preterm nec 2000-2499g and ih as the drug route? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Preterm NEC 2000-2499g" AND prescriptions.route = "IH" |
Pie. what are the different parties of representative? Show the party name and the number of representatives in each party. | CREATE TABLE election (Election_ID int,Representative_ID int,Date text,Votes real,Vote_Percent real,Seats real,Place real)CREATE TABLE representative (Representative_ID int,Name text,State text,Party text,Lifespan text) | SELECT Party, COUNT(*) FROM representative GROUP BY Party |
Which party does the incumbent first elected in 1994 belong to? | CREATE TABLE table_18113 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Results" text,"Candidates" text) | SELECT "Party" FROM table_18113 WHERE "First elected" = '1994' |
What is the Place that has a Date of 22 august 2004? | CREATE TABLE table_name_92 (place VARCHAR,date VARCHAR) | SELECT place FROM table_name_92 WHERE date = "22 august 2004" |
How many campuses exist are in the county of LA? | CREATE TABLE degrees (year number,campus number,degrees number)CREATE TABLE faculty (campus number,year number,faculty number)CREATE TABLE enrollments (campus number,year number,totalenrollment_ay number,fte_ay number)CREATE TABLE discipline_enrollments (campus number,discipline number,year number,undergraduate number,... | SELECT COUNT(*) FROM campuses WHERE county = "Los Angeles" |
Who was the winner for the Rome to Teramo course? | CREATE TABLE table_name_97 (winner VARCHAR,course VARCHAR) | SELECT winner FROM table_name_97 WHERE course = "rome to teramo" |
How many losses does Central Blues have? | CREATE TABLE table_26200568_16 (losses INTEGER,club VARCHAR) | SELECT MAX(losses) FROM table_26200568_16 WHERE club = "Central Blues" |
What is the first year of the European Championships competition? | CREATE TABLE table_68767 ("Year" real,"Competition" text,"Venue" text,"Position" text,"Notes" text) | SELECT MIN("Year") FROM table_68767 WHERE "Competition" = 'european championships' |
What is the number of the tax supervising and conservation bill? | CREATE TABLE table_256286_23 (meas_num INTEGER,description VARCHAR) | SELECT MIN(meas_num) FROM table_256286_23 WHERE description = "Tax Supervising and Conservation Bill" |
What Player has more than 1 Touchdowns with 0 Extra Points and less than 50 Points? | CREATE TABLE table_name_61 (player VARCHAR,points VARCHAR,touchdowns VARCHAR,extra_points VARCHAR) | SELECT player FROM table_name_61 WHERE touchdowns > 1 AND extra_points = 0 AND points < 50 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.