instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_train_152 (
"id" int,
"systolic_blood_pressure_sbp" int,
"creatinine_clearance_cl" float,
"diastolic_blood_pressure_dbp" int,
"total_cholesterol" int,
"urine_protein" int,
"proteinuria" int,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for th... | SELECT * FROM table_train_152 WHERE proteinuria = 1 OR urine_protein > 220 | criteria2sql |
CREATE TABLE table_68434 (
"Date" text,
"City" text,
"Event" text,
"Winner" text,
"Prize" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Ram Vaswani was a winner on what date?
| SELECT "Date" FROM table_68434 WHERE "Winner" = 'ram vaswani' | wikisql |
CREATE TABLE table_28019988_5 (
series__number INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest numbered episode in the series?
| SELECT MAX(series__number) FROM table_28019988_5 | sql_create_context |
CREATE TABLE table_name_36 (
player VARCHAR,
conv VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What player played on 04/05/1999 with a conv of 0?
| SELECT player FROM table_name_36 WHERE conv = "0" AND date = "04/05/1999" | sql_create_context |
CREATE TABLE table_77316 (
"Position" real,
"Driver / Passenger" text,
"Equipment" text,
"Bike No" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Equipment that has a Points littler than 442, and a Position of 9?
| SELECT "Equipment" FROM table_77316 WHERE "Points" < '442' AND "Position" = '9' | wikisql |
CREATE TABLE table_38703 (
"Games" real,
"Drawn" real,
"Lost" real,
"Points difference" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many drawn have points of 6 and lost by fewer than 4?
| SELECT COUNT("Drawn") FROM table_38703 WHERE "Points" = '6' AND "Lost" < '4' | wikisql |
CREATE TABLE table_23281862_10 (
game INTEGER,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most game for w 113 96 (ot)
| SELECT MAX(game) FROM table_23281862_10 WHERE score = "W 113–96 (OT)" | sql_create_context |
CREATE TABLE table_name_37 (
place VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Place of the Player with a Score of 67-76-74-67=284?
| SELECT place FROM table_name_37 WHERE score = 67 - 76 - 74 - 67 = 284 | sql_create_context |
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON 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 AND jybgb.BGDH = jy... | css |
CREATE TABLE table_15964 (
"Pick" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What teams did the player vadim sharifijanov play for?
| SELECT "College/junior/club team" FROM table_15964 WHERE "Player" = 'Vadim Sharifijanov' | wikisql |
CREATE TABLE table_57949 (
"Season" text,
"Team" text,
"Country" text,
"Division" real,
"Apps" real,
"Goals" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest apps in Honduras with less than 2 goals for Club Deportivo Victoria ... | SELECT MIN("Apps") FROM table_57949 WHERE "Country" = 'honduras' AND "Goals" < '2' AND "Team" = 'club deportivo victoria' AND "Division" > '1' | wikisql |
CREATE TABLE table_1480 (
"Player" text,
"Team" text,
"Matches" real,
"Innings" real,
"Runs" real,
"Average" text,
"Highest Score" text,
"100s" real,
"50s" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many numbers were recorded... | SELECT COUNT("Matches") FROM table_1480 WHERE "Player" = 'Arthur Morris' | wikisql |
CREATE TABLE table_70426 (
"Player" text,
"Country" text,
"Year won" real,
"Total" real,
"To par" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the earliest year won with a total bigger than 156?
| SELECT MIN("Year won") FROM table_70426 WHERE "Total" > '156' | wikisql |
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,
... | SELECT demographic.admittime, prescriptions.icustay_id FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Marilyn Norvell" | mimicsql_data |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname var... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Craig Ruff%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offeri... | advising |
CREATE TABLE table_17968229_1 (
home__2nd_leg_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the home is Atl tico Tucum n, what is the name of the first leg?
| SELECT 1 AS st_leg FROM table_17968229_1 WHERE home__2nd_leg_ = "Atlético Tucumán" | sql_create_context |
CREATE TABLE Sales (
sales_transaction_id INTEGER,
sales_details VARCHAR(255)
)
CREATE TABLE Lots (
lot_id INTEGER,
investor_id INTEGER,
lot_details VARCHAR(255)
)
CREATE TABLE Investors (
investor_id INTEGER,
Investor_details VARCHAR(255)
)
CREATE TABLE Purchases (
purchase_transacti... | SELECT transaction_type_code, AVG(amount_of_transaction) FROM Transactions GROUP BY transaction_type_code ORDER BY transaction_type_code | nvbench |
CREATE TABLE League (
id INTEGER,
country_id INTEGER,
name TEXT
)
CREATE TABLE Player (
id INTEGER,
player_api_id INTEGER,
player_name TEXT,
player_fifa_api_id INTEGER,
birthday TEXT,
height INTEGER,
weight INTEGER
)
CREATE TABLE Country (
id INTEGER,
name TEXT
)
CREAT... | SELECT birthday, COUNT(birthday) FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id ORDER BY potential DESC LIMIT 5 | nvbench |
CREATE TABLE table_name_59 (
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result of the 2011 US Open when the 2007 was F?
| SELECT 2011 FROM table_name_59 WHERE 2007 = "f" AND tournament = "us open" | 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 prescriptions (
subject_id text,
hadm_id... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT; MYOMECTOMY/SDA" AND procedures.icd9_code = "5187" | mimicsql_data |
CREATE TABLE table_204_843 (
id number,
"volume" number,
"year" text,
"names" text,
"articles" number,
"pages" number,
"images" number,
"maps" number,
"number of copies" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which volume h... | SELECT "volume" FROM table_204_843 ORDER BY "images" LIMIT 1 | squall |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2034" AND lab.itemid = "51009" | mimicsql_data |
CREATE TABLE table_60979 (
"English name" text,
"Chinese name" text,
"Year signed" real,
"Year separated" text,
"Reason for separation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the signed year for the Chinese name who separated in 198... | SELECT "Year signed" FROM table_60979 WHERE "Year separated" = '1987' AND "Chinese name" = '蘇永康' | wikisql |
CREATE TABLE table_15377 (
"Category" text,
"Film" text,
"Director(s)" text,
"Country" text,
"Nominating Festival" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Russia has films in which category?
| SELECT "Category" FROM table_15377 WHERE "Country" = 'russia' | wikisql |
CREATE TABLE table_name_17 (
head_coach VARCHAR,
city VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the head coach for the club from Estoril?
| SELECT head_coach FROM table_name_17 WHERE city = "estoril" | sql_create_context |
CREATE TABLE table_name_37 (
population INTEGER,
median_family_income VARCHAR,
number_of_households VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Population is the lowest one that has a Median family income of $74,905, and a Number of households s... | SELECT MIN(population) FROM table_name_37 WHERE median_family_income = "$74,905" AND number_of_households < 145 OFFSET 790 | sql_create_context |
CREATE TABLE table_name_68 (
position VARCHAR,
college VARCHAR,
years_exp VARCHAR,
weight VARCHAR,
number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Position, when Weight is greater than 200, when Number is less than 44, when Years Ex... | SELECT position FROM table_name_68 WHERE weight > 200 AND number < 44 AND years_exp = "9" AND college = "university of new mexico" | sql_create_context |
CREATE TABLE table_26240 (
"Episode Title" text,
"Song(s) Title" text,
"Writer" text,
"Singer(s)" text,
"Album(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What album was the song My Chariot on?
| SELECT "Album(s)" FROM table_26240 WHERE "Song(s) Title" = 'My Chariot' | wikisql |
CREATE TABLE table_28794 (
"Episode" real,
"First broadcast Denmark ( DR1 )" text,
"Official TNS Gallup ratings" real,
"First broadcast UK ( BBC Four )" text,
"Official BARB ratings" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the first ... | SELECT "First broadcast UK ( BBC Four )" FROM table_28794 WHERE "Official BARB ratings" = '1085000' | wikisql |
CREATE TABLE table_21382 (
"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.
-- How many population values are listed for the community with an area of 10.25 sq.km.... | SELECT COUNT("Population") FROM table_21382 WHERE "Area km 2" = '10.25' | wikisql |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate t... | SELECT Posts.OwnerUserId, COUNT(OwnerUserId), SUM(Score) FROM Posts WHERE Posts.ParentId IS NULL AND OwnerUserId IN (SELECT Users.Id FROM Users WHERE Id != -1 ORDER BY UpVotes - DownVotes LIMIT 20) GROUP BY OwnerUserId | sede |
CREATE TABLE table_37809 (
"Tournament" text,
"2006" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the 2011 with 2006 of 2r and 2008 of 2r
| SELECT "2011" FROM table_37809 WHERE "2006" = '2r' AND "2008" = '2r' | wikisql |
CREATE TABLE table_name_98 (
total_points VARCHAR,
assists VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the total number of points when there were 7 assists?
| SELECT total_points FROM table_name_98 WHERE assists = "7" | sql_create_context |
CREATE TABLE jobs (
job_title VARCHAR,
max_salary INTEGER,
min_salary VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- display job Title, the difference between minimum and maximum salaries for those jobs which max salary within the range 12000 to 18000.
| SELECT job_title, max_salary - min_salary FROM jobs WHERE max_salary BETWEEN 12000 AND 18000 | sql_create_context |
CREATE TABLE table_name_45 (
date_of_vacancy VARCHAR,
manner_of_departure VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of vacancy when the manner of departure is sacked and the team is nejapa?
| SELECT date_of_vacancy FROM table_name_45 WHERE manner_of_departure = "sacked" AND team = "nejapa" | sql_create_context |
CREATE TABLE bank (
branch_ID int,
bname varchar(20),
no_of_customers int,
city varchar(10),
state varchar(20)
)
CREATE TABLE loan (
loan_ID varchar(3),
loan_type varchar(15),
cust_ID varchar(3),
branch_ID varchar(3),
amount int
)
CREATE TABLE customer (
cust_ID varchar(3),... | SELECT bname, SUM(amount) FROM bank AS T1 JOIN loan AS T2 ON T1.branch_ID = T2.branch_ID GROUP BY T1.bname ORDER BY bname DESC | nvbench |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2121" AND diagnoses.long_title = "Malignant neoplasm of descending colon" | mimicsql_data |
CREATE TABLE table_name_49 (
score VARCHAR,
player VARCHAR,
country VARCHAR,
to_par VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the score when the country is united states, the to par is +2 and the player is phil hancock?
| SELECT score FROM table_name_49 WHERE country = "united states" AND to_par = "+2" AND player = "phil hancock" | sql_create_context |
CREATE TABLE shop (
Shop_ID int,
Address text,
Num_of_staff text,
Score real,
Open_Year text
)
CREATE TABLE happy_hour_member (
HH_ID int,
Member_ID int,
Total_amount real
)
CREATE TABLE member (
Member_ID int,
Name text,
Membership_card text,
Age int,
Time_of_purch... | SELECT Address, AVG(Age) FROM member GROUP BY Address ORDER BY Time_of_purchase | nvbench |
CREATE TABLE jybgb_jyjgzbb (
JYZBLSH number,
YLJGDM text,
jyjgzbb_id number
)
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 nu... | SELECT COUNT(*) FROM jybgb WHERE jybgb.YLJGDM = '8228050' AND jybgb.BGRQ BETWEEN '2009-05-30' AND '2018-11-28' | css |
CREATE TABLE table_6459 (
"District" text,
"2010 Population (000)" real,
"2008 GDP (USD bn) a" real,
"2008 GDP per capita (USD) a" real,
"Agri culture b" real,
"Mining b" real,
"Manufac turing b" real,
"Services & cons truction b" real,
"Exports (USD mn) 2011" text,
"Median mo. s... | SELECT AVG("Manufac turing b") FROM table_6459 WHERE "2008 GDP per capita (USD) a" < '20,682' AND "District" = 'chubut' AND "Structural poverty g" > '15.5' | wikisql |
CREATE TABLE table_73504 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's... | SELECT "Score" FROM table_73504 WHERE "High rebounds" = 'Shane Battier (8)' | wikisql |
CREATE TABLE table_204_295 (
id number,
"model" text,
"origin" text,
"type" text,
"version" text,
"in service" number,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many maxi ambulance vehicles are in service ?
| SELECT "in service" FROM table_204_295 WHERE "model" = 'maxi-ambulance' | squall |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arriv... | 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 = 24 AND date_day.month_number = 5 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time... | atis |
CREATE TABLE table_name_36 (
courtesy_title VARCHAR,
lineage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the courtesy title of 4th son of hatamoto oka tadataka?
| SELECT courtesy_title FROM table_name_36 WHERE lineage = "4th son of hatamoto ōoka tadataka" | sql_create_context |
CREATE TABLE table_name_94 (
score VARCHAR,
home VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score when Montreal was home?
| SELECT score FROM table_name_94 WHERE home = "montreal" | sql_create_context |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '09928457' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC | css |
CREATE TABLE Movie (
title VARCHAR,
director VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For all directors who directed more than one movie, return the titles of all movies directed by them, along with the director name. Sort by director name, then movie ... | SELECT T1.title, T1.director FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title <> T2.title ORDER BY T1.director, T1.title | sql_create_context |
CREATE TABLE table_name_60 (
builder VARCHAR,
name_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the builder for joffre
| SELECT builder FROM table_name_60 WHERE name_number = "joffre" | sql_create_context |
CREATE TABLE table_3692 (
"Model" text,
"Speed (GHz)" text,
"L3 Cache (MB)" real,
"QPI speed (GT/s)" text,
"DDR3 Clock (MHz)" real,
"TDP (W)" real,
"Cores" real,
"Threads" real,
"Turbo-Boost" text
)
-- Using valid SQLite, answer the following questions for the tables provided above... | SELECT COUNT("QPI speed (GT/s)") FROM table_3692 WHERE "Model" = 'L5506' | wikisql |
CREATE TABLE table_32453 (
"Rank" text,
"Name" text,
"City" text,
"Height in m (ft)" text,
"Floors" real,
"Year built" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What city has Sky Tower?
| SELECT "City" FROM table_32453 WHERE "Name" = 'sky tower' | wikisql |
CREATE TABLE table_name_17 (
worship_leader VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the Worship Leader for the song that was 7:05 long?
| SELECT worship_leader FROM table_name_17 WHERE time = "7:05" | sql_create_context |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE cos... | 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 procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B... | mimic_iii |
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
CREATE TABLE Lives_in (
stuid INTEGER,
do... | SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_54425 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the least number of laps for the constructor Ferrari and where the grid number was less tha... | SELECT MIN("Laps") FROM table_54425 WHERE "Constructor" = 'ferrari' AND "Grid" < '4' | wikisql |
CREATE TABLE table_39292 (
"Date" text,
"Jurisdiction" text,
"Ronald Reagan" text,
"George H. W. Bush" text,
"John B. Anderson" text,
"Howard Baker" text,
"John Connally" text,
"Phil Crane" text,
"Bob Dole" text
)
-- Using valid SQLite, answer the following questions for the tables... | SELECT "Howard Baker" FROM table_39292 WHERE "Ronald Reagan" = '72%' | wikisql |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
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... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour... | advising |
CREATE TABLE address (
address_id number,
address text,
address2 text,
district text,
city_id number,
postal_code text,
phone text,
last_update time
)
CREATE TABLE payment (
payment_id number,
customer_id number,
staff_id number,
rental_id number,
amount number,
... | SELECT title FROM film WHERE length > 100 OR rating = 'PG' EXCEPT SELECT title FROM film WHERE replacement_cost > 200 | spider |
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB text,
BGDH number,
YLJGDM number
)
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,
... | SELECT (SELECT COUNT(*) 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.RYBH = '50498130' AND mzjzjlb.JZKSRQ BETWEEN '2015-01-08' AND '2021-03-20') + (SELECT COUNT(*) FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_... | css |
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... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "SDH" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE table_19012 (
"Rank" real,
"Airport" text,
"Total Passengers" real,
"% Change 2008/2009" text,
"International Passengers" real,
"Domestic Passengers" real,
"Transit Passengers" real,
"Aircraft Movements" real,
"Freight ( Metric Tonnes )" real
)
-- Using valid SQLite, a... | SELECT "Rank" FROM table_19012 WHERE "Freight ( Metric Tonnes )" = '23791' | wikisql |
CREATE TABLE table_10525 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is silver when gold is 1 and the rank is less than 3 for japan?
| SELECT "Silver" FROM table_10525 WHERE "Gold" = '1' AND "Rank" < '3' AND "Nation" = 'japan' | wikisql |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text ... | WITH cisco AS (SELECT p.Id FROM Posts AS p INNER JOIN PostTags AS pt ON pt.PostId = p.Id INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE t.TagName = 'cisco') SELECT CAST((JULIANDAY(CURRENT_TIMESTAMP()) - JULIANDAY(p.CreationDate)) AS INT) AS week, CASE WHEN p.PostTypeId = 1 THEN 'Question' WHEN p.PostTypeId = 2 THEN 'Ans... | sede |
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 zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '94709761' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2014-02-18') | css |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)... | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '006-181433' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY patient.hospitaladmittime LIMIT 1 | eicu |
CREATE TABLE table_name_82 (
visitor VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the visiting team that had a record of 26-18?
| SELECT visitor FROM table_name_82 WHERE record = "26-18" | 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.diagnosis = "UPPER GI BLEED" AND demographic.dod_year <= "2179.0" | mimicsql_data |
CREATE TABLE table_name_34 (
home VARCHAR,
club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the home record for the Auxerre club?
| SELECT home FROM table_name_34 WHERE club = "auxerre" | sql_create_context |
CREATE TABLE table_name_77 (
season VARCHAR,
final_placing VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Season has a 19th Final Place?
| SELECT season FROM table_name_77 WHERE final_placing = "19th" | sql_create_context |
CREATE TABLE table_36311 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the visitor in the game that had Ottawa as the home team?
| SELECT "Visitor" FROM table_36311 WHERE "Home" = 'ottawa' | wikisql |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE chartevents (
... | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1561)) AND DATETIME(inputevents_cv.c... | mimic_iii |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE hz_info_mzjzjlb (
JZLSH number,
... | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB ... | css |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CRE... | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-4044')) AND STRFTIME('%y', treatment.treatmenttime) <= '2101' | eicu |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TA... | 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 = '010-6010')) ORDER BY lab.labresulttime LIMIT 1 | eicu |
CREATE TABLE table_77686 (
"Date" text,
"Tournament" text,
"Winning score" text,
"To par" text,
"Margin of victory" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What tournament was on Jan 29, 2012?
| SELECT "Tournament" FROM table_77686 WHERE "Date" = 'jan 29, 2012' | wikisql |
CREATE TABLE school (
enrollment INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the total and average enrollment of all schools?
| SELECT SUM(enrollment), AVG(enrollment) FROM school | sql_create_context |
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 time_zone (
time_zone_code text,
time_zone_name ... | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'FORT WORTH' AND ground_service.city_code = city.city_code | atis |
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 COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '2484766' AND IN_HOSP_DATE BETWEEN '2003-05-25' AND '2014-06-18' AND CLINIC_TYPE = '门诊' | css |
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 t_kc22 WHERE t_kc22.MED_ORG_DEPT_NM = '优生咨询专科' AND t_kc22.STA_DATE BETWEEN '2000-12-05' AND '2001-09-30' AND t_kc22.SOC_SRT_DIRE_CD = '826917' | css |
CREATE TABLE table_name_58 (
content VARCHAR,
television_service VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the content of the Television service of Vesti?
| SELECT content FROM table_name_58 WHERE television_service = "vesti" | sql_create_context |
CREATE TABLE table_14286908_1 (
school VARCHAR,
finalists VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the names that had a finalist score of 2?
| SELECT school FROM table_14286908_1 WHERE finalists = 2 | sql_create_context |
CREATE TABLE table_19930660_2 (
marcus_guest VARCHAR,
rufus_guest VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was Marcus's guest in the episode when Rufus's guest was Rory McGrath?
| SELECT marcus_guest FROM table_19930660_2 WHERE rufus_guest = "Rory McGrath" | sql_create_context |
CREATE TABLE table_15173650_2 (
attendance INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least attendance
| SELECT MIN(attendance) FROM table_15173650_2 | sql_create_context |
CREATE TABLE table_2541 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" text,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many positi... | SELECT COUNT("Position") FROM table_2541 WHERE "F/Laps" = '1' AND "Series" = 'British Formula Three' | wikisql |
CREATE TABLE table_30714 (
"First air date" text,
"Reward" text,
"Immunity" text,
"Eliminated" text,
"Vote" text,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is listed in eliminated when the finish is 15th voted out 9th jury Mem... | SELECT "Eliminated" FROM table_30714 WHERE "Finish" = '15th Voted Out 9th Jury Member Day 46' | wikisql |
CREATE TABLE table_name_91 (
avg_g INTEGER,
loss VARCHAR,
gain VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Avg/G has a Gain of 16, and a Name of barnes, freddie, and a Loss smaller than 2?
| SELECT SUM(avg_g) FROM table_name_91 WHERE gain = 16 AND name = "barnes, freddie" AND loss < 2 | sql_create_context |
CREATE TABLE table_77375 (
"Opposing Team" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date was the opposing team Poverty Bay?
| SELECT "Date" FROM table_77375 WHERE "Opposing Team" = 'poverty bay' | wikisql |
CREATE TABLE table_21977704_1 (
no INTEGER,
entrant VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most number for autom vil club argentino for benedicto campos
| SELECT MAX(no) FROM table_21977704_1 WHERE entrant = "Automóvil Club Argentino" AND driver = "Benedicto Campos" | sql_create_context |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | SELECT Id AS "post_link", Id, CreationDate, Score, ViewCount, LENGTH(Body) AS Size FROM Posts WHERE (Body LIKE '%\multicolumn{1}%' COLLATE SQL_Latin1_General_Cp1_CI_AS) ORDER BY CreationDate DESC | sede |
CREATE TABLE table_204_415 (
id number,
"season" text,
"tier" number,
"division" text,
"place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total number of seasons listed on the chat ?
| SELECT COUNT("season") FROM table_204_415 | squall |
CREATE TABLE table_name_26 (
name VARCHAR,
date_of_birth VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the person born in 1909?
| SELECT name FROM table_name_26 WHERE date_of_birth = "1909" | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT demographic.diagnosis, lab."CATEGORY" FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "24425" | mimicsql_data |
CREATE TABLE table_18442691_2 (
album VARCHAR,
artist VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When abba is the artist what is the album?
| SELECT album FROM table_18442691_2 WHERE artist = "ABBA" | sql_create_context |
CREATE TABLE Catalog_Contents_Additional_Attributes (
catalog_entry_id INTEGER,
catalog_level_number INTEGER,
attribute_id INTEGER,
attribute_value VARCHAR(255)
)
CREATE TABLE Attribute_Definitions (
attribute_id INTEGER,
attribute_name VARCHAR(30),
attribute_data_type VARCHAR(10)
)
CREATE... | SELECT catalog_entry_name, capacity FROM Catalog_Contents WHERE price_in_dollars > 700 ORDER BY catalog_entry_name | nvbench |
CREATE TABLE table_70533 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Time" text,
"Att." real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was time of the game against the Royals with a record of 81 73?
| SELECT "Time" FROM table_70533 WHERE "Opponent" = 'royals' AND "Record" = '81–73' | wikisql |
CREATE TABLE table_name_41 (
venue VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the venue of the game that was played on 23 October 1966?
| SELECT venue FROM table_name_41 WHERE date = "23 october 1966" | sql_create_context |
CREATE TABLE table_5707 (
"CERCLIS ID" text,
"Name" text,
"County" text,
"Proposed" text,
"Listed" text,
"Construction completed" text,
"Partially deleted" text,
"Deleted" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which county inclu... | SELECT "County" FROM table_5707 WHERE "Name" = 'himco dump' | wikisql |
CREATE TABLE table_1307842_6 (
gdp__billion_us$_ VARCHAR,
gdp_per_capita__us$_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the gdp of the country with a gdp per capita of $18048?
| SELECT gdp__billion_us$_ FROM table_1307842_6 WHERE gdp_per_capita__us$_ = 18048 | sql_create_context |
CREATE TABLE table_19744915_16 (
result VARCHAR,
couple VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Zoe and Matt's result?
| SELECT result FROM table_19744915_16 WHERE couple = "Zoe and Matt" | sql_create_context |
CREATE TABLE table_73944 (
"Rank" real,
"Couple" text,
"Judges" real,
"Public" real,
"Total" real,
"Vote percentage" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many public is there for the couple that got eliminated?
| SELECT MAX("Public") FROM table_73944 WHERE "Result" = 'Eliminated' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.