instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_49312 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Tyres" text,
"Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which entrant had a Brabham BT10 chassis before 1965?
| SELECT "Entrant" FROM table_49312 WHERE "Year" < '1965' AND "Chassis" = 'brabham bt10' | wikisql |
CREATE TABLE airports (
apid integer,
name text,
city text,
country text,
x real,
y real,
elevation bigint,
iata character varchar(3),
icao character varchar(4)
)
CREATE TABLE airlines (
alid integer,
name text,
iata varchar(2),
icao varchar(3),
callsign text,
... | SELECT country, COUNT(country) FROM airlines WHERE name LIKE 'Orbit%' GROUP BY country ORDER BY country | nvbench |
CREATE TABLE table_80139 (
"Vehicle Flight #" text,
"Date" text,
"Pilot" text,
"Mach" real,
"Velocity (km/h)" real,
"Altitude (meters)" real,
"Duration" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Date has a Mach of 0.662?
| SELECT "Date" FROM table_80139 WHERE "Mach" = '0.662' | wikisql |
CREATE TABLE table_17120964_9 (
opponent VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was the opponent where the date was the 21st?
| SELECT opponent FROM table_17120964_9 WHERE date = "21st" | sql_create_context |
CREATE TABLE table_61857 (
"Opposing Teams" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Status of Venue of sydney sports ground , sydney?
| SELECT "Status" FROM table_61857 WHERE "Venue" = 'sydney sports ground , sydney' | wikisql |
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
wind_speed_mph int
)
CREATE TABLE route (
train_id int,
station_id int
)
CREATE TABLE train (
id int,
train_number int,
name text,
origin text,... | SELECT day_of_week, AVG(high_temperature) FROM weekly_weather GROUP BY day_of_week | nvbench |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '3731061' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING MAX(t_kc21.IN_HOSP_DAYS) < 8) AS T | css |
CREATE TABLE table_name_16 (
tie_no VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Tie #has an Attendance of 54,591?
| SELECT tie_no FROM table_name_16 WHERE attendance = "54,591" | sql_create_context |
CREATE TABLE table_26078 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Attendance" real,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the score for december 19
| SELECT "Score" FROM table_26078 WHERE "Date" = 'December 19' | wikisql |
CREATE TABLE table_204_356 (
id number,
"name of place" text,
"number of counties" number,
"principal county" text,
"lower zip code" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which place has the highest number of counties ?
| SELECT "name of place" FROM table_204_356 ORDER BY "number of counties" DESC LIMIT 1 | squall |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CRE... | SELECT COUNT(*) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-18678')) AND treatment.treatmentname = 'cultures - urine' AND DATETIME(treat... | eicu |
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... | SELECT AVG(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-29334')) AND lab.labname = 'fio2' AND DATETIME(lab.labresulttime, 'start of ye... | eicu |
CREATE TABLE customers (
id INTEGER,
first_name VARCHAR(40),
last_name VARCHAR(20),
company VARCHAR(80),
address VARCHAR(70),
city VARCHAR(40),
state VARCHAR(40),
country VARCHAR(40),
postal_code VARCHAR(10),
phone VARCHAR(24),
fax VARCHAR(24),
email VARCHAR(60),
supp... | SELECT name, COUNT(name) FROM playlists GROUP BY name ORDER BY COUNT(name) | nvbench |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '03015928' AND t_kc22.STA_DATE BETWEEN '2011-04-01' AND '2012-04-08' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' | css |
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
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,
ro... | 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, food_service WHERE (((flight.meal_code = 'B' OR flight.meal_code = 'BB') AND food_service.meal_code = flight.meal_code AND food_service.meal_description = 'BREAKFAST'... | atis |
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... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "89" AND diagnoses.long_title = "Benzodiazepine-based tranquilizers causing adverse effects in therapeutic use" | mimicsql_data |
CREATE TABLE table_6552 (
"Game" text,
"Date" text,
"Home Team" text,
"Result" text,
"Road Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the result of game 5 with Los Angeles as the home team?
| SELECT "Result" FROM table_6552 WHERE "Home Team" = 'los angeles' AND "Game" = 'game 5' | wikisql |
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | SELECT JYSQJGMC, JYJGMC FROM jybgb WHERE BGDH = '94703013293' | css |
CREATE TABLE table_name_84 (
time_retired VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Time/Retired when the points were 32.
| SELECT time_retired FROM table_name_84 WHERE points = "32" | sql_create_context |
CREATE TABLE table_17162 (
"Suburb" text,
"Population (in 2008)" real,
"Median age (in 2006)" text,
"Mean household size (in 2006)" text,
"Area (km\u00b2)" text,
"Density (/km\u00b2)" real,
"Date first settled as a suburb" real,
"Gazetted as a Division Name" text
)
-- Using valid SQLit... | SELECT "Median age (in 2006)" FROM table_17162 WHERE "Area (km\u00b2)" = '1.7' | wikisql |
CREATE TABLE table_name_97 (
date VARCHAR,
type VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When has a Type of tko, and a Round of 1 (6)
| SELECT date FROM table_name_97 WHERE type = "tko" AND round = "1 (6)" | sql_create_context |
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... | SELECT demographic.admittime FROM demographic WHERE demographic.name = "Herlinda Thomson" | mimicsql_data |
CREATE TABLE table_10059 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE ATTENDANCE WITH A READING AWAY TEAM?
| SELECT "Attendance" FROM table_10059 WHERE "Away team" = 'reading' | wikisql |
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE ... | SELECT DISTINCT COUNT(DISTINCT writes.paperid) FROM author, writes WHERE author.authorname = 'huamin qu' AND writes.authorid = author.authorid | scholar |
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
)
... | SELECT MIN(demographic.days_stay) FROM demographic WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" | mimicsql_data |
CREATE TABLE table_23468 (
"Language" text,
"Concepci\u00f3n Municipality (%)" real,
"San Javier Municipality (%)" real,
"San Ram\u00f3n Municipality (%)" real,
"San Juli\u00e1n Municipality (%)" real,
"San Antonio de Lomer\u00edo Municipality (%)" text,
"Cuatro Ca\u00f1adas Municipality (%)... | SELECT MAX("San Javier Municipality (%)") FROM table_23468 WHERE "Language" = 'Aymara simi' | wikisql |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
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,
r... | 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 = 'BOSTON' AND date_day.day_number = 25 AND date_day.month_number = 6 AND da... | atis |
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_... | 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 1930 AND 1830) AND date_day.day_number = 24 AND date_day.month_number = 5 AND date_day.year = 1991 AND days.day_... | atis |
CREATE TABLE table_63796 (
"Position" real,
"Name" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Points have a Drawn smaller than 2, and a Lost of 12, and a Name of ev bad w rishofe... | SELECT MAX("Points") FROM table_63796 WHERE "Drawn" < '2' AND "Lost" = '12' AND "Name" = 'ev bad wörishofen' | wikisql |
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Draw ... | SELECT name, AVG(T1.stars) FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T2.name ORDER BY AVG(T1.stars) | nvbench |
CREATE TABLE table_29115 (
"Event" text,
"Start Date" text,
"Finish Date" text,
"Start" text,
"Finish" text,
"Distance" text,
"Abu Dhabi" text,
"Camper" real,
"Groupama" real,
"Puma" text,
"Sanya" text,
"Telef\u00f3nica" real
)
-- Using valid SQLite, answer the followin... | SELECT COUNT("Event") FROM table_29115 WHERE "Puma" = '20' AND "Abu Dhabi" = '30' | wikisql |
CREATE TABLE table_66677 (
"Date(s) Released" text,
"Polling institute" text,
"Nationalist" text,
"Labour" text,
"Democratic Alternative" text,
"Undecided/ No answer" text,
"Lead" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which polling ... | SELECT "Polling institute" FROM table_66677 WHERE "Lead" = '6%' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
... | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-143187') AND NOT patient.unitdischargetime I... | eicu |
CREATE TABLE category (
category_id number,
name text,
last_update time
)
CREATE TABLE customer (
customer_id number,
store_id number,
first_name text,
last_name text,
email text,
address_id number,
active boolean,
create_date time,
last_update time
)
CREATE TABLE staff... | SELECT COUNT(DISTINCT language_id) FROM film | spider |
CREATE TABLE table_72378 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the party of georgia 4
| SELECT "Party" FROM table_72378 WHERE "District" = 'Georgia 4' | wikisql |
CREATE TABLE table_name_55 (
group_position VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Date of 24 september 2002 is what group position?
| SELECT group_position FROM table_name_55 WHERE date = "24 september 2002" | sql_create_context |
CREATE TABLE table_21046399_3 (
walker__percentage VARCHAR,
county VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many figures are given for Walker's percentage in Kenosha county?
| SELECT COUNT(walker__percentage) FROM table_21046399_3 WHERE county = "Kenosha" | sql_create_context |
CREATE TABLE table_41597 (
"Rank" real,
"Name" text,
"Years" text,
"Matches" real,
"Goals" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average goals for Jimmy Greaves, and matches more than 516?
| SELECT AVG("Goals") FROM table_41597 WHERE "Name" = 'jimmy greaves' AND "Matches" > '516' | wikisql |
CREATE TABLE table_1817852_1 (
to_iran VARCHAR,
survived VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If 4 went to iran and the amount that survived was less than 12.0 how many were there in 1990?
| SELECT COUNT(1990) FROM table_1817852_1 WHERE to_iran = 4 AND survived < 12.0 | sql_create_context |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number... | SELECT Posts.Id AS "post_link", Posts.FavoriteCount, Posts.Score, Posts.CreationDate, Votes.UserId AS "user_link" FROM Votes JOIN Posts ON (Posts.Id = Votes.PostId) WHERE Posts.FavoriteCount = 1 AND VoteTypeId = 5 AND Posts.PostTypeId = 1 AND Posts.OwnerUserId = Votes.UserId ORDER BY Posts.CreationDate DESC | sede |
CREATE TABLE table_36101 (
"Tournament" text,
"1998" text,
"1999" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"Career SR" text,
"Caree... | SELECT "2011" FROM table_36101 WHERE "1999" = 'a' AND "2004" = '2r' AND "Career SR" = '0 / 10' | wikisql |
CREATE TABLE table_47911 (
"County" text,
"Kerry%" text,
"Kerry#" real,
"Bush%" text,
"Bush#" real,
"Others%" text,
"Others#" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Kerry's percentage where 66 people voted for another candidate?... | SELECT "Kerry%" FROM table_47911 WHERE "Others#" = '66' | wikisql |
CREATE TABLE table_name_41 (
condition VARCHAR,
bleeding_time VARCHAR,
partial_thromboplastin_time VARCHAR,
platelet_count VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the condition for partial thromboplastin time of prolonged and platelet cou... | SELECT condition FROM table_name_41 WHERE partial_thromboplastin_time = "prolonged" AND platelet_count = "unaffected" AND bleeding_time = "prolonged" | sql_create_context |
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 labevents ... | SELECT SUM(outputevents.value) 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 = 77213)) AND STRFTIME('%y-%m-%d', outputevents.charttime) <= '2102-10-31' | mimic_iii |
CREATE TABLE table_1618 (
"Official Name" text,
"Status" text,
"Area km 2" text,
"Population" real,
"Census Ranking" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Area KM 2 of the place that has a Census ranking of 1,608 of 5,008?
| SELECT "Area km 2" FROM table_1618 WHERE "Census Ranking" = '1,608 of 5,008' | wikisql |
CREATE TABLE table_49540 (
"Date" text,
"H/A/N" text,
"Opponent" text,
"Score" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the opponents when the score of the game was 101-105 and the H/A/N was H?
| SELECT "Opponent" FROM table_49540 WHERE "H/A/N" = 'h' AND "Score" = '101-105' | wikisql |
CREATE TABLE table_22670216_1 (
rnd VARCHAR,
location VARCHAR,
pole_position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the location is Brooklyn, Michigan and the pole position is Bobby Unser, what is the RND total number?
| SELECT COUNT(rnd) FROM table_22670216_1 WHERE location = "Brooklyn, Michigan" AND pole_position = "Bobby Unser" | sql_create_context |
CREATE TABLE table_30477 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided a... | SELECT "Directed by" FROM table_30477 WHERE "Title" = 'From Russia With Love' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid numb... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '032-24135' AND patient.wardid = 1068 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime LIMIT 1 | eicu |
CREATE TABLE zzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | SELECT zzmzjzjlb.JZLSH FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE hz_info.RYBH = '06038186' AND NOT zzmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2020-12-13') UNION SELECT fzzmzjzjlb.JZLSH FROM hz_info JOI... | css |
CREATE TABLE addresses (
address_id number,
line_1_number_building text,
city text,
zip_postcode text,
state_province_county text,
country text
)
CREATE TABLE customer_payments (
customer_id number,
datetime_payment time,
payment_method_code text,
amount_payment number
)
CREATE... | SELECT T2.first_name, T2.last_name FROM customer_payments AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) > 2 | spider |
CREATE TABLE table_name_49 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is 2011, when 2010 is 'WTA Premier 5 Tournaments'?
| SELECT 2011 FROM table_name_49 WHERE 2010 = "wta premier 5 tournaments" | sql_create_context |
CREATE TABLE table_46894 (
"Area" text,
"Population" text,
"% Muslim" text,
"% Hindu" text,
"% Buddhist" text,
"% Other" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the percentage of Buddhist when the Population is ~2.6 million (2.6mi... | SELECT "% Buddhist" FROM table_46894 WHERE "Population" = '~2.6 million (2.6million)' | wikisql |
CREATE TABLE certificate (
eid number,
aid number
)
CREATE TABLE aircraft (
aid number,
name text,
distance number
)
CREATE TABLE flight (
flno number,
origin text,
destination text,
distance number,
departure_date time,
arrival_date time,
price number,
aid number
)... | SELECT T1.name FROM employee AS T1 JOIN certificate AS T2 ON T1.eid = T2.eid JOIN aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Boeing 737-800" INTERSECT SELECT T1.name FROM employee AS T1 JOIN certificate AS T2 ON T1.eid = T2.eid JOIN aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Airbus A340-300" | spider |
CREATE TABLE Apartment_Buildings (
building_id INTEGER,
building_short_name CHAR(15),
building_full_name VARCHAR(80),
building_description VARCHAR(255),
building_address VARCHAR(255),
building_manager VARCHAR(50),
building_phone VARCHAR(80)
)
CREATE TABLE Apartments (
apt_id INTEGER,
... | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T2.gender_code = "Female" ORDER BY COUNT(booking_start_date) DESC | nvbench |
CREATE TABLE table_name_12 (
wins INTEGER,
tournament VARCHAR,
events VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many times did Morgan win The Masters Tournament with fewer than 12 appearances?
| SELECT AVG(wins) FROM table_name_12 WHERE tournament = "masters tournament" AND events < 12 | sql_create_context |
CREATE TABLE table_name_10 (
score VARCHAR,
game VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Score, when Game is greater than 49, and when Opponent is 'Pittsburgh Ironmen'?
| SELECT score FROM table_name_10 WHERE game > 49 AND opponent = "pittsburgh ironmen" | sql_create_context |
CREATE TABLE table_22754310_1 (
party VARCHAR,
runner_up_a VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the party a for m. s. k. sathiyendran runner up
| SELECT party AS a FROM table_22754310_1 WHERE runner_up_a = "M. S. K. Sathiyendran" | sql_create_context |
CREATE TABLE region (
region_id number,
region_name text,
date text,
label text,
format text,
catalogue text
)
CREATE TABLE party (
party_id number,
minister text,
took_office text,
left_office text,
region_id number,
party_name text
)
CREATE TABLE member (
member_i... | SELECT minister, party_name FROM party ORDER BY took_office DESC | spider |
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,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.religion = "PROTESTANT QUAKER" AND diagnoses.long_title = "Hydronephrosis" | mimicsql_data |
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... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.long_title = "Congestive heart failure, unspecified" | mimicsql_data |
CREATE TABLE table_name_16 (
away_team VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the away team score for the home team listed as Footscray?
| SELECT away_team AS score FROM table_name_16 WHERE home_team = "footscray" | sql_create_context |
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... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "71" | mimicsql_data |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE admissions (
row_id numbe... | SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd... | mimic_iii |
CREATE TABLE table_name_16 (
year VARCHAR,
quarter_finalists VARCHAR,
semi_finalists VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Year has a Quarter-Finalists of 1,000, and Semi-Finalists of 1,500?
| SELECT year FROM table_name_16 WHERE quarter_finalists = "£1,000" AND semi_finalists = "£1,500" | sql_create_context |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimme... | SELECT Time, ID FROM swimmer ORDER BY ID DESC | nvbench |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom te... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE STRFTIME('%y', procedures_icd.charttime) = '2105' GROUP BY procedures_icd.icd9_code) AS t1 ... | mimic_iii |
CREATE TABLE table_73425 (
"Pos" real,
"Club" text,
"Games played" real,
"Red/Yellow cards" real,
"Positive play" real,
"Respect toward opponents" real,
"Respect toward referee" real,
"Behaviour of team officials" real,
"Points" real,
"Score" text,
"Average" text
)
-- Using... | SELECT "Points" FROM table_73425 WHERE "Respect toward opponents" = '212' | wikisql |
CREATE TABLE Ref_Locations (
Location_Code CHAR(15),
Location_Name VARCHAR(255),
Location_Description VARCHAR(255)
)
CREATE TABLE All_Documents (
Document_ID INTEGER,
Date_Stored DATETIME,
Document_Type_Code CHAR(15),
Document_Name CHAR(255),
Document_Description CHAR(255),
Other_De... | SELECT Date_Stored, COUNT(Date_Stored) FROM All_Documents AS T1 JOIN Ref_Calendar AS T2 ON T1.Date_Stored = T2.Calendar_Date ORDER BY Date_Stored DESC | nvbench |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE compartment_class (
compartment varchar,
... | 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 ((date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time... | atis |
CREATE TABLE table_4733 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What away team played when the home team was sout... | SELECT "Away team" FROM table_4733 WHERE "Home team" = 'south melbourne' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title 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... | SELECT MAX(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1784)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'tempe... | mimic_iii |
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... | 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 = "Noninf gastroenterit NEC" AND prescriptions.route = "TP" | mimicsql_data |
CREATE TABLE table_22801331_1 (
game VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What game was held against a team with a 6-3 record against the Cowboys?
| SELECT game FROM table_22801331_1 WHERE record = "6-3" | sql_create_context |
CREATE TABLE table_204_514 (
id number,
"date" text,
"sub" number,
"flight" text,
"dead" number,
"hurt" number,
"pax." number,
"type" text,
"perpetrator" text,
"description" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many... | SELECT SUM("dead") FROM table_204_514 WHERE "date" IN (1973, 1974) | squall |
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... | 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 = "Calcium, Total" | mimicsql_data |
CREATE TABLE table_26842217_10 (
time VARCHAR,
visiting_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the time for #1 alabama
| SELECT time FROM table_26842217_10 WHERE visiting_team = "#1 Alabama" | sql_create_context |
CREATE TABLE table_name_46 (
round VARCHAR,
score INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which round is a lower score than 21.5?
| SELECT round FROM table_name_46 WHERE score < 21.5 | sql_create_context |
CREATE TABLE table_name_4 (
loss VARCHAR,
opponent VARCHAR,
save VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the loss of the game against with LA New Bears with a save of Mac Suzuki?
| SELECT loss FROM table_name_4 WHERE opponent = "la new bears" AND save = "mac suzuki" | sql_create_context |
CREATE TABLE table_53154 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most decile for roll of 428
| SELECT MAX("Decile") FROM table_53154 WHERE "Roll" = '428' | wikisql |
CREATE TABLE table_19412902_2 (
clubs VARCHAR,
member_association VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many clubs are there in the Korea Republic?
| SELECT clubs FROM table_19412902_2 WHERE member_association = "Korea Republic" | sql_create_context |
CREATE TABLE table_47709 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How long did the match last in the Rings: Final Cap... | SELECT "Time" FROM table_47709 WHERE "Event" = 'rings: final capture' | wikisql |
CREATE TABLE table_name_70 (
rank INTEGER,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the rank when the time is 3:12.40?
| SELECT SUM(rank) FROM table_name_70 WHERE time = "3:12.40" | sql_create_context |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
... | SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8116) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'sodium') AND STRFTIME('%y-%m', labevents.charttime) >= '2102-03' ORDER BY labeven... | mimic_iii |
CREATE TABLE Payments (
Payment_ID INTEGER,
Settlement_ID INTEGER,
Payment_Method_Code VARCHAR(255),
Date_Payment_Made DATE,
Amount_Payment INTEGER
)
CREATE TABLE Claims (
Claim_ID INTEGER,
Policy_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,... | SELECT Date_Payment_Made, COUNT(Date_Payment_Made) FROM Payments WHERE Payment_Method_Code = 'Visa' ORDER BY COUNT(Date_Payment_Made) DESC | nvbench |
CREATE TABLE table_36409 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- on april 29, what was the attendance?
| SELECT SUM("Attendance") FROM table_36409 WHERE "Date" = 'april 29' | wikisql |
CREATE TABLE table_39526 (
"Ethnic group" text,
"Totora Municipality (%)" real,
"Pojo Municipality (%)" real,
"Pocona Municipality (%)" real,
"Chimor\u00e9 Municipality (%)" real,
"Puerto Villarroel Municipality (%)" real,
"Entre R\u00edos Municipality (%)" real
)
-- Using valid SQLite, an... | SELECT SUM("Pocona Municipality (%)") FROM table_39526 WHERE "Puerto Villarroel Municipality (%)" > '14.6' AND "Pojo Municipality (%)" < '88.5' | wikisql |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE zzmzjzjlb.JZZDSM = '维生素B缺乏病' AND jyjgzbb.JCZBDM = '... | css |
CREATE TABLE table_50041 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Points have a Visitor of montreal canadie... | SELECT MAX("Points") FROM table_50041 WHERE "Visitor" = 'montreal canadiens' AND "Attendance" > '18,568' AND "Record" = '2–0–1' | wikisql |
CREATE TABLE table_11371 (
"Year" real,
"Team" text,
"League" text,
"Record" text,
"Finish" text,
"Organization" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total of the year with a Team of johnson city yankees, and a Finish of 6t... | SELECT SUM("Year") FROM table_11371 WHERE "Team" = 'johnson city yankees' AND "Finish" = '6th' | wikisql |
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)... | SELECT DISTINCT aircraft_code FROM aircraft WHERE aircraft_code = 'D9S' | atis |
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Description VARCHAR(255)
)
CREATE TABLE Documents_to_be_Destroyed (
Document_ID INTEGER,
Destruction_Authorised_by_Employee_ID INTEGER,
Destroyed_by_Employee_ID INTEGER,
Planned_Des... | SELECT Date_in_Location_From, COUNT(Date_in_Location_From) FROM Document_Locations ORDER BY Date_in_Location_From DESC | nvbench |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE hz_info_zyjzjlb (
JZLSH number,
YLJGDM number,
zyjzjlb_id number
)
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC t... | SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjz... | css |
CREATE TABLE table_name_75 (
round_of_16 VARCHAR,
quarterfinal VARCHAR,
round_of_32 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the round of 32 was n/a and quarterfinal was did not advance, what was the round of 16?
| SELECT round_of_16 FROM table_name_75 WHERE quarterfinal = "did not advance" AND round_of_32 = "n/a" | sql_create_context |
CREATE TABLE table_67871 (
"Member countries" text,
"Population" real,
"Area (km\u00b2)" real,
"GDP (billion US$)" real,
"GDP per capita (US$)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the GDP of the place with over 54,292,038 people a... | SELECT MIN("GDP (billion US$)") FROM table_67871 WHERE "Population" > '54,292,038' AND "Area (km\u00b2)" > '30,528' | wikisql |
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,
... | SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-118236' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1) AND NOT patient.admissionweight IS N... | eicu |
CREATE TABLE table_name_51 (
attendance INTEGER,
home VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the attendance of the match with motagua as the home team?
| SELECT AVG(attendance) FROM table_name_51 WHERE home = "motagua" | sql_create_context |
CREATE TABLE table_name_71 (
team VARCHAR,
fans_took VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team had fans took of 288?
| SELECT team FROM table_name_71 WHERE fans_took = "288" | sql_create_context |
CREATE TABLE table_20720 (
"English Name" text,
"Simplified" text,
"Traditional" text,
"Pinyin" text,
"Area" text,
"Population" real,
"Density" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the pinyin for where population is 44617
| SELECT "Pinyin" FROM table_20720 WHERE "Population" = '44617' | wikisql |
CREATE TABLE table_name_21 (
rank INTEGER,
name VARCHAR,
goals VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When Oscar M guez had over 107 goals, what was the lowest he ranked?
| SELECT MIN(rank) FROM table_name_21 WHERE name = "oscar míguez" AND goals > 107 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.