instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
What was the region for the 38xa-5 catalog? | CREATE TABLE table_name_6 (region VARCHAR,catalog VARCHAR) | SELECT region FROM table_name_6 WHERE catalog = "38xa-5" |
what is average age of patients whose primary disease is gangrene and admission year is greater than or equal to 2164? | 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 AVG(demographic.age) FROM demographic WHERE demographic.diagnosis = "GANGRENE" AND demographic.admityear >= "2164" |
count the number of patients whose drug name is fluconazole? | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Fluconazole" |
What is the date of the post-week 2 game with a result of l 16 10? | CREATE TABLE table_59375 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text) | SELECT "Date" FROM table_59375 WHERE "Week" > '2' AND "Result" = 'l 16–10' |
List the distinct payment method codes with the number of orders mad in a bar chart, and show by the X in ascending. | CREATE TABLE Drama_Workshop_Groups (Workshop_Group_ID INTEGER,Address_ID INTEGER,Currency_Code CHAR(15),Marketing_Region_Code CHAR(15),Store_Name VARCHAR(255),Store_Phone VARCHAR(255),Store_Email_Address VARCHAR(255),Other_Details VARCHAR(255))CREATE TABLE Ref_Payment_Methods (payment_method_code CHAR(10),payment_metho... | SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_code ORDER BY payment_method_code |
an intravenous steroid administered for septic shock, except for those patients who were tested and are responders to a corticotropin stimulation test, or patients who do not receive a steroid due to the clinical judgment of the treating physician, based on an alternate assessment ( e.g. normal baseline cortisol ) . | CREATE TABLE table_train_65 ("id" int,"intention_to_arterial_catheter" bool,"steroid_therapy" bool,"intention_to_central_venous_catheter" bool,"central_venous_pressure_cvp" int,"receiving_vasopressor" bool,"pulmonary_artery_occlusive_pressure_paop" int,"septic_shock" bool,"age" float,"NOUSE" float) | SELECT * FROM table_train_65 WHERE steroid_therapy = 1 AND septic_shock = 1 |
what is first weight of patient 12410 in 08/2101. | CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREA... | SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12410)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt'... |
azteca 7 and azteca 13 are both owned by whom ? | CREATE TABLE table_204_779 (id number,"network name" text,"flagship" text,"programming type" text,"owner" text,"affiliates" number) | SELECT "owner" FROM table_204_779 WHERE "network name" = 'azteca 7' |
What are the distinct visit dates, and count them by a line chart, and I want to order x axis in desc order. | CREATE TABLE Ref_Attraction_Types (Attraction_Type_Code CHAR(15),Attraction_Type_Description VARCHAR(255))CREATE TABLE Photos (Photo_ID INTEGER,Tourist_Attraction_ID INTEGER,Name VARCHAR(255),Description VARCHAR(255),Filename VARCHAR(255),Other_Details VARCHAR(255))CREATE TABLE Visitors (Tourist_ID INTEGER,Tourist_Deta... | SELECT Visit_Date, COUNT(Visit_Date) FROM Visits ORDER BY Visit_Date DESC |
when were patient 010-1155 first prescribed for warfarin sodium 5 mg po tabs and potassium chloride at the same time in this month? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid num... | SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'warfarin sodium 5 mg po tabs' AND patient.uniquepid = '010-1155' AND DATETIME(medication.drugstarttime, 'start of month')... |
what is the one year survival rate of a person with hypomagnesemia - due to etoh abuse? | CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE patient (uniquepid text,patienthealthsystemstayi... | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 1 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI... |
how many days have passed since patient 027-203413 had a nutrition total intake for the last time on the current intensive care unit visit? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,tempe... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =... |
when was last time patient 028-22327 was diagnosed since 4 years ago with cardiomyopathy? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE microlab (microlabid number,patientuni... | SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-22327')) AND diagnosis.diagnosisname = 'cardiomyopathy' AND D... |
Semantic Parsing papers by Li Dong | CREATE TABLE paper (paperid int,title varchar,venueid int,year int,numciting int,numcitedby int,journalid int)CREATE TABLE paperkeyphrase (paperid int,keyphraseid int)CREATE TABLE paperdataset (paperid int,datasetid int)CREATE TABLE field (fieldid int)CREATE TABLE writes (paperid int,authorid int)CREATE TABLE venue (ve... | SELECT DISTINCT author.authorid, paper.paperid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'Li Dong' AND keyphrase.keyphrasename = 'Semantic Parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authori... |
What frame size has pcm 4 ch/16 bit/48khz as audio coding and dvcam as the format name and 4:1:1 as the color sampling? | CREATE TABLE table_name_44 (frame_size VARCHAR,color_sampling VARCHAR,audio_coding VARCHAR,format_name VARCHAR) | SELECT frame_size FROM table_name_44 WHERE audio_coding = "pcm 4 ch/16 bit/48khz" AND format_name = "dvcam" AND color_sampling = "4:1:1" |
What is listed as the highest Year that's also got a Bronze of Wataru Haraguchi? | CREATE TABLE table_name_1 (year INTEGER,bronze VARCHAR) | SELECT MAX(year) FROM table_name_1 WHERE bronze = "wataru haraguchi" |
as of october 25 , 2005 , how many active voters are there ? | CREATE TABLE table_200_35 (id number,"party" text,"active voters" number,"inactive voters" number,"total voters" number,"percentage" text) | SELECT SUM("active voters") FROM table_200_35 |
Who won the Men's Double the same year as Florentina Petre winning the Women's Singles? | CREATE TABLE table_80134 ("Year" text,"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_80134 WHERE "Women's singles" = 'florentina petre' |
What is the point average for the game that has FGM-FGA of 11-28 and a number smaller than 7? | CREATE TABLE table_name_48 (points INTEGER,fgm___fga VARCHAR,number VARCHAR) | SELECT AVG(points) FROM table_name_48 WHERE fgm___fga = "11-28" AND number < 7 |
What was the Attendance in Week 10? | CREATE TABLE table_name_59 (attendance VARCHAR,week VARCHAR) | SELECT attendance FROM table_name_59 WHERE week = 10 |
What position is the player from 1987? | CREATE TABLE table_32666 ("Player" text,"Nationality" text,"Position" text,"From" real,"School/Country" text) | SELECT "Position" FROM table_32666 WHERE "From" = '1987' |
What is the highest average that has 6 dances and a total of over 128? | CREATE TABLE table_name_15 (average INTEGER,number_of_dances VARCHAR,total VARCHAR) | SELECT MAX(average) FROM table_name_15 WHERE number_of_dances = 6 AND total > 128 |
What label is associated with the United Kingdom and the chem036 catalog? | CREATE TABLE table_74756 ("Region" text,"Date" text,"Label" text,"Format" text,"Catalog" text) | SELECT "Label" FROM table_74756 WHERE "Region" = 'united kingdom' AND "Catalog" = 'chem036' |
What studio has the director Philip Frank Messina? | CREATE TABLE table_63482 ("Year" real,"Title" text,"Director" text,"Studio(s)" text,"Notes" text) | SELECT "Studio(s)" FROM table_63482 WHERE "Director" = 'philip frank messina' |
Name the year for avg start being 22.4 | CREATE TABLE table_2308381_1 (year VARCHAR,avg_start VARCHAR) | SELECT year FROM table_2308381_1 WHERE avg_start = "22.4" |
What were the location and attendance for the game against New Jersey? | CREATE TABLE table_name_33 (location_attendance VARCHAR,team VARCHAR) | SELECT location_attendance FROM table_name_33 WHERE team = "new jersey" |
Are there integrated secondary schools in Basel-Stadt? | CREATE TABLE table_22255 ("Canton" text,"Years of Kindergarten" real,"Years of Kindergarten provided" text,"Years of Kindergarten legally required" text,"Length of Primary School" real,"Length of mandatory Secondary School" real,"Separate Secondary Schools?" text,"Cooperative Secondary Schools?" text,"Integrated Second... | SELECT "Integrated Secondary Schools?" FROM table_22255 WHERE "Canton" = 'Basel-Stadt' |
Show the different headquarters and number of companies at each headquarter, and list X-axis in descending order. | CREATE TABLE employment (Company_ID int,People_ID int,Year_working int)CREATE TABLE company (Company_ID real,Name text,Headquarters text,Industry text,Sales_in_Billion real,Profits_in_Billion real,Assets_in_Billion real,Market_Value_in_Billion real)CREATE TABLE people (People_ID int,Age int,Name text,Nationality text,G... | SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters ORDER BY Headquarters DESC |
Which battle of the planets where ova (harmony gold dub) is solaris? | CREATE TABLE table_21753 ("Gatchaman" text,"Battle of the Planets" text,"G-Force" text,"Eagle Riders" text,"OVA (Harmony Gold Dub)" text) | SELECT "Battle of the Planets" FROM table_21753 WHERE "OVA (Harmony Gold Dub)" = 'Solaris' |
What is the date for the 10b serial? | CREATE TABLE table_name_46 (date VARCHAR,serial VARCHAR) | SELECT date FROM table_name_46 WHERE serial = "10b" |
find the primary disease and procedure name for rafael stewart. | 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 procedures (subject_id text,hadm_id te... | SELECT demographic.diagnosis, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Rafael Stewart" |
What was the away team's score in the match at Victoria Park? | CREATE TABLE table_32300 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Away team score" FROM table_32300 WHERE "Venue" = 'victoria park' |
Give the number of departments with greater than average budget in each building with a bar chart. | CREATE TABLE teaches (ID varchar(5),course_id varchar(8),sec_id varchar(8),semester varchar(6),year numeric(4,0))CREATE TABLE classroom (building varchar(15),room_number varchar(7),capacity numeric(4,0))CREATE TABLE student (ID varchar(5),name varchar(20),dept_name varchar(20),tot_cred numeric(3,0))CREATE TABLE departm... | SELECT building, COUNT(building) FROM department WHERE budget > (SELECT AVG(budget) FROM department) GROUP BY building |
What date had a tie no of replay, and an away team of watford? | CREATE TABLE table_name_57 (date VARCHAR,tie_no VARCHAR,away_team VARCHAR) | SELECT date FROM table_name_57 WHERE tie_no = "replay" AND away_team = "watford" |
how many patients born before year 2087 had the lab test fluid pleural? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2087" AND lab.fluid = "Pleural" |
What is the Korean dialect with a jeolla RR Romaja? | CREATE TABLE table_name_18 (korean_dialect VARCHAR,rr_romaja VARCHAR) | SELECT korean_dialect FROM table_name_18 WHERE rr_romaja = "jeolla" |
Are any morning classes available for ENGR 151 ? | CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE program_course (program_id int,course_id int,workload int,category varchar)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... | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'ENGR' AND course.number = 151 AND semester.semester = 'WN' AND semester.semester_id = course_off... |
Who had the fastest lap in the Dutch TT Grand Prix? | CREATE TABLE table_73001 ("Round" real,"Date" text,"Grand Prix" text,"Circuit" text,"Pole Position" text,"Fastest Lap" text,"Race Winner" text) | SELECT "Fastest Lap" FROM table_73001 WHERE "Grand Prix" = 'Dutch TT' |
What Circuit has a Date of 25 july? | CREATE TABLE table_79039 ("Name" text,"Circuit" text,"Date" text,"Winning driver" text,"Winning constructor" text,"Report" text) | SELECT "Circuit" FROM table_79039 WHERE "Date" = '25 july' |
What year was the team named the Raiders established? | CREATE TABLE table_20526 ("Institution" text,"Location" text,"Founded" real,"Affiliation" text,"Enrollment" real,"Team Nickname" text,"Primary conference" text) | SELECT MAX("Founded") FROM table_20526 WHERE "Team Nickname" = 'Raiders' |
Which Station has a Zone 2008 of 8, and a Zone 2007 of outside zones, and Services of london overground? | CREATE TABLE table_75343 ("Station" text,"Services" text,"Local authority" text,"Zone 2007" text,"Zone 2008" text,"Zone 2010" text,"Zone 2013" text) | SELECT "Station" FROM table_75343 WHERE "Zone 2008" = '8' AND "Zone 2007" = 'outside zones' AND "Services" = 'london overground' |
Find the number of rooms with price higher than 120 for different decor. Show bar chart. | CREATE TABLE Reservations (Code INTEGER,Room TEXT,CheckIn TEXT,CheckOut TEXT,Rate REAL,LastName TEXT,FirstName TEXT,Adults INTEGER,Kids INTEGER)CREATE TABLE Rooms (RoomId TEXT,roomName TEXT,beds INTEGER,bedType TEXT,maxOccupancy INTEGER,basePrice INTEGER,decor TEXT) | SELECT decor, COUNT(*) FROM Rooms WHERE basePrice > 120 GROUP BY decor |
What is the average year for Team Oreca? | CREATE TABLE table_40097 ("Year" real,"Team" text,"Co-Drivers" text,"Class" text,"Laps" real,"Pos." text,"Class Pos." text) | SELECT AVG("Year") FROM table_40097 WHERE "Team" = 'team oreca' |
how many championships are listed ? | CREATE TABLE table_204_287 (id number,"outcome" text,"no." number,"date" number,"championship" text,"surface" text,"opponent in the final" text,"score in the final" text) | SELECT COUNT("championship") FROM table_204_287 |
What is the Eurozone result for Population M (LUZ) of 3.08? | CREATE TABLE table_33785 ("Rank" real,"City" text,"State" text,"GDP in $ID B" text,"Population M (LUZ)" real,"GDP per capita $ID K" text,"Eurozone" text) | SELECT "Eurozone" FROM table_33785 WHERE "Population M (LUZ)" = '3.08' |
Recent comments on posts by a deleted user. | CREATE TABLE ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate time,ReviewTaskStateId number,PostId number,SuggestedEditId number,CompletedByReviewTaskId number)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score n... | SELECT p.Id AS "post_link", c.Text AS Comment, c.CreationDate FROM Posts AS p INNER JOIN Comments AS c ON c.PostId = p.Id WHERE p.OwnerDisplayName = '##Name:string##' ORDER BY c.CreationDate DESC |
how many patients are admitted before the year 2187 and diagnosed with cardia tamponade? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title 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.admityear < "2187" AND diagnoses.long_title = "Cardiac tamponade" |
The top 100 worst posts.. | 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 text,EmailHash text,AccountId number)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,Po... | SELECT Id AS "post_link", Score, Body FROM Posts ORDER BY Score LIMIT 100 |
What is the Opponents on a clay surface with christophe rochus as partner? | CREATE TABLE table_42722 ("Outcome" text,"Date" text,"Surface" text,"Partner" text,"Opponents" text,"Score" text) | SELECT "Opponents" FROM table_42722 WHERE "Surface" = 'clay' AND "Partner" = 'christophe rochus' |
give me the number of widowed patients who have ivpca route of drug administration. | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "WIDOWED" AND prescriptions.route = "IVPCA" |
List the writers of the books in ascending alphabetical order, and count them by a bar chart | CREATE TABLE book (Book_ID int,Title text,Issues real,Writer text)CREATE TABLE publication (Publication_ID int,Book_ID int,Publisher text,Publication_Date text,Price real) | SELECT Writer, COUNT(Writer) FROM book GROUP BY Writer ORDER BY Writer |
What was the lead margin when Nixon had 48% and reporting was done by Rasmussen Reports? | CREATE TABLE table_51069 ("Poll Source" text,"Dates administered" text,"Democrat: Jay Nixon" text,"Republican: Kenny Hulshof" text,"Lead Margin" real) | SELECT COUNT("Lead Margin") FROM table_51069 WHERE "Democrat: Jay Nixon" = '48%' AND "Poll Source" = 'rasmussen reports' |
What is the lowest poles that have 0 as a win, 0 as the top 5, with 66th as the postion? | CREATE TABLE table_name_61 (poles INTEGER,position VARCHAR,wins VARCHAR,top_5 VARCHAR) | SELECT MIN(poles) FROM table_name_61 WHERE wins = 0 AND top_5 = 0 AND position = "66th" |
If the passengers are 15,505,566, what is the iata code? | CREATE TABLE table_22096 ("Rank" real,"Airport Name" text,"Location" text,"IATA Code" text,"Passengers" text,"% Chg. 2009/10" text) | SELECT "IATA Code" FROM table_22096 WHERE "Passengers" = '15,505,566' |
how many patients were prescribed the drug norepinephrine during the same month after being diagnosed with gi bleeding, since 4 years ago? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature ... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'gi bleeding' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-4 year')) AS t1 JOIN (SELEC... |
How many episodes are numbered 12x03? | CREATE TABLE table_23292220_13 (first_broadcast VARCHAR,episode VARCHAR) | SELECT COUNT(first_broadcast) FROM table_23292220_13 WHERE episode = "12x03" |
On which date was a game played at Junction Oval? | CREATE TABLE table_78271 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Date" FROM table_78271 WHERE "Venue" = 'junction oval' |
tell the score when the times gone was 75 | CREATE TABLE table_19121 ("Club" text,"Played" text,"Won" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Tries for" text,"Tries against" text,"Try bonus" text,"Losing bonus" text,"Points" text) | SELECT "Points against" FROM table_19121 WHERE "Tries against" = '75' |
what's the currency name with highest monthly inflation rate being 29,500% | CREATE TABLE table_13681_2 (currency_name VARCHAR,highest_monthly_inflation_rate VARCHAR) | SELECT currency_name FROM table_13681_2 WHERE highest_monthly_inflation_rate = "29,500%" |
For the game played against the L.A. Lakers, where was the match played and what was the attendance level? | CREATE TABLE table_48467 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"Location Attendance" text,"Record" text) | SELECT "Location Attendance" FROM table_48467 WHERE "Team" = 'l.a. lakers' |
For all employees who have the letters D or S in their first name, give me the comparison about the amount of job_id over the job_id , and group by attribute job_id. | 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 job_history (EMPLOYEE_ID decimal(6,0)... | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID |
Where was the match on 10/11/2001 against 15? | CREATE TABLE table_name_3 (venue VARCHAR,against VARCHAR,date VARCHAR) | SELECT venue FROM table_name_3 WHERE against = 15 AND date = "10/11/2001" |
count the number of patients whose primary disease is bowel obstruction and age is less than 56? | 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 demographic (subject_id text,hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "BOWEL OBSTRUCTION" AND demographic.age < "56" |
what year was michele assaf nominated | CREATE TABLE table_name_60 (year VARCHAR,nominee VARCHAR) | SELECT year FROM table_name_60 WHERE nominee = "michele assaf" |
What is the location with the most cinemas opened in year 2010 or later? | CREATE TABLE cinema (cinema_id number,name text,openning_year number,capacity number,location text)CREATE TABLE schedule (cinema_id number,film_id number,date text,show_times_per_day number,price number)CREATE TABLE film (film_id number,rank_in_series number,number_in_season number,title text,directed_by text,original_... | SELECT location FROM cinema WHERE openning_year >= 2010 GROUP BY location ORDER BY COUNT(*) DESC LIMIT 1 |
Which NFL team has a player that came from a college in Washington? | CREATE TABLE table_47654 ("Pick #" real,"NFL Team" text,"Player" text,"Position" text,"College" text) | SELECT "NFL Team" FROM table_47654 WHERE "College" = 'washington' |
R questions and answers per month (2). How many questions per month does each tag in the top 10 tags get | CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,OwnerUserId number,Comment text,Text text,Title text,Tags text,RevisionGUID other)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE Pos... | SELECT Month, COUNT(*) AS count FROM (SELECT Id, PostTypeId, DATEADD(MONTH, DATEDIFF(MONTH, 0, CreationDate), 0) AS "month" FROM Posts LEFT JOIN PostTags ON PostId = Id WHERE TagId = 4452) AS tmp GROUP BY Month, PostTypeId ORDER BY Month, PostTypeId |
Top answerers on the site. A list of the top users with the highest average answer score excluding
community wiki / closed posts or users with fewer than 10 answers | CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,ContentLicense text)CREATE TABLE PostLinks (Id number,CreationDate time,PostId numb... | WITH UserAvgAnswerScore AS (SELECT Users.Id AS UserId, COUNT(Posts.Id) AS Answers, CAST(AVG(CAST(Score AS FLOAT)) AS FLOAT(6, 2)) AS "average_answer_score" FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId WHERE PostTypeId = 2 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL GROUP BY Users.Id, DisplayName HAVI... |
provide the number of patients whose insurance is government and diagnoses long title is microscopic hematuria? | 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.insurance = "Government" AND diagnoses.long_title = "Microscopic hematuria" |
What is the series episode number of the episode titled 'sound and vision'? | CREATE TABLE table_73841 ("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 MAX("Series #") FROM table_73841 WHERE "Title" = 'Sound and Vision' |
What is the sum of laps that has a time/retired that is +19.475? | CREATE TABLE table_5148 ("Rider" text,"Manufacturer" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT SUM("Laps") FROM table_5148 WHERE "Time/Retired" = '+19.475' |
For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of hire_date and the average of salary bin hire_date by time. | 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(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS... | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) |
What was the from for the Date From of 2007-08-08? | CREATE TABLE table_76254 ("Date From" text,"Date To" text,"Position" text,"Name" text,"From" text) | SELECT "From" FROM table_76254 WHERE "Date From" = '2007-08-08' |
WHAT COLLEGE HAS A ROUND LARGER THAN 9, WITH BUTCH WEBSTER? | CREATE TABLE table_77264 ("Round" real,"Pick" real,"Player" text,"Position" text,"Nationality" text,"College" text) | SELECT "College" FROM table_77264 WHERE "Round" > '9' AND "Player" = 'butch webster' |
could i have a list of flights in FIRST class on monday from SAN FRANCISCO to PITTSBURGH starting at 1200 and afterwards | 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 restriction (restriction_code text,advance_purchase int,stopovers text... | 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 AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, flight, flight_fare WHERE (((DAT... |
How many total Silver has a Bronze larger than 19 and a Total smaller than 125? | CREATE TABLE table_55759 ("Sport" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT SUM("Silver") FROM table_55759 WHERE "Bronze" > '19' AND "Total" < '125' |
What is the highest geohash length when the lat error is 0.00068, and the lat bits larger than 17? | CREATE TABLE table_7441 ("geohash length" real,"lat bits" real,"lng bits" real,"lat error" text,"lng error" text,"km error" text) | SELECT MAX("geohash length") FROM table_7441 WHERE "lat error" = '±0.00068' AND "lat bits" > '17' |
What is the lowest rank? | CREATE TABLE table_2126 ("Rank" real,"Couple" text,"Judges" real,"Public" real,"Total" real,"Vote percentage" text,"Result" text) | SELECT MIN("Rank") FROM table_2126 |
What was the value in 2012 when 2002 was Q1 and 2010 was 1R? | CREATE TABLE table_71531 ("Tournament" text,"2001" text,"2002" text,"2003" text,"2005" text,"2006" text,"2007" text,"2008" text,"2009" text,"2010" text,"2011" text,"2012" text) | SELECT "2012" FROM table_71531 WHERE "2002" = 'q1' AND "2010" = '1r' |
what are the three most commonly prescribed medications for patients for whom albumin human 25% is also prescribed at the same time, since 2103? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmen... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'albumin human 25%' AND STRFTIME('%y', medication.dr... |
Where the Vancouver Grizzlies is the awards, what is the conference? | CREATE TABLE table_name_29 (conference VARCHAR,awards VARCHAR) | SELECT conference FROM table_name_29 WHERE awards = "vancouver grizzlies" |
What is the country for the player Tiger Woods? | CREATE TABLE table_name_3 (country VARCHAR,player VARCHAR) | SELECT country FROM table_name_3 WHERE player = "tiger woods" |
What is the sum of the pick numbers for the player that went to San Miguel Beermen who played at San Sebastian? | CREATE TABLE table_42421 ("Pick" real,"Player" text,"Country of origin*" text,"PBA team" text,"College" text) | SELECT SUM("Pick") FROM table_42421 WHERE "PBA team" = 'san miguel beermen' AND "College" = 'san sebastian' |
Which Laid down has a Ship of fearless? | CREATE TABLE table_67044 ("Ship" text,"Pennant number" text,"Laid down" text,"Launched" text,"Commissioned" text) | SELECT "Laid down" FROM table_67044 WHERE "Ship" = 'fearless' |
since 12/30/2105, was patient 004-13127's temperature less than 37.778? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE patient (uniquepid text,patienthealthsystemsta... | SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-13127')) AND vitalperiodic.temperature < 37.778 AND NOT vitalper... |
how many songs are at most 3 minutes long ? | CREATE TABLE table_203_353 (id number,"#" number,"title" text,"producer(s)" text,"featured guest(s)" text,"time" text) | SELECT COUNT("title") FROM table_203_353 WHERE "time" < 3 |
what are the new meds of patient 006-172277 today compared to the one yesterday? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweigh... | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '006-172277') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medic... |
what is discharge location and discharge time of subject id 2560? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT demographic.discharge_location, demographic.dischtime FROM demographic WHERE demographic.subject_id = "2560" |
Show the pilot positions that have both pilots joining after year 2005 and pilots joining before 2000. | CREATE TABLE pilot_record (record_id number,pilot_id number,aircraft_id number,date text)CREATE TABLE pilot (pilot_id number,pilot_name text,rank number,age number,nationality text,position text,join_year number,team text)CREATE TABLE aircraft (aircraft_id number,order_year number,manufacturer text,model text,fleet_ser... | SELECT position FROM pilot WHERE join_year < 2000 INTERSECT SELECT position FROM pilot WHERE join_year > 2005 |
What is the record of the game with 28,135 people in attendance? | CREATE TABLE table_name_30 (record VARCHAR,attendance VARCHAR) | SELECT record FROM table_name_30 WHERE attendance = "28,135" |
Show different teams of technicians and the number of technicians in each team, list by the bar in desc. | CREATE TABLE technician (technician_id real,Name text,Team text,Starting_Year real,Age int)CREATE TABLE repair_assignment (technician_id int,repair_ID int,Machine_ID int)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 (... | SELECT Team, COUNT(*) FROM technician GROUP BY Team ORDER BY Team DESC |
A bar chart for what are the number of the descriptions of the categories that products with product descriptions that contain the letter t are in?, and display by the y-axis from high to low. | CREATE TABLE Product_Characteristics (product_id INTEGER,characteristic_id INTEGER,product_characteristic_value VARCHAR(50))CREATE TABLE Ref_Colors (color_code VARCHAR(15),color_description VARCHAR(80))CREATE TABLE Ref_Characteristic_Types (characteristic_type_code VARCHAR(15),characteristic_type_description VARCHAR(80... | SELECT product_category_description, COUNT(product_category_description) FROM Ref_Product_Categories AS T1 JOIN Products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' GROUP BY product_category_description ORDER BY COUNT(product_category_description) DESC |
What is the PBA team for roberto jabar who was picked before number 11? | CREATE TABLE table_65357 ("Pick" real,"Player" text,"Country of origin*" text,"PBA team" text,"College" text) | SELECT "PBA team" FROM table_65357 WHERE "Pick" < '11' AND "Player" = 'roberto jabar' |
Who was the interview subject on the date 1-97? | CREATE TABLE table_1566850_8 (interview_subject VARCHAR,date VARCHAR) | SELECT interview_subject FROM table_1566850_8 WHERE date = "1-97" |
Draw a bar chart about the distribution of Nationality and the amount of Nationality , and group by attribute Nationality, and I want to rank by the how many nationality from high to low. | CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 text,meter_400 text,meter_500 text,meter_600 text,meter_700 text,Time text)CREATE TABLE stadiu... | SELECT Nationality, COUNT(Nationality) FROM swimmer GROUP BY Nationality ORDER BY COUNT(Nationality) DESC |
on the last intensive care unit visit', what was maximum respiration of patient 007-11182? | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE lab (labid number,patientunitstayid num... | SELECT MAX(vitalperiodic.respiration) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-11182') AND NOT patient.unitdischargetime IS N... |
what type of aircraft is used on the flight from ATLANTA to PHILADELPHIA before 1200 | CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum_stay int,application text,no_discounts text)... | SELECT DISTINCT aircraft.aircraft_code FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND flight.departure_time < 1200 AND fl... |
Show the rank, first name, and last name for all the faculty. | CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)CREATE TABLE activity (actid number,activity_name text)CREATE TABLE participates_in (stuid number,actid number)CREATE TABLE faculty_participates_in (facid number,actid number)CREATE TABLE faculty (fac... | SELECT rank, fname, lname FROM faculty |
Show me a bar chart comparing the total number of captains of different classes. | CREATE TABLE captain (Captain_ID int,Name text,Ship_ID int,age text,Class text,Rank text)CREATE TABLE Ship (Ship_ID int,Name text,Type text,Built_Year real,Class text,Flag text) | SELECT Class, COUNT(Class) FROM captain GROUP BY Class |
what is the first test that patient 027-185580 had in their last hospital encounter? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number... | 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-185580' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmitt... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.