table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_37449 (
"School" text,
"Mascot" text,
"Location" text,
"Enrollment" real,
"IHSAA Class" text,
"IHSAA Football Class" text,
"County" text
) | What is the IHSAA class for Portage? | SELECT "IHSAA Class" FROM table_37449 WHERE "School" = 'portage' |
CREATE TABLE table_13564702_3 (
won VARCHAR,
club VARCHAR
) | Name the number of won for maesteg harlequins rfc | SELECT COUNT(won) FROM table_13564702_3 WHERE club = "Maesteg Harlequins RFC" |
CREATE TABLE table_name_55 (
right_ascension___j2000__ VARCHAR,
declination___j2000__ VARCHAR,
ngc_number VARCHAR,
constellation VARCHAR
) | What is the right ascension (J2000) with a Declination (J2000) of 12 43 , is a constellation of dorado, and has an NGC number larger than 2068? | SELECT right_ascension___j2000__ FROM table_name_55 WHERE ngc_number > 2068 AND constellation = "dorado" AND declination___j2000__ = "°12′43″" |
CREATE TABLE table_29581 (
"Pos" real,
"SP" real,
"No." real,
"Driver" text,
"Car Name" text,
"Car Make" text,
"Entrant" text,
"Laps" real,
"Status" text
) | How many status figures does James Finch have? | SELECT COUNT("Status") FROM table_29581 WHERE "Entrant" = 'James Finch' |
CREATE TABLE table_name_28 (
hits INTEGER,
year VARCHAR,
player VARCHAR
) | Name the least hits for year less than 1920 and player of ed delahanty | SELECT MIN(hits) FROM table_name_28 WHERE year < 1920 AND player = "ed delahanty" |
CREATE TABLE table_name_32 (
place VARCHAR,
score VARCHAR
) | What is the Place of the Player with a Score of 73-75-71-73=292? | SELECT place FROM table_name_32 WHERE score = 73 - 75 - 71 - 73 = 292 |
CREATE TABLE table_71398 (
"Branding" text,
"Callsign" text,
"Frequency" text,
"Power (kW)" text,
"Station Type" text,
"Location" text
) | Which Power has Location in metro manila | SELECT "Power (kW)" FROM table_71398 WHERE "Location" = 'metro manila' |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
res... | what is the fare on the THRIFT economy flight from BOSTON to SAN FRANCISCO | SELECT DISTINCT fare.fare_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_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND ... |
CREATE TABLE table_name_41 (
year_startup VARCHAR,
operator VARCHAR
) | What was the startup year for the project with apache energy/inpex as the operator? | SELECT year_startup FROM table_name_41 WHERE operator = "apache energy/inpex" |
CREATE TABLE table_73605 (
"Code name" text,
"Brand name" text,
"Model (list)" text,
"Frequency" text,
"Cores/Threads" text,
"Max Memory Speed" text
) | What brand is model I7-8xx? | SELECT "Brand name" FROM table_73605 WHERE "Model (list)" = 'i7-8xx' |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | count the number of patients born before 2052 who have combined right and left heart cardiac catheterization procedure. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2052" AND procedures.long_title = "Combined right and left heart cardiac catheterization" |
CREATE TABLE table_name_77 (
pick__number INTEGER,
college VARCHAR,
overall VARCHAR
) | What is the mean pick number for Iowa College when the overall is less than 200? | SELECT AVG(pick__number) FROM table_name_77 WHERE college = "iowa" AND overall < 200 |
CREATE TABLE table_20441 (
"No" text,
"Season" text,
"Start date (1st night)" text,
"End date (Last night)" text,
"Location" text,
"No of Proms" text
) | When are start dates (1st night) for the season of 1966? | SELECT "Start date (1st night)" FROM table_20441 WHERE "Season" = '1966' |
CREATE TABLE Staff (
staff_id INTEGER,
staff_first_name VARCHAR(80),
staff_last_name VARCHAR(80),
other_staff_details VARCHAR(255)
)
CREATE TABLE Problems (
problem_id INTEGER,
product_id INTEGER,
closure_authorised_by_staff_id INTEGER,
reported_by_staff_id INTEGER,
date_problem_rep... | Bar chart x axis log entry description y axis the number of log entry description, and I want to order y-axis in ascending order. | SELECT log_entry_description, COUNT(log_entry_description) FROM Problem_Log GROUP BY log_entry_description ORDER BY COUNT(log_entry_description) |
CREATE TABLE table_54903 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which Crowd has a Home team score of 11.13 (79)? | SELECT AVG("Crowd") FROM table_54903 WHERE "Home team score" = '11.13 (79)' |
CREATE TABLE table_8400 (
"Brigade" text,
"Staffing" text,
"Type" text,
"Location" text,
"Pumpers" real,
"Tankers" real,
"Telebooms" text,
"Platforms" text,
"Cars" text,
"Hazmat" text
) | Which Tankers have a Hazmat of , and Platforms of , and a Staffing of volunteer? | SELECT "Tankers" FROM table_8400 WHERE "Hazmat" = '–' AND "Platforms" = '–' AND "Staffing" = 'volunteer' |
CREATE TABLE table_204_561 (
id number,
"fence" number,
"name" text,
"jockey" text,
"age" number,
"handicap (st-lb)" text,
"starting price" text,
"fate" text
) | what is the first fence listed in the chart ? | SELECT "fence" FROM table_204_561 WHERE id = 1 |
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 (
... | give me the number of patients whose primary disease is hyperglycemia;hyponatremia? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "HYPERGLYCEMIA;HYPONATREMIA" |
CREATE TABLE table_name_93 (
date VARCHAR,
winning_score VARCHAR
) | Which Date has a Winning score of 14 (66-64-68-68=266)? | SELECT date FROM table_name_93 WHERE winning_score = –14(66 - 64 - 68 - 68 = 266) |
CREATE TABLE table_67093 (
"Year" real,
"Class" text,
"Team" text,
"Points" real,
"Rank" text,
"Wins" real
) | Name the rank for wins of 0 and points of 2 | SELECT "Rank" FROM table_67093 WHERE "Wins" = '0' AND "Points" = '2' |
CREATE TABLE table_name_35 (
series VARCHAR,
opponent VARCHAR,
round VARCHAR,
competition VARCHAR,
season VARCHAR
) | What is the Series for the uefa cup, in the 2006 07 season, and a Round of group, and an opponent of az? | SELECT series FROM table_name_35 WHERE competition = "uefa cup" AND season = "2006–07" AND round = "group" AND opponent = "az" |
CREATE TABLE table_34992 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game Site" text,
"Attendance" real
) | Who was the opponent at the game at Sullivan Stadium before week 11? | SELECT "Opponent" FROM table_34992 WHERE "Week" < '11' AND "Game Site" = 'sullivan stadium' |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnon... | Average comment length and score. | SELECT AVG(LENGTH(Text)), AVG(CAST(COALESCE(Score, 0.0) AS FLOAT)) FROM Comments WHERE NOT Score IS NULL |
CREATE TABLE table_59106 (
"Child" text,
"Date of birth" text,
"Mother" text,
"Father" text,
"DNA testing status" text
) | Who is the father of the child whose mother is Presendia Huntington Buell? | SELECT "Father" FROM table_59106 WHERE "Mother" = 'presendia huntington buell' |
CREATE TABLE table_47638 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What Venue on October 27, 2005 had a Score of 5-0? | SELECT "Venue" FROM table_47638 WHERE "Score" = '5-0' AND "Date" = 'october 27, 2005' |
CREATE TABLE table_9776 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | Which event has a Round larger than 2? | SELECT "Event" FROM table_9776 WHERE "Round" > '2' |
CREATE TABLE table_44418 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | What was strikeforce: barnett vs. cormier's record? | SELECT "Record" FROM table_44418 WHERE "Event" = 'strikeforce: barnett vs. cormier' |
CREATE TABLE table_57660 (
"Edition" real,
"Zone" text,
"Round" text,
"Date" text,
"Against" text,
"Surface" text,
"Opponent" text,
"Outcome" text,
"Result" text
) | Who was the Europe/Africa group i's opponent? | SELECT "Opponent" FROM table_57660 WHERE "Zone" = 'europe/africa group i' |
CREATE TABLE table_17294353_1 (
date VARCHAR,
opponent VARCHAR
) | When did the Broncos play the Miami Dolphins? | SELECT date FROM table_17294353_1 WHERE opponent = "Miami Dolphins" |
CREATE TABLE table_53458 (
"Season" text,
"Competition" text,
"Round" text,
"Club" text,
"Home" text,
"Away" text,
"Aggregate" text
) | What is the Away when the Club is Neath? | SELECT "Away" FROM table_53458 WHERE "Club" = 'neath' |
CREATE TABLE table_8370 (
"Date" text,
"Home" text,
"Score" text,
"Away" text,
"Attendance" real
) | On what Date is Olimpia the Home team? | SELECT "Date" FROM table_8370 WHERE "Home" = 'olimpia' |
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 black/african american patients who have phlebitis and thrombophlebitis of superficial veins of upper extremities diagnoses? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND diagnoses.long_title = "Phlebitis and thrombophlebitis of superficial veins of upper extremities" |
CREATE TABLE table_name_60 (
catalogue VARCHAR,
writer_s_ VARCHAR
) | Which Catalogue has a Writer(s) of mark james? | SELECT catalogue FROM table_name_60 WHERE writer_s_ = "mark james" |
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... | has patient 022-67644 taken a heparin 100 units-in drug on the first hospital encounter? | SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-67644' AND NOT patient.hospitaldischargetime IS NULL ORDER BY pati... |
CREATE TABLE table_1014 (
"Player" text,
"Touchdowns (5 points)" real,
"Extra points 1 point" real,
"Field goals (5 points)" real,
"Total Points" real
) | How many touchdowns did Bruce Shorts make? | SELECT MAX("Touchdowns (5 points)") FROM table_1014 WHERE "Player" = 'Bruce Shorts' |
CREATE TABLE table_12707313_2 (
first_win VARCHAR,
pos VARCHAR
) | What was the first win for pos 6? | SELECT first_win FROM table_12707313_2 WHERE pos = 6 |
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 (
... | find the date of birth and number of days of hospital stay of jerry deberry. | SELECT demographic.dob, demographic.days_stay FROM demographic WHERE demographic.name = "Jerry Deberry" |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,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 decimal(6,0),
MAX_SALARY decimal(6,... | For those employees who was hired before 2002-06-21, find hire_date and the sum of salary bin hire_date by time, and visualize them by a bar chart. | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicatio... | what was the yearly average value of weight for patient 007-13494 until 02/2105? | SELECT AVG(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-13494') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y-%m', patient.unitadmittime) <= '2105-02' GROUP BY STRFTIME('%y', patient.unit... |
CREATE TABLE table_49722 (
"Date" text,
"Opponent" text,
"Result" text,
"Score" text,
"Record" text,
"Location" text,
"Attendance" real
) | For the game where the opponent is listed as At Los Angeles Rams, what was the final score? | SELECT "Score" FROM table_49722 WHERE "Opponent" = 'at los angeles rams' |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
... | show me all the flights arriving in CHARLOTTE around 5pm next monday please | SELECT DISTINCT flight.flight_id FROM airport_service, city, date_day, days, flight WHERE ((flight.arrival_time <= 1730 AND flight.arrival_time >= 1630) AND date_day.day_number = 21 AND date_day.month_number = 2 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code) AND ... |
CREATE TABLE table_name_90 (
location VARCHAR,
nickname VARCHAR
) | Which location did the Tigers have? | SELECT location FROM table_name_90 WHERE nickname = "tigers" |
CREATE TABLE department (
dept_code text,
dept_name text,
school_code text,
emp_num number,
dept_address text,
dept_extension text
)
CREATE TABLE course (
crs_code text,
dept_code text,
crs_description text,
crs_credit number
)
CREATE TABLE enroll (
class_code text,
stu... | What is the number of different class sections offered in the course ACCT-211? | SELECT COUNT(DISTINCT class_section) FROM class WHERE crs_code = 'ACCT-211' |
CREATE TABLE table_name_81 (
score VARCHAR,
loss VARCHAR
) | What was the score of the game with a loss of Maholm (2 4)? | SELECT score FROM table_name_81 WHERE loss = "maholm (2–4)" |
CREATE TABLE table_25691838_12 (
production_code VARCHAR,
original_airdate VARCHAR
) | What is the production code of the episode with an original airdate of december 01? | SELECT production_code FROM table_25691838_12 WHERE original_airdate = "December 01" |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsysto... | plasmapheresis is, how much? | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'treatment' AND cost.eventid IN (SELECT treatment.treatmentid FROM treatment WHERE treatment.treatmentname = 'plasmapheresis') |
CREATE TABLE person (
name text,
age number,
city text,
gender text,
job text
)
CREATE TABLE personfriend (
name text,
friend text,
year number
) | What are the names of everybody sorted by age in descending order? | SELECT name FROM person ORDER BY age DESC |
CREATE TABLE table_name_32 (
gold VARCHAR,
year VARCHAR,
notes VARCHAR
) | Who won Gold later than 2004 with Notes of 2.73km, 14controls? | SELECT gold FROM table_name_32 WHERE year > 2004 AND notes = "2.73km, 14controls" |
CREATE TABLE table_25214321_1 (
season INTEGER,
winner VARCHAR
) | In what season was the winner Dado Dolabella? | SELECT MAX(season) FROM table_25214321_1 WHERE winner = "Dado Dolabella" |
CREATE TABLE table_53703 (
"Year" real,
"Date" text,
"Album" text,
"Label" text,
"Format(s)" text
) | Which Label has a Date of 20 July? | SELECT "Label" FROM table_53703 WHERE "Date" = '20 july' |
CREATE TABLE table_204_874 (
id number,
"year" number,
"winner" text,
"runner-up" text,
"final score" text,
"third" text
) | how many years did budivelnyk not win ? | SELECT COUNT("year") FROM table_204_874 WHERE "winner" <> 'budivelnyk' |
CREATE TABLE table_name_64 (
apps INTEGER,
country VARCHAR,
goals VARCHAR
) | What is the average Apps of indonesia with Goals smaller than 1000? | SELECT AVG(apps) FROM table_name_64 WHERE country = "indonesia" AND goals < 1000 |
CREATE TABLE table_21002034_4 (
title VARCHAR,
director VARCHAR
) | How many titles were directed by Alex Chapple? | SELECT COUNT(title) FROM table_21002034_4 WHERE director = "Alex Chapple" |
CREATE TABLE table_49175 (
"Year" text,
"Winner" text,
"Jockey" text,
"Trainer" text,
"Owner" text,
"Time" text
) | Which time contains the jockery of isaac murphy as well as the winner of kingman? | SELECT "Time" FROM table_49175 WHERE "Jockey" = 'isaac murphy' AND "Winner" = 'kingman' |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Give me the comparison about All_Games_Percent over the All_Games by a bar chart, and display Y-axis in ascending order. | SELECT All_Games, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent |
CREATE TABLE table_name_45 (
home_team VARCHAR,
venue VARCHAR
) | Which team plays home at Princes Park? | SELECT home_team FROM table_name_45 WHERE venue = "princes park" |
CREATE TABLE table_name_4 (
total_matches INTEGER,
points__percentage VARCHAR,
points_won VARCHAR,
year VARCHAR
) | What is the total matches in 2002 where points won is larger than 1.5 and the points % is smaller than 50? | SELECT MAX(total_matches) FROM table_name_4 WHERE points_won > 1.5 AND year = "2002" AND points__percentage < 50 |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutput... | what was the name of the first lab test patient 006-43795 had received since 06/2103? | SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-43795')) AND STRFTIME('%y-%m', lab.labresulttime) >= '2103-06' ORDER BY lab.labresult... |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count num... | Highest Voted Posts (non-Community Wiki). Non-CW posts with the highest number of votes. If views is zero then it is an answer. | SELECT p.Id AS "post_link", Score AS "votes", ViewCount AS "views" FROM Posts AS p WHERE NOT p.CommunityOwnedDate IS NULL AND p.OwnerUserId = '##UserId##' ORDER BY Score DESC LIMIT 100 |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic ... | what is the number of elective hospital admission patients who have procedure icd9 code 4611? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.icd9_code = "4611" |
CREATE TABLE category (
category_id TINYINT UNSIGNED,
name VARCHAR(25),
last_update TIMESTAMP
)
CREATE TABLE language (
language_id TINYINT UNSIGNED,
name CHAR(20),
last_update TIMESTAMP
)
CREATE TABLE store (
store_id TINYINT UNSIGNED,
manager_staff_id TINYINT UNSIGNED,
address_id... | List the genre name and genre id using a bar chart, and sort by the x axis in descending. | SELECT T2.name, T1.category_id FROM film_category AS T1 JOIN category AS T2 ON T1.category_id = T2.category_id ORDER BY T2.name DESC |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
... | show me the top four of the most common output event in 2101? | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT outputevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM outputevents WHERE STRFTIME('%y', outputevents.charttime) = '2101' GROUP BY outputevents.itemid) AS t1 WHERE t1.c1 <= 4) |
CREATE TABLE follows (
f1 number,
f2 number
)
CREATE TABLE tweets (
id number,
uid number,
text text,
createdate time
)
CREATE TABLE user_profiles (
uid number,
name text,
email text,
partitionid number,
followers number
) | Find the average number of followers for the users who do not have any tweet. | SELECT AVG(followers) FROM user_profiles WHERE NOT uid IN (SELECT uid FROM tweets) |
CREATE TABLE Student (
advisor VARCHAR
) | Which advisor has most number of students? | SELECT advisor FROM Student GROUP BY advisor ORDER BY COUNT(*) DESC LIMIT 1 |
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... | what's the number of patients who left the hospital in 2103? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE NOT admissions.dischtime IS NULL AND STRFTIME('%y', admissions.dischtime) = '2103' |
CREATE TABLE table_16815 (
"model" text,
"max. motive power" text,
"max. torque at rpm" text,
"engine displacement" text,
"engine type" text,
"engine configuration & notes 0-100km/h" text
) | What is the engine displacement for the engine type b5254 t? | SELECT "engine displacement" FROM table_16815 WHERE "engine type" = 'B5254 T' |
CREATE TABLE table_60301 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( \u00a3 )" real
) | What Northern Ireland Player has more than 36,000 Money with a To par of 7? | SELECT "Player" FROM table_60301 WHERE "Money ( \u00a3 )" > '36,000' AND "To par" = '–7' AND "Country" = 'northern ireland' |
CREATE TABLE airports (
apid number,
name text,
city text,
country text,
x number,
y number,
elevation number,
iata text,
icao text
)
CREATE TABLE routes (
rid number,
dst_apid number,
dst_ap text,
src_apid number,
src_ap text,
alid number,
airline text,
... | For the airline ids with the top 10 most routes operated, what are their names? | SELECT T1.name, T2.alid FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T2.alid ORDER BY COUNT(*) DESC LIMIT 10 |
CREATE TABLE table_6819 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Record" text
) | When has a Leading scorer of ricky davis (20)? | SELECT "Date" FROM table_6819 WHERE "Leading scorer" = 'ricky davis (20)' |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE T... | show me the flights from DENVER to SAN FRANCISCO | 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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRA... |
CREATE TABLE table_25940 (
"SF Round" real,
"Country" text,
"Location" text,
"Date" text,
"Driver" text,
"Race 1(pts)" real,
"Race 2(pts)" real,
"Race Total(pts)" real
) | What is every points value for race 1 if the total race points is 180? | SELECT "Race 1(pts)" FROM table_25940 WHERE "Race Total(pts)" = '180' |
CREATE TABLE table_3135 (
"Rank" real,
"Team" text,
"Round1" real,
"Round2" real,
"Round3" real,
"Round4" real,
"Total points" real
) | How many points did the team who had 325 total points have in round 3? | SELECT "Round3" FROM table_3135 WHERE "Total points" = '325' |
CREATE TABLE table_204_824 (
id number,
"no." number,
"train no:" text,
"origin" text,
"destination" text,
"train name" text
) | what is the first destination in the chart ? | SELECT "destination" FROM table_204_824 WHERE id = 1 |
CREATE TABLE table_1341522_41 (
status VARCHAR,
incumbent VARCHAR
) | What was the result of the election where william f. goodling was the incumbent? | SELECT status FROM table_1341522_41 WHERE incumbent = "William F. Goodling" |
CREATE TABLE table_7904 (
"Round" real,
"Pick" real,
"Player" text,
"Nationality" text,
"College" text
) | What round was northeastern college player Reggie Lewis drafted in? | SELECT MIN("Round") FROM table_7904 WHERE "College" = 'northeastern' AND "Player" = 'reggie lewis' |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean... | Questions (from inactive users) with one vote missing to automatic deletion. This query aims to identify borderline questions to the RemoveDeadQuestions script (https://meta.stackexchange.com/help/roomba); i.e., questions older than 30 days, with no answers, not locked, and score equal to zero (one vote missing to -1 w... | SELECT p.Id AS "post_link", p.Score FROM Posts AS p JOIN PostHistory AS ph ON ph.Id = p.Id WHERE p.PostTypeId = 1 AND p.CreationDate < CURRENT_TIMESTAMP() - 30 AND p.Score < 1 AND p.AnswerCount = 0 AND NOT EXISTS(SELECT * FROM PostHistory AS ph WHERE ph.PostId = p.Id AND ph.PostHistoryTypeId = 14) ORDER BY p.Score DESC... |
CREATE TABLE table_name_43 (
time_retired VARCHAR,
rider VARCHAR
) | Which Time/Retired has a Rider of daijiro kato? | SELECT time_retired FROM table_name_43 WHERE rider = "daijiro kato" |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_fl... | i need a flight from NEWARK to LOS ANGELES leaving tomorrow evening | 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 ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LOS ANGELES' AND date_day.day_number = 20 AND date_day.month_number = 1 ... |
CREATE TABLE table_name_78 (
home_team VARCHAR,
aedt_time VARCHAR
) | Which Home team score has a AEDT Time of 11:00 pm? | SELECT home_team AS score FROM table_name_78 WHERE aedt_time = "11:00 pm" |
CREATE TABLE table_6811 (
"Name" text,
"Position" text,
"Number" text,
"School/Club Team" text,
"Season" text,
"Acquisition via" text
) | What is the name for the forward in the 2009-2010 season? | SELECT "Name" FROM table_6811 WHERE "Position" = 'forward' AND "Season" = '2009-2010' |
CREATE TABLE table_1965650_4 (
pick__number INTEGER,
nhl_team VARCHAR
) | What's the smallest pick number of a player playing in Minnesota North Stars? | SELECT MIN(pick__number) FROM table_1965650_4 WHERE nhl_team = "Minnesota North Stars" |
CREATE TABLE table_1566852_5 (
date VARCHAR
) | Name the 20 questions for 8-04 | SELECT 20 AS _questions FROM table_1566852_5 WHERE date = "8-04" |
CREATE TABLE table_62192 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What was Eduardo Romero's score? | SELECT "Score" FROM table_62192 WHERE "Player" = 'eduardo romero' |
CREATE TABLE table_9272 (
"Team" text,
"Outgoing manager" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text
) | Which team had Christoph John as an outgoing manager? | SELECT "Team" FROM table_9272 WHERE "Outgoing manager" = 'christoph john' |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
... | what 's the cheapest fare for a round trip from INDIANAPOLIS to ORLANDO on 12 27 | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND C... |
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 gender is f and procedure icd9 code is 8968? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "F" AND procedures.icd9_code = "8968" |
CREATE TABLE table_61584 (
"Minister" text,
"Party" text,
"Governments" text,
"Term start" text,
"Term end" text
) | Which goverment had a party of yisrael beiteinu? | SELECT "Governments" FROM table_61584 WHERE "Party" = 'yisrael beiteinu' |
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 are the top four most common diagnosis until 2102? | SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE STRFTIME('%y', diagnosis.diagnosistime) <= '2102' GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 4 |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | Most viseted post for each user. | SELECT Users.DisplayName, Posts.Title, Posts.ViewCount FROM Users INNER JOIN Posts ON Posts.OwnerUserId = Users.Id WHERE Posts.ViewCount = (SELECT MAX(p.ViewCount) FROM Posts AS p WHERE p.OwnerUserId = Users.Id GROUP BY p.OwnerUserId) ORDER BY ViewCount |
CREATE TABLE Ref_Address_Types (
address_type_code VARCHAR(15),
address_type_description VARCHAR(80)
)
CREATE TABLE Student_Addresses (
student_id INTEGER,
address_id INTEGER,
date_address_from DATETIME,
date_address_to DATETIME,
monthly_rental DECIMAL(19,4),
other_details VARCHAR(255)
... | What is the number of end dates for incidents with incident type code 'NOISE'? Bin by weekday and return a bar chart. | SELECT date_incident_start, COUNT(date_incident_start) FROM Behavior_Incident WHERE incident_type_code = "NOISE" |
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... | give me the number of patients whose gender is m and diagnoses short title is emphysema nec? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.short_title = "Emphysema NEC" |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE semester (
... | Explain to me all the requirements of the CS-LSA degree . | SELECT DISTINCT program_requirement.additional_req, program_requirement.category, program_requirement.min_credit, program.name FROM program, program_requirement WHERE program.name LIKE '%CS-LSA%' AND program.program_id = program_requirement.program_id |
CREATE TABLE table_name_5 (
diameter__km_ VARCHAR,
diameter__mi_ VARCHAR
) | What shows as the Diameter (km) when the Diameter (mi) is 5mi? | SELECT diameter__km_ FROM table_name_5 WHERE diameter__mi_ = "5mi" |
CREATE TABLE table_name_31 (
method VARCHAR,
record VARCHAR
) | What was the method of resolution when Katsuhisa Fujii's record was 0-1? | SELECT method FROM table_name_31 WHERE record = "0-1" |
CREATE TABLE table_17941032_1 (
lost VARCHAR,
tries_for VARCHAR
) | When 22 is the tries for what is the lost? | SELECT lost FROM table_17941032_1 WHERE tries_for = "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,
... | what number of patients under procedure icd9 code 4439 had medicare insurance? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicare" AND procedures.icd9_code = "4439" |
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... | give me the number of patients whose procedure long title is continuous invasive mechanical ventilation for less than 96 consecutive hours and lab test category is chemistry? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Continuous invasive mechanical ventilation for less than 96 consecutive hours" AND lab."CATEGORY" = "Chemist... |
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 lab (
subject_id text,
hadm_id text,
... | get the number of patients with lab test item id 51379 who were admitted in hospital before the year 2178. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2178" AND lab.itemid = "51379" |
CREATE TABLE table_name_54 (
player VARCHAR,
country VARCHAR
) | Who is the golfer that golfs for Northern Ireland? | SELECT player FROM table_name_54 WHERE country = "northern ireland" |
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... | how many patients whose death status is 0 and procedure icd9 code is 8872? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.icd9_code = "8872" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.