instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Name the least pa for w being 2 | CREATE TABLE table_31201 ("Skip (Club)" text,"W" real,"L" real,"PF" real,"PA" real,"Ends Won" real,"Ends Lost" real,"Blank Ends" real,"Stolen Ends" real) | SELECT MIN("PA") FROM table_31201 WHERE "W" = '2' |
All questions with Bounty with tag android. | 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 PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time... | SELECT Posts.CreationDate, Posts.Id, Votes.BountyAmount, Posts.Title, Posts.AcceptedAnswerId, Posts.Tags FROM Posts LEFT JOIN Votes ON Votes.PostId = Posts.Id WHERE Posts.Tags LIKE ('%##Tag##%') AND BountyAmount > 0 ORDER BY Posts.CreationDate DESC LIMIT 30 |
On which day and in which zip code was the min dew point lower than any day in zip code 94107? | CREATE TABLE weather (date VARCHAR,zip_code VARCHAR,min_dew_point_f INTEGER) | SELECT date, zip_code FROM weather WHERE min_dew_point_f < (SELECT MIN(min_dew_point_f) FROM weather WHERE zip_code = 94107) |
Name the Gross-to-date which has a Date of august 23 25? | CREATE TABLE table_name_53 (gross_to_date VARCHAR,date VARCHAR) | SELECT gross_to_date FROM table_name_53 WHERE date = "august 23–25" |
Give me a pie chart about the proportion of the number of platforms in different locations. | 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 |
Which January has a Game of 50? | CREATE TABLE table_5376 ("Game" real,"January" real,"Opponent" text,"Score" text,"Record" text,"Points" real) | SELECT AVG("January") FROM table_5376 WHERE "Game" = '50' |
Top 50 SO Users from Iran. | 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 Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,Content... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%iran' ORDER BY Reputation DESC LIMIT 50 |
Find the first name and last name of the instructor of course that has course name | CREATE TABLE COURSE (Instructor VARCHAR,CName VARCHAR)CREATE TABLE FACULTY (Fname VARCHAR,Lname VARCHAR,FacID VARCHAR) | SELECT T2.Fname, T2.Lname FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID WHERE T1.CName = "COMPUTER LITERACY" |
What are the upper level options next semester that do not meet on Friday ? | CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time,monday varchar,tuesday varchar,wednesday varchar,thursday varchar,friday varchar,saturday varchar,sunday varchar,has_final_project varchar,has_final_exam varchar,textbook varchar,class_address varch... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.friday = 'N' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'FA' ... |
How old is the youngest person for each job Visualize by bar chart, could you list in ascending by the names? | CREATE TABLE PersonFriend (name varchar(20),friend varchar(20),year INTEGER)CREATE TABLE Person (name varchar(20),age INTEGER,city TEXT,gender TEXT,job TEXT) | SELECT job, MIN(age) FROM Person GROUP BY job ORDER BY job |
Bar chart x axis name y axis the number of name | CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL) | SELECT Name, COUNT(Name) FROM Products GROUP BY Name |
Find all questions from specified UserId. | CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE PostHisto... | SELECT Qus.CreationDate, Qus.Tags, Qus.Title, Qus.ViewCount, Qus.Score, Qus.Id, Qus.AcceptedAnswerId FROM Posts AS Qus WHERE Qus.OwnerUserId = '##UserId##' AND Qus.PostTypeId = 1 ORDER BY Qus.CreationDate DESC |
WHAT IS THE GAME ON SEPTEMBER 13? | CREATE TABLE table_name_23 (game INTEGER,date VARCHAR) | SELECT AVG(game) FROM table_name_23 WHERE date = "september 13" |
What is the call sign for the translator with an ERP W larger than 10? | CREATE TABLE table_name_38 (call_sign VARCHAR,erp_w INTEGER) | SELECT call_sign FROM table_name_38 WHERE erp_w > 10 |
show me the FIRST class fares from BALTIMORE to DALLAS | 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 fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code A... |
What is the total area of drakenstein and a population less than 251,262? | CREATE TABLE table_42837 ("Name" text,"Seat" text,"Population (2011)" real,"Area (km 2)" real,"Density (inhabitants/km 2)" real) | SELECT COUNT("Area (km 2 )") FROM table_42837 WHERE "Name" = 'drakenstein' AND "Population (2011)" < '251,262' |
what is admission type of subject id 3343? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime tex... | SELECT demographic.admission_type FROM demographic WHERE demographic.subject_id = "3343" |
What Name has the Captain Aaron Heal? | CREATE TABLE table_name_4 (name VARCHAR,captain VARCHAR) | SELECT name FROM table_name_4 WHERE captain = "aaron heal" |
For language Aymara Simi, what was the maximum San Javier municipality percentage? | CREATE TABLE table_19998428_3 (san_javier_municipality___percentage_ INTEGER,language VARCHAR) | SELECT MAX(san_javier_municipality___percentage_) FROM table_19998428_3 WHERE language = "Aymara simi" |
Which of the R. Epp, has J Thiessen of Tjoatj? | CREATE TABLE table_59744 ("A. Dyck" text,"H. Rempel" text,"R. Epp" text,"J. Thiessen" text,"J. J. Neufeld" text,"Ed Zacharias" text,"word meaning" text) | SELECT "R. Epp" FROM table_59744 WHERE "J. Thiessen" = 'tjoatj' |
What is the name of the artist who produced the shortest song? | CREATE TABLE genre (g_name text,rating text,most_popular_in text)CREATE TABLE artist (artist_name text,country text,gender text,preferred_genre text)CREATE TABLE song (song_name text,artist_name text,country text,f_id number,genre_is text,rating number,languages text,releasedate time,resolution number)CREATE TABLE file... | SELECT T1.artist_name FROM song AS T1 JOIN files AS T2 ON T1.f_id = T2.f_id ORDER BY T2.duration LIMIT 1 |
What was the score of the game against Minnesota? | CREATE TABLE table_63597 ("Game" real,"Date" text,"Opponent" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location/Attendance" text,"Record" text) | SELECT "Score" FROM table_63597 WHERE "Opponent" = 'minnesota' |
what is the number of fans in attendance at the game held at mile high stadium ? | CREATE TABLE table_203_672 (id number,"week" number,"date" text,"opponent" text,"result" text,"venue" text,"attendance" number) | SELECT "attendance" FROM table_203_672 WHERE "venue" = 'mile high stadium' |
Show the first year and last year of parties with theme 'Spring' or 'Teqnology'. | CREATE TABLE party (First_year VARCHAR,Last_year VARCHAR,Party_Theme VARCHAR) | SELECT First_year, Last_year FROM party WHERE Party_Theme = "Spring" OR Party_Theme = "Teqnology" |
What is the fewest minutes played for the player with exactly 638 good passes? | CREATE TABLE table_30517 ("Nr." real,"Player" text,"Games played" real,"Starting" real,"Sub" real,"Subbed" real,"Mins played" real,"Goals" real,"Pens. against" real,"Pens. for" real,"Fouls suff." real,"Fouls comm." real,"Yellow C" real,"Red c" real,"Assists" real,"Passes" real,"Good passes" real) | SELECT MIN("Mins played") FROM table_30517 WHERE "Good passes" = '638' |
what year was machine gun kelly signed ? | CREATE TABLE table_200_14 (id number,"act" text,"year signed" number,"# albums released under bad boy" number) | SELECT "year signed" FROM table_200_14 WHERE "act" = 'machine gun kelly' |
what is diagnoses long title of subject name kelly gallardo? | 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 diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Kelly Gallardo" |
What the since year of the player with a transfer fee of 75k? | CREATE TABLE table_name_76 (since VARCHAR,transfer_fee VARCHAR) | SELECT since FROM table_name_76 WHERE transfer_fee = "£ 75k" |
Who was the home team for the away game that Canvey Island played? | CREATE TABLE table_name_6 (home_team VARCHAR,away_team VARCHAR) | SELECT home_team FROM table_name_6 WHERE away_team = "canvey island" |
how many games did the harrisburg heat win in which they scored eight or more goals ? | CREATE TABLE table_204_151 (id number,"game" number,"day" text,"date" text,"kickoff" text,"opponent" text,"results\nscore" text,"results\nrecord" text,"location" text,"attendance" number) | SELECT COUNT(*) FROM table_204_151 WHERE "results\nscore" = 'w' AND "results\nscore" >= 8 |
what was the first album released ? | CREATE TABLE table_203_686 (id number,"release date" text,"album" text,"record label" text,"uk albums chart" number,"u.s. billboard 200 chart" number) | SELECT "album" FROM table_203_686 ORDER BY "release date" LIMIT 1 |
What is the rank when bronze was more than 0, gold more than 1, Nation is japan, and silver less than 0? | CREATE TABLE table_59802 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT AVG("Rank") FROM table_59802 WHERE "Bronze" > '0' AND "Gold" > '1' AND "Nation" = 'japan' AND "Silver" < '0' |
Count the number of unmarried patients who have copd exacerbation as their primary disease. | 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 WHERE demographic.marital_status = "SINGLE" AND demographic.diagnosis = "COPD EXACERBATION" |
Name the field goals for alexis yackley | CREATE TABLE table_25701 ("Player" text,"Games Played" real,"Minutes" real,"Field Goals" real,"Three Pointers" real,"Free Throws" real,"Rebounds" real,"Assists" real,"Blocks" real,"Steals" real,"Points" real) | SELECT MAX("Field Goals") FROM table_25701 WHERE "Player" = 'Alexis Yackley' |
What is the Team with a venue of Anyang Stadium? | CREATE TABLE table_name_96 (team VARCHAR,home_venue VARCHAR) | SELECT team FROM table_name_96 WHERE home_venue = "anyang stadium" |
What is the meaning of the class 6 verbs? | CREATE TABLE table_1745843_5 (verb_meaning VARCHAR,class VARCHAR) | SELECT verb_meaning FROM table_1745843_5 WHERE class = "6" |
can you show me the list of flights that fly from WASHINGTON to SAN FRANCISCO via DALLAS | CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)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 d... | 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, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CIT... |
What is the attendance total of the game with the Lakers as the home team? | CREATE TABLE table_name_67 (attendance VARCHAR,home VARCHAR) | SELECT COUNT(attendance) FROM table_name_67 WHERE home = "lakers" |
how many male patients have diagnoses icd9 code 71690? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.icd9_code = "71690" |
what are the three most frequently given specimen tests for patients who had previously been diagnosed with dmii wo cmp uncntrld within 2 months, since 2105? | CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREATE TABLE admissions (row_id... | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_... |
has patient 004-29334 received ssri administration - fluoxetine (prozac) at other hospitals? | 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 COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '004-29334' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '004-29334' AND patient.hospitaldischargetime IS NULL)) AND tr... |
Which the Lost to is in 2000 | CREATE TABLE table_64081 ("Year" real,"Category" text,"Film" text,"Result" text,"Lost to" text) | SELECT "Lost to" FROM table_64081 WHERE "Year" = '2000' |
What CFL team was the player playing on SB position drafted for? | CREATE TABLE table_23619005_3 (cfl_team VARCHAR,position VARCHAR) | SELECT cfl_team FROM table_23619005_3 WHERE position = "SB" |
find the cheapest one way fare from BOSTON to SAN FRANCISCO | CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion varchar,wide_body varchar,wing_span int,length int,weight int,capacity int,pay_load int,cruising_speed int,range_miles int,pressurized varchar)CREATE TABLE code_description (code varc... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare 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_... |
Who was the home team at MCG? | CREATE TABLE table_54487 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Home team" FROM table_54487 WHERE "Venue" = 'mcg' |
How many points for 2005? | CREATE TABLE table_10705060_1 (points VARCHAR,season VARCHAR) | SELECT COUNT(points) FROM table_10705060_1 WHERE season = "2005" |
Which DRG number has xxx railway number? | CREATE TABLE table_name_32 (drg_number_s_ VARCHAR,railway_number_s_ VARCHAR) | SELECT drg_number_s_ FROM table_name_32 WHERE railway_number_s_ = "xxx" |
What classes are 12 credits that are upper-level ? | CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)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... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 12 AND program_course.category LIKE 'ULCS' |
Who is every opponent on the date of March 16? | CREATE TABLE table_23486853_8 (opponent VARCHAR,date VARCHAR) | SELECT opponent FROM table_23486853_8 WHERE date = "March 16" |
count the number of patients who were prescribed 0.4 ml syringe : enoxaparin sodium 40 mg/0.4ml sc soln in the same hospital encounter after being diagnosed with obesity. | 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 diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'obesity') AS t1 JOIN (SELECT patient.uniquepid, medication.drugstarttime,... |
What is Tournament, when Opponent is 'Lu Jiaxiang'? | CREATE TABLE table_58626 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Opponent" text,"Score" text) | SELECT "Tournament" FROM table_58626 WHERE "Opponent" = 'lu jiaxiang' |
what kinds of planes are used by AA | CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE airport (airport_code varchar,airport_name text,airport_location text,state_code varchar,country_name varchar,time_zone_code varchar,minimum_connect_time int)CREATE TABLE dual_carrier (main_airline varchar,l... | SELECT DISTINCT aircraft.aircraft_code FROM aircraft, equipment_sequence, flight WHERE equipment_sequence.aircraft_code = aircraft.aircraft_code AND flight.aircraft_code_sequence = equipment_sequence.aircraft_code_sequence AND flight.airline_code = 'AA' |
is any medicine prescribed to patient 032-24135 on the current hospital visit? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE microlab (microlabid number,patientunitstayid number... | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-24135' AND patient.hospitaldischargetime IS NULL)) |
in riyadh, saudi arabia, what is the score? | CREATE TABLE table_39523 ("Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text) | SELECT "Score" FROM table_39523 WHERE "Venue" = 'riyadh, saudi arabia' |
how many patients with drug code cafcit stayed in the hospital for more than 27 days? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "27" AND prescriptions.formulary_drug_cd = "CAFCIT" |
what is the maximum hospital cost in which are involved social work consult? | CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim... | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'social work consult')) GROUP BY cost.patient... |
SO XPages - Question users. Users asking XPages questions | CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,R... | SELECT DISTINCT Posts.OwnerUserId, Users.DisplayName, Reputation, ProfileImageUrl, AccountId FROM Posts INNER JOIN PostTags ON Posts.Id = PostTags.PostId INNER JOIN Users ON Posts.OwnerUserId = Users.Id WHERE Posts.PostTypeId = 1 AND PostTags.TagId IN (66326, 80737, 80738) |
On 5 May 2011, what was the lead percentage? | CREATE TABLE table_52879 ("Date(s) conducted" text,"Cons" text,"Plaid Cymru" text,"Lib Dem" text,"UKIP" text,"Green" text,"Others" text,"Lead" text) | SELECT "Lead" FROM table_52879 WHERE "Date(s) conducted" = '5 may 2011' |
when was patient 3118 last prescribed heparin flush midline (100 units/ml) until 14 months ago? | CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE d_items (row_id number,itemid number,label text,linksto ... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3118) AND prescriptions.drug = 'heparin flush midline (100 units/ml)' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-14 month') ORDER BY prescrip... |
tell me the top four procedures that were the most common in this year. | CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id n... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of ye... |
Who had the high assists when the score was w 107 95 (ot)? | CREATE TABLE table_27715173_6 (high_assists VARCHAR,score VARCHAR) | SELECT high_assists FROM table_27715173_6 WHERE score = "W 107–95 (OT)" |
In the 2012 (85th) Ceremony, what was the Original title of the film not nominated? | CREATE TABLE table_name_66 (original_title VARCHAR,result VARCHAR,year__ceremony_ VARCHAR) | SELECT original_title FROM table_name_66 WHERE result = "not nominated" AND year__ceremony_ = "2012 (85th)" |
A bar chart about what is the total revenue of each manufacturer?, display by the X from low to high. | CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL) | SELECT Name, SUM(Revenue) FROM Manufacturers GROUP BY Name ORDER BY Name |
Show all origins and the number of flights from each origin Show bar chart, and list X-axis in asc order please. | CREATE TABLE employee (eid number(9,0),name varchar2(30),salary number(10,2))CREATE TABLE certificate (eid number(9,0),aid number(9,0))CREATE TABLE aircraft (aid number(9,0),name varchar2(30),distance number(6,0))CREATE TABLE flight (flno number(4,0),origin varchar2(20),destination varchar2(20),distance number(6,0),dep... | SELECT origin, COUNT(*) FROM flight GROUP BY origin ORDER BY origin |
What train number is heading to amritsar? | CREATE TABLE table_17414 ("Train No." text,"Train Name" text,"Origin" text,"Destination" text,"Frequency" text) | SELECT "Train No." FROM table_17414 WHERE "Destination" = 'Amritsar' |
what is the number of patients whose diagnoses icd9 code is e8788? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "E8788" |
Are students allowed to take BCS 534 and BCS 231 in the same semester ? | CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)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... | SELECT COUNT(*) > 0 FROM course AS COURSE_0, course AS COURSE_1, course_offering AS COURSE_OFFERING_0, course_offering AS COURSE_OFFERING_1, course_prerequisite WHERE COURSE_OFFERING_1.semester = COURSE_OFFERING_0.semester AND COURSE_0.course_id = COURSE_OFFERING_0.course_id AND COURSE_0.department = 'BCS' AND COURSE_0... |
Which season did Tich Freeman play against opponent V Warwickshire? | CREATE TABLE table_57486 ("Bowling" text,"Player" text,"Opponent" text,"Venue" text,"Season" text) | SELECT "Season" FROM table_57486 WHERE "Player" = 'tich freeman' AND "Opponent" = 'v warwickshire' |
Who is the player associated with the Esher venue? | CREATE TABLE table_name_63 (player VARCHAR,venue VARCHAR) | SELECT player FROM table_name_63 WHERE venue = "esher" |
Tell me the result for week of 4 | CREATE TABLE table_31891 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text) | SELECT "Result" FROM table_31891 WHERE "Week" = '4' |
What were the points per game in the selection where the rebounds per game were 15.0? | CREATE TABLE table_25774493_3 (points_per_game VARCHAR,rebounds_per_game VARCHAR) | SELECT points_per_game FROM table_25774493_3 WHERE rebounds_per_game = "15.0" |
how many patients are diagnosed with complete kidney transplant and tested with ascites in lab? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,sho... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Compl kidney transplant" AND lab.fluid = "Ascites" |
What party is Mick Young a member of? | CREATE TABLE table_name_45 (party VARCHAR,member VARCHAR) | SELECT party FROM table_name_45 WHERE member = "mick young" |
Which Championship has a League Cup larger than 0, and a FA Cup larger than 0? | CREATE TABLE table_12762 ("Name" text,"Championship" real,"League Cup" real,"FA Cup" real,"Total" real) | SELECT MIN("Championship") FROM table_12762 WHERE "League Cup" > '0' AND "FA Cup" > '0' |
what is the year when the position is 1/22 promoted and the leading scorer is james dean (27)? | CREATE TABLE table_name_81 (year VARCHAR,position VARCHAR,leading_scorer VARCHAR) | SELECT year FROM table_name_81 WHERE position = "1/22 promoted" AND leading_scorer = "james dean (27)" |
count the number of patients whose drug code is diaz5? | 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 procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "DIAZ5" |
how many wins did confey have ? | CREATE TABLE table_204_772 (id number,"team" text,"county" text,"wins" number,"years won" number) | SELECT COUNT(*) FROM table_204_772 WHERE "team" = 'confey' |
If the location attendance was Quicken Loans Arena 20,562, who had the High Assists? | CREATE TABLE table_29739 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "High assists" FROM table_29739 WHERE "Location Attendance" = 'Quicken Loans Arena 20,562' |
Name the least attendance with venue of away on 24 august 2007 | CREATE TABLE table_36994 ("Date" text,"Opponent" text,"Venue" text,"Result" text,"Attendance (Away)" real) | SELECT MIN("Attendance (Away)") FROM table_36994 WHERE "Venue" = 'away' AND "Date" = '24 august 2007' |
Compute the total number in each competition type, and then split by country. | CREATE TABLE club_rank (Rank real,Club_ID int,Gold real,Silver real,Bronze real,Total real)CREATE TABLE club (Club_ID int,name text,Region text,Start_year text)CREATE TABLE competition (Competition_ID int,Year real,Competition_type text,Country text)CREATE TABLE competition_result (Competition_ID int,Club_ID_1 int,Club... | SELECT Country, COUNT(Country) FROM competition GROUP BY Competition_type, Country |
What lane did the swimmer with a time of 52.84 have? | CREATE TABLE table_71224 ("Rank" real,"Lane" real,"Name" text,"Nationality" text,"Time" real) | SELECT MAX("Lane") FROM table_71224 WHERE "Time" = '52.84' |
For the game where the opponent is listed as @ Indiana Pacers, what was the end record? | CREATE TABLE table_46558 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location" text,"Record" text) | SELECT "Record" FROM table_46558 WHERE "Opponent" = '@ indiana pacers' |
Give me the start station and end station for the trips with the three oldest id. | CREATE TABLE trip (start_station_name VARCHAR,end_station_name VARCHAR,id VARCHAR) | SELECT start_station_name, end_station_name FROM trip ORDER BY id LIMIT 3 |
when has patient 18677 been given a microbiology test for the last time this month? | 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 inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount... | SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18677) AND DATETIME(microbiologyevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') ORDER BY microbiologyevent... |
Name the total number of valid poll with seats more than 4 and candidates more than 9 | CREATE TABLE table_35218 ("Constituency" text,"Electorate" real,"Turnout" text,"Spoilt" text,"Valid Poll" real,"Quota" text,"Seats" real,"Candidates" real) | SELECT COUNT("Valid Poll") FROM table_35218 WHERE "Seats" > '4' AND "Candidates" > '9' |
What province has an election after 2009? | CREATE TABLE table_33162 ("Province" text,"Inhabitants" real,"President" text,"Party" text,"Election" real) | SELECT "Province" FROM table_33162 WHERE "Election" > '2009' |
What average goals have matches less than 228? | CREATE TABLE table_name_68 (goals INTEGER,matches INTEGER) | SELECT AVG(goals) FROM table_name_68 WHERE matches < 228 |
how many hours have passed since first time on the current hospital visit patient 14671 stayed in the careunit micu? | 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 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14671 AND admissions.dischtime IS NULL) AND transfers.careunit = 'micu' ORDER BY transfers.intime LIMIT 1 |
Find the number of times ROY SWEAZY has reserved a room. | CREATE TABLE reservations (code number,room text,checkin text,checkout text,rate number,lastname text,firstname text,adults number,kids number)CREATE TABLE rooms (roomid text,roomname text,beds number,bedtype text,maxoccupancy number,baseprice number,decor text) | SELECT COUNT(*) FROM reservations WHERE firstname = "ROY" AND lastname = "SWEAZY" |
Questions that were initially tagged 'books'. | 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 DISTINCT Score, PostId AS "post_link" FROM PostHistory INNER JOIN Posts ON Posts.Id = PostId WHERE PostHistoryTypeId IN (3, 6) AND Text LIKE '%<books>%' ORDER BY Score DESC |
Who is the director of movie Avatar? | CREATE TABLE Movie (director VARCHAR,title VARCHAR) | SELECT director FROM Movie WHERE title = 'Avatar' |
What was head count in 2010 where the farm production is 6.9? | CREATE TABLE table_13618358_1 (agri_culture_b VARCHAR) | SELECT MAX(2010 AS _population__000_) FROM table_13618358_1 WHERE agri_culture_b = "6.9" |
What courses would be useful to take before SW 693 ? | CREATE TABLE area (course_id int,area varchar)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time... | SELECT DISTINCT advisory_requirement FROM course WHERE department = 'SW' AND number = 693 |
the sum of 2009 with rank of 5 and 2010 less than 76.5 is what? | CREATE TABLE table_name_70 (rank VARCHAR) | SELECT SUM(2009) FROM table_name_70 WHERE rank = 5 AND 2010 < 76.5 |
What is 2nd Leg, when Team 2 is 'Dunaferr'? | CREATE TABLE table_59180 ("Team 1" text,"Agg." text,"Team 2" text,"1st leg" text,"2nd leg" text) | SELECT "2nd leg" FROM table_59180 WHERE "Team 2" = 'dunaferr' |
what was the output of patient 012-4131 for the first time, on last month/21? | 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 lab (labid number,patientunitstayid number,labname text,labresult nu... | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-4131')) AND intakeoutput.cellpath LIKE '%output%' AND DA... |
how much is patient 017-55081's weight for the first time in 06/last year? | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE allergy (allergyid number,patientunitst... | SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-55081') AND NOT patient.admissionweight IS NULL AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-... |
What is the location of the salem district? | CREATE TABLE table_57113 ("College Name" text,"Location" text,"District" text,"Affiliation" text,"Estd" text) | SELECT "Location" FROM table_57113 WHERE "District" = 'salem district' |
What kind of Launched has a Homeport (as of July 2013) of sold to chile, and a Pennant number of f80? | CREATE TABLE table_name_65 (launched VARCHAR,homeport__as_of_july_2013_ VARCHAR,pennant_number VARCHAR) | SELECT launched FROM table_name_65 WHERE homeport__as_of_july_2013_ = "sold to chile" AND pennant_number = "f80" |
Which 2006 07 Pts has a 2007 08 Pts of 53, and a 2005 06 Pts larger than 51? | CREATE TABLE table_13023 ("Team" text,"2005\u201306 Pts" real,"2006\u201307 Pts" real,"2007\u201308 Pts" real,"Total Pts" real,"Total Pld" real) | SELECT MAX("2006\u201307 Pts") FROM table_13023 WHERE "2007\u201308 Pts" = '53' AND "2005\u201306 Pts" > '51' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.