instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
what is maximum age of patients whose primary disease is hyperglycemia and year of death is less than 2131? | 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 text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id te... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.diagnosis = "HYPERGLYCEMIA" AND demographic.dod_year < "2131.0" |
I want the total number of points for against of 753 and points diff more than -114 | CREATE TABLE table_name_75 (points VARCHAR,against VARCHAR,points_diff VARCHAR) | SELECT COUNT(points) FROM table_name_75 WHERE against = 753 AND points_diff > -114 |
Name the frequency for 103.7 energy fm dipolog* | CREATE TABLE table_30101 ("Branding" text,"Callsign" text,"Frequency" text,"Power kW" text,"Coverage" text) | SELECT "Frequency" FROM table_30101 WHERE "Branding" = '103.7 Energy FM Dipolog*' |
how much dapsone is prescribed to patient 95986 in total on the last hospital visit? | CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE cost (row_i... | SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 95986 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.drug = 'dapsone' |
What is the Place of the Player with Money greater than 300 and a Score of 71-69-70-70=280? | CREATE TABLE table_76985 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money ($)" real) | SELECT "Place" FROM table_76985 WHERE "Money ( $ )" > '300' AND "Score" = '71-69-70-70=280' |
what is the number of patients whose primary disease is abdominal pain and days of hospital stay is greater than 3? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ABDOMINAL PAIN" AND demographic.days_stay > "3" |
what is the number of times that gastroenterostomy nec is performed until 2 years ago? | CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outtime time)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_... | SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'gastroenterostomy nec') AND DATETIME(procedures_icd.charttime) <= DATETIME(CURRENT_TIME(), '-2 year') |
When spvgg vohenstrau is the oberpfalz what is the season? | CREATE TABLE table_23224961_1 (season VARCHAR,oberpfalz VARCHAR) | SELECT season FROM table_23224961_1 WHERE oberpfalz = "SpVgg Vohenstrauß" |
how many drivers did not finish 56 laps ? | CREATE TABLE table_204_743 (id number,"pos" text,"no" number,"driver" text,"constructor" text,"laps" number,"time/retired" text,"grid" number,"points" number) | SELECT COUNT("driver") FROM table_204_743 WHERE "laps" < 56 |
In what year was the total finals at 10? | CREATE TABLE table_72519 ("School" text,"Winners" real,"Finalists" real,"Total Finals" real,"Year of last win" text) | SELECT "Year of last win" FROM table_72519 WHERE "Total Finals" = '10' |
Posts by @userId since @startDate. | CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE Post... | SELECT t.Name, COUNT(*) FROM Posts AS p JOIN PostTypes AS t ON p.PostTypeId = t.Id WHERE OwnerUserId = @userId AND CreationDate >= @startDate GROUP BY t.Name |
what is the averaging time when the regulatory citation is 40 cfr 50.4(b)? | CREATE TABLE table_44965 ("Pollutant" text,"Type" text,"Standard" text,"Averaging Time" text,"Regulatory Citation" text) | SELECT "Averaging Time" FROM table_44965 WHERE "Regulatory Citation" = '40 cfr 50.4(b)' |
What is the lowest numbered lane of Sue Rolph with a rank under 5? | CREATE TABLE table_67081 ("Rank" real,"Lane" real,"Name" text,"Nationality" text,"Time" real) | SELECT MIN("Lane") FROM table_67081 WHERE "Name" = 'sue rolph' AND "Rank" < '5' |
Which is the highest Gold that has a total smaller than 4 and a silver of 1, and a bronze smaller than 2, and a rank of 13? | CREATE TABLE table_15599 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT MAX("Gold") FROM table_15599 WHERE "Total" < '4' AND "Silver" = '1' AND "Bronze" < '2' AND "Rank" = '13' |
tell me the amount of chest tubes cticu ct 1 patient 31854 has had on this month/30? | CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id numb... | SELECT SUM(outputevents.value) 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 = 31854)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'che... |
Which upper level classes do not require 519 as a prerequisite ? | 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 ta (campus_job_id int,student_id int,location var... | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite, program_course WHERE NOT COURSE_1.course_id IN (SELECT course_prerequisite.pre_course_id FROM course AS COURSE_0, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.cours... |
Give me a bar chart to show the names and revenue of the company that earns the highest revenue in each headquarter city, list in descending by the y axis. | 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, MAX(Revenue) FROM Manufacturers GROUP BY Headquarter ORDER BY MAX(Revenue) DESC |
What is the sum of the game with the boston bruins as the opponent? | CREATE TABLE table_49196 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location" text,"Attendance" real,"Record" text,"Points" real) | SELECT SUM("Game") FROM table_49196 WHERE "Opponent" = 'boston bruins' |
Can you tell me the Record that has the Team of minnesota? | CREATE TABLE table_name_91 (record VARCHAR,team VARCHAR) | SELECT record FROM table_name_91 WHERE team = "minnesota" |
How many entries have 3rd places greater than 19, and alain prost as the driver? | CREATE TABLE table_5441 ("Driver" text,"Seasons" text,"Entries" real,"3rd places" real,"Percentage" text) | SELECT COUNT("Entries") FROM table_5441 WHERE "3rd places" > '19' AND "Driver" = 'alain prost' |
Who was played against in the final on November 14, 1994? | CREATE TABLE table_name_17 (opponent_in_the_final VARCHAR,date VARCHAR) | SELECT opponent_in_the_final FROM table_name_17 WHERE date = "november 14, 1994" |
What player has a date of 12-02-2003? | CREATE TABLE table_name_98 (player VARCHAR,date VARCHAR) | SELECT player FROM table_name_98 WHERE date = "12-02-2003" |
TOP 100 Users based on coimbatore. | CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,UpVotes number,DownVotes number,ProfileImageUrl... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%Coimbatore%' OR UPPER(Location) LIKE '%coimbatore%' OR Location LIKE '%Coimbatore%' AND Reputation >= 1000 ORDER BY Reputation DESC |
give me the number of patients whose admission location is clinic referral/premature and discharge location is snf? | 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 WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.discharge_location = "SNF" |
What was the Attendance of the game against the Los Angeles Raiders? | CREATE TABLE table_name_85 (attendance VARCHAR,opponent VARCHAR) | SELECT attendance FROM table_name_85 WHERE opponent = "los angeles raiders" |
Players of judith wiesner and alex antonitsch had what match w-l? | CREATE TABLE table_5821 ("Placing" real,"Team" text,"Players" text,"Seeding" text,"Playoffs W-L" text,"Matches W-L" text) | SELECT "Matches W-L" FROM table_5821 WHERE "Players" = 'judith wiesner and alex antonitsch' |
How many championships were there where the score was 4 6, 7 6 (7 5) , [5 10]? | CREATE TABLE table_29163303_4 (championship VARCHAR,score VARCHAR) | SELECT COUNT(championship) FROM table_29163303_4 WHERE score = "4–6, 7–6 (7–5) , [5–10]" |
Who directed the episode for s02 e08? | CREATE TABLE table_16384596_4 (directed_by VARCHAR,broadcast_order VARCHAR) | SELECT directed_by FROM table_16384596_4 WHERE broadcast_order = "S02 E08" |
Which date has the tom gullikson butch walts final, and who was the runner-up? | CREATE TABLE table_33366 ("Outcome" text,"Date" text,"Tournament" text,"Partner" text,"Opponents in the final" text) | SELECT "Date" FROM table_33366 WHERE "Outcome" = 'runner-up' AND "Opponents in the final" = 'tom gullikson butch walts' |
What is the voltage range (v) if the clock multiplier is 3x or 2x mode and part number is a80486dx4wb-100? | CREATE TABLE table_15261_1 (voltage_range__v_ VARCHAR,clock_multiplier VARCHAR,part_number VARCHAR) | SELECT COUNT(voltage_range__v_) FROM table_15261_1 WHERE clock_multiplier = "3X or 2X mode" AND part_number = "A80486DX4WB-100" |
What are the countries of mountains with height bigger than 5000, and count them by a bar chart, display by the y-axis in descending. | CREATE TABLE mountain (Mountain_ID int,Name text,Height real,Prominence real,Range text,Country text)CREATE TABLE climber (Climber_ID int,Name text,Country text,Time text,Points real,Mountain_ID int) | SELECT Country, COUNT(Country) FROM mountain WHERE Height > 5000 GROUP BY Country ORDER BY COUNT(Country) DESC |
Return a bar chart on how many customers use each payment method? | CREATE TABLE Products (product_id INTEGER,product_type_code VARCHAR(10),product_name VARCHAR(80),product_price DECIMAL(19,4))CREATE TABLE Department_Stores (dept_store_id INTEGER,dept_store_chain_id INTEGER,store_name VARCHAR(80),store_address VARCHAR(255),store_phone VARCHAR(80),store_email VARCHAR(80))CREATE TABLE De... | SELECT payment_method_code, COUNT(*) FROM Customers GROUP BY payment_method_code |
What is the group C region with Illinois as group B? | CREATE TABLE table_name_53 (group_c VARCHAR,group_b VARCHAR) | SELECT group_c FROM table_name_53 WHERE group_b = "illinois" |
What average week has shea stadium as the game site, and 1979-12-09 as the date? | CREATE TABLE table_34017 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Game site" text,"Attendance" real) | SELECT AVG("Week") FROM table_34017 WHERE "Game site" = 'shea stadium' AND "Date" = '1979-12-09' |
average votes per view for questions. | CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE PostLinks (Id n... | SELECT MAX(value) FROM (SELECT CAST(COUNT(v.Id) AS FLOAT) / p.ViewCount AS value FROM Votes AS v, Posts AS p WHERE v.VoteTypeId IN (2, 3) AND p.Id = v.PostId AND p.PostTypeId = 1 AND p.ViewCount >= 1 GROUP BY p.ViewCount, p.Id) AS t |
How many train stations are there? | CREATE TABLE train (train_id number,name text,time text,service text)CREATE TABLE train_station (train_id number,station_id number)CREATE TABLE station (station_id number,name text,annual_entry_exit number,annual_interchanges number,total_passengers number,location text,main_services text,number_of_platforms number) | SELECT COUNT(*) FROM station |
Tell me the title of work for year more than 2009 | CREATE TABLE table_4347 ("Year" real,"Award" text,"Title of work" text,"Medium" text,"Result" text) | SELECT "Title of work" FROM table_4347 WHERE "Year" > '2009' |
What is the total number of losses for teams with less than 5 ties and more than 330 goals for? | CREATE TABLE table_42710 ("Season" text,"League" text,"Games" real,"Lost" real,"Tied" real,"Points" real,"Winning %" real,"Goals for" real,"Goals against" real,"Standing" text) | SELECT COUNT("Lost") FROM table_42710 WHERE "Tied" < '5' AND "Goals for" > '330' |
Which Type/code has a Torque@rpm of n m (lb ft) @1900 3500? Question 1 | CREATE TABLE table_65464 ("Model" text,"Years" text,"Type/code" text,"Power@rpm" text,"Torque@rpm" text) | SELECT "Type/code" FROM table_65464 WHERE "Torque@rpm" = 'n·m (lb·ft) @1900–3500' |
Name the miles for june 7 | CREATE TABLE table_20855 ("Year" real,"Date" text,"Driver" text,"Team" text,"Manufacturer" text,"Laps" text,"Miles (km)" text,"Race time" text,"Average speed (mph)" text,"Report" text) | SELECT "Miles (km)" FROM table_20855 WHERE "Date" = 'June 7' |
Show the smallest enrollment of each state using a bar chart, and could you display by the x axis in descending please? | CREATE TABLE College (cName varchar(20),state varchar(2),enr numeric(5,0))CREATE TABLE Tryout (pID numeric(5,0),cName varchar(20),pPos varchar(8),decision varchar(3))CREATE TABLE Player (pID numeric(5,0),pName varchar(20),yCard varchar(3),HS numeric(5,0)) | SELECT state, MIN(enr) FROM College GROUP BY state ORDER BY state DESC |
Which finalist has Semifinalists of andre agassi (1) lleyton hewitt (14)? | CREATE TABLE table_name_3 (finalist VARCHAR,semifinalists VARCHAR) | SELECT finalist FROM table_name_3 WHERE semifinalists = "andre agassi (1) lleyton hewitt (14)" |
Artist Justinas Lapatinskas with a draw of greater than 9 got what as the highest televote? | CREATE TABLE table_7709 ("Draw" real,"Artist" text,"Song" text,"Televote" real,"Place" real) | SELECT MAX("Televote") FROM table_7709 WHERE "Artist" = 'justinas lapatinskas' AND "Draw" > '9' |
List the names of wrestlers that have not been eliminated. | CREATE TABLE elimination (elimination_id text,wrestler_id text,team text,eliminated_by text,elimination_move text,time text)CREATE TABLE wrestler (wrestler_id number,name text,reign text,days_held text,location text,event text) | SELECT name FROM wrestler WHERE NOT wrestler_id IN (SELECT wrestler_id FROM elimination) |
Which college has the most authors with submissions? | CREATE TABLE acceptance (submission_id number,workshop_id number,result text)CREATE TABLE submission (submission_id number,scores number,author text,college text)CREATE TABLE workshop (workshop_id number,date text,venue text,name text) | SELECT college FROM submission GROUP BY college ORDER BY COUNT(*) DESC LIMIT 1 |
What are the names and prices of all products in the store Plot them as bar chart, and show mean price in ascending order please. | 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, AVG(Price) FROM Products GROUP BY Name ORDER BY AVG(Price) |
When 'i feel good' is the title and joe sachs is the writer how many series numbers are there? | CREATE TABLE table_24287 ("Series #" real,"Season #" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text) | SELECT COUNT("Series #") FROM table_24287 WHERE "Written by" = 'Joe Sachs' AND "Title" = 'I Feel Good' |
What is the Fri 3 June time for the rider with a Weds 1 June time of 18' 22.66 123.182mph? | CREATE TABLE table_74372 ("Rank" real,"Rider" text,"Mon 30 May" text,"Tues 31 May" text,"Wed 1 June" text,"Thurs 2 June" text,"Fri 3 June" text) | SELECT "Fri 3 June" FROM table_74372 WHERE "Wed 1 June" = '18'' 22.66 123.182mph' |
Name the D 43 when it has D 46 of d 26 | CREATE TABLE table_53301 ("D 50 O" text,"D 49 \u221a" text,"D 48 \u221a" text,"D 47 \u221a" text,"D 46 \u221a" text,"D 45 \u221a" text,"D 44 \u221a" text,"D 43 \u221a" text,"D 42 \u221a" text,"D 41 \u221a" text) | SELECT "D 43 \u221a" FROM table_53301 WHERE "D 46 \u221a" = 'd 26' |
How many couples are there for the song ' i wonder why ' curtis stigers? | CREATE TABLE table_30675 ("Couple" text,"Style" text,"Music" text,"Trine Dehli Cleve" real,"Tor Fl\u00f8ysvik" real,"Karianne Gulliksen" real,"Christer Tornell" real,"Total" real) | SELECT COUNT("Couple") FROM table_30675 WHERE "Music" = ' I Wonder Why "— Curtis Stigers' |
what is days of hospital stay and discharge location of subject id 18351? | 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.days_stay, demographic.discharge_location FROM demographic WHERE demographic.subject_id = "18351" |
Show me about the distribution of ACC_Road and the average of Team_ID , and group by attribute ACC_Road in a bar chart, list X-axis in asc order. | CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)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_Perce... | SELECT ACC_Road, AVG(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road |
had patient 021-25705 had any bulb #2 output in this month? | 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 allergy (allergyid number,patientunitstayid number,drugname text,allergyna... | SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-25705')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutpu... |
What was the score on 10 November 2006? | CREATE TABLE table_name_79 (score VARCHAR,date VARCHAR) | SELECT score FROM table_name_79 WHERE date = "10 november 2006" |
What is the GP winner with a place of genk, with race winners ben adriaenssen / ben van den bogaart? | CREATE TABLE table_49577 ("Date" text,"Place" text,"Race winners" text,"GP winner" text,"Source" text) | SELECT "GP winner" FROM table_49577 WHERE "Place" = 'genk' AND "Race winners" = 'ben adriaenssen / ben van den bogaart' |
Unix and Linux Tag List. | CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,LastEditorUserId number,LastEditorDisplayName text,LastEditDate time,LastActivityDate time,Title text,Ta... | SELECT TagName FROM Tags |
With a 1985-86 of 407 what is the airport? | CREATE TABLE table_9464 ("Rank" real,"Airport" text,"Location" text,"IATA" text,"1985\u201386" real,"1990\u201391" real,"1995\u201396" real,"2000\u201301" real,"2005\u201306" real,"2007\u201308" real,"2009\u201310" real,"2010-11" real) | SELECT "Airport" FROM table_9464 WHERE "1985\u201386" = '407' |
who is the next artist after artist enomoto atsuko ? | CREATE TABLE table_204_911 (id number,"album / name" text,"artist(s)" text,"label" text,"role/credit" text,"date" text,"chart#" text) | SELECT "artist(s)" FROM table_204_911 WHERE "date" > (SELECT "date" FROM table_204_911 WHERE "artist(s)" = 'enomoto atsuko') ORDER BY "date" LIMIT 1 |
what is the total cost of a minimum hospital with a drug called levaquin until 2104? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,discha... | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'levaquin')) AND STRFTIME('%y', cost.chargetime... |
What is the Translated Title of Steinulven? | CREATE TABLE table_name_31 (translated_title VARCHAR,norwegian_title VARCHAR) | SELECT translated_title FROM table_name_31 WHERE norwegian_title = "steinulven" |
Name the municpality for 57 populaton | CREATE TABLE table_16278673_1 (municipality VARCHAR,population VARCHAR) | SELECT municipality FROM table_16278673_1 WHERE population = "57" |
Give me the comparison about author_tutor_ATB over the password . | CREATE TABLE Courses (course_id INTEGER,author_id INTEGER,subject_id INTEGER,course_name VARCHAR(120),course_description VARCHAR(255))CREATE TABLE Student_Tests_Taken (registration_id INTEGER,date_test_taken DATETIME,test_result VARCHAR(255))CREATE TABLE Course_Authors_and_Tutors (author_id INTEGER,author_tutor_ATB VAR... | SELECT password, author_tutor_ATB FROM Course_Authors_and_Tutors ORDER BY personal_name |
were more bubas bison or copris hispanus linnaeus released ? | CREATE TABLE table_204_869 (id number,"species" text,"country of origin" text,"total released" number,"first release" text,"last release" text,"areas of release" text,"areas established" text,"pasture type" text) | SELECT "species" FROM table_204_869 WHERE "species" IN ('bubas bison', 'copris hispanus linnaeus') ORDER BY "total released" DESC LIMIT 1 |
Which Election has a Municipality of laives, and Inhabitants smaller than 17,197? | CREATE TABLE table_name_35 (election INTEGER,municipality VARCHAR,inhabitants VARCHAR) | SELECT AVG(election) FROM table_name_35 WHERE municipality = "laives" AND inhabitants < 17 OFFSET 197 |
What is the number of floors that have years under 2008 and were named Guinness Tower? | CREATE TABLE table_7203 ("Rank" text,"Name" text,"Height m / ft" text,"Floors" real,"Year" real) | SELECT COUNT("Floors") FROM table_7203 WHERE "Year" < '2008' AND "Name" = 'guinness tower' |
What is the to par for the player with winnings of 49,500? | CREATE TABLE table_name_74 (to_par VARCHAR,money___£__ VARCHAR) | SELECT to_par FROM table_name_74 WHERE money___£__ = "49,500" |
What are the lowest cuts made that have events less than 4? | CREATE TABLE table_name_84 (cuts_made INTEGER,events INTEGER) | SELECT MIN(cuts_made) FROM table_name_84 WHERE events < 4 |
What is the arena capacity of the arena in the town whose head coach is Roberto Serniotti? | CREATE TABLE table_19526911_1 (arena__capacity_ VARCHAR,head_coach VARCHAR) | SELECT arena__capacity_ FROM table_19526911_1 WHERE head_coach = "Roberto Serniotti" |
Show me the total number by category in a histogram, show total number from low to high order. | CREATE TABLE music_festival (ID int,Music_Festival text,Date_of_ceremony text,Category text,Volume int,Result text)CREATE TABLE artist (Artist_ID int,Artist text,Age int,Famous_Title text,Famous_Release_date text)CREATE TABLE volume (Volume_ID int,Volume_Issue text,Issue_Date text,Weeks_on_Top real,Song text,Artist_ID ... | SELECT Category, COUNT(*) FROM music_festival GROUP BY Category ORDER BY COUNT(*) |
What is the score when the game is bigger than 29.0? | CREATE TABLE table_23249053_8 (score VARCHAR,game INTEGER) | SELECT score FROM table_23249053_8 WHERE game > 29.0 |
Who was the home team when Manchester City was the away team? | CREATE TABLE table_47601 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text) | SELECT "Home team" FROM table_47601 WHERE "Away team" = 'manchester city' |
Show me a bar chart for what is the total credit does each department offer?, and show total number in asc order. | CREATE TABLE STUDENT (STU_NUM int,STU_LNAME varchar(15),STU_FNAME varchar(15),STU_INIT varchar(1),STU_DOB datetime,STU_HRS int,STU_CLASS varchar(2),STU_GPA float(8),STU_TRANSFER numeric,DEPT_CODE varchar(18),STU_PHONE varchar(4),PROF_NUM int)CREATE TABLE EMPLOYEE (EMP_NUM int,EMP_LNAME varchar(15),EMP_FNAME varchar(12)... | SELECT DEPT_CODE, SUM(CRS_CREDIT) FROM COURSE GROUP BY DEPT_CODE ORDER BY SUM(CRS_CREDIT) |
what is the FIRST class fare on UA flight 352 from DENVER to BOSTON | CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE flight_stop (flight_id int,stop_number int,stop_days text,stop_airport text,arrival_time int,arrival_airline text,arrival_flight_number int,departure_time int,departure_airline text,departure_flight_number int,stop_time int)CREATE TABLE airport (airport... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.flight_number = 352 AND flight.to_airport ... |
calculate the number of patients diagnosed with fall nos who have died | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.short_title = "Fall NOS" |
What is the lowest First Elected, when Results is 'Re-elected', and when Incumbent is 'Lincoln Davis'? | CREATE TABLE table_60233 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Results" text) | SELECT MIN("First elected") FROM table_60233 WHERE "Results" = 're-elected' AND "Incumbent" = 'lincoln davis' |
What was the first airdate with a viewership of 4.77 million? | CREATE TABLE table_21853 ("Episode" real,"Original title" text,"Directed by" text,"Written by" text,"Original airdate" text,"Duration" text,"Viewership" text) | SELECT "Original airdate" FROM table_21853 WHERE "Viewership" = '4.77 million' |
When 2006 is the year played and winter park is the fcsl team who is the player? | CREATE TABLE table_18373863_2 (player VARCHAR,fcsl_team VARCHAR,years_played VARCHAR) | SELECT player FROM table_18373863_2 WHERE fcsl_team = "Winter Park" AND years_played = "2006" |
What player has t3 as the place, with england united states as the country? | CREATE TABLE table_62580 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" real,"Money ($)" real) | SELECT "Player" FROM table_62580 WHERE "Place" = 't3' AND "Country" = 'england united states' |
Name the result for opponent of chicago bears | CREATE TABLE table_15115 ("Week" text,"Date" text,"Opponent" text,"Result" text,"Game site" text,"Record" text,"Attendance" text) | SELECT "Result" FROM table_15115 WHERE "Opponent" = 'chicago bears' |
What it Duration, when Test Flight is Free Flight #3? | CREATE TABLE table_48194 ("Test flight" text,"Date" text,"Speed" text,"Altitude" text,"Crew" text,"Duration" text,"Comment" text) | SELECT "Duration" FROM table_48194 WHERE "Test flight" = 'free flight #3' |
show me the flights from BALTIMORE to BOSTON | CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE code_description (code varchar,description text)CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)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, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOST... |
Show the proportion of the total enrollment in each county with a pie chart. | CREATE TABLE endowment (endowment_id int,School_id int,donator_name text,amount real)CREATE TABLE budget (School_id int,Year int,Budgeted int,total_budget_percent_budgeted real,Invested int,total_budget_percent_invested real,Budget_invested_percent text)CREATE TABLE School (School_id text,School_name text,Location text... | SELECT County, SUM(Enrollment) FROM School GROUP BY County |
What day was a friendly game held that had a score of 2:3? | CREATE TABLE table_37267 ("Date" text,"City" text,"Opponent" text,"Results\u00b9" text,"Type of game" text) | SELECT "Date" FROM table_37267 WHERE "Type of game" = 'friendly' AND "Results\u00b9" = '2:3' |
what is the percentage of democratic voters in which the registered voters is 67.8%? | CREATE TABLE table_27003223_4 (democratic VARCHAR,registered_voters VARCHAR) | SELECT democratic FROM table_27003223_4 WHERE registered_voters = "67.8%" |
What discs has a region 1 release date of January 22, 2008? | CREATE TABLE table_34504 ("Volume" text,"Discs" real,"Episodes" real,"Region 1 release" text,"Region 2 release" text,"Region 4 release" text) | SELECT "Discs" FROM table_34504 WHERE "Region 1 release" = 'january 22, 2008' |
Find the faculty rank that has the least members. | CREATE TABLE activity (actid number,activity_name text)CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)CREATE TABLE faculty_participates_in (facid number,actid number)CREATE TABLE faculty (facid number,lname text,fname text,rank text,sex text,phone... | SELECT rank FROM faculty GROUP BY rank ORDER BY COUNT(*) LIMIT 1 |
What are the themes and locations of parties? | CREATE TABLE party (party_id number,party_theme text,location text,first_year text,last_year text,number_of_hosts number)CREATE TABLE host (host_id number,name text,nationality text,age text)CREATE TABLE party_host (party_id number,host_id number,is_main_in_charge others) | SELECT party_theme, location FROM party |
What is the average amount of spectators when Essendon played as the home team? | CREATE TABLE table_55440 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT AVG("Crowd") FROM table_55440 WHERE "Home team" = 'essendon' |
What is the rank with a higher than 2 total, 21 gold and more than 12 bronze? | CREATE TABLE table_61384 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT AVG("Rank") FROM table_61384 WHERE "Total" > '2' AND "Gold" = '21' AND "Bronze" > '12' |
What competition is at 23:00 cet? | CREATE TABLE table_60754 ("Date" text,"Time" text,"Competition" text,"Opponent" text,"Ground" text,"Score" text) | SELECT "Competition" FROM table_60754 WHERE "Time" = '23:00 cet' |
Which event had the opponent of shinya aoki and was at 4:56? | CREATE TABLE table_name_90 (event VARCHAR,opponent VARCHAR,time VARCHAR) | SELECT event FROM table_name_90 WHERE opponent = "shinya aoki" AND time = "4:56" |
What is the highest number of games played? | CREATE TABLE table_22067 ("Position" real,"Club" text,"Games played" real,"Wins" real,"Draws" real,"Loses" real,"Goals scored" real,"Goals conceded" real,"Points" real) | SELECT MAX("Games played") FROM table_22067 |
Show all dates of transactions whose type code is 'SALE', and count them by a line chart, and display by the x-axis from high to low. | CREATE TABLE Transactions_Lots (transaction_id INTEGER,lot_id INTEGER)CREATE TABLE Purchases (purchase_transaction_id INTEGER,purchase_details VARCHAR(255))CREATE TABLE Transactions (transaction_id INTEGER,investor_id INTEGER,transaction_type_code VARCHAR(10),date_of_transaction DATETIME,amount_of_transaction DECIMAL(1... | SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE transaction_type_code = "SALE" ORDER BY date_of_transaction DESC |
What is Song's Index? | CREATE TABLE table_43466 ("Index" text,"Name" text,"Song" text,"Group Song" text,"Score" text) | SELECT "Index" FROM table_43466 WHERE "Song" = '会呼吸的痛' |
how many people had died after being diagnosed with cocaine abuse-continuous in the same hospital encounter until 2 years ago? | CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate ... | SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime, t1.hadm_id 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 FRO... |
What was the record after game 20? | CREATE TABLE table_20010140_9 (record VARCHAR,game VARCHAR) | SELECT record FROM table_20010140_9 WHERE game = 20 |
give me the number of patients whose discharge location is left against medical advi and year of birth is less than 2041? | 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 demographic (subject_id text,hadm_id text,name text,marital... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI" AND demographic.dob_year < "2041" |
What was the score for the game on November 1? | CREATE TABLE table_46124 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "Score" FROM table_46124 WHERE "Date" = 'november 1' |
How many patients with government health insurance had an initial insertion of dual-chamber device procedure? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marita... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.long_title = "Initial insertion of dual-chamber device" |
what is the average age of patient with single as marital status and admitted under clinic referral/premature? | 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 AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.admission_location = "CLINIC REFERRAL/PREMATURE" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.