answer stringlengths 6 3.91k | question stringlengths 7 766 | context stringlengths 27 7.14k |
|---|---|---|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT; MYOMECTOMY/SDA" AND lab.fluid = "Urine" | count the number of patients whose primary disease is coronary artery disease\coronary artery bypass graft; myomectomy/sda and lab test fluid is urine? | 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 prescription... |
SELECT 20 AS _questions FROM table_1566852_5 WHERE interview_subject = "Derek Jeter" | Name the 20 questions for derek jeter | CREATE TABLE table_1566852_5 (interview_subject VARCHAR) |
SELECT T1.teacher_id, T2.last_name FROM Detention AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id WHERE T1.detention_type_code = "AFTER" GROUP BY T1.teacher_id ORDER BY COUNT(*) DESC LIMIT 1 | Find the id and last name of the teacher that has the most detentions with detention type code "AFTER"? | CREATE TABLE Detention (teacher_id VARCHAR, detention_type_code VARCHAR); CREATE TABLE Teachers (last_name VARCHAR, teacher_id VARCHAR) |
SELECT plural_word FROM table_name_94 WHERE plural_abbreviation = "ll." | The plural abbreviation of ll. uses what plural word? | CREATE TABLE table_name_94 (
plural_word VARCHAR,
plural_abbreviation VARCHAR
) |
SELECT 20 AS _questions FROM table_1566852_5 WHERE date = "8-04" | Name the 20 questions for 8-04 | CREATE TABLE table_1566852_5 (date VARCHAR) |
SELECT T1.student_id, T2.first_name FROM Student_Addresses AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY AVG(monthly_rental) DESC LIMIT 1 | What are the id and first name of the student whose addresses have the highest average monthly rental? | CREATE TABLE Students (first_name VARCHAR, student_id VARCHAR); CREATE TABLE Student_Addresses (student_id VARCHAR) |
SELECT DISTINCT flight.flight_id FROM fare, flight, flight_fare WHERE ((flight.flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 21 AND DATE_DAYalias0.month_number = 2 AND DAT... | list flights from INDIANAPOLIS to MEMPHIS with fares on monday | 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,
round_trip_required varchar
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
... |
SELECT open_cup FROM table_15672920_1 WHERE year = 2010 | Name the open cup for 2010 | CREATE TABLE table_15672920_1 (open_cup VARCHAR, year VARCHAR) |
SELECT T2.address_id, T1.city FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id GROUP BY T2.address_id ORDER BY AVG(monthly_rental) DESC LIMIT 1 | Find the id and city of the student address with the highest average monthly rental. | CREATE TABLE Student_Addresses (address_id VARCHAR); CREATE TABLE Addresses (city VARCHAR, address_id VARCHAR) |
SELECT date FROM table_name_37 WHERE time___et__ = "1:00 pm" AND game_site = "arrowhead stadium" | What date is the 1:00 pm game at arrowhead stadium? | CREATE TABLE table_name_37 (
date VARCHAR,
time___et__ VARCHAR,
game_site VARCHAR
) |
SELECT date FROM table_1566852_7 WHERE interview_subject = "Shepard Smith" | IN WHAT ISSUE OF PLAYBOY WAS SHEPARD SMITH INTERVIEWED? | CREATE TABLE table_1566852_7 (date VARCHAR, interview_subject VARCHAR) |
SELECT T1.incident_type_code, T2.incident_type_description FROM Behavior_Incident AS T1 JOIN Ref_Incident_Type AS T2 ON T1.incident_type_code = T2.incident_type_code GROUP BY T1.incident_type_code ORDER BY COUNT(*) DESC LIMIT 1 | What are the code and description of the most frequent behavior incident type? | CREATE TABLE Ref_Incident_Type (incident_type_description VARCHAR, incident_type_code VARCHAR); CREATE TABLE Behavior_Incident (incident_type_code VARCHAR) |
SELECT draft_details FROM document_drafts WHERE document_id = 7 | What is draft detail of the document with id 7? | CREATE TABLE addresses (
address_id number,
address_details text
)
CREATE TABLE circulation_history (
document_id number,
draft_number number,
copy_number number,
employee_id number
)
CREATE TABLE ref_document_status (
document_status_code text,
document_status_description text
)
CREA... |
SELECT COUNT(cover_model) FROM table_1566852_7 WHERE centerfold_model = "Stephanie Larimore" | HOW MANY MODELS WERE ON THE COVER OF THE ISSUE WHERE THE CENTERFOLD WAS STEPHANIE LARIMORE? | CREATE TABLE table_1566852_7 (cover_model VARCHAR, centerfold_model VARCHAR) |
SELECT T1.detention_type_code, T2.detention_type_description FROM Detention AS T1 JOIN Ref_Detention_Type AS T2 ON T1.detention_type_code = T2.detention_type_code GROUP BY T1.detention_type_code ORDER BY COUNT(*) LIMIT 1 | What are the code and description of the least frequent detention type ? | CREATE TABLE Ref_Detention_Type (detention_type_description VARCHAR, detention_type_code VARCHAR); CREATE TABLE Detention (detention_type_code VARCHAR) |
SELECT "Jump 2" FROM table_32520 WHERE "Jump 3" = '7.77' | What is the Jump 2 of the person that has a Jump 3 of 7.77? | CREATE TABLE table_32520 (
"Athlete Name" text,
"Jump 1" text,
"Jump 2" text,
"Jump 3" text,
"Best Jump" text
) |
SELECT interview_subject FROM table_1566852_7 WHERE cover_model = "Kara Monaco" | IN THE ISSUE WITH KARA MONACO ON THE COVER, WHO WAS THE INTERVIEW SUBJECT? | CREATE TABLE table_1566852_7 (interview_subject VARCHAR, cover_model VARCHAR) |
SELECT T1.date_of_notes FROM Assessment_Notes AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.first_name = "Fanny" | Find the dates of assessment notes for students with first name "Fanny". | CREATE TABLE Students (student_id VARCHAR, first_name VARCHAR); CREATE TABLE Assessment_Notes (date_of_notes VARCHAR, student_id VARCHAR) |
SELECT Directed_by, COUNT(Directed_by) FROM film GROUP BY Directed_by | Give me a pie to show how many directed by from different directed by. | CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_season int,
Title text,
Directed_by text,
Original_air_date text,
Production_code text
)
CREATE TABLE schedule... |
SELECT COUNT(20 AS _questions) FROM table_1566852_7 WHERE interview_subject = "Ludacris" | HOW MANY TIMES WAS LUDACRIS THE INTERVIEW SUBJECT FOR THE 20 QUESTIONS COLUMN? | CREATE TABLE table_1566852_7 (interview_subject VARCHAR) |
SELECT T1.text_of_notes FROM Assessment_Notes AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id WHERE T2.last_name = "Schuster" | Find the texts of assessment notes for teachers with last name "Schuster". | CREATE TABLE Assessment_Notes (text_of_notes VARCHAR, teacher_id VARCHAR); CREATE TABLE Teachers (teacher_id VARCHAR, last_name VARCHAR) |
SELECT cospar_id FROM table_name_3 WHERE satellite = "ariel 3" | What is Ariel 3's COSPAR ID? | CREATE TABLE table_name_3 (
cospar_id VARCHAR,
satellite VARCHAR
) |
SELECT arabic_capital_name FROM table_15694696_1 WHERE english_capital_name = "Manama" | what is the arabic capital name wher the english capital name is manama? | CREATE TABLE table_15694696_1 (arabic_capital_name VARCHAR, english_capital_name VARCHAR) |
SELECT T1.date_incident_start, date_incident_end FROM Behavior_Incident AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.last_name = "Fahey" | Find the start and end dates of behavior incidents of students with last name "Fahey". | CREATE TABLE Behavior_Incident (date_incident_start VARCHAR, student_id VARCHAR); CREATE TABLE Students (student_id VARCHAR, last_name VARCHAR) |
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10266) AND prescriptions.drug IN ('d5 1/2ns', 'labetalol', 'insulin') AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year... | in a year before d5 1/2ns, labetalol or insulin were prescribed for patient 10266? | CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... |
SELECT arabic_capital_name FROM table_15694696_1 WHERE english_capital_name = "Beirut" | what is the arabic capital name where the english capital name is beirut? | CREATE TABLE table_15694696_1 (arabic_capital_name VARCHAR, english_capital_name VARCHAR) |
SELECT T1.datetime_detention_start, datetime_detention_end FROM Detention AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id WHERE T2.last_name = "Schultz" | Find the start and end dates of detentions of teachers with last name "Schultz". | CREATE TABLE Detention (datetime_detention_start VARCHAR, teacher_id VARCHAR); CREATE TABLE Teachers (teacher_id VARCHAR, last_name VARCHAR) |
SELECT CONCAT('id', 'post_link'), ViewCount, CreationDate, Score FROM Posts ORDER BY ViewCount DESC LIMIT 100 | Top 100 posts by view count. | CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PostHistory (
Id number,
Po... |
SELECT rank__night_ FROM table_15681686_4 WHERE rating = "4.4" | what is the rank for the rating 4.4? | CREATE TABLE table_15681686_4 (rank__night_ VARCHAR, rating VARCHAR) |
SELECT T2.address_id, T1.zip_postcode FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id ORDER BY monthly_rental DESC LIMIT 1 | What are the id and zip code of the address with the highest monthly rental? | CREATE TABLE Student_Addresses (address_id VARCHAR); CREATE TABLE Addresses (zip_postcode VARCHAR, address_id VARCHAR) |
SELECT "Chassis" FROM table_71124 WHERE "Tyres" = 'g' AND "Year" < '1987' | What Chassis has g Tyres before 1987? | CREATE TABLE table_71124 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Tyres" text,
"Points" real
) |
SELECT rating / SHARE(18 - 49) FROM table_15681686_4 WHERE rank__week_ = "48" | what is the rating where the rank is 48? | CREATE TABLE table_15681686_4 (rating VARCHAR, rank__week_ VARCHAR) |
SELECT T2.cell_mobile_number FROM Student_Addresses AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id ORDER BY T1.monthly_rental LIMIT 1 | What is the cell phone number of the student whose address has the lowest monthly rental? | CREATE TABLE Students (cell_mobile_number VARCHAR, student_id VARCHAR); CREATE TABLE Student_Addresses (student_id VARCHAR, monthly_rental VARCHAR) |
SELECT channel FROM table_name_83 WHERE country = "israel" | Which channel comes out of Israel? | CREATE TABLE table_name_83 (
channel VARCHAR,
country VARCHAR
) |
SELECT COUNT(rank__timeslot_) FROM table_15681686_4 WHERE rank__week_ = "58" | what is the total rank where the rank is 58? | CREATE TABLE table_15681686_4 (rank__timeslot_ VARCHAR, rank__week_ VARCHAR) |
SELECT T2.monthly_rental FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id WHERE T1.state_province_county = "Texas" | What are the monthly rentals of student addresses in Texas state? | CREATE TABLE Addresses (address_id VARCHAR, state_province_county VARCHAR); CREATE TABLE Student_Addresses (monthly_rental VARCHAR, address_id VARCHAR) |
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 = "NB obsrv suspct infect" AND lab."CATEGORY" = "Hematology" | how many patients are diagnosed with nb obsrv suspct infect and tested under hematology category in lab? | 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 t... |
SELECT rank__week_ FROM table_15681686_4 WHERE viewers__millions_ = "6.45" | what rank has viewers at 6.45? | CREATE TABLE table_15681686_4 (rank__week_ VARCHAR, viewers__millions_ VARCHAR) |
SELECT T2.first_name, T2.last_name FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id = T2.address_id WHERE T1.state_province_county = "Wisconsin" | What are the first names and last names of students with address in Wisconsin state? | CREATE TABLE Addresses (address_id VARCHAR, state_province_county VARCHAR); CREATE TABLE Students (first_name VARCHAR, last_name VARCHAR, address_id VARCHAR) |
SELECT year FROM table_name_83 WHERE tournament = "1st division el salvador" AND finish = "champion" AND team = "fas" | In what Year was 1st Division El Salvador with a Finish of Champion and a Team of Fas? | CREATE TABLE table_name_83 (
year VARCHAR,
team VARCHAR,
tournament VARCHAR,
finish VARCHAR
) |
SELECT COUNT(rank__timeslot_) FROM table_15681686_4 WHERE viewers__millions_ = "9.38" | what is the total number of rank where viewers is 9.38? | CREATE TABLE table_15681686_4 (rank__timeslot_ VARCHAR, viewers__millions_ VARCHAR) |
SELECT T1.line_1, AVG(T2.monthly_rental) FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id = T2.address_id GROUP BY T2.address_id | What are the line 1 and average monthly rentals of all student addresses? | CREATE TABLE Addresses (line_1 VARCHAR, address_id VARCHAR); CREATE TABLE Student_Addresses (monthly_rental INTEGER, address_id VARCHAR) |
SELECT accolade FROM table_name_76 WHERE year < 2002 AND publication = "rolling stone" AND rank = 48 | What is Accolade, when Year is less than 2002, when Publication is 'Rolling Stone', and when Rank is '48'? | CREATE TABLE table_name_76 (
accolade VARCHAR,
rank VARCHAR,
year VARCHAR,
publication VARCHAR
) |
SELECT destination FROM table_1569516_1 WHERE service_pattern = "Sydenham then fast to Norwood Junction" | Where is the service pattern sydenham then fast to norwood junction? | CREATE TABLE table_1569516_1 (destination VARCHAR, service_pattern VARCHAR) |
SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id = T2.address_id WHERE T2.first_name = "Lyla" | What is the zip code of the address where the teacher with first name "Lyla" lives? | CREATE TABLE Teachers (address_id VARCHAR, first_name VARCHAR); CREATE TABLE Addresses (zip_postcode VARCHAR, address_id VARCHAR) |
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | For those employees who did not have any job in the past, return a bar chart about the distribution of hire_date and the sum of salary bin hire_date by time. | 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 (
EMPLO... |
SELECT COUNT(platform) FROM table_1569516_1 WHERE operator = "Southern" AND service_pattern = "All stations via Clapham Junction" | How many platforms have a southern opertator and the pattern is all stations via clapham junction? | CREATE TABLE table_1569516_1 (platform VARCHAR, operator VARCHAR, service_pattern VARCHAR) |
SELECT T2.email_address FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id = T2.address_id WHERE T1.zip_postcode = "918" | What are the email addresses of teachers whose address has zip code "918"? | CREATE TABLE Addresses (address_id VARCHAR, zip_postcode VARCHAR); CREATE TABLE Teachers (email_address VARCHAR, address_id VARCHAR) |
SELECT DISTINCT fare.fare_id, flight.airline_code, flight.flight_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 = AIRPO... | what are the flights and fares from BOSTON to PHILADELPHIA | CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar... |
SELECT frequency__per_hour_ FROM table_1569516_1 WHERE destination = "London Bridge" | When London Bridge is the destination, what is the frequency? | CREATE TABLE table_1569516_1 (frequency__per_hour_ VARCHAR, destination VARCHAR) |
SELECT COUNT(*) FROM STUDENTS WHERE NOT student_id IN (SELECT student_id FROM Behavior_Incident) | How many students are not involved in any behavior incident? | CREATE TABLE STUDENTS (student_id VARCHAR); CREATE TABLE Behavior_Incident (student_id VARCHAR) |
SELECT "treaty" FROM table_203_109 ORDER BY "ratified" DESC LIMIT 1 | what is the last treaty morocco ratified ? | CREATE TABLE table_203_109 (
id number,
"treaty" text,
"organization" text,
"introduced" number,
"signed" number,
"ratified" number
) |
SELECT COUNT(line) FROM table_1569516_1 WHERE destination = "London Bridge" | When London Bridge is the destination, how many lines are there? | CREATE TABLE table_1569516_1 (line VARCHAR, destination VARCHAR) |
SELECT last_name FROM Teachers EXCEPT SELECT T1.last_name FROM Teachers AS T1 JOIN Detention AS T2 ON T1.teacher_id = T2.teacher_id | Find the last names of teachers who are not involved in any detention. | CREATE TABLE Teachers (last_name VARCHAR); CREATE TABLE Teachers (last_name VARCHAR, teacher_id VARCHAR); CREATE TABLE Detention (teacher_id VARCHAR) |
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13806) AND prescriptions.drug IN ('vancomycin hcl', 'phenylephrine', 'd5w (excel bag)') AND STRFTIME('%y', prescriptions.startdate) <= '2102' | had patient 13806 been prescribed vancomycin hcl, phenylephrine or d5w (excel bag) until 2102? | CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... |
SELECT playoffs FROM table_1570003_2 WHERE year = 1998 | What was the playoff advancement during the year 1998? | CREATE TABLE table_1570003_2 (playoffs VARCHAR, year VARCHAR) |
SELECT T1.line_1 FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id = T2.address_id INTERSECT SELECT T1.line_1 FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id = T2.address_id | What are the line 1 of addresses shared by some students and some teachers? | CREATE TABLE Teachers (address_id VARCHAR); CREATE TABLE Students (address_id VARCHAR); CREATE TABLE Addresses (line_1 VARCHAR, address_id VARCHAR) |
SELECT "2012" FROM table_58551 WHERE "2009" = '1r' | Name the 2012 for 2009 of 1r | CREATE TABLE table_58551 (
"Tournament" text,
"2009" text,
"2011" text,
"2012" text,
"2013" text
) |
SELECT open_cup FROM table_1570003_2 WHERE year = 2003 | During 2003 what was open cup qualifying status? | CREATE TABLE table_1570003_2 (open_cup VARCHAR, year VARCHAR) |
SELECT T1.asset_id, T1.asset_details FROM Assets AS T1 JOIN Asset_Parts AS T2 ON T1.asset_id = T2.asset_id GROUP BY T1.asset_id HAVING COUNT(*) = 2 INTERSECT SELECT T1.asset_id, T1.asset_details FROM Assets AS T1 JOIN Fault_Log AS T2 ON T1.asset_id = T2.asset_id GROUP BY T1.asset_id HAVING COUNT(*) < 2 | Which assets have 2 parts and have less than 2 fault logs? List the asset id and detail. | CREATE TABLE Assets (asset_id VARCHAR, asset_details VARCHAR); CREATE TABLE Asset_Parts (asset_id VARCHAR); CREATE TABLE Fault_Log (asset_id VARCHAR) |
SELECT nurse FROM on_call WHERE blockfloor = 1 AND blockcode = 1 | What nurses are on call with block floor 1 and block code 1? Tell me their names. | CREATE TABLE on_call (
nurse VARCHAR,
blockfloor VARCHAR,
blockcode VARCHAR
) |
SELECT MAX(year) FROM table_1570003_2 WHERE open_cup = "2nd Round" | What is the most recent year where team made it to 2nd round of the Open Cup? | CREATE TABLE table_1570003_2 (year INTEGER, open_cup VARCHAR) |
SELECT COUNT(*), T1.maintenance_contract_id FROM Maintenance_Contracts AS T1 JOIN Assets AS T2 ON T1.maintenance_contract_id = T2.maintenance_contract_id GROUP BY T1.maintenance_contract_id | How many assets does each maintenance contract contain? List the number and the contract id. | CREATE TABLE Assets (maintenance_contract_id VARCHAR); CREATE TABLE Maintenance_Contracts (maintenance_contract_id VARCHAR) |
SELECT Id AS "post_link", Body, CreationDate AS "date" FROM Posts WHERE Body LIKE '%$%' AND NOT Body LIKE '%$%$%' | Find posts with broken MathJax (single dollar sign). | CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... |
SELECT margin_of_victory FROM table_1569625_1 WHERE no = 15 | Name the margin of victory when the number is 15 | CREATE TABLE table_1569625_1 (margin_of_victory VARCHAR, no VARCHAR) |
SELECT COUNT(*), T1.company_id FROM Third_Party_Companies AS T1 JOIN Assets AS T2 ON T1.company_id = T2.supplier_company_id GROUP BY T1.company_id | How many assets does each third party company supply? List the count and the company id. | CREATE TABLE Assets (supplier_company_id VARCHAR); CREATE TABLE Third_Party_Companies (company_id VARCHAR) |
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.diagnosis = "MESENTERIC ISCHEMIA" | how many patients whose admission type is urgent and primary disease is mesenteric ischemia? | 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
)
C... |
SELECT COUNT(no) FROM table_1569625_1 WHERE runner_s__up = "Howard Clark" | Name the number of numbers for howard clark | CREATE TABLE table_1569625_1 (no VARCHAR, runner_s__up VARCHAR) |
SELECT T1.company_id, T1.company_name FROM Third_Party_Companies AS T1 JOIN Maintenance_Engineers AS T2 ON T1.company_id = T2.company_id GROUP BY T1.company_id HAVING COUNT(*) >= 2 UNION SELECT T3.company_id, T3.company_name FROM Third_Party_Companies AS T3 JOIN Maintenance_Contracts AS T4 ON T3.company_id = T4.mainten... | Which third party companies have at least 2 maintenance engineers or have at least 2 maintenance contracts? List the company id and name. | CREATE TABLE Maintenance_Contracts (maintenance_contract_company_id VARCHAR); CREATE TABLE Maintenance_Engineers (company_id VARCHAR); CREATE TABLE Third_Party_Companies (company_id VARCHAR, company_name VARCHAR) |
SELECT right_ascension___j2000__ FROM table_name_15 WHERE object_type = "spiral galaxy" AND apparent_magnitude > 12.2 | What is the Right ascension of the Object type spiral galaxy that has an Apparent magnitude larger that 12.2 | CREATE TABLE table_name_15 (
right_ascension___j2000__ VARCHAR,
object_type VARCHAR,
apparent_magnitude VARCHAR
) |
SELECT margin_of_victory FROM table_1569625_1 WHERE tournament = "Algarve Open de Portugal" | Name the margin of victory when tournament is algarve open de portugal | CREATE TABLE table_1569625_1 (margin_of_victory VARCHAR, tournament VARCHAR) |
SELECT T1.staff_name, T1.staff_id FROM Staff AS T1 JOIN Fault_Log AS T2 ON T1.staff_id = T2.recorded_by_staff_id EXCEPT SELECT T3.staff_name, T3.staff_id FROM Staff AS T3 JOIN Engineer_Visits AS T4 ON T3.staff_id = T4.contact_staff_id | What is the name and id of the staff who recorded the fault log but has not contacted any visiting engineers? | CREATE TABLE Engineer_Visits (contact_staff_id VARCHAR); CREATE TABLE Staff (staff_name VARCHAR, staff_id VARCHAR); CREATE TABLE Fault_Log (recorded_by_staff_id VARCHAR) |
SELECT "Young rider classification" FROM table_30586 WHERE "Winner" = 'Alessandro Petacchi' | Who was the young rider classification when Alessandro Petacchi won? | CREATE TABLE table_30586 (
"Stage" real,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Young rider classification" text
) |
SELECT tournament FROM table_1569625_1 WHERE margin_of_victory = "3 strokes" AND winning_score = 71 - 66 - 70 - 67 = 274 | Name the tournament when margin of victory is 3 strokes and winning score is 71-66-70-67=274 | CREATE TABLE table_1569625_1 (tournament VARCHAR, margin_of_victory VARCHAR, winning_score VARCHAR) |
SELECT T1.engineer_id, T1.first_name, T1.last_name FROM Maintenance_Engineers AS T1 JOIN Engineer_Visits AS T2 GROUP BY T1.engineer_id ORDER BY COUNT(*) DESC LIMIT 1 | Which engineer has visited the most times? Show the engineer id, first name and last name. | CREATE TABLE Maintenance_Engineers (engineer_id VARCHAR, first_name VARCHAR, last_name VARCHAR); CREATE TABLE Engineer_Visits (Id VARCHAR) |
SELECT COUNT(*) FROM Posts | Total number of posts by months. | CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConce... |
SELECT MAX(runs_conceded) FROM table_15700367_4 | Name the most runs conceded | CREATE TABLE table_15700367_4 (runs_conceded INTEGER) |
SELECT T1.part_name, T1.part_id FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_id HAVING COUNT(*) > 2 | Which parts have more than 2 faults? Show the part name and id. | CREATE TABLE Parts (part_name VARCHAR, part_id VARCHAR); CREATE TABLE Part_Faults (part_id VARCHAR) |
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_i... | what are the four most frequently ordered lab tests for patients who had previously received ven cath renal dialysis within the same month, in 2104? | CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id ... |
SELECT wickets FROM table_15700367_4 WHERE overs_bowled = "9" | Name the wickets when overs bowled is 9 | CREATE TABLE table_15700367_4 (wickets VARCHAR, overs_bowled VARCHAR) |
SELECT T1.first_name, T1.last_name, T1.other_details, T3.skill_description FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id = T2.engineer_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id | List all every engineer's first name, last name, details and coresponding skill description. | CREATE TABLE Maintenance_Engineers (first_name VARCHAR, last_name VARCHAR, other_details VARCHAR, engineer_id VARCHAR); CREATE TABLE Engineer_Skills (engineer_id VARCHAR, skill_id VARCHAR); CREATE TABLE Skills (skill_description VARCHAR, skill_id VARCHAR) |
SELECT status FROM table_name_24 WHERE newspaper_magazine = "al-thawra" | What is Status, when Newspaper/Magazine is Al-Thawra? | CREATE TABLE table_name_24 (
status VARCHAR,
newspaper_magazine VARCHAR
) |
SELECT MAX(maidens) FROM table_15700367_4 WHERE er = "5.11" | Name the most maidens when e.r. 5.11 | CREATE TABLE table_15700367_4 (maidens INTEGER, er VARCHAR) |
SELECT T1.fault_short_name, T3.skill_description FROM Part_Faults AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.part_fault_id = T2.part_fault_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id | For all the faults of different parts, what are all the decriptions of the skills required to fix them? List the name of the faults and the skill description. | CREATE TABLE Skills_Required_To_Fix (part_fault_id VARCHAR, skill_id VARCHAR); CREATE TABLE Part_Faults (fault_short_name VARCHAR, part_fault_id VARCHAR); CREATE TABLE Skills (skill_description VARCHAR, skill_id VARCHAR) |
SELECT result FROM table_name_89 WHERE date = "september 13, 1998" | Where Date is september 13, 1998 what is result? | CREATE TABLE table_name_89 (
result VARCHAR,
date VARCHAR
) |
SELECT MIN(runs_conceded) FROM table_15700367_4 WHERE name = "Brett Lee" | Name the least runs conceded for brett lee | CREATE TABLE table_15700367_4 (runs_conceded INTEGER, name VARCHAR) |
SELECT T1.part_name, COUNT(*) FROM Parts AS T1 JOIN Asset_Parts AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_name | How many assets can each parts be used in? List the part name and the number. | CREATE TABLE Parts (part_name VARCHAR, part_id VARCHAR); CREATE TABLE Asset_Parts (part_id VARCHAR) |
SELECT "Primary cartridge" FROM table_28657 WHERE "Year of introduction" = '1962' AND "Country of origin" = 'Denmark' | If the Country of Origin is Denmark and the year of introduction is 1962, what is the primary cartridge? | CREATE TABLE table_28657 (
"Name / designation" text,
"Year of introduction" text,
"Country of origin" text,
"Primary cartridge" text,
"primary user" text
) |
SELECT runs_conceded FROM table_15700367_6 WHERE er = "4.96" | How many runs conceded when the earned runs was 4.96? | CREATE TABLE table_15700367_6 (runs_conceded VARCHAR, er VARCHAR) |
SELECT T1.fault_description, T2.fault_status FROM Fault_Log AS T1 JOIN Fault_Log_Parts AS T2 ON T1.fault_log_entry_id = T2.fault_log_entry_id | What are all the fault descriptions and the fault status of all the faults recoreded in the logs? | CREATE TABLE Fault_Log (fault_description VARCHAR, fault_log_entry_id VARCHAR); CREATE TABLE Fault_Log_Parts (fault_status VARCHAR, fault_log_entry_id VARCHAR) |
SELECT "3rd run" FROM table_79697 WHERE "Rank" = '8' | Which 3rd run has rank of 8? | CREATE TABLE table_79697 (
"Rank" real,
"Name" text,
"1st run" text,
"2nd run" text,
"3rd run" text,
"Total" real
) |
SELECT COUNT(runs_conceded) FROM table_15700367_6 WHERE name = "Sanath Jayasuriya" | How many players named sanath jayasuriya? | CREATE TABLE table_15700367_6 (runs_conceded VARCHAR, name VARCHAR) |
SELECT COUNT(*), T1.fault_log_entry_id FROM Fault_Log AS T1 JOIN Engineer_Visits AS T2 ON T1.fault_log_entry_id = T2.fault_log_entry_id GROUP BY T1.fault_log_entry_id ORDER BY COUNT(*) DESC LIMIT 1 | How many engineer visits are required at most for a single fault log? List the number and the log entry id. | CREATE TABLE Fault_Log (fault_log_entry_id VARCHAR); CREATE TABLE Engineer_Visits (fault_log_entry_id VARCHAR) |
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | For all employees who have the letters D or S in their first name, a bar chart shows the distribution of hire_date and the amount of hire_date bin hire_date by time. | CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NA... |
SELECT runs_conceded FROM table_15700367_6 WHERE name = "Chaminda Vaas" | How many runs conceded for chaminda vaas? | CREATE TABLE table_15700367_6 (runs_conceded VARCHAR, name VARCHAR) |
SELECT DISTINCT last_name FROM Maintenance_Engineers | What are all the distinct last names of all the engineers? | CREATE TABLE Maintenance_Engineers (last_name VARCHAR) |
SELECT allergytype FROM allergy_type WHERE allergy = "Cat" | What is the type of allergy Cat? | CREATE TABLE allergy_type (
allergy text,
allergytype text
)
CREATE TABLE has_allergy (
stuid number,
allergy text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
) |
SELECT COUNT(overs_bowled) FROM table_15700367_6 WHERE name = "Muttiah Muralitharan" | How many overs bowled for muttiah muralitharan? | CREATE TABLE table_15700367_6 (overs_bowled VARCHAR, name VARCHAR) |
SELECT DISTINCT fault_status FROM Fault_Log_Parts | How many fault status codes are recorded in the fault log parts table? | CREATE TABLE Fault_Log_Parts (fault_status VARCHAR) |
SELECT "Venue" FROM table_18796 WHERE "Captain" = 'Luke Blackwell' | Which venue did Luke Blackwell serve as captain? | CREATE TABLE table_18796 (
"Season" real,
"Premiers" text,
"Runners Up" text,
"Score" text,
"Captain" text,
"Coach" text,
"Simpson Medal" text,
"Venue" text,
"Attendance" real,
"Umpires" text
) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.