instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
What is Lee Ka Man's Time? | CREATE TABLE table_64761 ("Rank" real,"Rower" text,"Country" text,"Time" text,"Notes" text) | SELECT "Time" FROM table_64761 WHERE "Rower" = 'lee ka man' |
Which label has the catalog CDZAP22? | CREATE TABLE table_59720 ("Country" text,"Date" text,"Label" text,"Format" text,"Catalog" text) | SELECT "Label" FROM table_59720 WHERE "Catalog" = 'cdzap22' |
show me the flights from NEW YORK to LOS ANGELES with stop in MILWAUKEE | CREATE TABLE code_description (code varchar,description text)CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE flight_stop (flight_id int,stop_numbe... | 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 = 'LOS ANGELES' AND CITY_... |
Top 10 users Stack Overflow users from Morocco. | CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,Clo... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%Bournemouth%' ORDER BY Reputation DESC LIMIT 10 |
provide the number of patients whose lab test name is parathyroid hormone and lab test result is delta. | 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 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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.flag = "delta" AND lab.label = "Parathyroid Hormone" |
When Yale is listed as the regular season winner, what tournament venue is given? | CREATE TABLE table_30506 ("Conference" text,"Regular Season Winner" text,"Conference Player of the Year" text,"Conference Tournament" text,"Tournament Venue (City)" text,"Tournament Winner" text) | SELECT "Tournament Venue (City)" FROM table_30506 WHERE "Regular Season Winner" = 'Yale' |
Name the manner of departure for luis enrique | CREATE TABLE table_27666856_3 (manner_of_departure VARCHAR,outgoing_manager VARCHAR) | SELECT manner_of_departure FROM table_27666856_3 WHERE outgoing_manager = "Luis Enrique" |
How many total points does Mike Hyndman have with more than 119 assists? | CREATE TABLE table_name_98 (points INTEGER,player VARCHAR,assists VARCHAR) | SELECT SUM(points) FROM table_name_98 WHERE player = "mike hyndman" AND assists > 119 |
what was the last test that patient 27465 had received since 100 months ago? | 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 procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_items (row_id number,itemid number,label text,lin... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27465) AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-100 month') ORDER BY labevents.charttime D... |
Please list the proportion number of each winning aircraft. | CREATE TABLE airport_aircraft (ID int,Airport_ID int,Aircraft_ID int)CREATE TABLE aircraft (Aircraft_ID int(11),Aircraft varchar(50),Description varchar(50),Max_Gross_Weight varchar(50),Total_disk_area varchar(50),Max_disk_Loading varchar(50))CREATE TABLE match (Round real,Location text,Country text,Date text,Fastest_Q... | SELECT Aircraft, COUNT(*) FROM aircraft AS T1 JOIN match AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft |
Which Date has Notes of notes? | CREATE TABLE table_name_21 (date VARCHAR) | SELECT date FROM table_name_21 WHERE "notes" = "notes" |
How many different types of settlements does Nova Pazova fall into? | CREATE TABLE table_2562572_53 (type VARCHAR,settlement VARCHAR) | SELECT COUNT(type) FROM table_2562572_53 WHERE settlement = "Nova Pazova" |
Name the slope length for 1966 groundstation | CREATE TABLE table_21933 ("Name or route" text,"type" text,"elevation groundstation" real,"elevation mountainstation" real,"slope length" real,"capacity in persons/hour" real,"construction year(s)" text) | SELECT COUNT("slope length") FROM table_21933 WHERE "elevation groundstation" = '1966' |
For each grade, return the grade number, the number of classrooms used for the grade, and the total number of students enrolled in the grade. | CREATE TABLE list (lastname text,firstname text,grade number,classroom number)CREATE TABLE teachers (lastname text,firstname text,classroom number) | SELECT grade, COUNT(DISTINCT classroom), COUNT(*) FROM list GROUP BY grade |
When did the term end for the person who started their term on 28 November 1912? | CREATE TABLE table_47527 ("Name" text,"Born-Died" text,"Term start" text,"Term end" text,"Political Party" text) | SELECT "Term end" FROM table_47527 WHERE "Term start" = '28 november 1912' |
What is the regular season info that had a record of 20-10? | CREATE TABLE table_56560 ("Year" text,"League" text,"Record" text,"Reg. Season" text,"Playoffs" text) | SELECT "Reg. Season" FROM table_56560 WHERE "Record" = '20-10' |
What is the episode number where the English title is Pilot? | CREATE TABLE table_19586 ("Number of episode" real,"Number of season" real,"Title (original)" text,"Title (English)" text,"Original air date" text) | SELECT "Number of episode" FROM table_19586 WHERE "Title (English)" = 'Pilot' |
What was the partner count when the opponents in the final was forget leconte? | CREATE TABLE table_22597626_17 (partner VARCHAR,opponents_in_the_final VARCHAR) | SELECT COUNT(partner) FROM table_22597626_17 WHERE opponents_in_the_final = "Forget Leconte" |
Show the name and prominence of the mountains whose picture is not taken by a lens of brand 'Sigma'. | CREATE TABLE mountain (id number,name text,height number,prominence number,range text,country text)CREATE TABLE camera_lens (id number,brand text,name text,focal_length_mm number,max_aperture number)CREATE TABLE photos (id number,camera_lens_id number,mountain_id number,color text,name text) | SELECT name, prominence FROM mountain EXCEPT SELECT T1.name, T1.prominence FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id = T3.id WHERE T3.brand = 'Sigma' |
Out of the total number of patients admitted before the year 2131, calculate the number of those who remained admitted in hospital for more than 23 days. | 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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.days_stay > "23" AND demographic.admityear < "2131" |
Who is the current manager of the team located in tubize? | CREATE TABLE table_name_15 (current_manager VARCHAR,location VARCHAR) | SELECT current_manager FROM table_name_15 WHERE location = "tubize" |
Who is the winning party/coalition name in election year 1980? | CREATE TABLE table_26128 ("Election Year" real,"Assembly" text,"Winning Party/Coalition" text,"Chief Minister" text,"Speaker" text) | SELECT "Winning Party/Coalition" FROM table_26128 WHERE "Election Year" = '1980' |
What was the score on 8 September 1999? | CREATE TABLE table_name_93 (score VARCHAR,date VARCHAR) | SELECT score FROM table_name_93 WHERE date = "8 september 1999" |
Show the denomination shared by schools founded before 1890 and schools founded after 1900 | CREATE TABLE school (Denomination VARCHAR,Founded INTEGER) | SELECT Denomination FROM school WHERE Founded < 1890 INTERSECT SELECT Denomination FROM school WHERE Founded > 1900 |
Which week's game was attended by 33,057 people? | CREATE TABLE table_51484 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text) | SELECT "Week" FROM table_51484 WHERE "Attendance" = '33,057' |
If the results are Kuwait won by 72 runs scorecard, what are the details? | CREATE TABLE table_22577693_1 (details VARCHAR,result VARCHAR) | SELECT details FROM table_22577693_1 WHERE result = "Kuwait won by 72 runs Scorecard" |
What is the lowest tourism arrivals in 2011 in millions with 507 US $ per arrival in 2011 tourism receipts and less than 11,869 million of US $ in 2011 tourism receipts? | CREATE TABLE table_name_95 (tourist_arrivals__2011___millions_ INTEGER,tourism_receipts__2011___us$_per_arrival_ VARCHAR,tourism_receipts__2011___millions_of_us$_ VARCHAR) | SELECT MIN(tourist_arrivals__2011___millions_) FROM table_name_95 WHERE tourism_receipts__2011___us$_per_arrival_ = 507 AND tourism_receipts__2011___millions_of_us$_ < 11 OFFSET 869 |
Draw a bar chart about the distribution of Nationality and the average of meter_100 , and group by attribute Nationality, and display in asc by the Nationality. | CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 text,meter_400 text,meter_500 text,meter_600 text,meter_700 text,Time text)CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Opening_year... | SELECT Nationality, AVG(meter_100) FROM swimmer GROUP BY Nationality ORDER BY Nationality |
When the Venue was Glenferrie Oval, who is the Away team? | CREATE TABLE table_name_3 (away_team VARCHAR,venue VARCHAR) | SELECT away_team FROM table_name_3 WHERE venue = "glenferrie oval" |
On what date did the Bills play the Houston Oilers before week 12? | CREATE TABLE table_name_79 (date VARCHAR,week VARCHAR,opponent VARCHAR) | SELECT date FROM table_name_79 WHERE week < 12 AND opponent = "houston oilers" |
What was the first leg score against Real Sociedad? | CREATE TABLE table_name_66 (first_leg VARCHAR,opposition VARCHAR) | SELECT first_leg FROM table_name_66 WHERE opposition = "real sociedad" |
What home team has Richmond listed as their Away team? | CREATE TABLE table_name_69 (home_team VARCHAR,away_team VARCHAR) | SELECT home_team FROM table_name_69 WHERE away_team = "richmond" |
Return the date of birth for all the guests with gender code 'Male'. | CREATE TABLE apartment_facilities (apt_id number,facility_code text)CREATE TABLE apartments (apt_id number,building_id number,apt_type_code text,apt_number text,bathroom_count number,bedroom_count number,room_count text)CREATE TABLE apartment_bookings (apt_booking_id number,apt_id number,guest_id number,booking_status_... | SELECT date_of_birth FROM guests WHERE gender_code = "Male" |
Which position does Jesse Boulerice play? | CREATE TABLE table_37129 ("Round" real,"Player" text,"Position" text,"Nationality" text,"College/Junior/Club Team (League)" text) | SELECT "Position" FROM table_37129 WHERE "Player" = 'jesse boulerice' |
How many average wins for players ranked below 2 with earnings greater than $7,676,552? | CREATE TABLE table_77591 ("Rank" real,"Player" text,"Country" text,"Earnings($)" real,"Wins" real) | SELECT AVG("Wins") FROM table_77591 WHERE "Earnings( $ )" > '7,676,552' AND "Rank" > '2' |
who was the victim of the last wolf attack to occur in california , usa ? | CREATE TABLE table_204_708 (id number,"victim(s)" text,"age" number,"gender" text,"date" text,"type of attack" text,"location" text,"details" text,"source(s)" text) | SELECT "victim(s)" FROM table_204_708 WHERE "location" = 'california' ORDER BY "date" DESC LIMIT 1 |
what is the percentile of 13.8 for a white blood cells test given the same age of patient 96833 on their current hospital encounter? | 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_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE microbiologyevents (row... | SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'white blood cells') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admiss... |
How many races take place in Dessau circuit? | CREATE TABLE table_1140116_6 (race_name VARCHAR,circuit VARCHAR) | SELECT COUNT(race_name) FROM table_1140116_6 WHERE circuit = "Dessau" |
how many patients were given the drug citalopram hydrobromide? | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Citalopram Hydrobromide" |
What are the student IDs and middle names of the students enrolled in at most two courses, rank x axis from low to high order please. | CREATE TABLE Courses (course_id INTEGER,author_id INTEGER,subject_id INTEGER,course_name VARCHAR(120),course_description VARCHAR(255))CREATE TABLE Student_Tests_Taken (registration_id INTEGER,date_test_taken DATETIME,test_result VARCHAR(255))CREATE TABLE Student_Course_Enrolment (registration_id INTEGER,student_id INTE... | SELECT T2.middle_name, T1.student_id FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id ORDER BY T2.middle_name |
Which Free polite has a Genitive 1 of *=ku? | CREATE TABLE table_40797 ("Free" text,"Free polite" text,"Genitive 1" text,"Genitive 2" text,"Genitive 3" text) | SELECT "Free polite" FROM table_40797 WHERE "Genitive 1" = '*=ku' |
What is the lowest number of total goals for a player with 6 league goals? | CREATE TABLE table_27170987_5 (total_goals INTEGER,league_goals VARCHAR) | SELECT MIN(total_goals) FROM table_27170987_5 WHERE league_goals = 6 |
Which team has the most ties with fewer than 4 losses and GA smaller than 20? | CREATE TABLE table_51248 ("Team" text,"Games Played" real,"Wins" real,"Losses" real,"Ties" real,"Goals For" real,"Goals Against" real) | SELECT MAX("Ties") FROM table_51248 WHERE "Losses" < '4' AND "Goals Against" < '20' |
What are the number of the countries of mountains with height bigger than 5000?, and sort names from high to low order. | CREATE TABLE climber (Climber_ID int,Name text,Country text,Time text,Points real,Mountain_ID int)CREATE TABLE mountain (Mountain_ID int,Name text,Height real,Prominence real,Range text,Country text) | SELECT Country, COUNT(Country) FROM mountain WHERE Height > 5000 GROUP BY Country ORDER BY Country DESC |
For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of hire_date and the average of salary bin hire_date by weekday, could you order the average of salary in ascending order? | 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 jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME var... | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(SALARY) |
In order to fulfill the ULCS requirement , which classes are the easiest ? | CREATE TABLE program (program_id int,name varchar,college varchar,introduction 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 varchar,minor va... | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_co... |
enrolled in a competing study | CREATE TABLE table_train_48 ("id" int,"in_another_study" bool,"renal_disease" bool,"receiving_vasopressor" bool,"sepsis" bool,"hypotension" bool,"septic_shock" bool,"age" float,"NOUSE" float) | SELECT * FROM table_train_48 WHERE in_another_study = 1 |
What is the length of the highway with remarks that it was replaced by lp 20? | CREATE TABLE table_name_28 (length VARCHAR,remarks VARCHAR) | SELECT length FROM table_name_28 WHERE remarks = "replaced by lp 20" |
Namethe democrat john lynch for joe kenney being 27% | CREATE TABLE table_21786 ("Poll Source" text,"Dates administered" text,"Democrat: John Lynch" text,"Republican: Joe Kenney" text,"Lead Margin" real) | SELECT "Democrat: John Lynch" FROM table_21786 WHERE "Republican: Joe Kenney" = '27%' |
What is the number of patients on multivitamins prescription who died in or before the year the year 2164? | 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 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2164.0" AND prescriptions.drug = "Multivitamins" |
Name the 1st match for brisbane bears | CREATE TABLE table_name_61 (team VARCHAR) | SELECT 1 AS st_match FROM table_name_61 WHERE team = "brisbane bears" |
What election has a 1st member of richard blakemore and a 2nd member of william goodenough hayter? | CREATE TABLE table_78811 ("Election" text,"1st Member" text,"1st Party" text,"2nd Member" text,"2nd Party" text) | SELECT "Election" FROM table_78811 WHERE "2nd Member" = 'william goodenough hayter' AND "1st Member" = 'richard blakemore' |
Name the example when the environment is #_x | CREATE TABLE table_name_46 (example VARCHAR,environment VARCHAR) | SELECT example FROM table_name_46 WHERE environment = "#_x" |
Which side has Orcagna as the inscription? | CREATE TABLE table_8987 ("Side" text,"Group" text,"Inscription" text,"Official history" text,"Identification" text) | SELECT "Side" FROM table_8987 WHERE "Inscription" = 'orcagna' |
COunt the sum of Diameter (km) which has a Latitude of 62.7n? | CREATE TABLE table_name_25 (diameter__km_ INTEGER,latitude VARCHAR) | SELECT SUM(diameter__km_) FROM table_name_25 WHERE latitude = "62.7n" |
What requirements are there for a degree in CS-LSA ? | CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_credit varchar,repeat_term varchar,test_id varchar)CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE... | SELECT DISTINCT program_requirement.additional_req, program_requirement.category, program_requirement.min_credit, program.name FROM program, program_requirement WHERE program.name LIKE '%CS-LSA%' AND program.program_id = program_requirement.program_id |
What is the manufacturer with a wheel arrangement of 2-8-0, and Year made of 1883? | CREATE TABLE table_name_82 (manufacturer VARCHAR,wheel_arrangement VARCHAR,year_made VARCHAR) | SELECT manufacturer FROM table_name_82 WHERE wheel_arrangement = "2-8-0" AND year_made = "1883" |
which title has no b sides ? | CREATE TABLE table_204_689 (id number,"year" number,"title" text,"album" text,"uk" number,"b-sides" text) | SELECT "title" FROM table_204_689 WHERE "b-sides" IS NULL |
how many patients have stayed in the hospital for more than 16 days with a globulin lab test done? | 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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "16" AND lab.label = "Globulin" |
When does the class meet for RCHUMS 218 ? | 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 course_prerequisite (pre_course_id int,course_id ... | SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_i... |
Which lost has 84 as the match points? | CREATE TABLE table_65630 ("Club" text,"Total points" text,"Bonus points" text,"Match points" text,"Games" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Diff" text) | SELECT "Lost" FROM table_65630 WHERE "Match points" = '84' |
Find the branch name of the bank that has the most number of customers. | CREATE TABLE bank (branch_id number,bname text,no_of_customers number,city text,state text)CREATE TABLE customer (cust_id text,cust_name text,acc_type text,acc_bal number,no_of_loans number,credit_score number,branch_id number,state text)CREATE TABLE loan (loan_id text,loan_type text,cust_id text,branch_id text,amount ... | SELECT bname FROM bank ORDER BY no_of_customers DESC LIMIT 1 |
Search for gold badge holders in Python tag. | CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,C... | SELECT u.Id AS "user_link", b.Name FROM Users AS u INNER JOIN Badges AS b ON b.UserId = u.Id WHERE b.Class = 1 AND b.Name = 'python' GROUP BY u.Id, b.Name |
since 3 years ago patient 005-86645 had been in an er? | CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid... | SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '005-86645' AND patient.hospitaladmitsource = 'emergency department' AND DATETIME(patient.unitadmittime) >= DATETIME(CURRENT_TIME(), '-3 year') |
give me the number of patients whose year of birth is less than 1879 and lab test name is hematocrit, calculated? | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "1879" AND lab.label = "Hematocrit, Calculated" |
okay i would like to know the type of aircraft used on a flight from CLEVELAND to DALLAS please | CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE compartment_class (compartment varchar,class_type varchar)CREATE TABLE airport (airport_code varchar,airport_name text,airport_location text,state_code varchar,country_name va... | SELECT DISTINCT aircraft.basic_type FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'CLEVELAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_... |
What is the League with a Year that is 1990/91? | CREATE TABLE table_41847 ("Year" text,"League" text,"Reg. Season" text,"Playoffs" text,"Lost" real) | SELECT "League" FROM table_41847 WHERE "Year" = '1990/91' |
How far did the pilot go when averaging 124.1km/h? | CREATE TABLE table_45510 ("Position" real,"Pilot" text,"Glider" text,"Speed" text,"Distance" text) | SELECT "Distance" FROM table_45510 WHERE "Speed" = '124.1km/h' |
Who directed the TV broadcast s03e19? | CREATE TABLE table_15861776_1 (directed_by VARCHAR,tv_broadcast VARCHAR) | SELECT directed_by FROM table_15861776_1 WHERE tv_broadcast = "S03E19" |
Which IHSAA Class has a Location of linton? | CREATE TABLE table_64390 ("School" text,"Location" text,"Mascot" text,"Enrollment" real,"IHSAA Class" text,"County" text,"Year Joined" real,"Previous Conference" text) | SELECT "IHSAA Class" FROM table_64390 WHERE "Location" = 'linton' |
patient 3929 was prescribed sterile water in this month? | 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 procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE patients (row_id number,subject_id number,... | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3929) AND prescriptions.drug = 'sterile water' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') |
Vote count by vote type. | CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuida... | SELECT vt.Name, COUNT(*) FROM Votes AS v INNER JOIN VoteTypes AS vt ON v.VoteTypeId = vt.Id GROUP BY vt.Name ORDER BY vt.Name |
List all the document names which contains 'CV'. | CREATE TABLE document_structures (document_structure_code text,parent_document_structure_code text,document_structure_description text)CREATE TABLE documents (document_code text,document_structure_code text,document_type_code text,access_count number,document_name text)CREATE TABLE document_sections (section_id number,... | SELECT document_name FROM documents WHERE document_name LIKE "%CV%" |
What is the dma of branding is big oldies 107.3 with the station warv-fm? | CREATE TABLE table_22830 ("DMA" real,"Market" text,"Station" text,"Frequency" text,"Branding" text,"Format" text) | SELECT "DMA" FROM table_22830 WHERE "Branding" = 'Big Oldies 107.3' AND "Station" = 'WARV-FM' |
What is the height m/ft where 207 w. hastings st. is the address? | CREATE TABLE table_name_64 (height_m___ft VARCHAR,street_address VARCHAR) | SELECT height_m___ft FROM table_name_64 WHERE street_address = "207 w. hastings st." |
Gold/Silver/Bronze badges over time (2010). | CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModeratorId number,ApprovalDate time,ApprovalModeratorId number,DeactivationDat... | WITH GoldBadges AS (SELECT DATEADD(m, MONTH(Date), '2010-12-01') AS CurDate, COUNT(Id) AS BadgeTotal FROM Badges WHERE (YEAR(Date) = 2011) AND (Class = 1) GROUP BY YEAR(Date), MONTH(Date)), SilverBadges AS (SELECT DATEADD(m, MONTH(Date), '2010-12-01') AS CurDate, COUNT(Id) AS BadgeTotal FROM Badges WHERE (YEAR(Date) = ... |
how many gold did u.s.a win | CREATE TABLE table_204_75 (id number,"year" number,"place" text,"gold" text,"silver" text,"bronze" text) | SELECT COUNT("gold") FROM table_204_75 WHERE "gold" = 'usa' |
What were the least Wins in 1988? | CREATE TABLE table_5724 ("Year" real,"Class" text,"Team" text,"Machine" text,"Points" real,"Wins" real) | SELECT MIN("Wins") FROM table_5724 WHERE "Year" = '1988' |
How many hosts does each nationality have? List the nationality and the count. | CREATE TABLE party_host (party_id number,host_id number,is_main_in_charge others)CREATE TABLE party (party_id number,party_theme text,location text,first_year text,last_year text,number_of_hosts number)CREATE TABLE host (host_id number,name text,nationality text,age text) | SELECT nationality, COUNT(*) FROM host GROUP BY nationality |
What is the state where the title is listed as count? | CREATE TABLE table_49407 ("State" text,"Type" text,"Name" text,"Title" text,"Royal house" text) | SELECT "State" FROM table_49407 WHERE "Title" = 'count' |
give me the number of patients whose days of hospital stay is greater than 2 and lab test fluid is urine? | 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 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.days_stay > "2" AND lab.fluid = "Urine" |
Who was the actor in London in 2002 with the shipwreck of Leonty Ibayev? | CREATE TABLE table_77483 ("Actor in London,2002" text,"Actor in New York,2006" text,"Actor in Moscow,2007" text,"Voyage" text,"Shipwreck" text) | SELECT "Actor in London, 2002" FROM table_77483 WHERE "Shipwreck" = 'leonty ibayev' |
Are we going to have a lab for Computational Fluid Dynamics of Nuclear Applications this year ? | CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_cre... | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE (course.description LIKE '%lab%' OR course.name LIKE '%lab%') AND (course.description LIKE '%Computational Fluid Dynamics of Nuclear Applications%' OR course.name LIKE '%Computational Fluid Dynamics of Nuclear Applications%') AND course.course_id = course... |
What is the lowest number of fa cup goals by a player? | CREATE TABLE table_27170987_5 (fa_cup_goals INTEGER) | SELECT MIN(fa_cup_goals) FROM table_27170987_5 |
show me the flights from NEWARK to LOS ANGELES | CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE code_description (code varchar,description text)CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,fare_airline text,restriction_code text,one_direction_cost int,round_trip_cost int,r... | 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 = 'NEWARK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LOS ANG... |
What MLS team drafted samuel appiah? | CREATE TABLE table_25518547_3 (mls_team VARCHAR,player VARCHAR) | SELECT mls_team FROM table_25518547_3 WHERE player = "Samuel Appiah" |
Name the money spent for 2Q having candidate of john mccain | CREATE TABLE table_78341 ("Candidate" text,"Money Raised,2Q" text,"Loans Received,2Q" text,"Money Spent,2Q" text,"Total Receipts" text,"Cash On Hand" text) | SELECT "Money Spent, 2Q" FROM table_78341 WHERE "Candidate" = 'john mccain' |
What is the draw for the artist Ketil Stokkan which has less than 44 points? | CREATE TABLE table_name_89 (draw INTEGER,artist VARCHAR,points VARCHAR) | SELECT MIN(draw) FROM table_name_89 WHERE artist = "ketil stokkan" AND points < 44 |
Who was the artist for the year of the snake? | CREATE TABLE table_name_76 (artist VARCHAR,theme VARCHAR) | SELECT artist FROM table_name_76 WHERE theme = "year of the snake" |
What is the latest year that 6th, Heartland is regular season? | CREATE TABLE table_1241987_1 (year INTEGER,regular_season VARCHAR) | SELECT MAX(year) FROM table_1241987_1 WHERE regular_season = "6th, Heartland" |
What is the name of the leading scorer when the record was 9 6? | CREATE TABLE table_name_18 (leading_scorer VARCHAR,record VARCHAR) | SELECT leading_scorer FROM table_name_18 WHERE record = "9–6" |
During the year when Lansing's fare is $433.59, what is the fare to Kalamazoo? | CREATE TABLE table_20701 ("Year" real,"Lansing (LAN)" text,"Detroit (DTW)" text,"Grand Rapids (GRR)" text,"Flint (FNT)" text,"Kalamazoo (AZO)" text,"Saginaw (MBS)" text) | SELECT "Kalamazoo (AZO)" FROM table_20701 WHERE "Lansing (LAN)" = '$433.59' |
Are there any non-general elective requirements that NATIVEAM 498 would fulfill for me ? | 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 program_course.category FROM course, program_course WHERE course.department = 'NATIVEAM' AND course.number = 498 AND program_course.course_id = course.course_id |
give me the number of patients whose insurance is private and lab test name is red blood cells? | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Private" AND lab.label = "Red Blood Cells" |
A bar chart for listing the number of the name of physicians who took some appointment. | CREATE TABLE Prescribes (Physician INTEGER,Patient INTEGER,Medication INTEGER,Date DATETIME,Appointment INTEGER,Dose VARCHAR(30))CREATE TABLE Physician (EmployeeID INTEGER,Name VARCHAR(30),Position VARCHAR(30),SSN INTEGER)CREATE TABLE Department (DepartmentID INTEGER,Name VARCHAR(30),Head INTEGER)CREATE TABLE Stay (Sta... | SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Physician AS T2 ON T1.Physician = T2.EmployeeID GROUP BY Name |
when notes are prima italica:raised for aborted caucasus war, when was that founded? | CREATE TABLE table_242785_1 (date_founded__founder VARCHAR,notes VARCHAR) | SELECT date_founded__founder FROM table_242785_1 WHERE notes = "prima Italica:raised for aborted Caucasus war" |
BIOLCHEM 416 is compulsory in which programs ? | CREATE TABLE area (course_id int,area varchar)CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE program (program_id int,name varchar,college varc... | SELECT DISTINCT program.name FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN program ON program.program_id = program_course.program_id WHERE course.department = 'BIOLCHEM' AND course.number = 416 |
what was the monthly minimum amount of output amt-hemovac drain given to patient 006-172277 since 07/04/2105? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,disch... | SELECT MIN(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-172277')) AND intakeoutput.celllabel = 'outp... |
What original vehicle has uwhvt homepage architecture? | CREATE TABLE table_37397 ("Years" text,"Competition" text,"Vehicle Name" text,"Original Vehicle" text,"Architecture" text) | SELECT "Original Vehicle" FROM table_37397 WHERE "Architecture" = 'uwhvt homepage' |
List the number of instructors for each course in year 2008 with a bar chart, order by the y-axis in desc. | CREATE TABLE course (course_id varchar(8),title varchar(50),dept_name varchar(20),credits numeric(2,0))CREATE TABLE instructor (ID varchar(5),name varchar(20),dept_name varchar(20),salary numeric(8,2))CREATE TABLE time_slot (time_slot_id varchar(4),day varchar(1),start_hr numeric(2),start_min numeric(2),end_hr numeric(... | SELECT title, COUNT(title) FROM course AS T1 JOIN teaches AS T2 ON T1.course_id = T2.course_id JOIN instructor AS T3 ON T2.ID = T3.ID WHERE year = 2008 GROUP BY title ORDER BY COUNT(title) DESC |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.