instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What is the earliest pick listed in the table.
CREATE TABLE table_16329 ("Pick #" real,"CFL Team" text,"Player" text,"Position" text,"College" text)
SELECT MIN("Pick #") FROM table_16329
Who is the Driver on Bob Keselowski's team?
CREATE TABLE table_71521 ("Team" text,"Car(s)" text,"Driver(s)" text,"Primary Sponsor(s)" text,"Owner(s)" text,"Crew Chief" text,"Rounds" real)
SELECT "Driver(s)" FROM table_71521 WHERE "Owner(s)" = 'bob keselowski'
tell me the three most frequent diagnoses?
CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE admissions (row_id number,su...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd GROUP BY diagnoses_icd.icd9_code) AS t1 WHERE t1.c1 <= 3)
What was the position for albums made by elbow with under 424,000 sales?
CREATE TABLE table_5521 ("Position" real,"Album title" text,"Artist" text,"Sales" real,"Peak" text)
SELECT AVG("Position") FROM table_5521 WHERE "Sales" < '424,000' AND "Artist" = 'elbow'
What is the nickname of the team whose 2013/2014 enrollment is 436?
CREATE TABLE table_22249 ("Team Name" text,"Schools" text,"Sports" text,"Host" text,"Nickname(s)" text,"Colors" text,"Enrollment (2013/14)" real)
SELECT "Nickname(s)" FROM table_22249 WHERE "Enrollment (2013/14)" = '436'
What is the last 10 meetings that have 11/26/1988 as the lasr meeting?
CREATE TABLE table_name_32 (last_10_meetings VARCHAR,last_meeting VARCHAR)
SELECT last_10_meetings FROM table_name_32 WHERE last_meeting = "11/26/1988"
What tournament has a 2008 value of A, q1 in 2005, and 1r in 2004?
CREATE TABLE table_50260 ("Tournament" text,"2002" text,"2003" text,"2004" text,"2005" text,"2006" text,"2007" text,"2008" text,"2009" text,"2010" text,"2011" text,"2012" text)
SELECT "Tournament" FROM table_50260 WHERE "2008" = 'a' AND "2005" = 'q1' AND "2004" = '1r'
How many totals have brazil as the nation, and a bronze less than 2?
CREATE TABLE table_name_89 (total INTEGER,nation VARCHAR,bronze VARCHAR)
SELECT SUM(total) FROM table_name_89 WHERE nation = "brazil" AND bronze < 2
how many male patients were admitted to the hospital before year 2139?
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_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.admityear < "2139"
chipper adams and justin beyendeza have how mnay wins ?
CREATE TABLE table_203_667 (id number,"year" number,"driver" text,"co-driver" text,"car" text,"notes" text)
SELECT COUNT(*) FROM table_203_667 WHERE "driver" = 'chipper adams' AND "co-driver" = 'justin beyendeza'
How many different production codes does the episode directed by Dominic Polcino have?
CREATE TABLE table_23767 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text)
SELECT COUNT("Production code") FROM table_23767 WHERE "Directed by" = 'Dominic Polcino'
What is the region for tv vtv?
CREATE TABLE table_60016 ("Name" text,"Region" text,"Programming" text,"Type" text,"Encryption" text)
SELECT "Region" FROM table_60016 WHERE "Name" = 'tv vtv'
when did patient 83038 get for the first time a lab test in this month?
CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE labevents (row_id number,subject_id number,hadm_id n...
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83038) AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') ORDER BY labevents.charttime LIMIT 1
What is the name of the DVD where the number of discs is greater than 2.0
CREATE TABLE table_17192 ("DVD Name" text,"Released" text,"Audio" text,"Aspect Ratio" text,"Duration" text,"Number of Episodes" real,"Num of Discs" real)
SELECT "DVD Name" FROM table_17192 WHERE "Num of Discs" > '2.0'
how much does patient 30733's arterial bp [diastolic] differ between last measured on the last icu visit compared to the first value measured on the last icu visit?
CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time...
SELECT (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 = 30733) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents...
What is the NBA draft result of the player from Washington, DC?
CREATE TABLE table_name_97 (nba_draft VARCHAR,hometown VARCHAR)
SELECT nba_draft FROM table_name_97 WHERE hometown = "washington, dc"
how many countries have remittances in 2008 of 9.07?
CREATE TABLE table_2941963_1 (country VARCHAR,remittances_2008 VARCHAR)
SELECT COUNT(country) FROM table_2941963_1 WHERE remittances_2008 = "9.07"
For those employees who was hired before 2002-06-21, give me the comparison about the sum of employee_id over the hire_date bin hire_date by weekday by a bar chart.
CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN...
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21'
Top SO users In Arizona.
CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,Ab...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE Reputation >= (SELECT Reputation FROM Users WHERE Id = 5285908) AND (UPPER(Location) LIKE '% AZ%' OR UPPER(Location) LIKE '% ARIZONA%') ORDER BY Reputation
What is Result, when Opponent is Cincinnati Bengals?
CREATE TABLE table_50144 ("Week" real,"Date" text,"Opponent" text,"Result" text,"TV Time" text,"Attendance" text)
SELECT "Result" FROM table_50144 WHERE "Opponent" = 'cincinnati bengals'
had patient 18866 got a diagnosis since 1 year 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 admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admissi...
SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18866) AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-1 year')
Which award-winning film has a closing date of September 4?
CREATE TABLE table_72993 ("Year" real,"Date (Opening)" text,"Date (Closing)" text,"Opening Film" text,"Number of Screening" text,"Award-Winning Film" text)
SELECT "Award-Winning Film" FROM table_72993 WHERE "Date (Closing)" = 'September 4'
how many patients admitted to emergency were treated with abacavir sulfate?
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.drug = "Abacavir Sulfate"
Erdo an Ar ca is the head coach at what venue?
CREATE TABLE table_21646 ("Team" text,"Head coach" text,"Team captain" text,"Venue" text,"Capacity" real,"Kitmaker" text,"Shirt sponsor" text,"Club Chairman" text)
SELECT "Venue" FROM table_21646 WHERE "Head coach" = 'Erdoğan Arıca'
i need a flight from BOSTON to PITTSBURGH
CREATE TABLE month (month_number int,month_name text)CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE days (days_code varchar,day_name varchar)CREATE T...
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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBU...
Who is the 92.5 with the press 282.5?
CREATE TABLE table_name_44 (press VARCHAR)
SELECT 925 FROM table_name_44 WHERE press = "282.5"
On what date was the away team Bournemouth?
CREATE TABLE table_60841 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text)
SELECT "Date" FROM table_60841 WHERE "Away team" = 'bournemouth'
What is Attendance, when Opponent is Montreal Alouettes, and when Date is Oct 4?
CREATE TABLE table_name_1 (attendance VARCHAR,opponent VARCHAR,date VARCHAR)
SELECT attendance FROM table_name_1 WHERE opponent = "montreal alouettes" AND date = "oct 4"
which was opened first ?
CREATE TABLE table_204_218 (id number,"name" text,"faith" text,"type" text,"gov" text,"opened" number,"intake" number,"dcsf number" number,"ofsted number" number,"web" text,"coordinates" text)
SELECT "name" FROM table_204_218 ORDER BY "opened" LIMIT 1
How many wins does he get when he starts at 10?
CREATE TABLE table_2169966_1 (wins VARCHAR,starts VARCHAR)
SELECT wins FROM table_2169966_1 WHERE starts = 10
what is the lowest number of sites when the headquarters are in columbus, ga and the rank is smaller than 4?
CREATE TABLE table_70061 ("Rank" real,"Circuit" text,"Headquarters" text,"Screens" real,"Sites" real)
SELECT MIN("Sites") FROM table_70061 WHERE "Headquarters" = 'columbus, ga' AND "Rank" < '4'
Which GNU/Linux had no haiku and a client of airdc++?
CREATE TABLE table_name_60 (gnu_linux VARCHAR,haiku VARCHAR,client VARCHAR)
SELECT gnu_linux FROM table_name_60 WHERE haiku = "no" AND client = "airdc++"
What are the naems of all the projects, and how many scientists were assigned to each of them, rank x axis in descending order.
CREATE TABLE AssignedTo (Scientist int,Project char(4))CREATE TABLE Projects (Code Char(4),Name Char(50),Hours int)CREATE TABLE Scientists (SSN int,Name Char(30))
SELECT Name, COUNT(*) FROM Projects AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project GROUP BY T1.Name ORDER BY Name DESC
Show me population by county name in a histogram, rank bar in asc order.
CREATE TABLE election (Election_ID int,Counties_Represented text,District int,Delegate text,Party int,First_Elected real,Committee text)CREATE TABLE party (Party_ID int,Year real,Party text,Governor text,Lieutenant_Governor text,Comptroller text,Attorney_General text,US_Senate text)CREATE TABLE county (County_Id int,Co...
SELECT County_name, Population FROM county ORDER BY County_name
What is the date of the game with a 17-31 record?
CREATE TABLE table_67446 ("Date" text,"Opponent" text,"Score" text,"Attendance" real,"Record" text)
SELECT "Date" FROM table_67446 WHERE "Record" = '17-31'
What was the surface later than 1979, for the Melbourne Indoor, Australia, and the score was 2 6, 6 2, 6 2?
CREATE TABLE table_61768 ("Outcome" text,"Date" real,"Championship" text,"Surface" text,"Opponent" text,"Score" text)
SELECT "Surface" FROM table_61768 WHERE "Date" > '1979' AND "Championship" = 'melbourne indoor, australia' AND "Score" = '2–6, 6–2, 6–2'
calculate patient 93104's length of stay of the last hospital stay that occurred.
CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE chartevents (row_id ...
SELECT STRFTIME('%j', admissions.dischtime) - STRFTIME('%j', admissions.admittime) FROM admissions WHERE admissions.subject_id = 93104 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1
how many currency does the region of africa have
CREATE TABLE table_204_321 (id number,"community" text,"currency" text,"region" text,"target date" number,"notes" text)
SELECT COUNT(DISTINCT "currency") FROM table_204_321 WHERE "region" = 'africa'
Draw a bar chart about the distribution of Nationality and the average of ID , and group by attribute Nationality, and list in desc by the y axis.
CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)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 stadium (ID int,name text,Capacity int,City text,Country text,Openin...
SELECT Nationality, AVG(ID) FROM swimmer GROUP BY Nationality ORDER BY AVG(ID) DESC
What is the general classification of stage 3
CREATE TABLE table_name_99 (general_classification VARCHAR,stage VARCHAR)
SELECT general_classification FROM table_name_99 WHERE stage = "3"
What is the density of ?
CREATE TABLE table_name_34 (density___km²_ VARCHAR,hanzi VARCHAR)
SELECT density___km²_ FROM table_name_34 WHERE hanzi = "昌黎县"
The player for what club had 2 tests?
CREATE TABLE table_27771406_1 (club VARCHAR,tests VARCHAR)
SELECT club FROM table_27771406_1 WHERE tests = 2
when was the first time that patient 52598 was prescribed with epinephrine until 01/2104?
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_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE admissions (row_id numbe...
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52598) AND prescriptions.drug = 'epinephrine' AND STRFTIME('%y-%m', prescriptions.startdate) <= '2104-01' ORDER BY prescriptions.startdate LIMIT 1
What season did the Sake Tuyas come in 1st place?
CREATE TABLE table_29619494_2 (season VARCHAR,sake_tuyas VARCHAR)
SELECT season FROM table_29619494_2 WHERE sake_tuyas = "1st"
Count of Tags relevant to Taxonomist. Returns the number of tags that would be eligible for awarding Taxonomist if it could be awarded multiple times
CREATE TABLE PostTags (PostId number,TagId number)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,Las...
SELECT COUNT(*) AS Tag_Count FROM Tags AS t WHERE t.Count >= 50
What was the result of the game played on November 23, 2003?
CREATE TABLE table_76999 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Kickoff Time" text,"Attendance" text)
SELECT "Result" FROM table_76999 WHERE "Date" = 'november 23, 2003'
What is the Airdate of the episode that ranked #29 and had a share greater than 10?
CREATE TABLE table_name_88 (airdate VARCHAR,share VARCHAR,rank VARCHAR)
SELECT airdate FROM table_name_88 WHERE share = 10 AND rank = "#29"
What is Run 1, when Athletes is 'Theo Kitt & Friedrich Kuhn'?
CREATE TABLE table_name_89 (run_1 VARCHAR,athletes VARCHAR)
SELECT run_1 FROM table_name_89 WHERE athletes = "theo kitt & friedrich kuhn"
What's the record of game number 23?
CREATE TABLE table_39661 ("Number" real,"Result" text,"Date" text,"Score" text,"Opponent" text,"Record" text)
SELECT "Record" FROM table_39661 WHERE "Number" = '23'
what's the 3rd day with 4th day being rowed-over
CREATE TABLE table_666 ("Year" real,"Finish position" text,"1st day" text,"2nd day" text,"3rd day" text,"4th Day" text)
SELECT "3rd day" FROM table_666 WHERE "4th Day" = 'rowed-over'
Questions which were bumped by community user many times.
CREATE TABLE ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate time,ReviewTaskStateId number,PostId number,SuggestedEditId number,CompletedByReviewTaskId number)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId...
SELECT RANK() OVER (ORDER BY COUNT(ph.Id) DESC) AS "rank", COUNT(ph.Id) AS "count", ph.PostId AS "post_link", 'site://posts/' + CAST(ph.PostId AS TEXT) + '/revisions' AS "revision_history" FROM PostHistory AS ph WHERE ph.PostHistoryTypeId = 50 GROUP BY ph.PostId ORDER BY COUNT(ph.Id) DESC
What's the smallest pick number of a player playing in Minnesota North Stars?
CREATE TABLE table_23129 ("Pick #" real,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text)
SELECT MIN("Pick #") FROM table_23129 WHERE "NHL team" = 'Minnesota North Stars'
How many problems are there for product voluptatem?
CREATE TABLE problems (product_id VARCHAR)CREATE TABLE product (product_id VARCHAR,product_name VARCHAR)
SELECT COUNT(*) FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id WHERE T1.product_name = "voluptatem"
What was the score for the game with a record of 11-22 and a H/A/N of A?
CREATE TABLE table_8033 ("Date" text,"H/A/N" text,"Opponent" text,"Score" text,"Record" text)
SELECT "Score" FROM table_8033 WHERE "H/A/N" = 'a' AND "Record" = '11-22'
what year was the memphis event?
CREATE TABLE table_42305 ("Aces" real,"Player" text,"Opponent" text,"Year" real,"Event" text,"Sets" real,"Result" text)
SELECT SUM("Year") FROM table_42305 WHERE "Event" = 'memphis'
what are the top five most frequent microbiology tests for patients who have been given anticoagulant administration - thrombin inhibitor since 2104 that were followed within 2 months?
CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE medication (medicationid number,patient...
SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'anticoagulant administration - thrombin inhi...
Please show the employee first names and ids of employees who serve at least 10 customers.
CREATE TABLE track (trackid number,name text,albumid number,mediatypeid number,genreid number,composer text,milliseconds number,bytes number,unitprice number)CREATE TABLE album (albumid number,title text,artistid number)CREATE TABLE customer (customerid number,firstname text,lastname text,company text,address text,city...
SELECT T1.firstname, T1.supportrepid FROM customer AS T1 JOIN employee AS T2 ON T1.supportrepid = T2.employeeid GROUP BY T1.supportrepid HAVING COUNT(*) >= 10
What is the team of the player from ohio state?
CREATE TABLE table_63005 ("Pick" real,"Team" text,"Player" text,"Position" text,"College" text)
SELECT "Team" FROM table_63005 WHERE "College" = 'ohio state'
For those records from the products and each product's manufacturer, find founder and the average of price , and group by attribute founder, and visualize them by a bar chart.
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 Founder, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder
the arterial bp [diastolic] of patient 8116 last measured on the current icu visit is greater than it was second to last measured on the current icu visit?
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 chartevents (row_id number,subject_id number,hadm_id number,icustay_id n...
SELECT (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 = 8116) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_it...
Visualize a bar chart for how many workshops did each author submit to? Return the author name and the number of workshops, and could you order names in desc order?
CREATE TABLE submission (Submission_ID int,Scores real,Author text,College text)CREATE TABLE Acceptance (Submission_ID int,Workshop_ID int,Result text)CREATE TABLE workshop (Workshop_ID int,Date text,Venue text,Name text)
SELECT Author, COUNT(DISTINCT T1.Workshop_ID) FROM Acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID ORDER BY Author DESC
Show me a bar chart for what are the different transaction types, and how many transactions of each have taken place?, list by the bar in ascending.
CREATE TABLE Customers (customer_id INTEGER,customer_first_name VARCHAR(20),customer_last_name VARCHAR(20),customer_address VARCHAR(255),customer_phone VARCHAR(255),customer_email VARCHAR(255),other_customer_details VARCHAR(255))CREATE TABLE Financial_Transactions (transaction_id INTEGER,previous_transaction_id INTEGER...
SELECT transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type ORDER BY transaction_type
has patient 010-40802 received a failure to wean diagnosis since 6 years ago.
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 patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid...
SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-40802')) AND diagnosis.diagnosisname = 'failure to wean' AND DATETIME(di...
What is the date when Joseph is the decision and San Jose is the home team?
CREATE TABLE table_name_40 (date VARCHAR,decision VARCHAR,home VARCHAR)
SELECT date FROM table_name_40 WHERE decision = "joseph" AND home = "san jose"
List high points from the April 7 game.
CREATE TABLE table_23248910_10 (high_points VARCHAR,date VARCHAR)
SELECT high_points FROM table_23248910_10 WHERE date = "April 7"
Sum the amount for all the payments processed with Visa by each year using a bar chart, and rank by the y-axis in asc.
CREATE TABLE Payments (Payment_ID INTEGER,Settlement_ID INTEGER,Payment_Method_Code VARCHAR(255),Date_Payment_Made DATE,Amount_Payment INTEGER)CREATE TABLE Customers (Customer_ID INTEGER,Customer_Details VARCHAR(255))CREATE TABLE Claims (Claim_ID INTEGER,Policy_ID INTEGER,Date_Claim_Made DATE,Date_Claim_Settled DATE,Am...
SELECT Date_Payment_Made, SUM(Amount_Payment) FROM Payments WHERE Payment_Method_Code = 'Visa' ORDER BY SUM(Amount_Payment)
What is the release date that has english as the subtitles, and magna pacific as the publisher?
CREATE TABLE table_name_61 (release_date VARCHAR,subtitles VARCHAR,publisher VARCHAR)
SELECT release_date FROM table_name_61 WHERE subtitles = "english" AND publisher = "magna pacific"
what is the drug type and drug route of drug code pheny100l?
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 prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "PHENY100L"
What is the Match with Points that are 24?
CREATE TABLE table_7547 ("Team" text,"Match" real,"Points" real,"Draw" real,"Lost" real)
SELECT "Match" FROM table_7547 WHERE "Points" = '24'
what voice acter played tien
CREATE TABLE table_38208 ("Character Name" text,"Voice Actor (Japanese)" text,"Voice Actor (English 1997 / Saban)" text,"Voice Actor (English 1998 / Pioneer)" text,"Voice Actor (English 2006 / FUNimation)" text)
SELECT "Voice Actor (Japanese)" FROM table_38208 WHERE "Character Name" = 'tien'
How many steals did Tamika Williams have?
CREATE TABLE table_27173 ("Player" text,"Minutes" real,"Field Goals" real,"Rebounds" real,"Assists" real,"Steals" real,"Blocks" real,"Points" real)
SELECT "Steals" FROM table_27173 WHERE "Player" = 'Tamika Williams'
What are the actual delivery dates of orders with quantity 1, and count them by a line chart
CREATE TABLE Bookings (Booking_ID INTEGER,Customer_ID INTEGER,Workshop_Group_ID VARCHAR(100),Status_Code CHAR(15),Store_ID INTEGER,Order_Date DATETIME,Planned_Delivery_Date DATETIME,Actual_Delivery_Date DATETIME,Other_Order_Details VARCHAR(255))CREATE TABLE Ref_Payment_Methods (payment_method_code CHAR(10),payment_meth...
SELECT Actual_Delivery_Date, COUNT(Actual_Delivery_Date) FROM Customer_Orders AS T1 JOIN Order_Items AS T2 ON T1.Order_ID = T2.Order_ID WHERE T2.Order_Quantity = 1 GROUP BY Actual_Delivery_Date
What was the aggregate score for the game against Dynamo Dresden?
CREATE TABLE table_40362 ("Round" text,"Opposition" text,"First leg" text,"Second leg" text,"Aggregate score" text)
SELECT "Aggregate score" FROM table_40362 WHERE "Opposition" = 'dynamo dresden'
What party is class 1 in wisconsin?
CREATE TABLE table_11775 ("Class" real,"State" text,"Name" text,"Party" text,"First took office" real,"Born" real)
SELECT "Party" FROM table_11775 WHERE "Class" = '1' AND "State" = 'wisconsin'
What is the most recent year where the final score is 4 6, 3 6, 6 4, 5 7?
CREATE TABLE table_22839669_1 (year INTEGER,score_in_the_final VARCHAR)
SELECT MAX(year) FROM table_22839669_1 WHERE score_in_the_final = "4–6, 3–6, 6–4, 5–7"
how many patients whose primary disease is gangrene?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,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.diagnosis = "GANGRENE"
how many days have elapsed since the first time patient 006-133605 had an intake of iv/ivpb: on the current icu visit?
CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature ...
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 =...
what were the three most common lab tests performed since 2 years ago for patients aged 60 or above?
CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TAB...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age >= 60) AND DATETIME(labevents.charttime) >= DATET...
Number of questions concerning xamarin development.
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 PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE ReviewTask...
SELECT COUNT(*) FROM Posts WHERE Id IN (SELECT DISTINCT (PostId) FROM PostTags WHERE TagId IN (SELECT Id FROM Tags WHERE TagName LIKE '%xamarin%'))
What is the minimum position when points are 32 and wins are greater than 13?
CREATE TABLE table_47738 ("Position" real,"Club" text,"Played" real,"Points" real,"Wins" real,"Draws" real,"Losses" real,"Goals for" real,"Goals against" real,"Goal Difference" real)
SELECT MIN("Position") FROM table_47738 WHERE "Points" = '32' AND "Wins" > '13'
What is the Kennel Club (UK) Toy Group with the shih-tzu as the American Kennel Club Toy Group breed?
CREATE TABLE table_38763 ("The Kennel Club (UK) Toy Group" text,"Canadian Kennel Club Toy Dogs Group" text,"American Kennel Club Toy Group" text,"Australian National Kennel Council Toy Dogs Group" text,"New Zealand Kennel Club Toy Group" text)
SELECT "The Kennel Club (UK) Toy Group" FROM table_38763 WHERE "American Kennel Club Toy Group" = 'shih-tzu'
what are the number of kurt maschler awards helen oxenbury has won ?
CREATE TABLE table_203_788 (id number,"year" number,"author" text,"illustrator" text,"title" text,"publisher" text)
SELECT COUNT(*) FROM table_203_788 WHERE "illustrator" = 'helen oxenbury'
Who is the winner when bigten (2-1) is the challenge leader?
CREATE TABLE table_21330550_2 (winner VARCHAR,challenge_leader VARCHAR)
SELECT winner FROM table_21330550_2 WHERE challenge_leader = "BigTen (2-1)"
how many people won in 1914
CREATE TABLE table_1342359_17 (district VARCHAR,first_elected VARCHAR)
SELECT COUNT(district) FROM table_1342359_17 WHERE first_elected = 1914
What Episode did Entrepreneur(s) Luke Booth and Christopher Eves take part?
CREATE TABLE table_71895 ("Episode" text,"First aired" text,"Entrepreneur(s)" text,"Company or product name" text,"Money requested (\u00a3)" text,"Investing Dragon(s)" text)
SELECT "Episode" FROM table_71895 WHERE "Entrepreneur(s)" = 'luke booth and christopher eves'
Which jockey had a group of G3?
CREATE TABLE table_36851 ("Result" text,"Date" text,"Race" text,"Venue" text,"Group" text,"Distance" text,"Weight (kg)" real,"Time" text,"Jockey" text,"Winner/2nd" text)
SELECT "Jockey" FROM table_36851 WHERE "Group" = 'g3'
What are the number of the facility codes of the apartments with more than four bedrooms?, and order by the total number in ascending please.
CREATE TABLE Apartment_Bookings (apt_booking_id INTEGER,apt_id INTEGER,guest_id INTEGER,booking_status_code CHAR(15),booking_start_date DATETIME,booking_end_date DATETIME)CREATE TABLE Apartments (apt_id INTEGER,building_id INTEGER,apt_type_code CHAR(15),apt_number CHAR(10),bathroom_count INTEGER,bedroom_count INTEGER,r...
SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code ORDER BY COUNT(facility_code)
Closed questions that need to be deleted.
CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)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 PostHistoryT...
SELECT CAST(DATEDIFF(DAY, ClosedDate, GETDATE()) AS FLOAT) AS Days, Posts.Title AS Title, 'https://stackoverflow.com/q/' + LTRIM(Posts.Id) AS url, Posts.Score AS Score FROM Posts WHERE CAST(DATEDIFF(DAY, ClosedDate, GETDATE()) AS FLOAT) != 0 AND Posts.Score <= '##Score##' ORDER BY -(CAST(DATEDIFF(DAY, ClosedDate, GETDA...
Among patients with icd9 code 4341, calculate the number of those who died in or before the year 2115.
CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2115.0" AND procedures.icd9_code = "4341"
Which date of Date of successor's formal installation has a State (class) of michigan (2)?
CREATE TABLE table_66239 ("State (class)" text,"Vacator" text,"Reason for change" text,"Successor" text,"Date of successor's formal installation" text)
SELECT "Date of successor's formal installation" FROM table_66239 WHERE "State (class)" = 'michigan (2)'
What was the record on January 17?
CREATE TABLE table_65657 ("Game" text,"Date" text,"Opponent" text,"Score" text,"Location/Attendance" text,"Record" text)
SELECT "Record" FROM table_65657 WHERE "Date" = 'january 17'
Return the colleges that have players who play the Midfielder position, as well as players who play the Defender position.
CREATE TABLE country (country_id number,country_name text,capital text,official_native_language text)CREATE TABLE team (team_id number,name text)CREATE TABLE player (player_id number,player text,years_played text,total_wl text,singles_wl text,doubles_wl text,team number)CREATE TABLE match_season (season number,player t...
SELECT college FROM match_season WHERE position = "Midfielder" INTERSECT SELECT college FROM match_season WHERE position = "Defender"
what team was the 1st leg champion of sakalai
CREATE TABLE table_name_98 (champion VARCHAR)
SELECT 1 AS st_leg FROM table_name_98 WHERE champion = "sakalai"
Show me a scatter plot of major and the average of age for .
CREATE TABLE Video_Games (GameID INTEGER,GName VARCHAR(40),GType VARCHAR(40))CREATE TABLE Plays_Games (StuID INTEGER,GameID INTEGER,Hours_Played INTEGER)CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1),Major INTEGER,Advisor INTEGER,city_code VARCHAR(3))CREATE TABLE Spor...
SELECT Major, AVG(Age) FROM Student GROUP BY Major
What is the lowest Rank of Denmark County with a Total smaller than 1?
CREATE TABLE table_name_2 (rank INTEGER,country VARCHAR,total VARCHAR)
SELECT MIN(rank) FROM table_name_2 WHERE country = "denmark" AND total < 1
what is the number of patients whose insurance is private and procedure icd9 code is 5059?
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.icd9_code = "5059"
what is the venue of neman
CREATE TABLE table_36030 ("Team" text,"Location" text,"Venue" text,"Capacity" real,"Position in 2001" text)
SELECT "Venue" FROM table_36030 WHERE "Team" = 'neman'
When the Venue is mcg what is the Home team?
CREATE TABLE table_name_47 (home_team VARCHAR,venue VARCHAR)
SELECT home_team FROM table_name_47 WHERE venue = "mcg"
What is the Opposition in the First Round of the UEFA Cup with a Score of 3 1 (h), 2 0 (a)?
CREATE TABLE table_63616 ("Season" text,"Competition" text,"Round" text,"Opposition" text,"Score" text)
SELECT "Opposition" FROM table_63616 WHERE "Round" = 'first round' AND "Competition" = 'uefa cup' AND "Score" = '3–1 (h), 2–0 (a)'
Visualize a bar chart for how many male and female assistant professors do we have?
CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1),Major INTEGER,Advisor INTEGER,city_code VARCHAR(3))CREATE TABLE Participates_in (stuid INTEGER,actid INTEGER)CREATE TABLE Activity (actid INTEGER,activity_name varchar(25))CREATE TABLE Faculty_Participates_in (FacID INTEG...
SELECT Sex, COUNT(*) FROM Faculty WHERE Rank = "AsstProf" GROUP BY Sex