table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_... | what flights are there from SAN FRANCISCO to PHILADELPHIA DAILY with economy class | 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, fare, fare_basis, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND fare_basis.economy = 'YES' AND fare.far... |
CREATE TABLE View_Unit_Status (
apt_id INTEGER,
apt_booking_id INTEGER,
status_date DATETIME,
available_yn BIT
)
CREATE TABLE Apartment_Bookings (
apt_booking_id INTEGER,
apt_id INTEGER,
guest_id INTEGER,
booking_status_code CHAR(15),
booking_start_date DATETIME,
booking_end_dat... | Plot the total number by grouped by booking status code as a bar graph, sort in ascending by the Y. | SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code ORDER BY COUNT(*) |
CREATE TABLE table_28199 (
"Name of Award" text,
"Name of Film" text,
"Language" text,
"Awardee(s)" text,
"Cash Prize" text
) | Who won best actor? | SELECT "Awardee(s)" FROM table_28199 WHERE "Name of Award" = 'Best Actor' |
CREATE TABLE table_name_7 (
pick INTEGER,
school VARCHAR
) | What is the pick number for School of lsu? | SELECT SUM(pick) FROM table_name_7 WHERE school = "lsu" |
CREATE TABLE table_65287 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | How many bronzes have a Total of 9? | SELECT SUM("Bronze") FROM table_65287 WHERE "Total" = '9' |
CREATE TABLE table_54946 (
"Year" real,
"Artist" text,
"Composition" text,
"Mintage" real,
"Issue Price" text
) | When the Year is over 2008, what is the highest Mintage for the Royal Canadian Mint Engravers Artist? | SELECT MAX("Mintage") FROM table_54946 WHERE "Artist" = 'royal canadian mint engravers' AND "Year" > '2008' |
CREATE TABLE table_33721 (
"Coach" text,
"Years" text,
"Record" text,
"Conference Record" text,
"Overall Win Percentage" text
) | What was coach Dick Bennett's overall win percentage? | SELECT "Overall Win Percentage" FROM table_33721 WHERE "Coach" = 'dick bennett' |
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 unknown/not specified ethnic background patients who had calculated hematocrit lab test done. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "UNKNOWN/NOT SPECIFIED" AND lab.label = "Hematocrit, Calculated" |
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 intakeoutput (
in... | give me the top three most common events in a year before? | SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%output%' AND DATETIME(intakeoutput.intakeoutputtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY intakeoutput.celllabel) AS ... |
CREATE TABLE table_64801 (
"School (IHSAA ID#)" text,
"Location" text,
"Mascot" text,
"Enrollment" real,
"IHSAA Class" text,
"# / County" text,
"Year Joined" real
) | Which year did the school with enrollment of 413 join? | SELECT "Year Joined" FROM table_64801 WHERE "Enrollment" = '413' |
CREATE TABLE table_name_65 (
tournament VARCHAR,
score_in_the_final VARCHAR
) | Which tournament had a final score of 6 3, 6 2? | SELECT tournament FROM table_name_65 WHERE score_in_the_final = "6–3, 6–2" |
CREATE TABLE table_9219 (
"Tournament" text,
"Surface" text,
"Week" text,
"Winner and score" text,
"Finalist" text,
"Semifinalists" text
) | who is the winner and score for finalist s bastien grosjean? | SELECT "Winner and score" FROM table_9219 WHERE "Finalist" = 'sébastien grosjean' |
CREATE TABLE Staff (
staff_id INTEGER,
staff_name VARCHAR(255),
gender VARCHAR(1),
other_staff_details VARCHAR(255)
)
CREATE TABLE Skills (
skill_id INTEGER,
skill_code VARCHAR(20),
skill_description VARCHAR(255)
)
CREATE TABLE Third_Party_Companies (
company_id INTEGER,
company_ty... | A bar chart listing the number of faults for different description of skills required to fix them, and sort in asc by the y axis. | SELECT skill_description, COUNT(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 GROUP BY skill_description ORDER BY COUNT(skill_description) |
CREATE TABLE table_name_33 (
winner VARCHAR,
result VARCHAR,
loser VARCHAR,
location VARCHAR
) | Who is the Winner, when the Loser is the Baltimore Colts, when the Location is Schaefer Stadium, and when the Result is 42-3? | SELECT winner FROM table_name_33 WHERE loser = "baltimore colts" AND location = "schaefer stadium" AND result = "42-3" |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE... | patient 12775 had any naacetate7.7meq in the current hospital encounter? | SELECT COUNT(*) > 0 FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12775 AND admissions.dischtime IS NULL)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_item... |
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 prescriptions (
subject_id text,
hadm_id... | look for the religious and ethnic background for patient hector blair. | SELECT demographic.religion, demographic.ethnicity FROM demographic WHERE demographic.name = "Hector Blair" |
CREATE TABLE match_season (
season number,
player text,
position text,
country number,
team number,
draft_pick_number number,
draft_class text,
college text
)
CREATE TABLE player (
player_id number,
player text,
years_played text,
total_wl text,
singles_wl text,
... | Return the positions of players on the team Ryley Goldner. | SELECT T1.position FROM match_season AS T1 JOIN team AS T2 ON T1.team = T2.team_id WHERE T2.name = "Ryley Goldner" |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartr... | is patient 009-15 given medication in 11/last year? | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-15')) AND DATETIME(medication.drugstarttime, 'start of year') = DATETI... |
CREATE TABLE table_29096 (
"Series #" real,
"Episode #" real,
"Title" text,
"Director" text,
"Writer" text,
"Original Airdate" text
) | The director of the episode with the title 'The Sky is Falling' is who? | SELECT "Director" FROM table_29096 WHERE "Title" = 'The Sky is Falling' |
CREATE TABLE table_203_168 (
id number,
"team name" text,
"leagues" text,
"base" text,
"year started" text,
"year ended" text,
"notable riders" text
) | what was the next team to end after the london lions ? | SELECT "team name" FROM table_203_168 WHERE "year ended" > (SELECT "year ended" FROM table_203_168 WHERE "team name" = 'london lions') ORDER BY "year ended" LIMIT 1 |
CREATE TABLE campuses (
id VARCHAR,
campus VARCHAR
)
CREATE TABLE faculty (
campus VARCHAR,
year VARCHAR
) | How many faculty lines are there in 'San Francisco State University' in year 2004? | SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus = T2.id WHERE T1.year = 2004 AND T2.campus = "San Francisco State University" |
CREATE TABLE table_51412 (
"Year" real,
"Film" text,
"Role" text,
"Leading Man" text,
"Director" text
) | What director directed the role of shelby barret wyatt in 1935? | SELECT "Director" FROM table_51412 WHERE "Year" = '1935' AND "Role" = 'shelby barret wyatt' |
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 microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,... | potassium, whole blood,whats the cost of it? | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'potassium, whole blood')) |
CREATE TABLE table_27764201_2 (
game_site VARCHAR,
opponent VARCHAR
) | How many times did the Centurions play the Rhein Fire? | SELECT COUNT(game_site) FROM table_27764201_2 WHERE opponent = "Rhein Fire" |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | what is primary disease of subject id 2560? | SELECT demographic.diagnosis FROM demographic WHERE demographic.subject_id = "2560" |
CREATE TABLE table_name_32 (
home_team VARCHAR,
crowd INTEGER
) | What was the score when the home team had a crowd larger than 21,188? | SELECT home_team AS score FROM table_name_32 WHERE crowd > 21 OFFSET 188 |
CREATE TABLE table_45054 (
"Season" text,
"Races" real,
"Wins" real,
"Podiums" real,
"Poles" real,
"Fastest Laps" real
) | What is the smallest number of poles when the fastest laps are less than 0? | SELECT MIN("Poles") FROM table_45054 WHERE "Fastest Laps" < '0' |
CREATE TABLE table_name_43 (
crowd INTEGER,
away_team VARCHAR
) | I want to know the average crowd for away team of melbourne | SELECT AVG(crowd) FROM table_name_43 WHERE away_team = "melbourne" |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGui... | Top Users by Post Efficiency. | WITH PostsPerUser AS (SELECT u.Id, COUNT(*) AS NumPosts FROM Posts AS a INNER JOIN Users AS u ON u.Id = a.OwnerUserId WHERE a.PostTypeId IN (1, 2) GROUP BY u.Id HAVING COUNT(*) >= @MinAnswers), TopUsers AS (SELECT u.Id AS "user_link", u.Reputation, ppu.NumPosts, (CAST(u.Reputation AS FLOAT) / NumPosts) AS RepPerPost FR... |
CREATE TABLE table_203_789 (
id number,
"season" text,
"team" text,
"country" text,
"division" number,
"apps" number,
"goals" number,
"assists" number
) | in which season was there a total of 2 assists ? | SELECT "season" FROM table_203_789 WHERE "assists" = 2 |
CREATE TABLE table_name_45 (
tier INTEGER,
postseason VARCHAR
) | What is the total number of tiers for the postseason of semifinalist? | SELECT SUM(tier) FROM table_name_45 WHERE postseason = "semifinalist" |
CREATE TABLE table_26495 (
"Administrative division" text,
"Area (km\u00b2) 2011**" text,
"Population 2001 Census (Adjusted)" real,
"Population 2011 Census (Adjusted)" real,
"Population density (/km\u00b2 2011)" text
) | What was the population density in km2 for 2011 in the division where area in km2 was 684.37 in 2011? | SELECT "Population density (/km\u00b2 2011)" FROM table_26495 WHERE "Area (km\u00b2) 2011**" = '684.37' |
CREATE TABLE table_9068 (
"Name" text,
"Height" text,
"Weight" real,
"Position" text,
"Bats/Throws" text,
"Class" text,
"Hometown/Highschool" text
) | What position did kyle mckenzie play? | SELECT "Position" FROM table_9068 WHERE "Name" = 'kyle mckenzie' |
CREATE TABLE table_1243601_1 (
regular_season VARCHAR,
year VARCHAR
) | What was the regular season listing in 2007? | SELECT regular_season FROM table_1243601_1 WHERE year = "2007" |
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,
... | what is the number of patients whose admission location is emergency room admit and lab test name is troponin t? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND lab.label = "Troponin T" |
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... | give me the number of patients admitted in the emergency room under diagnoses icd9 code 311. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND diagnoses.icd9_code = "311" |
CREATE TABLE table_204_763 (
id number,
"county" text,
"km" number,
"intersecting road" text,
"notes" text,
"coordinates" text
) | what is the last intersecting road on the chart ? | SELECT "intersecting road" FROM table_204_763 ORDER BY id DESC LIMIT 1 |
CREATE TABLE table_name_23 (
date VARCHAR,
attendance VARCHAR
) | What was the date of the game with an attendance of 20,874 fans? | SELECT date FROM table_name_23 WHERE attendance = "20,874" |
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 patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
... | what is the maximum total cost to the hospital that includes a atypical lymphocytes lab test since 4 years ago? | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'atypical lymphocytes')) AND DATETIME(cost.chargetime) >= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY... |
CREATE TABLE Teachers (
teacher_id INTEGER,
address_id INTEGER,
first_name VARCHAR(80),
middle_name VARCHAR(80),
last_name VARCHAR(80),
gender VARCHAR(1),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
other_details VARCHAR(255)
)
CREATE TABLE Ref_Address_Types (
add... | Give me the trend about the amount of date_address_to over date_address_to , and group by attribute other_details. | SELECT date_address_to, COUNT(date_address_to) FROM Student_Addresses GROUP BY other_details, date_address_to ORDER BY monthly_rental DESC |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | tell me the duration of patient 010-26737's first stay in the hospital. | SELECT STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', patient.hospitaladmittime) FROM patient WHERE patient.uniquepid = '010-26737' AND NOT patient.hospitaladmittime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1 |
CREATE TABLE table_28003 (
"Episode #" real,
"The W\u00f8rd" text,
"Guest" text,
"Introductory phrase" text,
"Original airdate" text,
"Production code" real
) | What is the production code of the episode with an original airdate of december 01? | SELECT "Production code" FROM table_28003 WHERE "Original airdate" = 'December 01' |
CREATE TABLE table_name_13 (
bronze INTEGER,
nation VARCHAR,
silver VARCHAR
) | What is the highest number of bronze for the United States with more than 1 silver? | SELECT MAX(bronze) FROM table_name_13 WHERE nation = "united states" AND silver > 1 |
CREATE TABLE table_name_56 (
location VARCHAR,
country VARCHAR
) | What was the location of the tournament held in Spain? | SELECT location FROM table_name_56 WHERE country = "spain" |
CREATE TABLE table_203_60 (
id number,
"outcome" text,
"no." number,
"date" text,
"championship" text,
"surface" text,
"opponent in the final" text,
"score in the final" text
) | which month were the most championships played ? | SELECT "date" FROM table_203_60 GROUP BY "date" ORDER BY COUNT(*) DESC LIMIT 1 |
CREATE TABLE table_54201 (
"Date" text,
"Competition" text,
"Venue" text,
"Result" text,
"Score" text
) | What outcome has a score of 12-22? | SELECT "Result" FROM table_54201 WHERE "Score" = '12-22' |
CREATE TABLE table_60894 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real
) | What is Country, when To par is '1', and when Player is 'Seve Ballesteros'? | SELECT "Country" FROM table_60894 WHERE "To par" = '1' AND "Player" = 'seve ballesteros' |
CREATE TABLE LANGUAGE (
name VARCHAR,
language_id VARCHAR
)
CREATE TABLE film (
language_id VARCHAR,
title VARCHAR
) | Which language does the film AIRPORT POLLOCK use? List the language name. | SELECT T2.name FROM film AS T1 JOIN LANGUAGE AS T2 ON T1.language_id = T2.language_id WHERE T1.title = 'AIRPORT POLLOCK' |
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... | how many patients marital status is single and are tested with albumin in lab? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.label = "Albumin" |
CREATE TABLE table_61010 (
"2006" real,
"2007" real,
"2008" real,
"2009" real,
"2010" real
) | How many 2008s have 6.9 as a 2006, with a 2007 less than 7.1? | SELECT COUNT("2008") FROM table_61010 WHERE "2006" = '6.9' AND "2007" < '7.1' |
CREATE TABLE table_66115 (
"School" text,
"Location" text,
"Mascot" text,
"# / County" text,
"Enrollment" real,
"IHSAA Class / Football/Soccer" text,
"Year Joined" real,
"Previous Conference" text
) | Which Mascot has a School of logansport community? | SELECT "Mascot" FROM table_66115 WHERE "School" = 'logansport community' |
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREA... | How many papers run experiments on ImageNet ? | SELECT DISTINCT COUNT(DISTINCT paper.paperid) FROM dataset, paper, paperdataset WHERE dataset.datasetname LIKE 'ImageNet' AND paperdataset.datasetid = dataset.datasetid AND paper.paperid = paperdataset.paperid |
CREATE TABLE table_name_98 (
model_number VARCHAR,
gpu_frequency VARCHAR
) | What is the model number for the GPU and 320 mhz? | SELECT model_number FROM table_name_98 WHERE gpu_frequency = "320 mhz" |
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 is the name of a drug that patient 025-44495 has been prescribed for two or more times since 06/2105? | SELECT t1.drugname FROM (SELECT medication.drugname, COUNT(medication.drugstarttime) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025... |
CREATE TABLE table_name_82 (
surface VARCHAR,
date VARCHAR
) | What surface was the match on November 6, 1982 played on? | SELECT surface FROM table_name_82 WHERE date = "november 6, 1982" |
CREATE TABLE table_name_66 (
date VARCHAR,
race_name VARCHAR
) | On what date was the I Dessau Autobahnspinne race? | SELECT date FROM table_name_66 WHERE race_name = "i dessau autobahnspinne" |
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, give me the comparison about the sum of code over the founder , and group by attribute founder, I want to list in descending by the y axis. | SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T1.Code DESC |
CREATE TABLE table_70752 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | What is the average Points when equipe ligier gauloises blondes is the entrant? | SELECT AVG("Points") FROM table_70752 WHERE "Entrant" = 'equipe ligier gauloises blondes' |
CREATE TABLE table_46428 (
"Finished" real,
"Time/ Behind" text,
"Post" real,
"Horse" text,
"Jockey" text,
"Trainer" text,
"Owner" text
) | What is Jockey, when Post is 12? | SELECT "Jockey" FROM table_46428 WHERE "Post" = '12' |
CREATE TABLE table_17764 (
"Model Number" text,
"Clock Speed" text,
"L2" text,
"L3" text,
"FSB Speed" text,
"Multiplier" text,
"Cores" real,
"Threads per core" real,
"Voltage" text,
"TDP (W)" text,
"Socket" text,
"Release Date" text,
"Price ( USD )" text
) | What's the clock speed of the model that costs $910? | SELECT "Clock Speed" FROM table_17764 WHERE "Price ( USD )" = '$910' |
CREATE TABLE table_name_97 (
pick INTEGER,
round VARCHAR,
position VARCHAR,
name VARCHAR
) | In what round smaller than 10, was the center les studdard picked in? | SELECT MIN(pick) FROM table_name_97 WHERE position = "center" AND name = "les studdard" AND round < 10 |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TA... | what medication was prescribed to patient 028-47306 last time until 8 months ago? | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-47306')) AND DATETIME(medication.drugstarttime) <= DATETIME(CUR... |
CREATE TABLE table_74494 (
"Pick #" real,
"MLS team" text,
"Player" text,
"Position" text,
"Affiliation" text
) | What team does Jimmy Frazelle play on? | SELECT "MLS team" FROM table_74494 WHERE "Player" = 'jimmy frazelle' |
CREATE TABLE table_203_750 (
id number,
"#" number,
"date" text,
"venue" text,
"opponent" text,
"score" text,
"result" text,
"competition" text
) | number of different teams listed on the chart | SELECT COUNT(DISTINCT "opponent") FROM table_203_750 |
CREATE TABLE table_name_96 (
nation VARCHAR,
silver VARCHAR,
total VARCHAR,
gold VARCHAR,
bronze VARCHAR
) | Which Nation has a Gold larger than 0, and a Bronze smaller than 2, and a Total larger than 3, and a Silver larger than 1? | SELECT nation FROM table_name_96 WHERE gold > 0 AND bronze < 2 AND total > 3 AND silver > 1 |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
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 ti... | what was the last measured value of heart rate of patient 31854 today? | SELECT 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 = 31854)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rat... |
CREATE TABLE table_1342331_18 (
candidates VARCHAR,
district VARCHAR
) | What candidate is in Louisiana 6? | SELECT candidates FROM table_1342331_18 WHERE district = "Louisiana 6" |
CREATE TABLE table_34898 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text
) | What is the first elected date for the incumbent in the South Carolina 4 district? | SELECT "First elected" FROM table_34898 WHERE "District" = 'south carolina 4' |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_icd_diag... | what is the difference in red blood cells levels of patient 42829 second measured on the current hospital visit compared to the value first measured on the current hospital visit? | SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 42829 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'red blood cells') ORDER BY labevents.ch... |
CREATE TABLE table_239 (
"Power Source" text,
"Number of Generators" real,
"Power Capacity (GW)" text,
"% of total Capacity" text,
"Capacity factor" text,
"Annual Energy (billion kWh)" text,
"% of annual production" text
) | What is the number of generators where the power capicity is 78.7? | SELECT COUNT("Number of Generators") FROM table_239 WHERE "Power Capacity (GW)" = '78.7' |
CREATE TABLE table_10147 (
"Race Name" text,
"Circuit" text,
"Date" text,
"Winning driver" text,
"Constructor" text,
"Report" text
) | On what circuit was the iii Reims Grand Prix held? | SELECT "Circuit" FROM table_10147 WHERE "Race Name" = 'iii reims grand prix' |
CREATE TABLE table_name_61 (
partner VARCHAR,
outcome VARCHAR,
tournament VARCHAR
) | Which partners were runner-up in the tournament in Mons, Belgium? | SELECT partner FROM table_name_61 WHERE outcome = "runner-up" AND tournament = "mons, belgium" |
CREATE TABLE table_name_55 (
song VARCHAR,
total_points VARCHAR,
jury__points_ VARCHAR
) | What is the song with more than 9 points and 44 (11) jury (points)? | SELECT song FROM table_name_55 WHERE total_points > 9 AND jury__points_ = "44 (11)" |
CREATE TABLE city (
Status VARCHAR
) | How many different statuses do cities have? | SELECT COUNT(DISTINCT Status) FROM city |
CREATE TABLE table_name_97 (
time VARCHAR,
rider VARCHAR
) | what was valentino rossi's rider time? | SELECT time FROM table_name_97 WHERE rider = "valentino rossi" |
CREATE TABLE table_name_42 (
result VARCHAR,
week VARCHAR
) | What was the result on week 6? | SELECT result FROM table_name_42 WHERE week = 6 |
CREATE TABLE table_764 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | When was the Tennessee 3 district incumbent first elected? | SELECT MAX("First elected") FROM table_764 WHERE "District" = 'Tennessee 3' |
CREATE TABLE table_20236726_2 (
serial_no VARCHAR,
wd_no VARCHAR
) | Name the total number of serial number for 24 wd no | SELECT COUNT(serial_no) FROM table_20236726_2 WHERE wd_no = 24 |
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 (
... | list the top five most frequent drugs that patients have been prescribed with within 2 months after they had been prescribed with atorvastatin calcium 20 mg po tabs in this year. | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'atorvastatin calcium 20 mg po tabs' AND DATETIME(me... |
CREATE TABLE table_1463383_1 (
social_democratic VARCHAR,
socialist VARCHAR
) | If Socialist is at 46.1%, what are all percentages for social democratic? | SELECT social_democratic FROM table_1463383_1 WHERE socialist = "46.1%" |
CREATE TABLE table_204_567 (
id number,
"team" text,
"location" text,
"stadium" text,
"capacity" number,
"manager" text,
"captain" text,
"kit manufacturer" text,
"shirt sponsor" text
) | the stadium can only hold 2500 people . | SELECT "stadium" FROM table_204_567 WHERE "capacity" = 2500 |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId n... | Answers per day for a particular user. | SELECT TIME_TO_STR(CreationDate, '%d') AS "day", COUNT(Id) AS "count" FROM Posts WHERE PostTypeId = 2 AND OwnerUserId = '##UserID:int##' AND TIME_TO_STR(CreationDate, '%Y') = '##Year:int##' AND TIME_TO_STR(CreationDate, '%M') = '##Month:int##' AND CommunityOwnedDate IS NULL GROUP BY TIME_TO_STR(CreationDate, '%d') ORDE... |
CREATE TABLE tryout (
pid number,
cname text,
ppos text,
decision text
)
CREATE TABLE player (
pid number,
pname text,
ycard text,
hs number
)
CREATE TABLE college (
cname text,
state text,
enr number
) | Find the name, enrollment of the colleges whose size is bigger than 10000 and location is in state LA. | SELECT cname, enr FROM college WHERE enr > 10000 AND state = "LA" |
CREATE TABLE table_62984 (
"Year" real,
"Winner" text,
"Jockey" text,
"Trainer" text,
"Owner" text,
"Distance" text,
"Time" text,
"Purse" text
) | What is the purse in 2003, which had a 1-1/16 distance? | SELECT "Purse" FROM table_62984 WHERE "Distance" = '1-1/16' AND "Year" = '2003' |
CREATE TABLE table_30308 (
"Year Location" text,
"Mens Singles" text,
"Womens Singles" text,
"Mens Doubles" text,
"Womens Doubles" text
) | Who is listed under womens singles when year location is 1998 doha? | SELECT "Womens Singles" FROM table_30308 WHERE "Year Location" = '1998 Doha' |
CREATE TABLE table_18600760_19 (
township VARCHAR,
latitude VARCHAR
) | how is called the township where the latitude is 47.377790 | SELECT township FROM table_18600760_19 WHERE latitude = "47.377790" |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
... | has there ever been any .45% normal saline given to patient 8562 during the last month? | SELECT COUNT(*) > 0 FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8562)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = '.45% norm... |
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 demographic ... | find the maximum age of patients who are married and have medicaid insurance. | SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.insurance = "Medicaid" |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime tim... | on 08/28/2100, when patient 32592 got .9% normal saline for the last time? | SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 32592)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label... |
CREATE TABLE table_204_71 (
id number,
"rank" number,
"heat" number,
"name" text,
"nationality" text,
"time" text,
"notes" text
) | how many women from england were ranked in top 14 in the heats of 100m women 's hurdles ? | SELECT COUNT("name") FROM table_204_71 WHERE "nationality" = 'england' AND "rank" <= 14 |
CREATE TABLE procedures (
name VARCHAR,
cost VARCHAR
) | Find the three most expensive procedures. | SELECT name FROM procedures ORDER BY cost LIMIT 3 |
CREATE TABLE table_48963 (
"Team #1" text,
"Agg." text,
"Team #2" text,
"1st leg" text,
"2nd leg" text
) | What was the 1st leg score for the team with an Agg score of 151-134? | SELECT "1st leg" FROM table_48963 WHERE "Agg." = '151-134' |
CREATE TABLE table_66420 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text
) | What was the location of the game with a score of 113-106? | SELECT "Location/Attendance" FROM table_66420 WHERE "Score" = '113-106' |
CREATE TABLE table_37290 (
"7:00" text,
"7:30" text,
"8:00" text,
"8:30" text,
"9:00" text,
"10:00" text,
"10:30" text
) | Which 7:30 has an 8:00 of movies & specials? | SELECT "7:30" FROM table_37290 WHERE "8:00" = 'movies & specials' |
CREATE TABLE phone_market (
Market_ID int,
Phone_ID text,
Num_of_stock int
)
CREATE TABLE phone (
Name text,
Phone_ID int,
Memory_in_G int,
Carrier text,
Price real
)
CREATE TABLE market (
Market_ID int,
District text,
Num_of_employees int,
Num_of_shops real,
Rankin... | Can you show a bar chart to visualize the number of carriers?, and list x axis from high to low order. | SELECT Carrier, COUNT(Carrier) FROM phone GROUP BY Carrier ORDER BY Carrier DESC |
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_seaso... | Give me a bar chart for total number of capacity of each openning year, order by the Y from high to low. | SELECT Openning_year, SUM(Capacity) FROM cinema GROUP BY Openning_year ORDER BY SUM(Capacity) DESC |
CREATE TABLE companies (
id number,
name text,
headquarters text,
industry text,
sales_billion number,
profits_billion number,
assets_billion number,
market_value_billion text
)
CREATE TABLE buildings (
id number,
name text,
city text,
height number,
stories number,
... | Show the headquarters shared by more than two companies. | SELECT headquarters FROM companies GROUP BY headquarters HAVING COUNT(*) > 2 |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | Which course is tougher 632 or 532 ? | SELECT DISTINCT course.number FROM course, program_course WHERE (course.number = 632 OR course.number = 532) AND course.department = 'EECS' AND program_course.course_id = course.course_id ORDER BY program_course.workload DESC LIMIT 1 |
CREATE TABLE Department_Stores (
dept_store_id INTEGER,
dept_store_chain_id INTEGER,
store_name VARCHAR(80),
store_address VARCHAR(255),
store_phone VARCHAR(80),
store_email VARCHAR(80)
)
CREATE TABLE Customer_Addresses (
customer_id INTEGER,
address_id INTEGER,
date_from DATETIME,
... | Return a histogram on what are the names and ids of customers whose address contains TN?, and show by the customer_id in descending please. | SELECT customer_name, customer_id FROM Customers WHERE customer_address LIKE "%TN%" ORDER BY customer_id DESC |
CREATE TABLE table_2342078_6 (
original_airdate VARCHAR,
written_by VARCHAR
) | Name the airdate for the episode written by howard ostroff | SELECT original_airdate FROM table_2342078_6 WHERE written_by = "Howard Ostroff" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.