table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
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
)
... | what is minimum age of patients whose marital status is divorced and admission type is elective? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.admission_type = "ELECTIVE" |
CREATE TABLE table_2624098_1 (
english_day_name_meaning VARCHAR,
modern_english_day_name VARCHAR
) | how many different meanings does Wednesday have? | SELECT COUNT(english_day_name_meaning) FROM table_2624098_1 WHERE modern_english_day_name = "Wednesday" |
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 text,
flag text,
value_unit text,... | provide the number of patients whose drug code is rosi8? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "ROSI8" |
CREATE TABLE table_name_28 (
competition VARCHAR,
date VARCHAR
) | For what competition was the game played on 28 March 2009? | SELECT competition FROM table_name_28 WHERE date = "28 march 2009" |
CREATE TABLE table_34056 (
"Date" text,
"Label" text,
"Region" text,
"Format" text,
"Catalog" text
) | What is the Region of Catalog 885 973-4? | SELECT "Region" FROM table_34056 WHERE "Catalog" = '885 973-4' |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees who was hired before 2002-06-21, draw a bar chart about the distribution of hire_date and the amount of hire_date bin hire_date by weekday, and rank in asc by the Y. | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY COUNT(HIRE_DATE) |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number... | how many patients were prescribed with 2 ml : ondansetron hcl 4 mg/2ml iv soln in the same hospital encounter until 4 years ago after the procedure of analgesics - oral analgesics? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'analgesics - oral analgesics' AND DATETIME(treatment.treatmenttime) <= DA... |
CREATE TABLE table_26723 (
"Week" real,
"Date" text,
"Kickoff" text,
"Opponent" text,
"Final score" text,
"Team record" text,
"Game site" text,
"Attendance" real
) | What date did the team play on week 8? | SELECT "Date" FROM table_26723 WHERE "Week" = '8' |
CREATE TABLE table_name_98 (
ties VARCHAR,
losses INTEGER
) | What is the total number of ties a team with less than 3 losses have? | SELECT COUNT(ties) FROM table_name_98 WHERE losses < 3 |
CREATE TABLE STUDENT (
Advisor VARCHAR
) | Report all advisors that advise more than 2 students. | SELECT Advisor FROM STUDENT GROUP BY Advisor HAVING COUNT(*) > 2 |
CREATE TABLE table_24625467_1 (
no VARCHAR,
production_code VARCHAR
) | What episode number has 2j5352 as a production code? | SELECT no FROM table_24625467_1 WHERE production_code = "2J5352" |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE patients (
row_... | when is the first procedure patient 29971 received until 2103? | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29971) AND STRFTIME('%y', procedures_icd.charttime) <= '2103' ORDER BY procedures_icd.charttime LIMIT 1 |
CREATE TABLE table_203_871 (
id number,
"#" number,
"player" text,
"pos" text,
"pts" number,
"tries" number,
"conv" number,
"pens" number,
"drop" number,
"opposition" text,
"venue" text,
"date" text
) | who is the only player who is not a fly half ? | SELECT "player" FROM table_203_871 WHERE "pos" <> 'fly-half' |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
a... | what airline is US | SELECT DISTINCT airline_code FROM airline WHERE airline_code = 'US' |
CREATE TABLE table_name_6 (
player VARCHAR,
place VARCHAR,
score VARCHAR
) | Who scored 74-70-67=211 and placed t5? | SELECT player FROM table_name_6 WHERE place = "t5" AND score = 74 - 70 - 67 = 211 |
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 medication (
medi... | how much is the daily minimum weight of patient 006-71495 until 02/2104? | SELECT MIN(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-71495') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y-%m', patient.unitadmittime) <= '2104-02' GROUP BY STRFTIME('%y-%m-%d', patien... |
CREATE TABLE table_48573 (
"Position" real,
"Driver / Passenger" text,
"Equipment" text,
"Bike No" real,
"Points" real
) | What is the lowest Postion, when Bike No is greater than 10, when Driver / Passenger is Nicky Pulinx / Ondrej Cermak, and when Points is greater than 244? | SELECT MIN("Position") FROM table_48573 WHERE "Bike No" > '10' AND "Driver / Passenger" = 'nicky pulinx / ondrej cermak' AND "Points" > '244' |
CREATE TABLE table_29565601_2 (
pa INTEGER,
pf VARCHAR
) | What is the PA when the PF is 73? | SELECT MIN(pa) FROM table_29565601_2 WHERE pf = 73 |
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 prescriptions... | how many patients with medicaid insurance underwent the lab test for prostate specific antigen? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Medicaid" AND lab.label = "Prostate Specific Antigen" |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE patient (
uniquep... | when did patient 031-4987 first receive a nasopharynx microbiological test since 91 months ago? | SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-4987')) AND microlab.culturesite = 'nasopharynx' AND DATETIME... |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE ... | Is the only Gender and Social Science professor Prof. Joyce ? | SELECT DISTINCT course.department, course.name, course.number, instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.name LIKE '%Gender and Social Science%' AND NOT instructor.name LIKE '%Joyce%' AND offering_instructor.instructor_id ... |
CREATE TABLE table_78844 (
"Season" text,
"League" text,
"Teams" text,
"Home" text,
"Away" text
) | What season has a regionalliga s d league, a 1-0 home, and an away of 2-3? | SELECT "Season" FROM table_78844 WHERE "League" = 'regionalliga süd' AND "Home" = '1-0' AND "Away" = '2-3' |
CREATE TABLE table_51480 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | How many laps did Jo Bonnier driver when the grid number was smaller than 11? | SELECT SUM("Laps") FROM table_51480 WHERE "Driver" = 'jo bonnier' AND "Grid" < '11' |
CREATE TABLE Transactions_Lots (
transaction_id INTEGER,
lot_id INTEGER
)
CREATE TABLE Ref_Transaction_Types (
transaction_type_code VARCHAR(10),
transaction_type_description VARCHAR(80)
)
CREATE TABLE Investors (
investor_id INTEGER,
Investor_details VARCHAR(255)
)
CREATE TABLE Lots (
lo... | Show the id and details for the investors who have the top 3 number of transactions by a bar chart. | SELECT T1.Investor_details, T1.investor_id FROM Investors AS T1 JOIN Transactions AS T2 ON T1.investor_id = T2.investor_id ORDER BY COUNT(*) DESC LIMIT 3 |
CREATE TABLE table_name_54 (
segment_c VARCHAR,
segment_b VARCHAR
) | Which Segment C has a Segment B of fish food? | SELECT segment_c FROM table_name_54 WHERE segment_b = "fish food" |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | count the number of patients whose insurance is private and procedure short title is hemodialysis? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.short_title = "Hemodialysis" |
CREATE TABLE table_54970 (
"Country/Region" text,
"Languages" text,
"Premiere" text,
"Seasons" text,
"Status" text
) | What country speaks Vietnamese? | SELECT "Country/Region" FROM table_54970 WHERE "Languages" = 'vietnamese' |
CREATE TABLE table_59162 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What is the score if the Tie no is 32? | SELECT "Score" FROM table_59162 WHERE "Tie no" = '32' |
CREATE TABLE table_17566 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Young rider classification" text,
"Trofeo Fast Team" text
) | Name the general classification of stage 15 | SELECT COUNT("General classification") FROM table_17566 WHERE "Stage" = '15' |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semes... | RCIDIV 302 has been in the course listings for how long ? | SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'RCIDIV' AND course.number = 302 AND semester.semester_id = course_offering.semester ORDER BY semester.year LIMIT 1 |
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
)
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
) | Stacked bar chart of how many nationality for with each Type in each nationality | SELECT Nationality, COUNT(Nationality) FROM ship GROUP BY Type, Nationality |
CREATE TABLE table_24985 (
"Year" text,
"Chairman" text,
"Artistic Director" text,
"Performance Liaison" text,
"Secretary" text,
"Business manager" text,
"Production Stagemanager" text,
"Dramaturge" text,
"Public Relations" text,
"First/Second Year Rep." text,
"Male Rep." tex... | What year were the first/second year reps Katie Pautler and Devery North? | SELECT "Year" FROM table_24985 WHERE "First/Second Year Rep." = 'Katie Pautler and Devery North' |
CREATE TABLE table_name_8 (
firefox VARCHAR,
netscape VARCHAR
) | What percentage of users were using Firefox during the period in which *0.77% were using Netscape? | SELECT firefox FROM table_name_8 WHERE netscape = "*0.77%" |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE allergy (
... | count the number of patients who have had a social work consult procedure within 2 months after having been diagnosed until 1 year ago with depression. | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'depression' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-1 year')) AS t1 JOIN (SELECT... |
CREATE TABLE table_57201 (
"Type of sign" text,
"Shape" text,
"Border" text,
"Background colour" text,
"Text/Symbol" text
) | Which sign had a yellow background and a triangular shape? | SELECT "Border" FROM table_57201 WHERE "Background colour" = 'yellow' AND "Shape" = 'triangular' |
CREATE TABLE table_11254821_2 (
points_awarded__platinum_ INTEGER,
finishing_position VARCHAR
) | How many platinum points were awarded for 5th place? | SELECT MAX(points_awarded__platinum_) FROM table_11254821_2 WHERE finishing_position = "5th" |
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 diagnoses (
... | how many patients whose gender is m and drug code is clin1000i? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.formulary_drug_cd = "CLIN1000I" |
CREATE TABLE table_20566 (
"Year" real,
"GDP Nominal ($ billions)" text,
"GDP Adjusted ($ billions)" text,
"Population (millions)" text,
"GDP per capita Nominal ($)" real,
"GDP per capita Adjusted ($)" real
) | What is the nominal GDP per capita when the population is 63.056 million? | SELECT MIN("GDP per capita Nominal ($)") FROM table_20566 WHERE "Population (millions)" = '63.056' |
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
) | For those records from the products and each product's manufacturer, a bar chart shows the distribution of name and the average of code , and group by attribute name, display from low to high by the x-axis. | SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name |
CREATE TABLE table_41587 (
"Position" text,
"Jersey number" real,
"Name v t e" text,
"Height (cm)" real,
"Weight (kg)" real,
"Birthplace" text,
"2008-09 team" text,
"NHL rights, if any" text
) | What is the average weight of the player with a height of 180 cm and plays the d position? | SELECT AVG("Weight (kg)") FROM table_41587 WHERE "Height (cm)" = '180' AND "Position" = 'd' |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
i... | what was patient 004-64091's last output since 12/29/2105? | 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 = '004-64091')) AND intakeoutput.cellpath LIKE '%output%' AND S... |
CREATE TABLE table_204_256 (
id number,
"position" number,
"club" text,
"played" number,
"points" number,
"wins" number,
"draws" number,
"losses" number,
"goals for" number,
"goals against" number,
"goal difference" number
) | what is the combined wins of the clubs in the top 3 positions ? | SELECT SUM("wins") FROM table_204_256 WHERE "position" <= 3 |
CREATE TABLE table_2931 (
"Player" text,
"Position" text,
"NASL years" text,
"NASL club(s)" text,
"Accolades (Pre-NASL)" text
) | How many years of nasl years did the accolades read 'captained england to victory at the 1966 world cup'? | SELECT COUNT("NASL years") FROM table_2931 WHERE "Accolades (Pre-NASL)" = 'Captained England to victory at the 1966 World Cup' |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate tim... | Ever Protected Questions, simple search. | SELECT ph.PostId AS "post_link", ph.CreationDate AS "protected_date", CASE ph.UserId WHEN NULL THEN ph.UserDisplayName ELSE ph.UserId END AS "user_link" FROM PostHistory AS ph WHERE ph.PostHistoryTypeId = 19 ORDER BY ph.PostId, ph.CreationDate |
CREATE TABLE table_4606 (
"Team" text,
"Chassis" text,
"Engine" text,
"Tires" text,
"Drivers" text
) | What chassis did Gordon Johncock use with his cosworth engine? | SELECT "Chassis" FROM table_4606 WHERE "Engine" = 'cosworth' AND "Drivers" = 'gordon johncock' |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
countr... | In 2004 Spring , EEB 801 will have how many professors teaching it ? | SELECT COUNT(DISTINCT instructor.instructor_id) FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EEB' AND course.number = 801 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offeri... |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | which patients have metl25 drug code? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "METL25" |
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 prescriptions (
row_id number,
subject_id number,
h... | tell me the maximum sao2 in patient 4368 on 05/24/this year? | SELECT MAX(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4368)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'sao2'... |
CREATE TABLE Documents_with_Expenses (
Document_ID INTEGER,
Budget_Type_Code CHAR(15),
Document_Details VARCHAR(255)
)
CREATE TABLE Accounts (
Account_ID INTEGER,
Statement_ID INTEGER,
Account_Details VARCHAR(255)
)
CREATE TABLE Ref_Budget_Codes (
Budget_Type_Code CHAR(15),
Budget_Type... | Show the number of documents created in each day and bin document date by year interval with a line chart, display in desc by the Document_Date please. | SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code ORDER BY Document_Date DESC |
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 text,
flag text,
value_unit text,... | Let me know the number of patients with diagnoses icd9 code 49320 who had a urine test. | 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.icd9_code = "49320" AND lab.fluid = "Urine" |
CREATE TABLE table_43387 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | How many Gold medals did Great Britain with a Total of more than 2 medals receive? | SELECT MIN("Gold") FROM table_43387 WHERE "Nation" = 'great britain' AND "Total" > '2' |
CREATE TABLE table_20574 (
"Date (CE)" text,
"Text" text,
"Simplified characters" text,
"Traditional characters" text,
"Pinyin" text,
"Wade-Giles" text,
"Literal meaning" text
) | Name the pinyin for 657 date | SELECT "Pinyin" FROM table_20574 WHERE "Date (CE)" = '657' |
CREATE TABLE table_70169 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Podiums" real
) | How many wins has a podiums greater than 1 and 9 as the races with a season after 1984? | SELECT COUNT("Wins") FROM table_70169 WHERE "Podiums" > '1' AND "Races" = '9' AND "Season" > '1984' |
CREATE TABLE Settlements (
Settlement_ID INTEGER,
Claim_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amount_Settled INTEGER,
Customer_Policy_ID INTEGER
)
CREATE TABLE Customers (
Customer_ID INTEGER,
Customer_Details VARCHAR(255)
)
CREATE TABLE... | Show the amount for all the payments processed with Visa distributing the payment date with a bar chart, display in descending by the Date_Payment_Made please. | SELECT Date_Payment_Made, Amount_Payment FROM Payments WHERE Payment_Method_Code = 'Visa' ORDER BY Date_Payment_Made DESC |
CREATE TABLE table_50675 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | What was the finish for the golfer with a total of 285? | SELECT "Finish" FROM table_50675 WHERE "Total" = '285' |
CREATE TABLE table_name_46 (
away_team VARCHAR,
tie_no VARCHAR
) | For the Tie number of 14 who was the away team? | SELECT away_team FROM table_name_46 WHERE tie_no = "14" |
CREATE TABLE table_9537 (
"Tournament" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | What 2009 has statistics by surface in 2012? | SELECT "2009" FROM table_9537 WHERE "2012" = 'statistics by surface' |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees who did not have any job in the past, give me the comparison about the average of department_id over the job_id , and group by attribute job_id. | SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID |
CREATE TABLE table_72689 (
"Conflict" text,
"United Nations Mission" text,
"Sexual abuse 1" real,
"Murder 2" real,
"Extortion/Theft 3" text
) | What is the sexual abuse rate where the conflict is the Burundi Civil War? | SELECT MAX("Sexual abuse 1") FROM table_72689 WHERE "Conflict" = 'Burundi Civil War' |
CREATE TABLE table_51415 (
"Air Date" text,
"Timeslot (EST)" text,
"Season" text,
"Rating" real,
"Share" real,
"18-49 (Rating/Share)" text,
"Viewers (m)" real,
"Weekly Rank (#)" text
) | What is the highest number of viewers for a rating greater than 9.4? | SELECT MAX("Viewers (m)") FROM table_51415 WHERE "Rating" > '9.4' |
CREATE TABLE table_47602 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What was the score when the home team was Stockport County? | SELECT "Score" FROM table_47602 WHERE "Home team" = 'stockport county' |
CREATE TABLE table_15518 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | What is the average round of the match in the Hero's 9 event with a time of 5:00? | SELECT AVG("Round") FROM table_15518 WHERE "Time" = '5:00' AND "Event" = 'hero''s 9' |
CREATE TABLE table_51453 (
"Opponent" text,
"Result" text,
"Score" text,
"Date" text,
"Venue" text
) | Who won that game on 24 July 2010? | SELECT "Result" FROM table_51453 WHERE "Date" = '24 july 2010' |
CREATE TABLE table_name_80 (
ends VARCHAR,
transfer_fee VARCHAR
) | What is the total number of ends when the transfer fee was dkk 14m? | SELECT COUNT(ends) FROM table_name_80 WHERE transfer_fee = "dkk 14m" |
CREATE TABLE table_10881 (
"Result" text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Location" text
) | Which Event has the Opponent, Jason Yee? | SELECT "Event" FROM table_10881 WHERE "Opponent" = 'jason yee' |
CREATE TABLE table_name_21 (
away_team VARCHAR
) | What did South Melbourne score when they were the Away team? | SELECT away_team AS score FROM table_name_21 WHERE away_team = "south melbourne" |
CREATE TABLE table_11462 (
"Tournament" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | What is the 2007 value with NMS in 2011? | SELECT "2007" FROM table_11462 WHERE "2011" = 'nms' |
CREATE TABLE projects (
project_id number,
organisation_id number,
project_details text
)
CREATE TABLE staff_roles (
role_code text,
role_description text
)
CREATE TABLE organisations (
organisation_id number,
organisation_type text,
organisation_details text
)
CREATE TABLE organisati... | How many kinds of roles are there for the staff? | SELECT COUNT(DISTINCT role_code) FROM project_staff |
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,
... | when was the first time that patient 007-849 on the last intensive care unit visit had systemicmean less than 215.0? | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-849') AND NOT patient.unitdischargetime IS NULL... |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight 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 TA... | show me the flights from SAN FRANCISCO to DALLAS | 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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '... |
CREATE TABLE table_203_449 (
id number,
"name" text,
"lifetime" text,
"nationality" text,
"notable as" text,
"notes" text
) | how many novelists are listed ? | SELECT COUNT(*) FROM table_203_449 WHERE "notable as" = 'novelist' |
CREATE TABLE table_23486853_8 (
score VARCHAR,
location VARCHAR,
points VARCHAR
) | What is every score at the location of Verizon Center and points of 68? | SELECT score FROM table_23486853_8 WHERE location = "Verizon Center" AND points = 68 |
CREATE TABLE table_59626 (
"Player" text,
"Team" text,
"Matches" real,
"Overs" real,
"Runs" real,
"Wickets" real,
"Best" text,
"Econ" real,
"S/Rate" real,
"4/inns" real,
"5+/inns" real,
"Average" real
) | What is the average wickets that have overs greater than 44, danish kaneria as the player, with an average greater than 13.8? | SELECT AVG("Wickets") FROM table_59626 WHERE "Overs" > '44' AND "Player" = 'danish kaneria' AND "Average" > '13.8' |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | how many patients are admitted before the year 2170 and used the drug clobetasol propionate 0.05% oinment? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2170" AND prescriptions.drug = "Clobetasol Propionate 0.05% Ointment" |
CREATE TABLE table_76273 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is High Points, when Game is less than 10, and when High Assists is 'Chauncey Billups (8)'? | SELECT "High points" FROM table_76273 WHERE "Game" < '10' AND "High assists" = 'chauncey billups (8)' |
CREATE TABLE table_33047 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was Carlton's score when they were the away team? | SELECT "Away team score" FROM table_33047 WHERE "Away team" = 'carlton' |
CREATE TABLE table_1566852_4 (
centerfold_model VARCHAR,
cover_model VARCHAR
) | How many centerfold models were there when the cover model was Torrie Wilson? | SELECT COUNT(centerfold_model) FROM table_1566852_4 WHERE cover_model = "Torrie Wilson" |
CREATE TABLE table_71210 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | Who took the loss on May 25? | SELECT "Loss" FROM table_71210 WHERE "Date" = 'may 25' |
CREATE TABLE table_38228 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Attendance" real,
"Record" text,
"Points" real
) | Which Date has a Visitor of boston? | SELECT "Date" FROM table_38228 WHERE "Visitor" = 'boston' |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jo... | What are all the courses for Other ? | SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE program_course.category LIKE '%Other%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id |
CREATE TABLE table_train_3 (
"id" int,
"pregnancy_or_lactation" bool,
"severe_sepsis" bool,
"systolic_blood_pressure_sbp" int,
"mean_arterial_pressure_map" int,
"leukocyte_count" int,
"renal_disease" bool,
"temperature" float,
"sepsis" bool,
"hypotension" bool,
"heart_rate" i... | patient age > 18 years | SELECT * FROM table_train_3 WHERE age > 18 |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE... | select count(*) from posts where posts.ViewCount > 58000;. | SELECT COUNT(*) FROM Posts WHERE Posts.ViewCount > 58000 |
CREATE TABLE table_18499 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | what's the result with dbeingtrict being florida 4 | SELECT "Result" FROM table_18499 WHERE "District" = 'Florida 4' |
CREATE TABLE field (
fieldid int
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE cite (
... | How many papers does michael i. jordan have in 2016 ? | SELECT DISTINCT COUNT(writes.paperid) FROM author, paper, writes WHERE author.authorname = 'michael i. jordan' AND paper.year = 2016 AND writes.authorid = author.authorid AND writes.paperid = paper.paperid |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | give me the number of patients with hypopotassemia diagnoses who have both eyes as route of drug administration. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Hypopotassemia" AND prescriptions.route = "BOTH EYES" |
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adults INTEGER,
Kids INTEGER
)
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
baseP... | Show the average price of the rooms in different decor using a bar chart, sort from low to high by the X please. | SELECT decor, AVG(basePrice) FROM Rooms GROUP BY decor ORDER BY decor |
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
) | Draw a bar chart for what is average age of male for different job title?, order by the job in asc. | SELECT job, AVG(age) FROM Person WHERE gender = 'male' GROUP BY job ORDER BY job |
CREATE TABLE table_name_24 (
position VARCHAR,
pick VARCHAR,
college VARCHAR
) | What position did the player from Rice College play who was picked under 15? | SELECT position FROM table_name_24 WHERE pick < 15 AND college = "rice" |
CREATE TABLE restaurant (
id int,
name varchar,
food_type varchar,
city_name varchar,
rating "decimal
)
CREATE TABLE location (
restaurant_id int,
house_number int,
street_name varchar,
city_name varchar
)
CREATE TABLE geographic (
city_name varchar,
county varchar,
reg... | where is the best restaurant in bay area for american food ? | SELECT location.house_number, restaurant.name FROM geographic, location, restaurant WHERE geographic.region = 'bay area' AND restaurant.city_name = geographic.city_name AND restaurant.food_type = 'american' AND restaurant.id = location.restaurant_id AND restaurant.rating = (SELECT MAX(RESTAURANTalias1.rating) FROM geog... |
CREATE TABLE table_7814 (
"Tournament" text,
"Wins" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | What is the sum of top-10 values for the Open Championship and less than 3 in the top-25? | SELECT SUM("Top-10") FROM table_7814 WHERE "Tournament" = 'the open championship' AND "Top-25" < '3' |
CREATE TABLE table_name_2 (
series VARCHAR,
season VARCHAR
) | What is Series, when Season is 2007? | SELECT series FROM table_name_2 WHERE season = 2007 |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Number of custom off-topic close reasons for each site. | SELECT COUNT(*) FROM CloseAsOffTopicReasonTypes WHERE NOT ApprovalDate IS NULL AND DeactivationDate IS NULL |
CREATE TABLE table_22020 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | Which club had 2 wins and 1 draw? | SELECT "Club" FROM table_22020 WHERE "Drawn" = '1' AND "Won" = '2' |
CREATE TABLE table_1231316_5 (
fastest_time__s_ VARCHAR,
nation VARCHAR
) | Nigeria had the fastest time once. | SELECT COUNT(fastest_time__s_) FROM table_1231316_5 WHERE nation = "Nigeria" |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | count the number of patients whose age is less than 24 and procedure long title is endoscopic removal of stone(s) from biliary tract? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "24" AND procedures.long_title = "Endoscopic removal of stone(s) from biliary tract" |
CREATE TABLE table_35497 (
"Player" text,
"Position" text,
"Overall Pick" real,
"Round" text,
"NFL Draft" real,
"Franchise" text
) | What is the highest NFL Draft that has jeff robinson as the player, with an overall pick less than 98? | SELECT MAX("NFL Draft") FROM table_35497 WHERE "Player" = 'jeff robinson' AND "Overall Pick" < '98' |
CREATE TABLE table_77984 (
"Player" text,
"Position" text,
"Round" real,
"Pick" real,
"NFL Club" text
) | What was the latest round that Derek Pagel was selected with a pick higher than 50? | SELECT MAX("Round") FROM table_77984 WHERE "Pick" > '50' AND "Player" = 'derek pagel' |
CREATE TABLE table_name_4 (
date VARCHAR,
score VARCHAR,
opponents VARCHAR
) | What is Date, when Score is '0-2', and when Opponents is 'Bayer Leverkusen'? | SELECT date FROM table_name_4 WHERE score = "0-2" AND opponents = "bayer leverkusen" |
CREATE TABLE table_name_17 (
d_40 VARCHAR,
d_44 VARCHAR
) | I want the D 40 with D 44 of d 15 | SELECT d_40 FROM table_name_17 WHERE d_44 = "d 15" |
CREATE TABLE table_20680 (
"Dates (MDY)" text,
"Position" real,
"Gross sales" text,
"Tickets sold / available" text,
"Sellout (%)" text
) | What is the position of tickets sold/available when the sellout is 82%? | SELECT COUNT("Tickets sold / available") FROM table_20680 WHERE "Sellout (%)" = '82%' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.