instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Find the number of patients who had procedure titled fiber-optic bronchoscopy and have their status as 0. | CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.long_title = "Fiber-optic bronchoscopy" |
Name the australian marquee for alessandro del piero | CREATE TABLE table_17932 ("Club" text,"Australian Marquee" text,"International Marquee" text,"Junior Marquee player" text,"Captain" text,"Vice-Captain" text) | SELECT "Australian Marquee" FROM table_17932 WHERE "International Marquee" = 'Alessandro Del Piero' |
What is the lowest rank for Chris Brown with react greater than 0.244? | CREATE TABLE table_name_44 (rank INTEGER,athlete VARCHAR,react VARCHAR) | SELECT MIN(rank) FROM table_name_44 WHERE athlete = "chris brown" AND react > 0.244 |
how many patients whose primary disease is morbid obesity/sda and lab test fluid is urine? | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "MORBID OBESITY/SDA" AND lab.fluid = "Urine" |
Get Comments By User Id. | CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,Text text,ContentLicense text)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE FlagTypes (Id number,Na... | SELECT Id AS "comment_link", Score, Text FROM Comments WHERE UPPER(Text) LIKE UPPER('%##CommentText##%') AND UserId = '##UserId##' ORDER BY Score DESC |
What was the departure time of the train going to Boston? | CREATE TABLE table_22290 ("Departure" text,"Going to" text,"Calling at" text,"Arrival" text,"Operator" text) | SELECT "Departure" FROM table_22290 WHERE "Going to" = 'Boston' |
How many poles for the Netherlands? | CREATE TABLE table_19487922_1 (poles INTEGER,country VARCHAR) | SELECT MAX(poles) FROM table_19487922_1 WHERE country = "Netherlands" |
what is the admission location and discharge location of patient id 2560? | 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 demographic.admission_location, demographic.discharge_location FROM demographic WHERE demographic.subject_id = "2560" |
What language has sky famiglia as the package/option? | CREATE TABLE table_39984 ("Television service" text,"Language" text,"Content" text,"HDTV" text,"Package/Option" text) | SELECT "Language" FROM table_39984 WHERE "Package/Option" = 'sky famiglia' |
when are the AA flights from PHOENIX to MILWAUKEE | 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_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE compartment_class (compartment varchar,class_type varchar)CREATE TABLE airli... | 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 = 'PHOENIX' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '... |
on 7 23 all flights on AA from PHILADELPHIA to SAN FRANCISCO | CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREAT... | 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 ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_number = 23 AND date_day.month_number = ... |
How many trips did not end in San Francisco? | CREATE TABLE station (id number,name text,lat number,long number,dock_count number,city text,installation_date text)CREATE TABLE trip (id number,duration number,start_date text,start_station_name text,start_station_id number,end_date text,end_station_name text,end_station_id number,bike_id number,subscription_type text... | SELECT COUNT(*) FROM trip AS T1 JOIN station AS T2 ON T1.end_station_id = T2.id WHERE T2.city <> "San Francisco" |
tell me the name of the lab tests that patient 027-61708 first received? | 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 lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-61708')) ORDER BY lab.labresulttime LIMIT 1 |
List the name of technicians whose team is not 'NYY', and count them by a bar chart, could you list Y from high to low order? | CREATE TABLE technician (technician_id real,Name text,Team text,Starting_Year real,Age int)CREATE TABLE repair (repair_ID int,name text,Launch_Date text,Notes text)CREATE TABLE machine (Machine_ID int,Making_Year int,Class text,Team text,Machine_series text,value_points real,quality_rank int)CREATE TABLE repair_assignm... | SELECT Name, COUNT(Name) FROM technician WHERE Team <> "NYY" GROUP BY Name ORDER BY COUNT(Name) DESC |
Who is the second performer in episode 5? | CREATE TABLE table_19691 ("Date" text,"Episode" real,"Performer 1" text,"Performer 2" text,"Performer 3" text,"Performer 4" text) | SELECT "Performer 2" FROM table_19691 WHERE "Episode" = '5' |
What is the attendance number later than week 9 on November 20, 1983? | CREATE TABLE table_62057 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real) | SELECT COUNT("Attendance") FROM table_62057 WHERE "Week" > '9' AND "Date" = 'november 20, 1983' |
provide me the diagnosis short title and diagnosis icd9 code for patient with patient id 2560. | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag... | SELECT diagnoses.icd9_code, diagnoses.short_title FROM diagnoses WHERE diagnoses.subject_id = "2560" |
What is the lowest number of wins of the team with less than 24 scored, 27 conceded, and more than 18 played? | CREATE TABLE table_name_32 (wins INTEGER,played VARCHAR,scored VARCHAR,conceded VARCHAR) | SELECT MIN(wins) FROM table_name_32 WHERE scored < 24 AND conceded = 27 AND played > 18 |
How much Standard Rank has a Name of 311 south wacker drive, and a Year larger than 1990? | CREATE TABLE table_name_97 (std_rank INTEGER,name VARCHAR,year VARCHAR) | SELECT SUM(std_rank) FROM table_name_97 WHERE name = "311 south wacker drive" AND year > 1990 |
fasting glucose 126 _ 270 mg / dl | CREATE TABLE table_train_168 ("id" int,"cholesterol" float,"hemoglobin_a1c_hba1c" float,"triglyceride_tg" float,"fasting_glucose" int,"NOUSE" float) | SELECT * FROM table_train_168 WHERE fasting_glucose >= 126 AND fasting_glucose <= 270 |
provide the number of patients whose death status is 1 and diagnoses long title is kidney dialysis as the cause of abnormal reaction of patient, or of later complication, without mention of misadventure at time of procedure? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.long_title = "Kidney dialysis as the cause of abnormal reaction of patient, or of later complication, without mention of misadventure at time o... |
What is the goal difference for the team from Chorley? | CREATE TABLE table_47497 ("Position" real,"Team" text,"Played" real,"Drawn" real,"Lost" real,"Goals For" real,"Goals Against" real,"Goal Difference" text,"Points 1" text) | SELECT "Goal Difference" FROM table_47497 WHERE "Team" = 'chorley' |
how many more general acute care hospitals are there in california than rehabilitation hospitals ? | CREATE TABLE table_203_216 (id number,"rank" number,"hospital" text,"city" text,"county" text,"# beds" number,"type of hospital" text) | SELECT (SELECT COUNT("hospital") FROM table_203_216 WHERE "type of hospital" = 'general acute care') - (SELECT COUNT("hospital") FROM table_203_216 WHERE "type of hospital" = 'rehabilitaion') |
how many cities have populations greater than arquata scrivia ? | CREATE TABLE table_203_413 (id number,"rank" text,"city" text,"population" number,"area\n(km2)" number,"density\n(inhabitants/km2)" number,"altitude\n(mslm)" number) | SELECT COUNT("city") FROM table_203_413 WHERE "population" > (SELECT "population" FROM table_203_413 WHERE "city" = 'arquata scrivia') |
What is the rank of the team having 3 bronzes and 0 silver? | CREATE TABLE table_name_79 (rank VARCHAR,bronze VARCHAR,silver VARCHAR) | SELECT rank FROM table_name_79 WHERE bronze = 3 AND silver = 0 |
give me the number of patients whose ethnicity is asian and diagnoses icd9 code is 30501? | 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 demographic (subject_id text,hadm_id text,name text,marita... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "ASIAN" AND diagnoses.icd9_code = "30501" |
Where did Zimbabwe play? | CREATE TABLE table_31988 ("Sixes" text,"Player" text,"Opponent" text,"Venue" text,"Date" text) | SELECT "Venue" FROM table_31988 WHERE "Opponent" = 'zimbabwe' |
What is the coefficient for agust n marches n (1)? | CREATE TABLE table_30083499_1 (coefficient VARCHAR,player VARCHAR) | SELECT coefficient FROM table_30083499_1 WHERE player = "Agustín Marchesín (1)" |
Can you tell me the sum of FLap that has the Pole larger than 0, and the Podiums of 6? | CREATE TABLE table_name_40 (flap INTEGER,pole VARCHAR,podiums VARCHAR) | SELECT SUM(flap) FROM table_name_40 WHERE pole > 0 AND podiums = 6 |
Name the most wins for sport colombia | CREATE TABLE table_18703133_1 (wins INTEGER,team VARCHAR) | SELECT MAX(wins) FROM table_18703133_1 WHERE team = "Sport Colombia" |
What is the propulsion for the RB 04 earlier than 1962? | CREATE TABLE table_35040 ("Name" text,"Year" real,"Propulsion" text,"launched by" text,"Country" text) | SELECT "Propulsion" FROM table_35040 WHERE "Year" < '1962' AND "Name" = 'rb 04' |
The courses that fulfill Other program requirements are taught by whom ? | 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 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 program_course ON program_course.course_id = course_offering.course_id INN... |
When the rank is larger than 3 with a second quarter of johnson & johnson 156,515.9, what is the fourth quarter? | CREATE TABLE table_36997 ("Rank" real,"First quarter" text,"Second quarter" text,"Third quarter" text,"Fourth quarter" text) | SELECT "Fourth quarter" FROM table_36997 WHERE "Rank" > '3' AND "Second quarter" = 'johnson & johnson 156,515.9' |
show me flights from NEW YORK to MIAMI | CREATE TABLE code_description (code varchar,description text)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 food_service (meal_code text,meal_number int,compartment text,meal_descript... | 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 = 'NEW YORK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MIAMI... |
What is the j p c that commonly decays (>5% of decays) d 0 + 0 or d 0 + ? | CREATE TABLE table_76407 ("Particle name" text,"Particle symbol" text,"Antiparticle symbol" text,"Quark content" text,"Rest mass (MeV / c 2)" text,"J P C" text,"Mean lifetime (s)" text,"Commonly decays to (>5% of decays)" text) | SELECT "J P C" FROM table_76407 WHERE "Commonly decays to (>5% of decays)" = 'd 0 + π 0 or d 0 + γ' |
Who is the original broadway performer for the character Colin Craven? | CREATE TABLE table_1901751_1 (original_broadway_performer VARCHAR,character VARCHAR) | SELECT original_broadway_performer FROM table_1901751_1 WHERE character = "Colin Craven" |
A bar chart about what are the ids and names of the medicine that can interact with two or more enzymes?, and show in descending by the y axis please. | CREATE TABLE medicine_enzyme_interaction (enzyme_id int,medicine_id int,interaction_type text)CREATE TABLE medicine (id int,name text,Trade_Name text,FDA_approved text)CREATE TABLE enzyme (id int,name text,Location text,Product text,Chromosome text,OMIM int,Porphyria text) | SELECT name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id ORDER BY id DESC |
List name and damage for all storms in a descending order of max speed with a bar chart. | CREATE TABLE storm (Storm_ID int,Name text,Dates_active text,Max_speed int,Damage_millions_USD real,Number_Deaths int)CREATE TABLE affected_region (Region_id int,Storm_ID int,Number_city_affected real)CREATE TABLE region (Region_id int,Region_code text,Region_name text) | SELECT Name, Damage_millions_USD FROM storm ORDER BY Max_speed DESC |
what are syntactic parsing papers not written by chris dyer | CREATE TABLE cite (citingpaperid int,citedpaperid int)CREATE TABLE paperfield (fieldid int,paperid int)CREATE TABLE author (authorid int,authorname varchar)CREATE TABLE dataset (datasetid int,datasetname varchar)CREATE TABLE writes (paperid int,authorid int)CREATE TABLE paperdataset (paperid int,datasetid int)CREATE TA... | SELECT DISTINCT author.authorname, paper.paperid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname <> 'chris dyer' AND keyphrase.keyphrasename = 'syntactic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.... |
what company is ranked below apple ? | CREATE TABLE table_203_83 (id number,"ranking" number,"company" text,"industry" text,"revenue (usd billions)" text,"fy" text,"capitalization (usd billions)" text,"employees" number,"listing" text,"headquarters" text,"ceo" text) | SELECT "company" FROM table_203_83 WHERE "ranking" = (SELECT "ranking" FROM table_203_83 WHERE "company" = 'apple') + 1 |
What was the score of the game when their record was 62-67 | CREATE TABLE table_80196 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text) | SELECT "Score" FROM table_80196 WHERE "Record" = '62-67' |
What event did he compete in at Taipei? | CREATE TABLE table_66562 ("Season" text,"Event type" text,"Location" text,"Format" text,"Date" text,"Rank" real) | SELECT "Format" FROM table_66562 WHERE "Location" = 'taipei' |
How many countries did Utah Bulwark's owner come from? | CREATE TABLE table_21676617_1 (country_of_owner VARCHAR,horse VARCHAR) | SELECT COUNT(country_of_owner) FROM table_21676617_1 WHERE horse = "Utah Bulwark" |
Who is in January where April is chris cranston? | CREATE TABLE table_66797 ("January" text,"February" text,"March" text,"April" text,"June" text,"July" text,"August" text,"September" text,"October" text,"November" text,"December" text) | SELECT "January" FROM table_66797 WHERE "April" = 'chris cranston' |
What is Fitzroy's smallest crowd size? | CREATE TABLE table_55484 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT MIN("Crowd") FROM table_55484 WHERE "Home team" = 'fitzroy' |
Name the men's doubles for years before 1999 and elizabeth cann for women's singles | CREATE TABLE table_15028 ("Year" real,"Men's singles" text,"Women's singles" text,"Men's doubles" text,"Women's doubles" text,"Mixed doubles" text) | SELECT "Men's doubles" FROM table_15028 WHERE "Year" < '1999' AND "Women's singles" = 'elizabeth cann' |
What authority controls the school in Levin that has a decile of 6, and a roll of 226? | CREATE TABLE table_14944 ("Name" text,"Years" text,"Gender" text,"Area" text,"Authority" text,"Decile" real,"Roll" real) | SELECT "Authority" FROM table_14944 WHERE "Decile" = '6' AND "Area" = 'levin' AND "Roll" = '226' |
What season was there a 2nd place finish? | CREATE TABLE table_name_81 (season VARCHAR,position VARCHAR) | SELECT season FROM table_name_81 WHERE position = "2nd" |
Score per answer for users with at least 10 answers in the past 30 days in a tag.. | CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score number,ApprovedByUserId number,ApprovalDate time)CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE FlagTypes (Id number,Name... | SELECT Posts.OwnerUserId AS "user_link", SUM(Score) AS Score, COUNT(*) AS Answers, ROUND(1.0 * SUM(Score) / COUNT(*), 2) AS ScorePerAnswer FROM Posts WHERE Posts.ParentId IN (SELECT Posts.Id FROM Posts INNER JOIN PostTags ON PostTags.PostId = Posts.Id INNER JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName = @Ta... |
what number of songs was released in may ? | CREATE TABLE table_204_680 (id number,"released" text,"title" text,"artist" text,"format" text,"language" text) | SELECT COUNT(*) FROM table_204_680 WHERE "released" = 5 |
What is the lowest Pick #, when College is 'Jackson State'? | CREATE TABLE table_49234 ("Round" real,"Pick #" real,"Player" text,"Position" text,"College" text) | SELECT MIN("Pick #") FROM table_49234 WHERE "College" = 'jackson state' |
Who was placed third when the ruuner up was Guangzhou Apollo? | CREATE TABLE table_17632217_2 (third_place VARCHAR,runners_up VARCHAR) | SELECT third_place FROM table_17632217_2 WHERE runners_up = "Guangzhou Apollo" |
What's the Kilometers listed that also has the Station Code of Kuda? | CREATE TABLE table_name_87 (kilometers VARCHAR,station_code VARCHAR) | SELECT kilometers FROM table_name_87 WHERE station_code = "kuda" |
What is the total number pick for seattle mariners team? | CREATE TABLE table_name_13 (pick VARCHAR,team VARCHAR) | SELECT COUNT(pick) FROM table_name_13 WHERE team = "seattle mariners" |
when was the last time patient 031-23605 got their urine, catheter specimen microbial testing until 08/2104? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender t... | SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23605')) AND microlab.culturesite = 'urine, catheter specimen... |
In what barony are both the townland Dawstown and the civil parish Matehy located? | CREATE TABLE table_30120566_1 (barony VARCHAR,townland VARCHAR,civil_parish VARCHAR) | SELECT barony FROM table_30120566_1 WHERE townland = "Dawstown" AND civil_parish = "Matehy" |
For those employees who did not have any job in the past, visualize a bar chart about the distribution of job_id and the sum of department_id , and group by attribute job_id, and could you rank by the total number of department id in asc? | 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 departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE regions (RE... | SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(DEPARTMENT_ID) |
Give me the comparison about the average of monthly_rental over the date_address_to bin date_address_to by time by a bar chart. | CREATE TABLE Behavior_Incident (incident_id INTEGER,incident_type_code VARCHAR(10),student_id INTEGER,date_incident_start DATETIME,date_incident_end DATETIME,incident_summary VARCHAR(255),recommendations VARCHAR(255),other_details VARCHAR(255))CREATE TABLE Ref_Incident_Type (incident_type_code VARCHAR(10),incident_type... | SELECT date_address_to, AVG(monthly_rental) FROM Student_Addresses ORDER BY monthly_rental DESC |
What is the date when the tournament is san diego and the opponent is ann grossman? | CREATE TABLE table_name_92 (date VARCHAR,tournament VARCHAR,opponent VARCHAR) | SELECT date FROM table_name_92 WHERE tournament = "san diego" AND opponent = "ann grossman" |
What is ISBN US, when Title is 'Mission To Venus'? | CREATE TABLE table_name_55 (isbn_us VARCHAR,title VARCHAR) | SELECT isbn_us FROM table_name_55 WHERE title = "mission to venus" |
which swimmer had the longest time ? | CREATE TABLE table_204_886 (id number,"rank" number,"swimmer" text,"country" text,"time" text,"note" text) | SELECT "swimmer" FROM table_204_886 ORDER BY "rank" DESC LIMIT 1 |
i'm looking for a flight from PITTSBURGH to SAN FRANCISCO | CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion varchar,wide_body varchar,wing_span int,length int,weight int,capacity int,pay_load int,cruising_speed int,range_miles int,pressurized varchar)CREATE TABLE airport_service (city_code ... | 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 = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN... |
WHAT IS THE AVERAGE OVERALL WITH A ROUND LARGER THAN 9, AND RB POSITION? | CREATE TABLE table_name_85 (overall INTEGER,round VARCHAR,position VARCHAR) | SELECT AVG(overall) FROM table_name_85 WHERE round > 9 AND position = "rb" |
Give me a bar chart to compare the number of departments located in different cities, and I want to order by the Y-axis in asc. | 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 departments (DEPARTMENT_ID decimal(4,... | SELECT CITY, COUNT(CITY) FROM locations GROUP BY CITY ORDER BY COUNT(CITY) |
Evolution of mean score and number of questions in 2015 by week. Evolution of mean score and number of questions in 2015 by week | CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE PostTags ... | SELECT TIME_TO_STR(p.CreationDate, '%W') AS weekOfCreation, AVG(p.Score) AS meanQuestionScore, COUNT(p.Id) AS NumberOfPosts FROM Posts AS p WHERE p.PostTypeId = 1 AND TIME_TO_STR(p.CreationDate, '%Y') = 2015 GROUP BY TIME_TO_STR(p.CreationDate, '%W') ORDER BY TIME_TO_STR(p.CreationDate, '%W') |
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of phone_number and commission_pct , and list from low to high by the X. | CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar... | SELECT PHONE_NUMBER, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER |
how did patient 027-100528 last be admitted during the previous year to the hospital? | CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim... | SELECT patient.hospitaladmitsource FROM patient WHERE patient.uniquepid = '027-100528' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY patient.hospitaladmittime DESC LIMIT 1 |
For each advisor, report the total number of students advised by him or her. | CREATE TABLE STUDENT (Advisor VARCHAR) | SELECT Advisor, COUNT(*) FROM STUDENT GROUP BY Advisor |
What is the car number driven by Darren Manning? | CREATE TABLE table_17256857_1 (car_no VARCHAR,driver VARCHAR) | SELECT car_no FROM table_17256857_1 WHERE driver = "Darren Manning" |
What is the platelet count when partial thromboplastin time and bleeding time are unaffected? | CREATE TABLE table_221653_1 (platelet_count VARCHAR,partial_thromboplastin_time VARCHAR,bleeding_time VARCHAR) | SELECT platelet_count FROM table_221653_1 WHERE partial_thromboplastin_time = "Unaffected" AND bleeding_time = "Unaffected" |
Bin the claim date into the Day of Week interval and count them for visualizing a bar chart. | CREATE TABLE Settlements (Settlement_ID INTEGER,Claim_ID INTEGER,Date_Claim_Made DATE,Date_Claim_Settled DATE,Amount_Claimed INTEGER,Amount_Settled INTEGER,Customer_Policy_ID INTEGER)CREATE TABLE Customers (Customer_ID INTEGER,Customer_Details VARCHAR(255))CREATE TABLE Claims (Claim_ID INTEGER,Policy_ID INTEGER,Date_Cl... | SELECT Date_Claim_Made, COUNT(Date_Claim_Made) FROM Settlements |
the electrolyte administration - phosphate is how much? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE cost (costid number,uniquepid text,patientheal... | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'treatment' AND cost.eventid IN (SELECT treatment.treatmentid FROM treatment WHERE treatment.treatmentname = 'electrolyte administration - phosphate') |
What number pick was the player drafted in round 3 at #28 overall? | CREATE TABLE table_50557 ("Round" real,"Pick" real,"Overall" real,"Name" text,"Position" text,"College" text) | SELECT AVG("Pick") FROM table_50557 WHERE "Overall" < '28' AND "Round" = '3' |
The Estevan Bruins (WCHL) are affiliated with what NHL team? | CREATE TABLE table_name_51 (nhl_team VARCHAR,college_junior_club_team VARCHAR) | SELECT nhl_team FROM table_name_51 WHERE college_junior_club_team = "estevan bruins (wchl)" |
How long has Sebastian Telfair played for Toronto? | CREATE TABLE table_32062 ("Player" text,"Nationality" text,"Position" text,"Years in Toronto" text,"School/Club Team" text) | SELECT "Years in Toronto" FROM table_32062 WHERE "Player" = 'sebastian telfair' |
Name the population 1891 for area being 175836 | CREATE TABLE table_14925084_1 (population_1891 VARCHAR,area_1891__statute_acres_ VARCHAR) | SELECT COUNT(population_1891) FROM table_14925084_1 WHERE area_1891__statute_acres_ = 175836 |
Which of the highest drawn has a played less than 10? | CREATE TABLE table_name_96 (drawn INTEGER,played INTEGER) | SELECT MAX(drawn) FROM table_name_96 WHERE played < 10 |
in how man years did ifk finish in at least 5th place . | CREATE TABLE table_204_42 (id number,"season" number,"level" text,"division" text,"section" text,"position" text,"movements" text) | SELECT COUNT("season") FROM table_204_42 WHERE "position" <= 5 |
What's the average number of wins for those with less than 2 byes? | CREATE TABLE table_name_62 (wins INTEGER,byes INTEGER) | SELECT AVG(wins) FROM table_name_62 WHERE byes < 2 |
how many patients were there who were aged less than 83 years and with a calculated total co2 lab test done? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "83" AND lab.label = "Calculated Total CO2" |
What was the sum of attendance for games with a time of 3:23? | CREATE TABLE table_name_53 (attendance INTEGER,time VARCHAR) | SELECT SUM(attendance) FROM table_name_53 WHERE time = "3:23" |
What is the model of the enginge d5252 t? | CREATE TABLE table_16827 ("Model name" text,"Power (ps)" real,"Torque (Nm@rpm)" text,"Displacement (cm\u00b3)" real,"Engine code" text,"Comment" text) | SELECT "Model name" FROM table_16827 WHERE "Engine code" = 'D5252 T' |
Who has high points when 50-26 is the record? | CREATE TABLE table_2830 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "High points" FROM table_2830 WHERE "Record" = '50-26' |
What Goals has a Team of zamora, and Average larger than 0.89? | CREATE TABLE table_name_92 (goals INTEGER,team VARCHAR,average VARCHAR) | SELECT AVG(goals) FROM table_name_92 WHERE team = "zamora" AND average > 0.89 |
what team played on july 9 | CREATE TABLE table_name_72 (opponent VARCHAR,date VARCHAR) | SELECT opponent FROM table_name_72 WHERE date = "july 9" |
last year to make over 1000000 | CREATE TABLE table_203_203 (id number,"year" number,"majors" number,"atp wins" number,"total wins" number,"earnings (us$)" number,"money list rank" number) | SELECT MAX("year") FROM table_203_203 WHERE "earnings (us$)" > 1000000 |
Across all departments , how many classes are being offered next semester ? | CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time,monday varchar,tuesday varchar,wednesday varchar,thursday varchar,friday varchar,saturday varchar,sunday varchar,has_final_project varchar,has_final_exam varchar,textbook varchar,class_address varch... | SELECT COUNT(DISTINCT course_offering.course_id) FROM course_offering, semester WHERE semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016 |
What's the total Rank that has a Gold that's smaller than 0? | CREATE TABLE table_75259 ("Rank" real,"Gold" real,"Silver" real,"Bronze" real,"Total" real,"Participants" real) | SELECT SUM("Rank") FROM table_75259 WHERE "Gold" < '0' |
how many of the patients had urgent admission due to hyperacusis? | 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.admission_type = "URGENT" AND diagnoses.short_title = "Hyperacusis" |
i need to fly from BOSTON to BALTIMORE please give me the times of your flights in the morning before 800 o'clock | CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE code_description (code varchar,description text)CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE dual_carr... | 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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND flight.departure_time < 800 AND flight.to_airport = AIRPORT_SERVICE_1.airp... |
What is the average minimum and price of the rooms for each different decor. | CREATE TABLE reservations (code number,room text,checkin text,checkout text,rate number,lastname text,firstname text,adults number,kids number)CREATE TABLE rooms (roomid text,roomname text,beds number,bedtype text,maxoccupancy number,baseprice number,decor text) | SELECT decor, AVG(baseprice), MIN(baseprice) FROM rooms GROUP BY decor |
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, find job_id and the amount of job_id , and group by attribute job_id, and visualize them by a bar chart, and I want to list x axis in asc order please. | CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))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 (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decima... | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID |
How many games were played by the player at FB? | CREATE TABLE table_38148 ("Position" text,"Number" real,"Name" text,"Height" text,"Weight" real,"Class" text,"Hometown" text,"Games\u2191" real) | SELECT COUNT("Games\u2191") FROM table_38148 WHERE "Position" = 'fb' |
Which Year has a Position of 4th? | CREATE TABLE table_8716 ("Year" real,"Competition" text,"Venue" text,"Position" text,"Event" text) | SELECT SUM("Year") FROM table_8716 WHERE "Position" = '4th' |
What was the result in 2008 under head coach Mike Sherman? | CREATE TABLE table_32714 ("Team" text,"Bowl" text,"Season coach" text,"Interim head coach" text,"Result" text,"2008 head coach" text) | SELECT "Result" FROM table_32714 WHERE "2008 head coach" = 'mike sherman' |
Score of 8 - 1 happened on what day in December? | CREATE TABLE table_name_27 (december VARCHAR,score VARCHAR) | SELECT december FROM table_name_27 WHERE score = "8 - 1" |
Name the sum of points for chassis of maserati 250f and entrant of officine alfieri maserati | CREATE TABLE table_name_80 (points INTEGER,chassis VARCHAR,entrant VARCHAR) | SELECT SUM(points) FROM table_name_80 WHERE chassis = "maserati 250f" AND entrant = "officine alfieri maserati" |
What is the Spring and Summer schedule for upper-level electives ? | CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE gsi (course_offering_i... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = '... |
What is the Winner of the Event in Nuevo Vallarta? | CREATE TABLE table_name_63 (winner VARCHAR,city VARCHAR) | SELECT winner FROM table_name_63 WHERE city = "nuevo vallarta" |
What is the figure for Pasadena when Tujunga is 36? | CREATE TABLE table_name_11 (pasadena VARCHAR,tujunga VARCHAR) | SELECT pasadena FROM table_name_11 WHERE tujunga = "36" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.