instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_67543 (
"Member countries" text,
"Population" text,
"Area (km\u00b2)" text,
"GDP (billion US$)" text,
"GDP per capita (US$)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the per-capita GDP of the country with an overall ... | SELECT "GDP per capita (US$)" FROM table_67543 WHERE "GDP (billion US$)" = '80.955' | wikisql |
CREATE TABLE faculty_participates_in (
facid number,
actid number
)
CREATE TABLE participates_in (
stuid number,
actid number
)
CREATE TABLE activity (
actid number,
activity_name text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
... | SELECT COUNT(*) FROM faculty WHERE rank = "Professor" AND building = "NEB" | spider |
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 COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND STRFTIME('%y', patient.hospitaldischargetime) <= '2101' | eicu |
CREATE TABLE film_market_estimation (
Estimation_ID int,
Low_Estimate real,
High_Estimate real,
Film_ID int,
Type text,
Market_ID int,
Year int
)
CREATE TABLE film (
Film_ID int,
Title text,
Studio text,
Director text,
Gross_in_dollar int
)
CREATE TABLE market (
Mar... | SELECT Studio, COUNT(*) FROM film GROUP BY Studio ORDER BY Studio DESC | nvbench |
CREATE TABLE table_29747178_3 (
directed_by VARCHAR,
us_viewers__million_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who directed the episode that was watched by 2.67 million U.S. viewers?
| SELECT directed_by FROM table_29747178_3 WHERE us_viewers__million_ = "2.67" | sql_create_context |
CREATE TABLE table_2850912_6 (
pick__number INTEGER,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What pick was Greg Strome?
| SELECT MAX(pick__number) FROM table_2850912_6 WHERE player = "Greg Strome" | sql_create_context |
CREATE TABLE table_22570439_1 (
us_viewers__millions_ VARCHAR,
series__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many u.s. viewers (million) have a series # 83?
| SELECT us_viewers__millions_ FROM table_22570439_1 WHERE series__number = 83 | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
a... | SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-29268') | eicu |
CREATE TABLE country (
country_id SMALLINT UNSIGNED,
country VARCHAR(50),
last_update TIMESTAMP
)
CREATE TABLE film (
film_id SMALLINT UNSIGNED,
title VARCHAR(255),
description TEXT,
release_year YEAR,
language_id TINYINT UNSIGNED,
original_language_id TINYINT UNSIGNED,
rental_d... | SELECT payment_date, COUNT(payment_date) FROM payment WHERE amount > 10 UNION SELECT T1.payment_date FROM payment AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Elsa' | nvbench |
CREATE TABLE table_name_77 (
games_played VARCHAR,
trophy VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who many games were played for the series with the Sawhorse Dollar trophy?
| SELECT games_played FROM table_name_77 WHERE trophy = "sawhorse dollar" | sql_create_context |
CREATE TABLE table_58057 (
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Diff" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest diff with drawn of 6 and play larger than 18?
| SELECT MAX("Diff") FROM table_58057 WHERE "Drawn" = '6' AND "Played" > '18' | wikisql |
CREATE TABLE head (
head_ID int,
name text,
born_state text,
age real
)
CREATE TABLE department (
Department_ID int,
Name text,
Creation text,
Ranking int,
Budget_in_Billions real,
Num_Employees real
)
CREATE TABLE management (
department_ID int,
head_ID int,
tempor... | SELECT born_state, COUNT(born_state) FROM head GROUP BY born_state ORDER BY born_state DESC | nvbench |
CREATE TABLE table_20925393_3 (
english VARCHAR,
cardinal_direction VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- state the name of day in english where cardinal direction is east
| SELECT english FROM table_20925393_3 WHERE cardinal_direction = "East" | sql_create_context |
CREATE TABLE users (
user_id number,
role_code text,
user_name text,
user_login text,
password text
)
CREATE TABLE functional_areas (
functional_area_code text,
parent_functional_area_code text,
functional_area_description text
)
CREATE TABLE document_sections (
section_id number,
... | SELECT role_description FROM roles WHERE role_code = (SELECT role_code FROM users WHERE user_login = 1 GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1) | spider |
CREATE TABLE table_26091 (
"Rank" real,
"Rider" text,
"Mon 24 Aug" text,
"Tues 25 Aug" text,
"Wed 26 Aug" text,
"Thurs 27 Aug" text,
"Fri 28 Aug" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the rider when Fri 28 Aug was 24' 23.36 ... | SELECT "Rider" FROM table_26091 WHERE "Fri 28 Aug" = '24'' 23.36 92.820mph' | wikisql |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskSt... | SELECT Id AS "post_link", PostTypeId, CreationDate FROM Posts WHERE (SELECT Text FROM PostHistory WHERE Id IN (SELECT MAX(Id) FROM PostHistory WHERE PostId = Posts.Id AND PostHistoryTypeId IN (2, 5, 8))) LIKE '%<a href=%' ORDER BY CreationDate DESC | sede |
CREATE TABLE table_name_23 (
arch_type VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What kind of arch is the pont de montanges (pont-des-pierres)?
| SELECT arch_type FROM table_name_23 WHERE name = "pont de montanges (pont-des-pierres)" | sql_create_context |
CREATE TABLE gwyjzb (
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 * FROM gwyjzb WHERE gwyjzb.PERSON_ID = '59383313' AND gwyjzb.MED_SER_ORG_NO = '5882181' AND gwyjzb.MED_ORG_DEPT_NM LIKE '%复工%' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '59383313' AND fgwyjzb.MED_SER_ORG_NO = '5882181' AND fgwyjzb.MED_ORG_DEPT_NM LIKE '%复工%' | css |
CREATE TABLE table_name_29 (
crowd VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people attended the game where Footscray was away?
| SELECT crowd FROM table_name_29 WHERE away_team = "footscray" | sql_create_context |
CREATE TABLE bdmzjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH number,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZD... | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM... | css |
CREATE TABLE member_attendance (
Member_ID int,
Performance_ID int,
Num_of_Pieces int
)
CREATE TABLE performance (
Performance_ID real,
Date text,
Host text,
Location text,
Attendance int
)
CREATE TABLE member (
Member_ID text,
Name text,
Nationality text,
Role text
)
... | SELECT Date, COUNT(Date) FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID WHERE T2.Role = "Violin" GROUP BY Date ORDER BY Date | nvbench |
CREATE TABLE table_name_47 (
agg VARCHAR,
team_2 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When Partizan is Team 2, what is the Agg?
| SELECT agg FROM table_name_47 WHERE team_2 = "partizan" | sql_create_context |
CREATE TABLE table_name_86 (
score VARCHAR,
competition VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Score of the Fifa World Cup 1986 Qualifying Competition?
| SELECT score FROM table_name_86 WHERE competition = "fifa world cup 1986 qualifying" | sql_create_context |
CREATE TABLE camera_lens (
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the camera lens names containing substring 'Digital'.
| SELECT name FROM camera_lens WHERE name LIKE "%Digital%" | sql_create_context |
CREATE TABLE table_23248910_11 (
high_rebounds VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the amount of rebounds in game 2?
| SELECT high_rebounds FROM table_23248910_11 WHERE game = 2 | sql_create_context |
CREATE TABLE table_24733 (
"Date" text,
"Event #" text,
"Event" text,
"Winner" text,
"Prize" text,
"Entries" text,
"Prize Pool" text,
"Elapsed Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many elapsed times were recorded for ... | SELECT COUNT("Elapsed Time") FROM table_24733 WHERE "Prize Pool" = '$1,678,200' | wikisql |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '奚修然' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2007-06-07' AND '2020-01-13' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' | css |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE patient (
uniquep... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'liver ca - ca metastatic to liver' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) | eicu |
CREATE TABLE product (
product_id number,
product text,
dimensions text,
dpi number,
pages_per_minute_color number,
max_page_size text,
interface text
)
CREATE TABLE store_district (
store_id number,
district_id number
)
CREATE TABLE store_product (
store_id number,
product... | SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id GROUP BY t3.headquartered_city ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_name_56 (
date VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of the game when their record was 84-69?
| SELECT date FROM table_name_56 WHERE record = "84-69" | sql_create_context |
CREATE TABLE table_name_61 (
label VARCHAR,
album VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Label that has an Album of so red the rose?
| SELECT label FROM table_name_61 WHERE album = "so red the rose" | sql_create_context |
CREATE TABLE table_name_10 (
film VARCHAR,
director VARCHAR,
award VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Award of troisi me prix, and a Year smaller than 2010, and a Director of jan komasa is what film?
| SELECT film FROM table_name_10 WHERE award = "troisième prix" AND year < 2010 AND director = "jan komasa" | sql_create_context |
CREATE TABLE table_name_8 (
venue VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the venue for Round f?
| SELECT venue FROM table_name_8 WHERE round = "f" | sql_create_context |
CREATE TABLE table_name_21 (
film VARCHAR,
year VARCHAR,
category VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the film when the year is earlier than 2002 and the category is outstanding actress?
| SELECT film FROM table_name_21 WHERE year < 2002 AND category = "outstanding actress" | sql_create_context |
CREATE TABLE volume (
Volume_ID int,
Volume_Issue text,
Issue_Date text,
Weeks_on_Top real,
Song text,
Artist_ID int
)
CREATE TABLE artist (
Artist_ID int,
Artist text,
Age int,
Famous_Title text,
Famous_Release_date text
)
CREATE TABLE music_festival (
ID int,
Musi... | SELECT Category, COUNT(Category) FROM music_festival WHERE Result = "Awarded" GROUP BY Category | nvbench |
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREA... | SELECT DISTINCT aircraft.basic_type FROM aircraft, airline, equipment_sequence, flight WHERE airline.airline_name LIKE 'CANADIAN AIRLINES' AND equipment_sequence.aircraft_code = aircraft.aircraft_code AND flight.aircraft_code_sequence = equipment_sequence.aircraft_code_sequence AND flight.airline_code = airline.airline... | atis |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
... | 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 = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRA... | atis |
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 SUM(t_kc24.OVE_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '0329082' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2001-10-07' AND '2013-08-28' UNION SELECT SUM(t_kc24.OVE_PAY) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.MED_SER_ORG_NO = '... | css |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND... | css |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT PERSON_NM, PERSON_SEX, PERSON_AGE, IDENTITY_CARD FROM t_kc21 WHERE MED_CLINIC_ID = '04488736077' | css |
CREATE TABLE table_5284 (
"Date" text,
"Opponent" text,
"Location" text,
"Result" text,
"Overall" text,
"Conf." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where did the Bruins play Iowa State?
| SELECT "Location" FROM table_5284 WHERE "Opponent" = 'iowa state' | wikisql |
CREATE TABLE table_43302 (
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"HDTV" text,
"Package/Option" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the content for la sorgente sat 3?
| SELECT "Content" FROM table_43302 WHERE "Television service" = 'la sorgente sat 3' | wikisql |
CREATE TABLE table_14070062_3 (
club VARCHAR,
try_bonus VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many clubs have a try bonus value of 5?
| SELECT COUNT(club) FROM table_14070062_3 WHERE try_bonus = "5" | sql_create_context |
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
)
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average age for... | SELECT job, AVG(age) FROM Person WHERE gender = 'male' GROUP BY job ORDER BY AVG(age) | nvbench |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Descri... | SELECT Id AS "post_link" FROM Posts WHERE (PostTypeId = 1) AND (Title LIKE '%##keyword##%') ORDER BY CreationDate DESC | sede |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH ... | css |
CREATE TABLE table_name_28 (
gold INTEGER,
silver VARCHAR,
bronze VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum for gold when there is more than 17 silver and more than 24 bronze?
| SELECT SUM(gold) FROM table_name_28 WHERE silver > 17 AND bronze > 24 | sql_create_context |
CREATE TABLE fires (
fire_year number,
discovery_date number,
discovery_doy number,
discovery_time text,
stat_cause_code number,
stat_cause_descr text,
cont_date text,
cont_doy text,
cont_time text,
fire_size number,
fire_size_class text,
latitude number,
longitude nu... | SELECT state FROM fires WHERE fire_year = 2001 GROUP BY state ORDER BY COUNT(*) DESC LIMIT 1 | uswildfires |
CREATE TABLE table_26819 (
"Rank" real,
"Senator" text,
"Date of birth" text,
"Entered Senate" text,
"Left Senate" text,
"State served" text,
"Party" text,
"Time since entry" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Of which part d... | SELECT "Party" FROM table_26819 WHERE "Senator" = 'Dick Clark' | wikisql |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH ... | css |
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station_id INTEGER,
bike_id INTEGER,
subscription_type TEXT,
zip_code INTEGER
)
CREATE TABLE station (
id INTEG... | SELECT date, COUNT(date) FROM weather WHERE zip_code = 94107 AND events <> "Fog" AND events <> "Rain" | nvbench |
CREATE TABLE table_name_9 (
country VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country did Raymond Floyd play for?
| SELECT country FROM table_name_9 WHERE player = "raymond floyd" | sql_create_context |
CREATE TABLE table_33792 (
"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 was the venue when the away team scored 9.1... | SELECT "Venue" FROM table_33792 WHERE "Away team score" = '9.17 (71)' | wikisql |
CREATE TABLE table_67866 (
"Language" text,
"Number" text,
"percentage (%)" text,
"males" text,
"females" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of males 977 948?
| SELECT "Number" FROM table_67866 WHERE "males" = '977 948' | wikisql |
CREATE TABLE table_80446 (
"Rank" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many total gold are less than 4?
| SELECT COUNT("Gold") FROM table_80446 WHERE "Total" < '4' | wikisql |
CREATE TABLE table_142573_1 (
bus_width__bits_ VARCHAR,
bandwidth__mb_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the bus width bits when bandwidth mb/s is 3200
| SELECT bus_width__bits_ FROM table_142573_1 WHERE bandwidth__mb_s_ = 3200 | sql_create_context |
CREATE TABLE table_1802 (
"Year" text,
"Governor" text,
"Lieutenant Governor" text,
"Secretary of State" text,
"Attorney General" text,
"Treasurer" text,
"State Senate" text,
"State Assembly" text,
"U.S. Senator (Class I)" text,
"U.S. Senator (Class III)" text,
"U.S. House" t... | SELECT "Treasurer" FROM table_1802 WHERE "Year" = '2008' | wikisql |
CREATE TABLE table_name_82 (
position VARCHAR,
notes VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Is there a Position for Notes 53.96?
| SELECT position FROM table_name_82 WHERE notes = "53.96" | sql_create_context |
CREATE TABLE table_45826 (
"Season" real,
"Series" text,
"Points" text,
"Position" text,
"Driver" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Position, when Series is Queensland Formula Ford Championship, when Season is after 2001, and wh... | SELECT "Position" FROM table_45826 WHERE "Series" = 'queensland formula ford championship' AND "Season" > '2001' AND "Points" = '234' | wikisql |
CREATE TABLE table_24368 (
"Type of Record" text,
"Attendance" real,
"Date/Year" text,
"Stadium" text,
"Result/Games" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which type of record has result/games of 9 games (57,144 avg.)
| SELECT "Type of Record" FROM table_24368 WHERE "Result/Games" = '9 games (57,144 avg.)' | wikisql |
CREATE TABLE table_59305 (
"Country" text,
"Electricity production (Kw/h, billion)" real,
"% Coal" real,
"% Natural gas" real,
"% Oil" real,
"% Hydropower" real,
"% Other renewable" real,
"% Nuclear power" real
)
-- Using valid SQLite, answer the following questions for the tables prov... | SELECT MAX("Electricity production (Kw/h, billion)") FROM table_59305 WHERE "% Other renewable" = '0.4' AND "% Coal" = '0' AND "% Hydropower" > '99' | wikisql |
CREATE TABLE table_name_15 (
country VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country does Gary Koch play for?
| SELECT country FROM table_name_15 WHERE player = "gary koch" | sql_create_context |
CREATE TABLE table_48847 (
"Result" text,
"Opponent" text,
"Method" text,
"Date" text,
"Round" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Date has a Result of win, and a Round smaller than 2, and an Opponent of myron greenberg?
| SELECT "Date" FROM table_48847 WHERE "Result" = 'win' AND "Round" < '2' AND "Opponent" = 'myron greenberg' | wikisql |
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
... | SELECT Nationality, SUM(ID) FROM swimmer GROUP BY Nationality ORDER BY Nationality | nvbench |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT T2.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name | nvbench |
CREATE TABLE table_24613895_1 (
number_of_believers INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least number of believers
| SELECT MIN(number_of_believers) FROM table_24613895_1 | sql_create_context |
CREATE TABLE table_38518 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Tournament has a Winning score of e (72-69-71-68=280)?
| SELECT "Tournament" FROM table_38518 WHERE "Winning score" = 'e (72-69-71-68=280)' | wikisql |
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,... | 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 (((flight.departure_time <= 0 AND flight.departure_time >= 1200) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND fligh... | atis |
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Morphine Sulfate" | mimicsql_data |
CREATE TABLE table_204_697 (
id number,
"song" text,
"artist(s)" text,
"concert" number,
"film" number,
"1978 album" number,
"2002 album" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many songs in total ?
| SELECT COUNT("song") FROM table_204_697 | squall |
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int
)
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int
)
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real... | SELECT Name, COUNT(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.Artist_ID = T2.Artist_ID GROUP BY T1.Artist_ID ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_name_95 (
laps INTEGER,
rider VARCHAR,
grid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average Laps that have gregorio lavilla as the rider, with a grid greater than 13?
| SELECT AVG(laps) FROM table_name_95 WHERE rider = "gregorio lavilla" AND grid > 13 | sql_create_context |
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,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Angioneurotic edema, not elsewhere classified" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE table_name_75 (
teams VARCHAR,
home VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team has a home of 2-3?
| SELECT teams FROM table_name_75 WHERE home = "2-3" | sql_create_context |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationD... | SELECT LAST_DATE_OF_MONTH(CreationDate) AS Asked, 1.0 * SUM(CASE WHEN LastEditDate > ClosedDate THEN 1 ELSE 0 END) / COUNT(*) AS "%edit_after_close" FROM Posts WHERE NOT ClosedDate IS NULL AND PostTypeId = 1 GROUP BY LAST_DATE_OF_MONTH(CreationDate) ORDER BY LAST_DATE_OF_MONTH(CreationDate) | sede |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE airport_service (... | 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.arrival_time < flight.departure_time) AND date_day.day_number = 20 AND date_day.month_number = 1 AND date_day.year = 1991 AND days.da... | atis |
CREATE TABLE table_name_51 (
gold INTEGER,
bronze VARCHAR,
nation VARCHAR,
silver VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Silver larger than 0, and a Total smaller than 3, and a Nation of bulgaria, and a Bronze smaller than ... | SELECT SUM(gold) FROM table_name_51 WHERE silver > 0 AND total < 3 AND nation = "bulgaria" AND bronze < 0 | sql_create_context |
CREATE TABLE table_25125 (
"Series #" real,
"Season #" real,
"Episode title" text,
"Written by" text,
"Directed by" text,
"U.S. viewers (millions)" text,
"Original air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many written by ... | SELECT COUNT("Written by") FROM table_25125 WHERE "Directed by" = 'Wendey Stanzler' | wikisql |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id num... | SELECT p.Id AS "Post Link", p.Score AS "P.Score", p.Body AS "P.Body", c.Text AS "C.Text", c.Score AS "C.Score", c.CreationDate FROM Posts AS p JOIN Comments AS c ON p.Id = c.PostId WHERE c.UserId = '##CommenterID:int##' AND LOWER(c.Text) LIKE LOWER('%##SearchTerm##%') ORDER BY c.Score DESC | sede |
CREATE TABLE table_33695 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"TV Time" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the attendance for the game on October 30, 1994 for a week after week 2?
| SELECT COUNT("Attendance") FROM table_33695 WHERE "Week" > '2' AND "Date" = 'october 30, 1994' | wikisql |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jo... | SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.start_time > '19:15' AND course.course_id = course_offering.course_id AND course.department = 'ANTHRBIO' AND course.number = 334 AND semester.semester = 'WN' ... | advising |
CREATE TABLE competition_record (
competition_id number,
farm_id number,
rank number
)
CREATE TABLE farm_competition (
competition_id number,
year number,
theme text,
host_city_id number,
hosts text
)
CREATE TABLE city (
city_id number,
official_name text,
status text,
... | SELECT status FROM city GROUP BY status ORDER BY COUNT(*) | spider |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT All_Home, SUM(School_ID) FROM basketball_match GROUP BY All_Home | nvbench |
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 t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 3 | eicu |
CREATE TABLE table_69096 (
"Outcome" text,
"Date" text,
"Surface" text,
"Partnering" text,
"Opponents in the final" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What surface was played on that resulted in a score of 4 6, 6 2, [10... | SELECT "Surface" FROM table_69096 WHERE "Score" = '4–6, 6–2, [10–7]' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospit... | SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23605')) ORDER BY microlab.culturetakentime LIMIT 1 | eicu |
CREATE TABLE table_name_79 (
format VARCHAR,
catalogue VARCHAR,
region VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What format is the Catalogue 9362486152 from the region of Australia in?
| SELECT format FROM table_name_79 WHERE catalogue = "9362486152" AND region = "australia" | sql_create_context |
CREATE TABLE table_203_598 (
id number,
"date" text,
"time" text,
"opponent" text,
"site" text,
"tv" text,
"result" text,
"attendance" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which opponent was next after jackson state ?
| SELECT "opponent" FROM table_203_598 WHERE "date" > (SELECT "date" FROM table_203_598 WHERE "opponent" = 'jackson state') ORDER BY "date" LIMIT 1 | squall |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | SELECT mzjzjlb.JZZDBM, mzjzjlb.JZZDSM FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.person_info_XM = '水清懿' | css |
CREATE TABLE table_203_175 (
id number,
"rank" text,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which country won the most medals total ?
| SELECT "nation" FROM table_203_175 ORDER BY "total" DESC LIMIT 1 | squall |
CREATE TABLE table_30476 (
"Club" text,
"Location" text,
"Home Venue" text,
"Capacity" text,
"Founded" real,
"Years Active" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the capacity for the Home Venue of the New Zealand Breakers club?
| SELECT "Capacity" FROM table_30476 WHERE "Club" = 'New Zealand Breakers' | wikisql |
CREATE TABLE status (
statusId INTEGER,
status TEXT
)
CREATE TABLE qualifying (
qualifyId INTEGER,
raceId INTEGER,
driverId INTEGER,
constructorId INTEGER,
number INTEGER,
position INTEGER,
q1 TEXT,
q2 TEXT,
q3 TEXT
)
CREATE TABLE lapTimes (
raceId INTEGER,
driverId... | SELECT location, circuitId FROM circuits WHERE country = "France" OR country = "Belgium" ORDER BY location | nvbench |
CREATE TABLE table_70035 (
"Date" text,
"City" text,
"Event" text,
"Winner" text,
"Prize" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Winner had a Prize of z 2,153,999?
| SELECT "Winner" FROM table_70035 WHERE "Prize" = 'zł2,153,999' | wikisql |
CREATE TABLE table_1894 (
"Position" real,
"Sail Number" text,
"Yacht" text,
"State/Country" text,
"Yacht Type" text,
"LOA (Metres)" text,
"Skipper" text,
"Elapsed Time d:hh:mm:ss" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When 17.0... | SELECT "Yacht Type" FROM table_1894 WHERE "LOA (Metres)" = '17.07' | wikisql |
CREATE TABLE table_name_88 (
original_title VARCHAR,
language VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the original title of the Hindi film?
| SELECT original_title FROM table_name_88 WHERE language = "hindi" | sql_create_context |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT txmzjzjlb.JZZDBM, txmzjzjlb.JZZDSM FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '90684137520' UNION SELECT ftxmzjzjlb.JZZDBM, ftxmzjzjlb.JZZDSM FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '90684137520' | css |
CREATE TABLE table_11381 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Decision when the Visitor was Carolina?
| SELECT "Decision" FROM table_11381 WHERE "Visitor" = 'carolina' | wikisql |
CREATE TABLE player (
Player_name VARCHAR,
gender VARCHAR,
Player_ID VARCHAR
)
CREATE TABLE coach (
Coach_ID VARCHAR
)
CREATE TABLE player_coach (
Coach_ID VARCHAR,
Player_ID VARCHAR,
Starting_year INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided ab... | SELECT T3.Player_name, T3.gender FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID WHERE T1.Starting_year > 2011 | sql_create_context |
CREATE TABLE table_39365 (
"Game" real,
"December" real,
"Opponent" text,
"Score" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score for the Dec 11 game?
| SELECT "Score" FROM table_39365 WHERE "December" = '11' | wikisql |
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | SELECT Sex, SUM(Height) FROM people GROUP BY Sex ORDER BY Sex DESC | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.