instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Which highest overall figure had Robert Alford as a name and a round of more than 2? | CREATE TABLE table_name_89 (overall INTEGER,name VARCHAR,round VARCHAR) | SELECT MAX(overall) FROM table_name_89 WHERE name = "robert alford" AND round > 2 |
Name the total number of points for newell's old boys | CREATE TABLE table_17968282_1 (points VARCHAR,team VARCHAR) | SELECT COUNT(points) FROM table_17968282_1 WHERE team = "Newell's Old Boys" |
May I sign up for 100 -level classes in Spring or Summer term ? | 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 comment_instructor (instructor_id int,student_id ... | SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURS... |
What song was in french? | CREATE TABLE table_76347 ("Draw" real,"Language" text,"Artist" text,"Song" text,"English translation" text,"Place" real,"Points" real) | SELECT "Song" FROM table_76347 WHERE "Language" = 'french' |
What's the name of the episode associated with Nick production number 342? | CREATE TABLE table_28767 ("Season #" real,"Series #" real,"Episode title" text,"Original air date" text,"Nick prod. #" real) | SELECT "Episode title" FROM table_28767 WHERE "Nick prod. #" = '342' |
What Leading scorer had a Score of 80 112? | CREATE TABLE table_name_98 (leading_scorer VARCHAR,score VARCHAR) | SELECT leading_scorer FROM table_name_98 WHERE score = "80–112" |
was the value of patient 016-38131's bun last measured on the current hospital visit less than they were first measured on the current hospital visit? | CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text... | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-38131' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'bun' ... |
What is on at 5pm on the channel where As the World Turns is on at 2pm? | CREATE TABLE table_61209 ("7:00 am" text,"7:30 am" text,"8:00 am" text,"9:00 am" text,"10:00 am" text,"11:00 am" text,"noon" text,"12:30 pm" text,"1:00 pm" text,"1:30 pm" text,"2:00 pm" text,"3:00 pm" text,"3:30 pm" text,"5:00 pm" text,"6:30 pm" text) | SELECT "5:00 pm" FROM table_61209 WHERE "2:00 pm" = 'as the world turns' |
Are there any sections of EECS 767 offered after 07:30 P.M. ? | CREATE TABLE course_tags_count (course_id int,clear_grading int,pop_quiz int,group_projects int,inspirational int,long_lectures int,extra_credit int,few_tests int,good_feedback int,tough_tests int,heavy_papers int,cares_for_students int,heavy_assignments int,respected int,participation int,heavy_reading int,tough_grade... | SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.start_time > '07:30' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 767 AND semester.semester = 'WN' AND ... |
Name the most interview for minnesota and average more than 7.901 | CREATE TABLE table_57084 ("State" text,"Interview" real,"Swimsuit" real,"Evening gown" real,"Average" real) | SELECT MAX("Interview") FROM table_57084 WHERE "State" = 'minnesota' AND "Average" > '7.901' |
In the game where the Hornets were the home team and Clippers the visiting team, what is the score? | CREATE TABLE table_56666 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Leading scorer" text,"Attendance" real,"Record" text) | SELECT "Score" FROM table_56666 WHERE "Home" = 'hornets' AND "Visitor" = 'clippers' |
Tag Usage - Presentation Frameworks. | CREATE TABLE Posts (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,Tags text,Ans... | SELECT t.TagName, COUNT(p.Id) AS Posts, SUM(CASE WHEN p.AnswerCount > 0 THEN 1 ELSE 0 END) AS Answered FROM Tags AS t INNER JOIN PostTags AS pta ON t.Id = pta.TagId INNER JOIN Posts AS p ON p.Id = pta.PostId AND p.PostTypeId = 1 WHERE t.TagName IN ('angular', 'ember.js', 'reactjs', 'vuejs2') GROUP BY t.TagName |
What was the highest money when the score was 69-68-67-69=273? | CREATE TABLE table_62549 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money ($)" real) | SELECT MAX("Money ( $ )") FROM table_62549 WHERE "Score" = '69-68-67-69=273' |
Who were the opponents during week 14? | CREATE TABLE table_name_53 (opponent VARCHAR,week VARCHAR) | SELECT opponent FROM table_name_53 WHERE week = 14 |
tell me patient 10624's minimum bands value this month? | 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 d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay... | SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10624) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bands') AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURR... |
After 1961, who as the Entrant when the engine was a Ferrari v8, and when the points were lower than 23? | CREATE TABLE table_name_64 (entrant VARCHAR,points VARCHAR,year VARCHAR,engine VARCHAR) | SELECT entrant FROM table_name_64 WHERE year > 1961 AND engine = "ferrari v8" AND points < 23 |
What are the nationalities and the taotal ages of journalists. Visualize by a bar chart. | CREATE TABLE news_report (journalist_ID int,Event_ID int,Work_Type text)CREATE TABLE event (Event_ID int,Date text,Venue text,Name text,Event_Attendance int)CREATE TABLE journalist (journalist_ID int,Name text,Nationality text,Age text,Years_working int) | SELECT Nationality, SUM(Age) FROM journalist GROUP BY Nationality |
Which award was given for the role of Elphaba in 2009? | CREATE TABLE table_43430 ("Year" text,"Award" text,"Production" text,"Role" text,"Result" text) | SELECT "Award" FROM table_43430 WHERE "Role" = 'elphaba' AND "Year" = '2009' |
What was the result when incumbent Tom Steed was elected? | CREATE TABLE table_1342198_36 (result VARCHAR,incumbent VARCHAR) | SELECT result FROM table_1342198_36 WHERE incumbent = "Tom Steed" |
Term Ending smaller than 2018, and a Nationality of new zealand what is the name? | CREATE TABLE table_5255 ("Name" text,"Nationality" text,"Position" text,"Tenure Began" real,"Term Ending" real) | SELECT "Name" FROM table_5255 WHERE "Term Ending" < '2018' AND "Nationality" = 'new zealand' |
What is the name of series episode 11-02's segment c? | CREATE TABLE table_15187735_11 (segment_c VARCHAR,series_ep VARCHAR) | SELECT segment_c FROM table_15187735_11 WHERE series_ep = "11-02" |
Can you tell me the High rebounds that has the Date of november 5? | CREATE TABLE table_name_16 (high_rebounds VARCHAR,date VARCHAR) | SELECT high_rebounds FROM table_name_16 WHERE date = "november 5" |
A bar chart shows the number of appellations whose score is higher than 93, and ordered by Name. | CREATE TABLE wine (No INTEGER,Grape TEXT,Winery TEXT,Appelation TEXT,State TEXT,Name TEXT,Year INTEGER,Price INTEGER,Score INTEGER,Cases INTEGER,Drink TEXT)CREATE TABLE appellations (No INTEGER,Appelation TEXT,County TEXT,State TEXT,Area TEXT,isAVA TEXT)CREATE TABLE grapes (ID INTEGER,Grape TEXT,Color TEXT) | SELECT Appelation, COUNT(Appelation) FROM wine WHERE Score > 93 GROUP BY Appelation ORDER BY Name |
what is minimum age of patients whose days of hospital stay is 29 and admission year is greater than or equal to 2107? | 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 text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethni... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.days_stay = "29" AND demographic.admityear >= "2107" |
Which Surface has a Week of march 1? | CREATE TABLE table_8542 ("Tournament" text,"Surface" text,"Week" text,"Winner and score" text,"Finalist" text,"Semifinalists" text) | SELECT "Surface" FROM table_8542 WHERE "Week" = 'march 1' |
Find the names of all the product characteristics. | CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR) | SELECT DISTINCT characteristic_name FROM CHARACTERISTICS |
on what date did the bears win by a difference of 27 points ? | CREATE TABLE table_204_207 (id number,"week" number,"date" text,"opponent" text,"result" text,"attendance" number,"bye" text) | SELECT "date" FROM table_204_207 WHERE "result" = 'w' AND "result" - "result" = 27 |
Who was in 2nd leg when Boca Juniors was in home (1st leg)? | CREATE TABLE table_14219514_1 (home__1st_leg_ VARCHAR) | SELECT 2 AS nd_leg FROM table_14219514_1 WHERE home__1st_leg_ = "Boca Juniors" |
how many times did debbie black block | CREATE TABLE table_19722233_5 (blocks VARCHAR,player VARCHAR) | SELECT blocks FROM table_19722233_5 WHERE player = "Debbie Black" |
Who had the decision goal when the record was 7-7-2? | CREATE TABLE table_name_83 (decision VARCHAR,record VARCHAR) | SELECT decision FROM table_name_83 WHERE record = "7-7-2" |
what were the top four most common drugs that followed during the same hospital visit for the patients who were given lt heart angiocardiogram during the previous year? | CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,discht... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR... |
Show the name, home city, and age for all drivers. | CREATE TABLE driver (name VARCHAR,home_city VARCHAR,age VARCHAR) | SELECT name, home_city, age FROM driver |
how many patients are admitted urgently and lab tested for bilirubin,direct? | 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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.label = "Bilirubin, Direct" |
what is the number of patients whose marital status is married and procedure long title is percutaneous [endoscopic] gastrostomy [peg]? | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "MARRIED" AND procedures.long_title = "Percutaneous [endoscopic] gastrostomy [PEG]" |
Which is the highest Rd 1 has a Province of utrecht and a Rd 4 larger than 0? | CREATE TABLE table_name_70 (rd_1 INTEGER,province VARCHAR,rd_4 VARCHAR) | SELECT MAX(rd_1) FROM table_name_70 WHERE province = "utrecht" AND rd_4 > 0 |
how old is the youngest person for each job?, and could you order x-axis from low to high order? | CREATE TABLE Person (name varchar(20),age INTEGER,city TEXT,gender TEXT,job TEXT)CREATE TABLE PersonFriend (name varchar(20),friend varchar(20),year INTEGER) | SELECT job, MIN(age) FROM Person GROUP BY job ORDER BY job |
what was the teams final record | CREATE TABLE table_204_123 (id number,"week" number,"date" text,"kickoff" text,"opponent" text,"results\nfinal score" text,"results\nteam record" text,"game site" text,"attendance" number) | SELECT "results\nteam record" FROM table_204_123 ORDER BY "week" DESC LIMIT 1 |
What is the average number in attendance on September 16? | CREATE TABLE table_name_23 (attendance INTEGER,date VARCHAR) | SELECT AVG(attendance) FROM table_name_23 WHERE date = "september 16" |
What classes are required to declare a major in CLARCH ? | CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,en... | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%CLARCH%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id |
How many original air dates were there for the episode with production code 212? | CREATE TABLE table_23937219_3 (original_air_date VARCHAR,prod_code VARCHAR) | SELECT COUNT(original_air_date) FROM table_23937219_3 WHERE prod_code = 212 |
what is the capacity when the acceleration 1-100km/h is 11.1 s? | CREATE TABLE table_name_39 (capacity VARCHAR,acceleration_0_100km_h VARCHAR) | SELECT capacity FROM table_name_39 WHERE acceleration_0_100km_h = "11.1 s" |
Name the To par of payne stewart? | CREATE TABLE table_name_4 (to_par VARCHAR,player VARCHAR) | SELECT to_par FROM table_name_4 WHERE player = "payne stewart" |
what is minimum age of patients whose primary disease is aortic insufficiency\re-do sternotomy; aortic valve replacement and days of hospital stay is 20? | 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 text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethni... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT " AND demographic.days_stay = "20" |
how many employees does vitol have ? | CREATE TABLE table_203_83 (id number,"ranking" number,"company" text,"industry" text,"revenue (usd billions)" text,"fy" text,"capitalization (usd billions)" text,"employees" number,"listing" text,"headquarters" text,"ceo" text) | SELECT "employees" FROM table_203_83 WHERE "company" = 'vitol' |
What was E.J. 'Dutch' Harrison's lowest To Par? | CREATE TABLE table_70516 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" real,"Money ($)" text) | SELECT MIN("To par") FROM table_70516 WHERE "Player" = 'e.j. "dutch" harrison' |
count the number of private health insurance patients who had transplant from cadaver. | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.short_title = "Transplant cadaver donor" |
Name the centennial for location | CREATE TABLE table_20448 ("Information" text,"Akimel A-al The name is Tohono Oodham for children of the river" text,"Altade\u00f1a" text,"Aprende" text,"Centennial" text,"Kyrene MS" text,"del Pueblo" text) | SELECT "Centennial" FROM table_20448 WHERE "Information" = 'Location' |
What are the invoice dates, order ids, and order details for all invoices? | CREATE TABLE financial_transactions (transaction_id number,account_id number,invoice_number number,transaction_type text,transaction_date time,transaction_amount number,transaction_comment text,other_transaction_details text)CREATE TABLE invoices (invoice_number number,order_id number,invoice_date time)CREATE TABLE cus... | SELECT T1.invoice_date, T1.order_id, T2.order_details FROM invoices AS T1 JOIN orders AS T2 ON T1.order_id = T2.order_id |
give me the number of patients whose primary disease is newborn and lab test abnormal status is abnormal? | 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 diagnoses (subject_id text,hadm_id text,icd9_code text,sho... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "NEWBORN" AND lab.flag = "abnormal" |
what is the home city for the stadion src mladost? | CREATE TABLE table_44912 ("Team" text,"Manager" text,"Home city" text,"Stadium" text,"Capacity" real) | SELECT "Home city" FROM table_44912 WHERE "Stadium" = 'stadion src mladost' |
How close am I to the sportsmanship badge?. | CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE Users (Id numb... | WITH CandidatePosts AS (SELECT ParentId AS postId FROM Posts AS p WHERE p.OwnerUserId = '##UserId##' AND p.PostTypeId = 2 AND p.Score > 0) SELECT p1.Id AS "post_link", p1.OwnerUserId AS "user_link", Body FROM Posts AS p1 JOIN CandidatePosts AS cp ON cp.postId = p1.ParentId WHERE p1.OwnerUserId != '##UserId##' ORDER BY ... |
list ground transportation in BALTIMORE | CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,fare_airline text,restriction_code text,o... | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'BALTIMORE' AND ground_service.city_code = city.city_code |
How many players are listed for the school/club team Washington? | CREATE TABLE table_20094 ("Name" text,"Position" text,"Number" real,"School/Club Team" text,"Season" text,"Acquisition via" text) | SELECT COUNT("Name") FROM table_20094 WHERE "School/Club Team" = 'Washington' |
What type of chipset is in the Precision t3400 model with the PCI Express graphics? | CREATE TABLE table_name_97 (chipset VARCHAR,graphics VARCHAR,model VARCHAR) | SELECT chipset FROM table_name_97 WHERE graphics = "pci express" AND model = "precision t3400" |
Find the name and gender type of the dorms whose capacity is greater than 300 or less than 100. | CREATE TABLE dorm (dormid number,dorm_name text,student_capacity number,gender text)CREATE TABLE lives_in (stuid number,dormid number,room_number number)CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)CREATE TABLE has_amenity (dormid number,amenid ... | SELECT dorm_name, gender FROM dorm WHERE student_capacity > 300 OR student_capacity < 100 |
For those payments processed with Visa, bin the payment day into the Day of Week interval and compute the total amount payment as the Y-axis. | CREATE TABLE Customers (Customer_ID INTEGER,Customer_Details VARCHAR(255))CREATE TABLE Payments (Payment_ID INTEGER,Settlement_ID INTEGER,Payment_Method_Code VARCHAR(255),Date_Payment_Made DATE,Amount_Payment INTEGER)CREATE TABLE Settlements (Settlement_ID INTEGER,Claim_ID INTEGER,Date_Claim_Made DATE,Date_Claim_Settle... | SELECT Date_Payment_Made, SUM(Amount_Payment) FROM Payments WHERE Payment_Method_Code = 'Visa' |
Tell me the highest total when the horse is spender s | CREATE TABLE table_name_99 (total INTEGER,horse VARCHAR) | SELECT MAX(total) FROM table_name_99 WHERE horse = "spender s" |
What is the air date for 'there goes the bride'? | CREATE TABLE table_19608 ("Series #" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production Code" real,"U.S. viewers (millions)" text) | SELECT "Original air date" FROM table_19608 WHERE "Title" = 'There Goes the Bride' |
list the flights from ST. PAUL to SAN JOSE and from ST. PAUL to HOUSTON | CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE days (days_code varchar,day_name varchar)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)CREATE TABLE date_day (month_numb... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight WHERE ((flight.to_airport = AIRPORT_SERVICE_1.airport_code AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND... |
Give me a bar chart about the number of platforms in different locations, and I want to list from high to low by the total number please. | CREATE TABLE train (Train_ID int,Name text,Time text,Service text)CREATE TABLE station (Station_ID int,Name text,Annual_entry_exit real,Annual_interchanges real,Total_Passengers real,Location text,Main_Services text,Number_of_Platforms int)CREATE TABLE train_station (Train_ID int,Station_ID int) | SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location ORDER BY SUM(Number_of_Platforms) DESC |
what is the wins when the f/laps is test driver and team is lotus racing? | CREATE TABLE table_44077 ("Season" text,"Series" text,"Team" text,"Races" text,"Wins" text,"Poles" text,"F/Laps" text,"Podiums" text,"Points" text,"Pos." text) | SELECT "Wins" FROM table_44077 WHERE "F/Laps" = 'test driver' AND "Team" = 'lotus racing' |
What was the final record for the game in which Dirk Nowitzki (19) had the high points? | CREATE TABLE table_21474 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "Record" FROM table_21474 WHERE "High points" = 'Dirk Nowitzki (19)' |
What is the record where high assists is pierce (6)? | CREATE TABLE table_17290 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "Record" FROM table_17290 WHERE "High assists" = 'Pierce (6)' |
Which Chinese has a Pali of atappa? | CREATE TABLE table_45211 ("English" text,"Pali" text,"Sanskrit" text,"Chinese" text,"Tibetan" text) | SELECT "Chinese" FROM table_45211 WHERE "Pali" = 'atappa' |
what are the four most frequently ordered microbiology tests for patients who received glucose - d5ns earlier within 2 months since 2 years ago? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsyste... | 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 = 'glucose - d5ns' AND DATETIME(treatment.treat... |
what was the number of aneurysm resection / repair procedures that were performed a year before? | CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesit... | SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'aneurysm resection / repair' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') |
count the number of patients whose ethnicity is asian and diagnoses long title is suicide and self-inflicted injury by hanging? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "ASIAN" AND diagnoses.long_title = "Suicide and self-inflicted injury by hanging" |
What is the total number of losses for the Team of Montreal with Goals For larger than 29? | CREATE TABLE table_11770 ("Team" text,"Games Played" real,"Wins" real,"Losses" real,"Ties" real,"Goals For" real,"Goals Against" real) | SELECT COUNT("Losses") FROM table_11770 WHERE "Goals For" > '29' AND "Team" = 'montreal' |
what is the side-chain polarity for the amino acid with the 1-letter v? | CREATE TABLE table_55835 ("Amino Acid" text,"3-Letter" text,"1-Letter" text,"Side-chain polarity" text,"Side-chain charge (pH 7.4)" text,"Hydropathy index" text) | SELECT "Side-chain polarity" FROM table_55835 WHERE "1-Letter" = 'v' |
What is the average number of cuts made in events with fewer than 1 win and exactly 11 top-10s? | CREATE TABLE table_name_93 (cuts_made INTEGER,top_10 VARCHAR,wins VARCHAR) | SELECT AVG(cuts_made) FROM table_name_93 WHERE top_10 = 11 AND wins < 1 |
count the number of patients born before the year 2049. | 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 lab (subject_id text,hadm_id text,itemid text,charttime te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dob_year < "2049" |
give me the number of patients whose primary disease is newborn and procedure icd9 code is 5361? | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "NEWBORN" AND procedures.icd9_code = "5361" |
What are the open dates and years for the shop named Apple? | CREATE TABLE device (device_id number,device text,carrier text,package_version text,applications text,software_platform text)CREATE TABLE stock (shop_id number,device_id number,quantity number)CREATE TABLE shop (shop_id number,shop_name text,location text,open_date text,open_year number) | SELECT open_date, open_year FROM shop WHERE shop_name = "Apple" |
specify the type and route of administration of drug digoxin | 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 demographic (subject_id text,hadm_id t... | SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Digoxin" |
return me the paper after 2000 in VLDB conference with more than 200 citations . | CREATE TABLE domain_publication (did int,pid int)CREATE TABLE domain_conference (cid int,did int)CREATE TABLE publication_keyword (kid int,pid int)CREATE TABLE domain_keyword (did int,kid int)CREATE TABLE author (aid int,homepage varchar,name varchar,oid int)CREATE TABLE publication (abstract varchar,cid int,citation_n... | SELECT publication.title FROM conference, publication WHERE conference.name = 'VLDB' AND publication.cid = conference.cid AND publication.citation_num > 200 AND publication.year > 2000 |
May I look at my transcript ? | CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE area (course_id int,area varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,tota... | SELECT DISTINCT course.department, course.name, course.number, semester.semester, semester.year, student_record.grade FROM course, semester, student_record WHERE student_record.course_id = course.course_id AND student_record.semester = semester.semester_id AND student_record.student_id = 1 |
All questions with a *single* tag. | CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score number,ApprovedByUserId number,ApprovalDate time)CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteU... | SELECT Id AS "post_link", AnswerCount FROM Posts WHERE PostTypeId = 1 AND Tags = CONCAT('<', '##Tag:string##', '>') AND ClosedDate IS NULL ORDER BY CreationDate DESC |
Show me a scatter plot of time of purchase and age for . | CREATE TABLE happy_hour (HH_ID int,Shop_ID int,Month text,Num_of_shaff_in_charge int)CREATE TABLE member (Member_ID int,Name text,Membership_card text,Age int,Time_of_purchase int,Level_of_membership int,Address text)CREATE TABLE shop (Shop_ID int,Address text,Num_of_staff text,Score real,Open_Year text)CREATE TABLE ha... | SELECT Time_of_purchase, Age FROM member |
actually what are the nonstop flights from LAS VEGAS to BURBANK on saturday 5 22 | CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,time_zone_code varchar)CREATE TABLE month (month_number int,month_name text)CREATE TABLE airline (airline_code varchar,airline_name text,no... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BURBANK' AND date_day.day_number = 22 AND date_day.month_number = 5 AND ... |
What shirt No has a Birth Date of April 12, 1986 (age27)? | CREATE TABLE table_name_63 (shirt_no INTEGER,birth_date VARCHAR) | SELECT MIN(shirt_no) FROM table_name_63 WHERE birth_date = "april 12, 1986 (age27)" |
What is the smallest lost when position is larger than 6, drawn is 7, and the points stat is less than 15? | CREATE TABLE table_34592 ("Position" real,"Team" text,"Points" real,"Played" real,"Drawn" real,"Lost" real,"Against" real,"Difference" text) | SELECT MIN("Lost") FROM table_34592 WHERE "Position" > '6' AND "Drawn" = '7' AND "Points" < '15' |
What was the grid for Bruno Junqueira for Dale Coyne Racing? | CREATE TABLE table_name_45 (grid VARCHAR,team VARCHAR,driver VARCHAR) | SELECT grid FROM table_name_45 WHERE team = "dale coyne racing" AND driver = "bruno junqueira" |
what is the number of patients whose lab test fluid is urine? | 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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.fluid = "Urine" |
what is the number of patients with discharge location as snf diagnosed with primary disease hyperglycemia? | 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.discharge_location = "SNF" AND demographic.diagnosis = "HYPERGLYCEMIA" |
what was the organism found in the last urine, catheter specimen microbiology test for patient 025-19271 in their last hospital visit? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number... | SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-19271' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient... |
how many patients who have private insurance stayed in hospital for more than 9 days? | 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 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 WHERE demographic.insurance = "Private" AND demographic.days_stay > "9" |
get data for inverted index assignment. | CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,... | SELECT Id, Body, Tags FROM Posts WHERE CreationDate LIKE '%2018%' LIMIT 1000 |
In what year was Yauco, which had over 42,043 people in 2010, founded? | CREATE TABLE table_65006 ("Municipality" text,"FIPS code" real,"Founded" real,"Population (2010)" real,"Area" text) | SELECT AVG("Founded") FROM table_65006 WHERE "Municipality" = 'yauco' AND "Population (2010)" > '42,043' |
Return a histogram on what are the first names and ids for customers who have two or more accounts? | CREATE TABLE Order_Items (order_item_id INTEGER,order_id INTEGER,product_id INTEGER,product_quantity VARCHAR(50),other_order_item_details VARCHAR(255))CREATE TABLE Products (product_id INTEGER,parent_product_id INTEGER,production_type_code VARCHAR(15),unit_price DECIMAL(19,4),product_name VARCHAR(80),product_color VARC... | SELECT T2.customer_first_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id |
what was the name of the organism found during the first other microbiology examination of patient 031-23724 in their last hospital encounter? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemic... | SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23724' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient... |
what number of patients primarily diagnosed for coronary artery disease were given drug by inhalation? | 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 text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethni... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE" AND prescriptions.route = "INHALATION" |
What is the home team with scarborough as the away team? | CREATE TABLE table_name_50 (home_team VARCHAR,away_team VARCHAR) | SELECT home_team FROM table_name_50 WHERE away_team = "scarborough" |
What upper level electives are offered for CS majors ? | CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE course_offering (offering_id int,course_id int,semester in... | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id |
For the 2nd string of Do and an Accord du 1st string of FA what is the Depart de la main gauche? | CREATE TABLE table_76895 ("Mode" text,"D\u00e9part de la main gauche" text,"Accord du 1st string" text,"2nd string" text,"3rd string" text) | SELECT "D\u00e9part de la main gauche" FROM table_76895 WHERE "2nd string" = 'do' AND "Accord du 1st string" = 'fa' |
Find the total number of students for each department with a bar chart, and could you list y axis in descending order? | CREATE TABLE classroom (building varchar(15),room_number varchar(7),capacity numeric(4,0))CREATE TABLE advisor (s_ID varchar(5),i_ID varchar(5))CREATE TABLE instructor (ID varchar(5),name varchar(20),dept_name varchar(20),salary numeric(8,2))CREATE TABLE prereq (course_id varchar(8),prereq_id varchar(8))CREATE TABLE te... | SELECT T1.dept_name, COUNT(DISTINCT T2.ID) FROM department AS T1 JOIN student AS T2 ON T1.dept_name = T2.dept_name JOIN instructor AS T3 ON T1.dept_name = T3.dept_name ORDER BY COUNT(DISTINCT T2.ID) DESC |
does toronto 's population grow more or less than hamilton 's ? | CREATE TABLE table_204_113 (id number,"rank" number,"area" text,"state/\nprovince" text,"csa/cma\n2009 population" number,"projected\n2025 population" number,"projected increase\n2009-2025" number) | SELECT (SELECT "projected increase\n2009-2025" FROM table_204_113 WHERE "area" = 'toronto') > (SELECT "projected increase\n2009-2025" FROM table_204_113 WHERE "area" = 'hamilton') |
provide the number of patients whose marital status is married and admission year is less than 2108? | 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.marital_status = "MARRIED" AND demographic.admityear < "2108" |
What is the draw number that has 59 points? | CREATE TABLE table_54761 ("Draw" real,"Artist" text,"Song" text,"Points" real,"Place" text) | SELECT AVG("Draw") FROM table_54761 WHERE "Points" = '59' |
what is maximum age of patients whose language is engl and primary disease is hypertension;rule out coronary artery disease\cardiac cath? | 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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.language = "ENGL" AND demographic.diagnosis = "HYPERTENSION;RULE OUT CORONARY ARTERY DISEASE\CARDIAC CATH" |
what was patient 025-30850's weight the last time in 06/2105? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid numbe... | SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-30850') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y-%m', patient.unitadmittime) = '2105-06' ORDER BY patient.unitadmittime DESC LIMIT ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.