instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Name the number of episodes for alan nourse | CREATE TABLE table_1319 ("Episode" real,"Title" text,"Story" text,"Adapted by" text,"Director" text,"Airdate" text,"Exists?" text) | SELECT COUNT("Episode") FROM table_1319 WHERE "Story" = 'Alan Nourse' |
For those records from the products and each product's manufacturer, show me about the distribution of name and the average of manufacturer , and group by attribute name in a bar chart, and I want to order in desc by the y axis please. | CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER) | SELECT T2.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Manufacturer DESC |
Name the parter for w/o | CREATE TABLE table_30878 ("Outcome" text,"Year" real,"Championship" text,"Surface" text,"Partner" text,"Opponents" text,"Score" text) | SELECT "Partner" FROM table_30878 WHERE "Score" = 'w/o' |
What is the id, forname and surname of the driver who had the first position in terms of laptime at least twice? | CREATE TABLE drivers (driverid VARCHAR,forename VARCHAR,surname VARCHAR)CREATE TABLE laptimes (driverid VARCHAR) | SELECT T1.driverid, T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE POSITION = '1' GROUP BY T1.driverid HAVING COUNT(*) >= 2 |
At the match in windy hill, how much did the home team score? | CREATE TABLE table_10972 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Home team score" FROM table_10972 WHERE "Venue" = 'windy hill' |
What was the outcome on 25 october 2004? | CREATE TABLE table_34466 ("Outcome" text,"Date" text,"Championship" text,"Surface" text,"Opponent in the final" text,"Score in the final" text) | SELECT "Outcome" FROM table_34466 WHERE "Date" = '25 october 2004' |
What is the name of the away team whose venue is Kardinia Park? | CREATE TABLE table_32754 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Away team" FROM table_32754 WHERE "Venue" = 'kardinia park' |
What are Tiger Woods' average earnings? | CREATE TABLE table_68304 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money ($)" real) | SELECT AVG("Money ( $ )") FROM table_68304 WHERE "Player" = 'tiger woods' |
What was the maximum rank for the vote percentage of 5.6% | CREATE TABLE table_26375386_23 (rank INTEGER,vote_percentage VARCHAR) | SELECT MIN(rank) FROM table_26375386_23 WHERE vote_percentage = "5.6%" |
What is the score of the game on January 18? | CREATE TABLE table_37412 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text) | SELECT "Score" FROM table_37412 WHERE "Date" = 'january 18' |
what are the five most frequent drugs that were prescribed in the same hospital encounter to the atrial fibrillation male patients 30s after they have been diagnosed with atrial fibrillation in 2104? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature n... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'atrial fibrilla... |
Which High assists has a Score of w 71-56? | CREATE TABLE table_66223 ("Game" real,"Date" text,"Opponent" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location" text,"Record" text) | SELECT "High assists" FROM table_66223 WHERE "Score" = 'w 71-56' |
How many pageants were in san fernando, pampanga? | CREATE TABLE table_1825751_14 (pageant VARCHAR,hometown VARCHAR) | SELECT COUNT(pageant) FROM table_1825751_14 WHERE hometown = "San Fernando, Pampanga" |
What is the screen size and pixel value when the dimensions are 115.5 83.7 102.5? | CREATE TABLE table_32079 ("Model" text,"Release date" text,"Sensor res.,size" text,"Lens(35mmequiv.) zoom,aperture" text,"Screen size,pixels" text,"Dimensions W\u00d7H\u00d7D (mm)" text,"Weight" text) | SELECT "Screen size,pixels" FROM table_32079 WHERE "Dimensions W\u00d7H\u00d7D (mm)" = '115.5×83.7×102.5' |
Among the least difficult MDE courses , which has the largest class size ? | 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 instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE requirement (requirement_id int,requirement varchar,colle... | SELECT DISTINCT department, name, number FROM course WHERE course_id IN (SELECT PROGRAM_COURSE_ID FROM program_course AS PROGRAM_COURSE WHERE PROGRAM_WORKLOAD = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 WHERE PROGRAM_COURSEalias1.category LIKE '%MDE%')) AND num_enrolled = (S... |
how many times is the name Derek Smith when the round is higher than 3? | CREATE TABLE table_44647 ("Round" real,"Pick" real,"Overall" real,"Name" text,"Position" text,"College" text) | SELECT COUNT("Overall") FROM table_44647 WHERE "Name" = 'derek smith' AND "Round" > '3' |
Find all users answering question 3368246. | CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE Posts (Id number,Po... | SELECT Id, Id AS "post_link", ParentId, Title, OwnerUserId FROM Posts WHERE ParentId = 3368246 AND PostTypeId = 2 |
For all employees who have the letters D or S in their first name, a bar chart shows the distribution of hire_date and the sum of employee_id bin hire_date by time, and rank y axis from high to low order. | 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 jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY ... | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(EMPLOYEE_ID) DESC |
calculate the number of dead patients who are less than 70 years of age. | 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 lab (subject_id text,hadm_id text,itemid text,charttime te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.age < "70" |
Where is the moving from location with a transfer window of summer and the source kerkida.net? | CREATE TABLE table_44101 ("Nat." text,"Name" text,"Moving from" text,"Type" text,"Transfer window" text,"Ends" real,"Transfer fee" text,"Source" text) | SELECT "Moving from" FROM table_44101 WHERE "Transfer window" = 'summer' AND "Source" = 'kerkida.net' |
For employees with first names that end with the letter 'm', groups and counts the first name to visualize a pie graph. | CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))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 dec... | SELECT FIRST_NAME, COUNT(FIRST_NAME) FROM employees WHERE FIRST_NAME LIKE '%m' GROUP BY FIRST_NAME |
How many wins has more than 165 against? | CREATE TABLE table_name_80 (wins INTEGER,against INTEGER) | SELECT MAX(wins) FROM table_name_80 WHERE against > 165 |
For all course_name from courses table, group by the course name and count them with a bar chart, and list by the the number of course name from low to high. | CREATE TABLE People (person_id INTEGER,first_name VARCHAR(255),middle_name VARCHAR(255),last_name VARCHAR(255),cell_mobile_number VARCHAR(40),email_address VARCHAR(40),login_name VARCHAR(40),password VARCHAR(40))CREATE TABLE Courses (course_id VARCHAR(100),course_name VARCHAR(120),course_description VARCHAR(255),other_... | SELECT course_name, COUNT(course_name) FROM Courses GROUP BY course_name ORDER BY COUNT(course_name) |
If the lees team is Clare Balding and Miranda Hart, what is the first broadcast total number? | CREATE TABLE table_2911 ("Episode" text,"First broadcast" text,"Davids team" text,"Lees team" text,"Scores" text) | SELECT COUNT("First broadcast") FROM table_2911 WHERE "Lees team" = 'Clare Balding and Miranda Hart' |
What was the score when she was a runner-up? | CREATE TABLE table_name_38 (score VARCHAR,outcome VARCHAR) | SELECT score FROM table_name_38 WHERE outcome = "runner-up" |
Find the last names of the students in third grade that are not taught by COVIN JEROME. | CREATE TABLE teachers (lastname text,firstname text,classroom number)CREATE TABLE list (lastname text,firstname text,grade number,classroom number) | SELECT DISTINCT T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 3 AND T2.firstname <> "COVIN" AND T2.lastname <> "JEROME" |
Check Strunk und White process. Return how far I have to go to get S&W | CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE Users (Id numb... | SELECT 100 - COUNT(*) AS "Edits To Strunk & White" FROM Posts WHERE PostTypeId = 1 AND LastEditorUserId = @UserId AND OwnerUserId != @UserId |
What is the most top-10 of the team with 8 cuts made and less than 11 events? | CREATE TABLE table_40324 ("Tournament" text,"Wins" real,"Top-5" real,"Top-10" real,"Top-25" real,"Events" real,"Cuts made" real) | SELECT MAX("Top-10") FROM table_40324 WHERE "Cuts made" = '8' AND "Events" < '11' |
what is the school when signed is no and round is 50? | CREATE TABLE table_68845 ("Round" real,"Name" text,"Position" text,"School" text,"Signed" text) | SELECT "School" FROM table_68845 WHERE "Signed" = 'no' AND "Round" = '50' |
What is the sum of the run 1 of athlete matthias guggenberger, who has a run 2 greater than 55.24? | CREATE TABLE table_name_40 (run_1 INTEGER,run_2 VARCHAR,athlete VARCHAR) | SELECT SUM(run_1) FROM table_name_40 WHERE run_2 > 55.24 AND athlete = "matthias guggenberger" |
When was twenty released? | CREATE TABLE table_name_16 (date_of_release VARCHAR,title VARCHAR) | SELECT date_of_release FROM table_name_16 WHERE title = "twenty" |
how many patients whose diagnoses icd9 code is 6824 and lab test category is blood gas? | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "6824" AND lab."CATEGORY" = "Blood Gas" |
Which Podium has 1 Race and a Final Place of 5th? | CREATE TABLE table_14914 ("Season" text,"Series" text,"Races" text,"Wins" text,"Podiums" text,"Points" text,"Final Placing" text) | SELECT "Podiums" FROM table_14914 WHERE "Races" = '1' AND "Final Placing" = '5th' |
In zip code 94107, on which day neither Fog nor Rain was not observed, and count them by a bar chart, order total number in ascending order please. | 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 weather (date TEXT,max_temperature_f INTEGER,mean_temperature_f INTEGER,min_temperature_f... | SELECT date, COUNT(date) FROM weather WHERE zip_code = 94107 AND events <> "Fog" AND events <> "Rain" ORDER BY COUNT(date) |
did adrienne power or kim wall have a faster time ? | CREATE TABLE table_204_155 (id number,"rank" number,"heat" number,"athlete" text,"nationality" text,"time" number,"notes" text) | SELECT "athlete" FROM table_204_155 WHERE "athlete" IN ('adrienne power', 'kim wall') ORDER BY "time" LIMIT 1 |
What incumbent was re-elected in the district in california 3? | CREATE TABLE table_35098 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text) | SELECT "Incumbent" FROM table_35098 WHERE "Result" = 're-elected' AND "District" = 'california 3' |
What episode number of the series had a production code of bdf409? | CREATE TABLE table_3958 ("Series #" real,"Season #" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text,"U.S. viewers (million)" text) | SELECT MIN("Series #") FROM table_3958 WHERE "Production code" = 'BDF409' |
How many release dates does volume 4 DVD have? | CREATE TABLE table_19514 ("DVD name" text,"Ep No." real,"DVD No." real,"Release date" real,"Additional information" text) | SELECT COUNT("Release date") FROM table_19514 WHERE "DVD name" = 'Volume 4' |
compared to 1998 , what is the difference in seats won in the 2001 election cycle ? | CREATE TABLE table_204_28 (id number,"election" text,"name of the party/alliance" text,"number of votes" number,"percentage" text,"seats in the parliament" number) | SELECT ABS((SELECT "seats in the parliament" FROM table_204_28 WHERE "election" = 2001) - (SELECT "seats in the parliament" FROM table_204_28 WHERE "election" = 1998)) |
What is the lowest attendance on November 18? | CREATE TABLE table_53718 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Decision" text,"Attendance" real,"Record" text) | SELECT MIN("Attendance") FROM table_53718 WHERE "Date" = 'november 18' |
What is the position of the player on the Los Angeles Kings? | CREATE TABLE table_70177 ("Pick #" text,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text) | SELECT "Position" FROM table_70177 WHERE "NHL team" = 'los angeles kings' |
since 3 years ago what was the three most frequently given procedure for patients 40s? | CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,chart... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B... |
what was the name of the drug that patient 015-91239 had been prescribed two times in the current 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 intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text... | SELECT t1.drugname FROM (SELECT medication.drugname, COUNT(medication.drugstarttime) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015... |
Name the player for 1 touchdowns | CREATE TABLE table_28073 ("Player" text,"Touchdowns" real,"Extra points" real,"Field goals" real,"Points" real) | SELECT "Player" FROM table_28073 WHERE "Touchdowns" = '1' |
How many games was Damien Wilkins (27) the high scorer? | CREATE TABLE table_398 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT MIN("Game") FROM table_398 WHERE "High points" = 'Damien Wilkins (27)' |
Who is affiliated with the nickname Ramblers? | CREATE TABLE table_50188 ("Institution" text,"Location" text,"Founded" real,"Affiliation" text,"Nickname" text) | SELECT "Affiliation" FROM table_50188 WHERE "Nickname" = 'ramblers' |
What is Gene Sauers' to par? | CREATE TABLE table_name_28 (to_par VARCHAR,player VARCHAR) | SELECT to_par FROM table_name_28 WHERE player = "gene sauers" |
How many of my edits have been rolled back?. Lists all of your posts where someone else performed a rollback after your edit.
There could be some false positives here, where someone edited after you and the rollback just reverted their changes (and not yours). | CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTask... | SELECT DISTINCT edits.PostId AS "post_link", edits.Comment AS "edit_comment", edits.CreationDate AS "edit_date", rollbacks.Comment AS "rollback_comment", rollbacks.CreationDate AS "rollback_date" FROM PostHistory AS edits INNER JOIN PostHistory AS rollbacks ON edits.PostId = rollbacks.PostId AND rollbacks.CreationDate ... |
What is the System with a freeware License? | CREATE TABLE table_55982 ("Name" text,"Current version" text,"System" text,"Platform" text,"License" text) | SELECT "System" FROM table_55982 WHERE "License" = 'freeware' |
I want the date for rockies | CREATE TABLE table_54623 ("Pitcher" text,"Date" text,"Team" text,"Result" text,"Site" text) | SELECT "Date" FROM table_54623 WHERE "Team" = 'rockies' |
Add up all the Ends columns that have goals smaller than 0. | CREATE TABLE table_69313 ("Nat." text,"Name" text,"Since" text,"Goals" real,"Ends" real,"Transfer fee" text) | SELECT SUM("Ends") FROM table_69313 WHERE "Goals" < '0' |
Which Country's Author is based on Sophocles and Euripides? | CREATE TABLE table_62967 ("play" text,"author" text,"company" text,"base" text,"country" text) | SELECT "country" FROM table_62967 WHERE "author" = 'based on sophocles and euripides' |
how many patients whose ethnicity is american indian/alaska native and procedure short title is adm inhal nitric oxide? | 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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND procedures.short_title = "Adm inhal nitric oxide" |
What is the payload for Class MRBM, and a range of 1,930km? | CREATE TABLE table_8749 ("Name/Designation" text,"Class" text,"Range (varies with payload weight)" text,"Payload" text,"Status" text) | SELECT "Payload" FROM table_8749 WHERE "Class" = 'mrbm' AND "Range (varies with payload weight)" = '1,930km' |
What is the top fastest time, larger than 2, in Enugu? | CREATE TABLE table_name_76 (fastest_time__s_ INTEGER,location VARCHAR,rank VARCHAR) | SELECT MAX(fastest_time__s_) FROM table_name_76 WHERE location = "enugu" AND rank > 2 |
How many peak positions were there on the daily charts? | CREATE TABLE table_23180638_1 (peak_position VARCHAR,oricon_albums_chart VARCHAR) | SELECT peak_position FROM table_23180638_1 WHERE oricon_albums_chart = "Daily Charts" |
What was the final score on March 22, 1993? | CREATE TABLE table_name_24 (score_in_the_final VARCHAR,date VARCHAR) | SELECT score_in_the_final FROM table_name_24 WHERE date = "march 22, 1993" |
Find the insurance of subject id 3284. | 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 demographic.insurance FROM demographic WHERE demographic.subject_id = "3284" |
What is the average Goals for team Kairat, in the 2002 season with more than 29 apps? | CREATE TABLE table_43033 ("Season" text,"Team" text,"Country" text,"League" text,"Level" real,"Apps" real,"Goals" real) | SELECT AVG("Goals") FROM table_43033 WHERE "Team" = 'kairat' AND "Season" = '2002' AND "Apps" > '29' |
Which date has a Terrain of plain stage, and a Stage of 4? | CREATE TABLE table_32382 ("Stage" text,"Date" text,"Route" text,"Terrain" text,"Length" text,"Winner" text) | SELECT "Date" FROM table_32382 WHERE "Terrain" = 'plain stage' AND "Stage" = '4' |
What Rider had a Time of +1:08.291? | CREATE TABLE table_name_14 (rider VARCHAR,time VARCHAR) | SELECT rider FROM table_name_14 WHERE time = "+1:08.291" |
let me know the short title of procedure and death date of patient with patient id 15898. | 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 demographic.dod, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "15898" |
like to book a flight from BURBANK to MILWAUKEE | CREATE TABLE month (month_number int,month_name text)CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distan... | 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 = 'BURBANK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MILWAU... |
What was the runner-up when champion is 0, 4th place is 0 and rank is 6? | CREATE TABLE table_name_18 (runner_up VARCHAR,rank VARCHAR,champion VARCHAR,fourth_place VARCHAR) | SELECT runner_up FROM table_name_18 WHERE champion = "0" AND fourth_place = "0" AND rank = 6 |
Compare the average salary by each hire date (bin it into month interval) of employees using a bar chart. | 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 jobs (JOB_I... | SELECT HIRE_DATE, AVG(SALARY) FROM employees |
What language has sky famiglia as the package/option? | CREATE TABLE table_name_82 (language VARCHAR,package_option VARCHAR) | SELECT language FROM table_name_82 WHERE package_option = "sky famiglia" |
Which Round has a NHL team of edmonton oilers and a Player of vyacheslav trukhno? | CREATE TABLE table_name_12 (round INTEGER,nhl_team VARCHAR,player VARCHAR) | SELECT AVG(round) FROM table_name_12 WHERE nhl_team = "edmonton oilers" AND player = "vyacheslav trukhno" |
How many times has class 224 been taught by Prof. Amy Pienta ? | CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)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 gsi (course_offering_id int,student... | SELECT COUNT(*) FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.number = 224 AND instructor.name LIKE '%Amy Pienta%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.offering... |
Return a bar chart for what is the number of areas for all appellations?, and could you rank y axis in asc order please? | 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)CREATE TABLE grapes (ID INTEGER,Grape TEXT,Color TEXT)CREATE TABLE appellations (No INTEGER,Appelation TEXT,County TEXT,State TEXT,Area TEXT,isAVA TEXT) | SELECT Area, COUNT(Area) FROM appellations GROUP BY Area ORDER BY COUNT(Area) |
How many of the episodes have Roger Goldby as the director? | CREATE TABLE table_14330096_4 (total_number VARCHAR,director VARCHAR) | SELECT total_number FROM table_14330096_4 WHERE director = "Roger Goldby" |
What is the sum of the points for the player who was a rank of 61t? | CREATE TABLE table_34510 ("Rank" text,"Player" text,"Position" text,"Career" text,"Points" real) | SELECT SUM("Points") FROM table_34510 WHERE "Rank" = '61t' |
what is the total number of delegates ? | CREATE TABLE table_204_20 (id number,"represent" text,"contestant" text,"age" number,"height" text,"hometown" text) | SELECT COUNT("contestant") FROM table_204_20 |
How many runs were there when the high score was 55 and there were more than 12 innings? | CREATE TABLE table_name_34 (runs INTEGER,high_score VARCHAR,innings VARCHAR) | SELECT SUM(runs) FROM table_name_34 WHERE high_score = 55 AND innings > 12 |
What is the total number of Psychological Dependence, when Pleasure is '2.3', and when Mean is less than 1.9300000000000002? | CREATE TABLE table_58853 ("Drug" text,"Mean" real,"Pleasure" real,"Psychological dependence" real,"Physical dependence" real) | SELECT COUNT("Psychological dependence") FROM table_58853 WHERE "Pleasure" = '2.3' AND "Mean" < '1.9300000000000002' |
What high school team did Doug Nolan play for? | CREATE TABLE table_15955 ("Pick" real,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text) | SELECT "College/junior/club team" FROM table_15955 WHERE "Player" = 'Doug Nolan' |
which is the only stadium with a capacity of larger than 20,000 ? | CREATE TABLE table_204_992 (id number,"team" text,"manager" text,"city" text,"stadium" text,"capacity" text) | SELECT "stadium" FROM table_204_992 WHERE "capacity" > 20000 |
Comment Vote and Post count. | CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModera... | SELECT (SELECT COUNT(*) FROM Votes) AS VoteCount, (SELECT COUNT(*) FROM Posts) AS PostCount, (SELECT COUNT(*) FROM Comments) AS CommentCount |
Does Prof. Valeriy Tenishev 's ARTDES 182 class have a lab ? | CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_cr... | SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course.department = 'ARTD... |
show me all round trip flights from MIAMI to NEW YORK nonstop | 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.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEW YORK' AND NOT fare.round_trip_cost IS NULL AND flight_fare.fare_i... |
What are the largest cuts made when the events are less than 21? | CREATE TABLE table_name_11 (cuts_made INTEGER,events INTEGER) | SELECT MAX(cuts_made) FROM table_name_11 WHERE events < 21 |
What is the Name that has a 60mH littler than 1002, and a 800m littler than 985, and a Country of lithuania? | CREATE TABLE table_49727 ("Name" text,"Country" text,"Total" text,"60mH" real,"800m" real) | SELECT "Name" FROM table_49727 WHERE "60mH" < '1002' AND "800m" < '985' AND "Country" = 'lithuania' |
was there any organism detected in the last blood (toxo) test of patient 57050 this month? | CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE patients (row_id number,subject_id number,ge... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 57050) AND microbiologyevents.spec_type_desc = 'blood (toxo)' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.charttime, 'start of month') ... |
How much Snatch has a Total (kg) smaller than 257? | CREATE TABLE table_61396 ("Name" text,"Bodyweight" real,"Snatch" real,"Clean & Jerk" real,"Total (kg)" real) | SELECT SUM("Snatch") FROM table_61396 WHERE "Total (kg)" < '257' |
What is the average episode # with a name of the origin of Donnie (part 1)? | CREATE TABLE table_name_75 (episode__number INTEGER,episode_name VARCHAR) | SELECT AVG(episode__number) FROM table_name_75 WHERE episode_name = "the origin of donnie (part 1)" |
provide the number of patients whose days of hospital stay is greater than 10 and lab test fluid is ascites? | 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.days_stay > "10" AND lab.fluid = "Ascites" |
What is the 3'utr sequence with a variant id of acd'6a 3? | CREATE TABLE table_997 ("Variant id" text,"5\u2019UTR splice" text,"Coding" text,"3\u2019UTR sequence" text,"GenBank id" text) | SELECT "3\u2019UTR sequence" FROM table_997 WHERE "Variant id" = 'ACD''6A 3' |
Name the average week for attendance of 75,111 | CREATE TABLE table_15072 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real) | SELECT AVG("Week") FROM table_15072 WHERE "Attendance" = '75,111' |
Where can you find Colorado and Southern Railway #9? | CREATE TABLE table_1057316_1 (disposition VARCHAR,operational_owner_s_ VARCHAR) | SELECT disposition FROM table_1057316_1 WHERE operational_owner_s_ = "Colorado and Southern Railway #9" |
give me the number of patients whose year of death is less than or equal to 2115? | 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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dod_year <= "2115.0" |
what was the most populous neighborhood in calgary in 2012 ? | CREATE TABLE table_203_642 (id number,"name" text,"quadrant" text,"sector" text,"ward" text,"type" text,"2012\npopulation\nrank" number,"population\n(2012)" number,"population\n(2011)" number,"% change" number,"dwellings\n(2012)" number,"area\n(km2)" number,"population\ndensity" number) | SELECT "name" FROM table_203_642 ORDER BY "population\n(2012)" DESC LIMIT 1 |
until 2102, what were the five most frequent medications prescribed to the female patients 60 or above within the same hospital visit after they were diagnosed with hyperlipidemia nec/nos? | CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valu... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_... |
What country has a time of 3:19.167? | CREATE TABLE table_64605 ("Rank" real,"Athletes" text,"Country" text,"Time" text,"Notes" text) | SELECT "Country" FROM table_64605 WHERE "Time" = '3:19.167' |
What are the name and active date of the customers whose contact channel code is email? | CREATE TABLE addresses (address_id number,address_content text,city text,zip_postcode text,state_province_county text,country text,other_address_details text)CREATE TABLE customers (customer_id number,payment_method text,customer_name text,date_became_customer time,other_customer_details text)CREATE TABLE customer_cont... | SELECT t1.customer_name, t2.active_from_date FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t2.channel_code = 'Email' |
what is patient 3097's age when they came to the hospital last time? | 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 microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,sp... | SELECT admissions.age FROM admissions WHERE admissions.subject_id = 3097 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1 |
What was the start of the competitor with a qualifying time of 84.300? | CREATE TABLE table_51402 ("Year" text,"Start" text,"Qual" text,"Rank" text,"Finish" text,"Laps" real) | SELECT "Start" FROM table_51402 WHERE "Qual" = '84.300' |
provide the number of patients who were admitted before year 2175 and whose diagnosis short title is chronic liver disease nec. | 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.admityear < "2175" AND diagnoses.short_title = "Chronic liver dis NEC" |
Who was the constructor of the car driven by Heikki Kovalainen? | CREATE TABLE table_37765 ("Driver" text,"Constructor" text,"Laps" text,"Time/Retired" text,"Grid" text) | SELECT "Constructor" FROM table_37765 WHERE "Driver" = 'heikki kovalainen' |
What percentage voted for Tom Horner according to the poll source with sampling error of 2.5%? | CREATE TABLE table_2213 ("Poll source" text,"Dates administered" text,"Tom Emmer (R)" text,"Matt Entenza (DFL)" text,"Tom Horner (I)" text,"Undecided" text,"Sampling error" text) | SELECT "Tom Horner (I)" FROM table_2213 WHERE "Sampling error" = '2.5%' |
What's the reserved number for constituency number 108? | CREATE TABLE table_name_43 (reserved_for___sc___st__none_ VARCHAR,constituency_number VARCHAR) | SELECT reserved_for___sc___st__none_ FROM table_name_43 WHERE constituency_number = "108" |
Which memeber has nt as the state? | CREATE TABLE table_name_7 (member VARCHAR,state VARCHAR) | SELECT member FROM table_name_7 WHERE state = "nt" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.