table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_38605 (
"Team" text,
"Recopa 1995" text,
"Supercopa 1995" text,
"CONMEBOL 1995" text,
"Copa Libertadores 1996" text
) | which Copa Libertadores 1996 has round 1 Supercopa 1995 and argentinos juniors team ? | SELECT "Copa Libertadores 1996" FROM table_38605 WHERE "Supercopa 1995" = 'round 1' AND "Team" = 'argentinos juniors' |
CREATE TABLE table_67107 (
"Date" text,
"Visiting Team" text,
"Final Score" text,
"Host Team" text,
"Stadium" text
) | Name the date for visiting team of denver broncos | SELECT "Date" FROM table_67107 WHERE "Visiting Team" = 'denver broncos' |
CREATE TABLE table_7818 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What was the game number of the game played against Charlotte? | SELECT COUNT("Game") FROM table_7818 WHERE "Team" = 'charlotte' |
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(... | Compare the total number of different job titles for all those jobs in department 80 using a bar chart. | SELECT JOB_TITLE, COUNT(JOB_TITLE) FROM employees AS T1 JOIN jobs AS T2 ON T1.JOB_ID = T2.JOB_ID WHERE T1.DEPARTMENT_ID = 80 GROUP BY JOB_TITLE |
CREATE TABLE table_9624 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What was Fuzzy Zoeller's score in the United States? | SELECT "Score" FROM table_9624 WHERE "Country" = 'united states' AND "Player" = 'fuzzy zoeller' |
CREATE TABLE table_203_79 (
id number,
"year" number,
"film" text,
"publisher" text,
"director" text,
"distributor" text,
"worldwide gross" text,
"notes" text
) | what is the number of live action american superhero movies released in 1978 ? | SELECT COUNT("film") FROM table_203_79 WHERE "year" = 1978 |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod tim... | what are the four most common medicines that patients were prescribed during the same month after they were prescribed rufinamide until 2101? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'rufinamide' AND STRFTIME('%y', prescriptions.startdate) <= '2101'... |
CREATE TABLE table_19834691_4 (
timeslot VARCHAR,
_number VARCHAR
) | name the total number of timeslot for number 1 | SELECT COUNT(timeslot) FROM table_19834691_4 WHERE _number = 1 |
CREATE TABLE table_name_66 (
bronze INTEGER,
total VARCHAR,
gold VARCHAR
) | What is the low bronze total for the team with 4 total and under 1 gold? | SELECT MIN(bronze) FROM table_name_66 WHERE total = 4 AND gold < 1 |
CREATE TABLE instructor (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
salary numeric(8,2)
)
CREATE TABLE prereq (
course_id varchar(8),
prereq_id varchar(8)
)
CREATE TABLE student (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
tot_cred numeric(3,0)
)
CRE... | Bar chart of minimal salary from each dept name, order dept_name in ascending order please. | SELECT dept_name, MIN(salary) FROM instructor GROUP BY dept_name ORDER BY dept_name |
CREATE TABLE table_35545 (
"Series Ep." text,
"Episode" real,
"Netflix" text,
"Segment A" text,
"Segment B" text,
"Segment C" text,
"Segment D" text
) | What was the B segmint for Netlix S03E01? | SELECT "Segment B" FROM table_35545 WHERE "Netflix" = 's03e01' |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
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_re... | in ATLANTA i would like information on ground transportation | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'ATLANTA' AND ground_service.city_code = city.city_code |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | GENERATE HTML PAGE SHOWING (mostly) ANIMATED GIFS posted in specified # of days. Creates HTML to paste into blank .html file showing .GIF images (mostly animated GIFs) linked to Q&A posts within 'the past number of days specified'. Looks for the first occurrence of `.gif` in the post body and searches backwards for `ht... | SELECT SUBSTRING(Body, CHARINDEX(@stEnd, Body) + LEN(@stStart) - (CHARINDEX(REVERSE(@stStart), REVERSE(LEFT(Body, CHARINDEX(@stEnd, Body) + LEN(@stStart) - 1))) + LEN(@stStart) - 1), CHARINDEX(REVERSE(@stStart), REVERSE(LEFT(Body, CHARINDEX(@stEnd, Body) + LEN(@stStart) - 1))) + LEN(@stStart) - 1) AS "gif_url", CASE WH... |
CREATE TABLE table_76990 (
"Title" text,
"Lyricist(s)" text,
"Composer(s)" text,
"Arranger(s)" text,
"Length" text
) | Who was the arranger of ' '? | SELECT "Arranger(s)" FROM table_76990 WHERE "Title" = 'ขอโทษ' |
CREATE TABLE table_52371 (
"Party" text,
"Leader" text,
"Votes" real,
"Percentage" text,
"Seats" real
) | Which highest number of Seats has votes of 244,867? | SELECT MAX("Seats") FROM table_52371 WHERE "Votes" = '244,867' |
CREATE TABLE table_62049 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Competition" text
) | When did the peterborough phantoms play at a venue of home? | SELECT "Date" FROM table_62049 WHERE "Venue" = 'home' AND "Opponent" = 'peterborough phantoms' |
CREATE TABLE patient (
ssn number,
name text,
address text,
phone text,
insuranceid number,
pcp number
)
CREATE TABLE medication (
code number,
name text,
brand text,
description text
)
CREATE TABLE prescribes (
physician number,
patient number,
medication number,
... | How many rooms does each block floor have? | SELECT COUNT(*), T1.blockfloor FROM block AS T1 JOIN room AS T2 ON T1.blockfloor = T2.blockfloor AND T1.blockcode = T2.blockcode GROUP BY T1.blockfloor |
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | When is 511 offered next semester ? | SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course, course_offering, semester WHERE course.course_id = course_offe... |
CREATE TABLE table_name_14 (
prohibition_ticket VARCHAR,
progressive_ticket VARCHAR
) | What name ran for the Prohibition ticket when the Progressive ticket was Eugene M. Travis? | SELECT prohibition_ticket FROM table_name_14 WHERE progressive_ticket = "eugene m. travis" |
CREATE TABLE table_name_48 (
proto_oceanic VARCHAR,
proto_polynesian VARCHAR
) | Which Proto-Oceanic has a Proto-Polynesian of *lima? | SELECT proto_oceanic FROM table_name_48 WHERE proto_polynesian = "*lima" |
CREATE TABLE table_41538 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | What is the average number of drawn with a difference of 17 and 22 points? | SELECT AVG("Drawn") FROM table_41538 WHERE "Difference" = '17' AND "Points" = '22' |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
... | what is patient 015-7988's first diagnosis until 4 years ago? | SELECT diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-7988')) AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CUR... |
CREATE TABLE table_36079 (
"Name" text,
"Species Specific" text,
"Intra-molecular structure" text,
"Comparative" text,
"Link" text
) | Which Species Specific has a Comparative of no, and an Intra-molecular structure of no, and a Link of sourcecode? | SELECT "Species Specific" FROM table_36079 WHERE "Comparative" = 'no' AND "Intra-molecular structure" = 'no' AND "Link" = 'sourcecode' |
CREATE TABLE table_70973 (
"Round" real,
"Overall" real,
"Player" text,
"Position" text,
"College" text
) | What is the lowest overall with more than 17 rounds? | SELECT MIN("Overall") FROM table_70973 WHERE "Round" > '17' |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
... | what is the marital status of patient 19894 in their first hospital encounter. | SELECT admissions.marital_status FROM admissions WHERE admissions.subject_id = 19894 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1 |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
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,
lan... | when did patient 92788 get white blood cells lab test for the last time during their current hospital visit? | SELECT labevents.charttime 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 admissions.subject_id = 92788 AND admissions.dischtime IS NULL) ORDER BY labevents.chartti... |
CREATE TABLE drivers (
driverId INTEGER,
driverRef TEXT,
number TEXT,
code TEXT,
forename TEXT,
surname TEXT,
dob TEXT,
nationality TEXT,
url TEXT
)
CREATE TABLE pitStops (
raceId INTEGER,
driverId INTEGER,
stop INTEGER,
lap INTEGER,
time TEXT,
duration TEXT,... | What are the number of the names of all the Japanese constructors that have earned more than 5 points?, display in ascending by the x-axis please. | SELECT name, COUNT(name) FROM constructors AS T1 JOIN constructorStandings AS T2 ON T1.constructorId = T2.constructorId WHERE T1.nationality = "Japanese" AND T2.points > 5 GROUP BY name ORDER BY name |
CREATE TABLE table_name_70 (
first_class_team VARCHAR,
date_of_birth VARCHAR
) | What is the first class team of the player born on 23 February 1973? | SELECT first_class_team FROM table_name_70 WHERE date_of_birth = "23 february 1973" |
CREATE TABLE table_204_164 (
id number,
"branding" text,
"callsign" text,
"frequency" text,
"power (kw)" text,
"location" text
) | what is the difference in kw between naga and bacolod radio ? | SELECT ABS((SELECT "power (kw)" FROM table_204_164 WHERE "location" = 'naga') - (SELECT "power (kw)" FROM table_204_164 WHERE "location" = 'bacolod')) |
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 products with a price between 60 and 120, give me the comparison about manufacturer over the name , and rank x axis from low to high order. | SELECT Name, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Name |
CREATE TABLE table_name_5 (
week INTEGER,
date VARCHAR
) | WHAT IS THE AVERAGE WEEK WITH A DATE OF JULY 25? | SELECT AVG(week) FROM table_name_5 WHERE date = "july 25" |
CREATE TABLE table_71772 (
"Year" real,
"Men's singles" text,
"Women's singles" text,
"Men's doubles" text,
"Women's doubles" text,
"Mixed doubles" text
) | Who won Women's doubles when Zen Yaqiong won Women's singles? | SELECT "Women's doubles" FROM table_71772 WHERE "Women's singles" = 'zen yaqiong' |
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 microlab (
microl... | has patient 013-29856 received any diagnoses on the last hospital encounter? | SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-29856' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.ho... |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Give me the comparison about the average of School_ID over the All_Home , and group by attribute All_Home by a bar chart, I want to display by the x axis from low to high. | SELECT All_Home, AVG(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home |
CREATE TABLE table_name_91 (
player VARCHAR,
score VARCHAR
) | Who had a score of 77-69-70-71=287? | SELECT player FROM table_name_91 WHERE score = 77 - 69 - 70 - 71 = 287 |
CREATE TABLE table_name_10 (
height_ft___m__ VARCHAR,
street_address VARCHAR
) | How tall is the Street address of 07.0 200 east washington street? | SELECT height_ft___m__ FROM table_name_10 WHERE street_address = "07.0 200 east washington street" |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY... | For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about salary over the job_id , rank by the Y-axis in ascending. | SELECT JOB_ID, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SALARY |
CREATE TABLE teachers (
lastname text,
firstname text,
classroom number
)
CREATE TABLE list (
lastname text,
firstname text,
grade number,
classroom number
) | Which teachers teach in classroom 109? Give me their last names. | SELECT lastname FROM teachers WHERE classroom = 109 |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | what is marital status and diagnoses short title of subject id 42067? | SELECT demographic.marital_status, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "42067" |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE month (
month_number int,
... | i need a flight from OAKLAND to SALT LAKE CITY on wednesday departing after 1800 | SELECT DISTINCT flight_id FROM flight WHERE (((departure_time > 1800 AND 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 = 23 AND DATE_DAYalias0.month_number = 4 AND DATE_DAYa... |
CREATE TABLE table_70218 (
"Currency" text,
"Code" text,
"Entry ERM II" text,
"Central rate" text,
"Official target date" text
) | What is the official target date for the Swedish Krona? | SELECT "Official target date" FROM table_70218 WHERE "Currency" = 'swedish krona' |
CREATE TABLE table_7194 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Location" text
) | Where was the location for Arras Paul Arras? | SELECT "Location" FROM table_7194 WHERE "Opponent" = 'arras paul arras' |
CREATE TABLE table_51373 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | What was the record on March 22? | SELECT "Record" FROM table_51373 WHERE "Date" = 'march 22' |
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,
language text,
religion text,
... | how many patients died in or befor 2186 with diagnosis icd9 code 42613? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dod_year <= "2186.0" AND diagnoses.icd9_code = "42613" |
CREATE TABLE table_name_75 (
name VARCHAR,
league_cup_goals VARCHAR,
league_apps VARCHAR
) | Which Name has a League Cup Goals of 0, and League Apps of 1? | SELECT name FROM table_name_75 WHERE league_cup_goals = 0 AND league_apps = "1" |
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,
linksto text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,... | on this month/21, was arterial bp [diastolic] of patient 10855 ever less than 61.0? | SELECT COUNT(*) > 0 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 = 10855)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [dias... |
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,
wa... | what was the first time that patient 025-64321 had the maximum sao2 since 08/21/2102? | 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 = '025-64321')) AND NOT vitalperiodic.sao2 IS NULL AND... |
CREATE TABLE table_39490 (
"Volume:Issue" text,
"Issue Date(s)" text,
"Weeks on Top" real,
"Song" text,
"Artist" text
) | When was the song by Andy Gibb issued? | SELECT "Issue Date(s)" FROM table_39490 WHERE "Artist" = 'andy gibb' |
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,... | give me the number of patients whose insurance is medicaid and procedure icd9 code is 331? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicaid" AND procedures.icd9_code = "331" |
CREATE TABLE table_1818471_1 (
value VARCHAR,
mitchell VARCHAR
) | What is every value when Mitchell is 676? | SELECT value FROM table_1818471_1 WHERE mitchell = 676 |
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,
... | what are the top four most common lab tests until 4 years ago? | SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE DATETIME(lab.labresulttime) <= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 4 |
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
)
... | give me the number of patients whose ethnicity is black/cape verdean and primary disease is colangitis? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.diagnosis = "COLANGITIS" |
CREATE TABLE table_25794 (
"Rank" real,
"City/Town" text,
"County" text,
"Region/Province" text,
"Population" real,
"Country" text
) | When 142900 is the population what is the highest rank? | SELECT MAX("Rank") FROM table_25794 WHERE "Population" = '142900' |
CREATE TABLE table_10578 (
"Year" real,
"City" text,
"Rider 1" text,
"Rider 2" text,
"Horse 1" text,
"Horse 2" text,
"Association" text
) | With which association did estribillo ii run as Horse 1? | SELECT "Association" FROM table_10578 WHERE "Horse 1" = 'estribillo ii' |
CREATE TABLE table_22459 (
"Township" text,
"County" text,
"Pop. (2010)" real,
"Land ( sqmi )" text,
"Water (sqmi)" text,
"Latitude" text,
"Longitude" text,
"GEO ID" real,
"ANSI code" real
) | how many latitudes have 0.081 (sqmi) of water? | SELECT COUNT("Latitude") FROM table_22459 WHERE "Water (sqmi)" = '0.081' |
CREATE TABLE table_72090 (
"District" text,
"Total amount of trees" real,
"Prevailing types, %" text,
"Amount of old trees" text,
"Amount of trees, that require replacement" text
) | What is the amount of trees, that require replacement when district is leninsky? | SELECT "Amount of trees, that require replacement" FROM table_72090 WHERE "District" = 'Leninsky' |
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE month (
... | please give me flights from ATLANTA to BOSTON on wednesday afternoon and thursday morning | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((((flight.departure_time BETWEEN 0 AND 1200) AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_na... |
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,
... | what are the numbers of patients who have had a diuretic - spironolactone two or more times? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'diuretic - spironolactone') GROUP BY patient.uniquepid) AS t1 WHERE t1.c1 >= 2 |
CREATE TABLE table_15887683_15 (
television_service VARCHAR,
country VARCHAR,
n° VARCHAR
) | what television service are in the united kingdom and n is greater than 854.0? | SELECT television_service FROM table_15887683_15 WHERE country = "United Kingdom" AND n° > 854.0 |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE restriction (
restriction_code text,
... | what kinds of ground transportation is available in DALLAS FORT WORTH | SELECT DISTINCT ground_service.transport_type FROM city AS CITY_0, city AS CITY_1, ground_service WHERE (ground_service.city_code = CITY_0.city_code AND CITY_0.city_name = 'DALLAS') OR (ground_service.city_code = CITY_1.city_code AND CITY_1.city_name = 'FORT WORTH') |
CREATE TABLE table_30407 (
"Season" text,
"Host" text,
"Mens Singles" text,
"Womens Singles" text,
"Mens Doubles" text,
"Womens Doubles" text
) | How many people are women's singles in the season of 2000/01? | SELECT COUNT("Womens Singles") FROM table_30407 WHERE "Season" = '2000/01' |
CREATE TABLE table_72843 (
"Poll Year" text,
"Winner" text,
"Second" text,
"Third" text,
"Fourth" text,
"Fifth" text,
"Sixth" text,
"Seventh" text,
"Eighth" text,
"Ninth" text,
"Tenth" text
) | Who was in 4th when in 6th is Air Traffic? | SELECT "Fourth" FROM table_72843 WHERE "Sixth" = 'Air Traffic' |
CREATE TABLE table_59559 (
"Show" text,
"Date" text,
"Official ratings (millions)" real,
"Weekly rank" text,
"Share" text
) | Which Share has a weekly Rank of 8 and is dated 15 June? | SELECT "Share" FROM table_59559 WHERE "Weekly rank" = '8' AND "Date" = '15 june' |
CREATE TABLE table_203_387 (
id number,
"parish est" number,
"church" text,
"city" text,
"current bldg begun" number,
"weekly collections" text,
"notes" number
) | our lady of the assumption catholic church started the same year as what church ? | SELECT "church" FROM table_203_387 WHERE "church" <> 'our lady of the assumption catholic church' AND "current bldg begun" = (SELECT "current bldg begun" FROM table_203_387 WHERE "church" = 'our lady of the assumption catholic church') |
CREATE TABLE table_3897 (
"Position" real,
"Driver" text,
"Points" real,
"Winnings" text,
"Series" text
) | how many winnings does jeff gordon have? | SELECT "Winnings" FROM table_3897 WHERE "Driver" = 'Jeff Gordon' |
CREATE TABLE table_31826 (
"Rank" real,
"Rider" text,
"Team" text,
"Speed" text,
"Time" text
) | What is the time/s of team Triumph in those races in which Triumph ranked higher than 4? | SELECT "Time" FROM table_31826 WHERE "Team" = 'triumph' AND "Rank" < '4' |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE procedures_icd (
... | did patient 24268 excreted any of his urine . on the first icu visit? | SELECT COUNT(*) > 0 FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24268) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND outputevents.itemid IN (SELECT... |
CREATE TABLE table_6745 (
"Buechel & Manhart spelling (pronunciation)" text,
"Ullrich" text,
"Brandon University" text,
"Deloria & Boas" text,
"Dakota Mission" text,
"Rood & Taylor" text,
"Riggs" text,
"Williamson" text,
"University of Minnesota" text,
"White Hat" text
) | University of Minnesota of had what Deloria & Boas? | SELECT "Deloria & Boas" FROM table_6745 WHERE "University of Minnesota" = 'ṭ' |
CREATE TABLE table_name_20 (
site VARCHAR,
attendance VARCHAR
) | What Site had an Attendance of 45,000? | SELECT site FROM table_name_20 WHERE attendance = "45,000" |
CREATE TABLE table_6581 (
"Celebrity" text,
"Famous for" text,
"Entered" text,
"Exited" text,
"Finished" text
) | Which celebrity who was famous for being the ex busted member and TV presenter exited on day 19? | SELECT "Celebrity" FROM table_6581 WHERE "Exited" = 'day 19' AND "Famous for" = 'ex busted member and tv presenter' |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TAB... | Answers to Delphi Posts with Accepted Answer and Fav Count>2. Enter Query Description | SELECT * FROM Posts WHERE ParentId IN (SELECT Id FROM Posts WHERE FavoriteCount > 2 AND NOT AcceptedAnswerId IS NULL AND Id IN (SELECT PostId FROM PostTags WHERE TagId IN (SELECT Id FROM Tags WHERE TagName LIKE '%delphi%'))) |
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
)
... | give the number of patients whose drug code is posa200l and lab test fluid is urine? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "POSA200L" AND lab.fluid = "Urine" |
CREATE TABLE table_41737 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What was the lowest attendance at a week 15 game? | SELECT MIN("Attendance") FROM table_41737 WHERE "Week" = '15' |
CREATE TABLE table_76887 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
) | On what date did Fleetcenter have a game lower than 9 with a score of 104-94? | SELECT "Date" FROM table_76887 WHERE "Location" = 'fleetcenter' AND "Game" < '9' AND "Score" = '104-94' |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | Are there certain professors who do not teach any classes with labs ? | SELECT DISTINCT instructor.name FROM instructor, course, course_offering, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course_offering.offering_id = offering_instructor.offering_id AND instructor.instructor_id = offering_instructor.instructor_id AND NOT instr... |
CREATE TABLE table_name_11 (
podiums VARCHAR,
races VARCHAR,
final_placing VARCHAR
) | Which Podium has 1 Race and a Final Place of 5th? | SELECT podiums FROM table_name_11 WHERE races = "1" AND final_placing = "5th" |
CREATE TABLE prereq (
course_id varchar(8),
prereq_id varchar(8)
)
CREATE TABLE advisor (
s_ID varchar(5),
i_ID varchar(5)
)
CREATE TABLE section (
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
building varchar(15),
room_number varchar(7),
... | Find the minimum salary for the departments whose average salary is above the average payment of all instructors Plot them as bar chart, display in ascending by the Y-axis. | SELECT dept_name, MIN(salary) FROM instructor GROUP BY dept_name ORDER BY MIN(salary) |
CREATE TABLE salary (
year number,
team_id text,
league_id text,
player_id text,
salary number
)
CREATE TABLE player (
player_id text,
birth_year text,
birth_month text,
birth_day text,
birth_country text,
birth_state text,
birth_city text,
death_year text,
death... | What is the average lifespan of a baseball player? | SELECT AVG(death_year - birth_year) FROM player |
CREATE TABLE table_34849 (
"Tournament" text,
"1981" text,
"1982" text,
"1983" text,
"1984" text,
"1985" text,
"1986" text,
"1987" text,
"1988" text,
"1989" text
) | Which Tournament has a 1984 of 1r? | SELECT "Tournament" FROM table_34849 WHERE "1984" = '1r' |
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TE... | How many wines are there for each grape, and I want to display by the X in ascending. | SELECT Grape, COUNT(*) FROM wine GROUP BY Grape ORDER BY Grape |
CREATE TABLE table_name_7 (
bronze INTEGER,
rank VARCHAR,
silver VARCHAR
) | Which Bronze is the lowest one that has a Rank of 3, and a Silver smaller than 2? | SELECT MIN(bronze) FROM table_name_7 WHERE rank = "3" AND silver < 2 |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of email and manager_id in a bar chart, display by the bar in descending please. | SELECT EMAIL, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMAIL DESC |
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... | provide the number of patients whose primary disease is ruq pain and year of birth is less than 2041? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "RUQ PAIN" AND demographic.dob_year < "2041" |
CREATE TABLE table_name_46 (
rank VARCHAR,
athletes VARCHAR
) | What is the rank of Manuel Cortina Mart nez? | SELECT rank FROM table_name_46 WHERE athletes = "manuel cortina martínez" |
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 procedures (
... | how many patients had a diagnosis short title preterm nec 2000-2499g and ih as the drug route? | 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 = "Preterm NEC 2000-2499g" AND prescriptions.route = "IH" |
CREATE TABLE election (
Election_ID int,
Representative_ID int,
Date text,
Votes real,
Vote_Percent real,
Seats real,
Place real
)
CREATE TABLE representative (
Representative_ID int,
Name text,
State text,
Party text,
Lifespan text
) | Pie. what are the different parties of representative? Show the party name and the number of representatives in each party. | SELECT Party, COUNT(*) FROM representative GROUP BY Party |
CREATE TABLE table_18113 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text,
"Candidates" text
) | Which party does the incumbent first elected in 1994 belong to? | SELECT "Party" FROM table_18113 WHERE "First elected" = '1994' |
CREATE TABLE table_name_92 (
place VARCHAR,
date VARCHAR
) | What is the Place that has a Date of 22 august 2004? | SELECT place FROM table_name_92 WHERE date = "22 august 2004" |
CREATE TABLE degrees (
year number,
campus number,
degrees number
)
CREATE TABLE faculty (
campus number,
year number,
faculty number
)
CREATE TABLE enrollments (
campus number,
year number,
totalenrollment_ay number,
fte_ay number
)
CREATE TABLE discipline_enrollments (
c... | How many campuses exist are in the county of LA? | SELECT COUNT(*) FROM campuses WHERE county = "Los Angeles" |
CREATE TABLE table_name_97 (
winner VARCHAR,
course VARCHAR
) | Who was the winner for the Rome to Teramo course? | SELECT winner FROM table_name_97 WHERE course = "rome to teramo" |
CREATE TABLE table_26200568_16 (
losses INTEGER,
club VARCHAR
) | How many losses does Central Blues have? | SELECT MAX(losses) FROM table_26200568_16 WHERE club = "Central Blues" |
CREATE TABLE table_68767 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Notes" text
) | What is the first year of the European Championships competition? | SELECT MIN("Year") FROM table_68767 WHERE "Competition" = 'european championships' |
CREATE TABLE table_256286_23 (
meas_num INTEGER,
description VARCHAR
) | What is the number of the tax supervising and conservation bill? | SELECT MIN(meas_num) FROM table_256286_23 WHERE description = "Tax Supervising and Conservation Bill" |
CREATE TABLE table_name_61 (
player VARCHAR,
points VARCHAR,
touchdowns VARCHAR,
extra_points VARCHAR
) | What Player has more than 1 Touchdowns with 0 Extra Points and less than 50 Points? | SELECT player FROM table_name_61 WHERE touchdowns > 1 AND extra_points = 0 AND points < 50 |
CREATE TABLE table_name_54 (
score VARCHAR,
home VARCHAR
) | What is the Score with a Home with hornets? | SELECT score FROM table_name_54 WHERE home = "hornets" |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | what is the number of patients whose diagnoses long title is surgical operation with anastomosis, bypass, or graft, with natural or artificial tissues used as implant causing abnormal patient reaction, or later complication, without mention of misadventure at time of operation and drug type is base? | 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.long_title = "Surgical operation with anastomosis, bypass, or graft, with natural or artificial tissues u... |
CREATE TABLE table_2615 (
"Stage" real,
"Stage winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Malaysian rider classification" text,
"Team classification" text,
"Malaysian team classification" text
) | Which team classification has malaysian team classification of mncf continental team? | SELECT "Team classification" FROM table_2615 WHERE "Malaysian team classification" = 'MNCF Continental Team' |
CREATE TABLE table_name_62 (
cuts_made INTEGER,
top_10 VARCHAR,
wins VARCHAR,
top_5 VARCHAR
) | How many cuts were made when there weren't any wins but had a top-5 of 1 and a top 10 larger than 4? | SELECT SUM(cuts_made) FROM table_name_62 WHERE wins < 1 AND top_5 = 1 AND top_10 > 4 |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END... | Give me a histogram, that simply displays the last name of the employee and the corresponding manager id, could you show by the x-axis in asc? | SELECT LAST_NAME, MANAGER_ID FROM employees ORDER BY LAST_NAME |
CREATE TABLE table_name_40 (
wins VARCHAR,
podiums VARCHAR,
series VARCHAR
) | Which Wins has Podiums of 0, and a Series of masters of formula 3? | SELECT wins FROM table_name_40 WHERE podiums = "0" AND series = "masters of formula 3" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.