instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE T... | SELECT DISTINCT aircraft_code FROM aircraft WHERE aircraft_code = 'M80' | atis |
CREATE TABLE table_name_12 (
home_team VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Home team had an Attendance of 2,776?
| SELECT home_team FROM table_name_12 WHERE attendance = "2,776" | sql_create_context |
CREATE TABLE table_75876 (
"Rank" real,
"Main span metres" text,
"Main span feet" text,
"Year opened" real,
"Country" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the main span feet from opening year of 1936 in the United States with a ran... | SELECT "Main span feet" FROM table_75876 WHERE "Year opened" = '1936' AND "Country" = 'united states' AND "Rank" > '47' AND "Main span metres" = '421' | wikisql |
CREATE TABLE table_45347 (
"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.
-- What was Juli's winning margin on Aug 24, 1986?
| SELECT "Margin of victory" FROM table_45347 WHERE "Date" = 'aug 24, 1986' | wikisql |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | SELECT a.Body FROM Posts AS q INNER JOIN Posts AS a ON q.AcceptedAnswerId = a.Id WHERE YEAR(a.CreationDate) = 2019 AND q.PostTypeId = 1 AND a.PostTypeId = 2 | sede |
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 demographic.name, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "2560" | mimicsql_data |
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND diagnoses.short_title = "Mixed acid-base bal dis" | mimicsql_data |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT SUM(t_kc24.MED_AMOUT) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '许忆彤' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2001-04-24' AND '2018-07-26' UNION SELECT SUM(t_kc24.MED_AMOUT) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE fgwyjzb.PE... | css |
CREATE TABLE table_name_59 (
date INTEGER,
notes VARCHAR,
result VARCHAR,
method VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the lowest date for result of win and method of points with notes of opening round
| SELECT MIN(date) FROM table_name_59 WHERE result = "win" AND method = "points" AND notes = "opening round" | sql_create_context |
CREATE TABLE table_test_13 (
"id" int,
"systolic_blood_pressure_sbp" int,
"tachycardia" int,
"diastolic_blood_pressure_dbp" int,
"total_cholesterol" int,
"high_density_lipoprotein_cholesterol_hdl_c" int,
"serum_creatinine" float,
"alcohol_abuse" bool,
"drug_abuse" bool,
"body_mas... | SELECT * FROM table_test_13 WHERE diastolic_blood_pressure_dbp < 90 | criteria2sql |
CREATE TABLE table_4794 (
"Date" text,
"Opponent" text,
"Home / Away" 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.
... | SELECT "Date" FROM table_4794 WHERE "Home / Away" = 'away' AND "Location/Attendance" = 'blue cross arena' | wikisql |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requi... | SELECT DISTINCT advisory_requirement, enforced_requirement, name FROM course WHERE department = 'EECS' AND number = 443 | advising |
CREATE TABLE table_11465 (
"Team" text,
"Chassis" text,
"Engine" text,
"Tyre" text,
"Drivers" text,
"Races" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who drove a race car with a Mercedes IC 108e engine and has an 8-10 record?
| SELECT "Drivers" FROM table_11465 WHERE "Engine" = 'mercedes ic 108e' AND "Races" = '8-10' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE tr... | SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'human chorionic gonadotropin') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25523) AND STRFTIME('%y-%m', labevents.charttime) >= '2102-04' | mimic_iii |
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 person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '韦德润' AND hz_info.YLJGDM = '1777463' AND NOT mzjzjlb.JZZDSM LIKE '%失眠%' | css |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT All_Neutral, Team_ID FROM basketball_match ORDER BY All_Neutral DESC | nvbench |
CREATE TABLE table_name_95 (
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What did st kilda score at home?
| SELECT home_team AS score FROM table_name_95 WHERE home_team = "st kilda" | sql_create_context |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | SELECT p.Id AS "post_link", p.CreationDate, p.Score FROM Posts AS p WHERE p.OwnerUserId = '##User##' AND p.Body LIKE '%aioobe.se%' | sede |
CREATE TABLE table_8241 (
"Team" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Overall" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many silver when bronze is 25 and overall is less than 67?
| SELECT SUM("Silver") FROM table_8241 WHERE "Bronze" = '25' AND "Overall" < '67' | wikisql |
CREATE TABLE table_name_9 (
color_quality VARCHAR,
relay VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the color quality when the relay is ?
| SELECT color_quality FROM table_name_9 WHERE relay = "✓" | sql_create_context |
CREATE TABLE table_19398910_4 (
bout_1 VARCHAR,
bout_5 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which were the bout 1 when the bout 5 was andreev ( rus ) w 5-2?
| SELECT bout_1 FROM table_19398910_4 WHERE bout_5 = "Andreev ( RUS ) W 5-2" | sql_create_context |
CREATE TABLE table_64721 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Catalog has a Date of july 15, 2011?
| SELECT AVG("Catalog") FROM table_64721 WHERE "Date" = 'july 15, 2011' | wikisql |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
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... | 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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTO... | atis |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABL... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnoses_icd.charttime)) FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hypertension nos') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions... | mimic_iii |
CREATE TABLE table_32844 (
"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 home team's score in the match at V... | SELECT "Home team score" FROM table_32844 WHERE "Venue" = 'victoria park' | wikisql |
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | SELECT DISTINCT course.department, course.name, course.number, semester.semester 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... | advising |
CREATE TABLE flight (
velocity INTEGER,
pilot VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the velocity of the pilot named 'Thompson'?
| SELECT AVG(velocity) FROM flight WHERE pilot = 'Thompson' | sql_create_context |
CREATE TABLE table_20836 (
"Locale" text,
"Skip" text,
"W" real,
"L" real,
"PF" real,
"PA" real,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real,
"Shot %" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-... | SELECT MIN("L") FROM table_20836 WHERE "Ends Lost" = '52' | wikisql |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT All_Games, Team_ID FROM basketball_match ORDER BY All_Games DESC | nvbench |
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
account_id INTEGER,
invoice_number INTEGER,
transaction_type VARCHAR(15),
transaction_date DATETIME,
transaction_amount DECIMAL(19,4),
transaction_comment VARCHAR(255),
other_transaction_details VARCHAR(255)
)
CREATE TABLE In... | SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts GROUP BY other_account_details ORDER BY date_account_opened DESC | nvbench |
CREATE TABLE table_59829 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Opponent has a Result of 0-3?
| SELECT "Opponent" FROM table_59829 WHERE "Result" = '0-3' | wikisql |
CREATE TABLE customers_cards (
card_id number,
customer_id number,
card_type_code text,
card_number text,
date_valid_from time,
date_valid_to time,
other_card_details text
)
CREATE TABLE accounts (
account_id number,
customer_id number,
account_name text,
other_account_detai... | SELECT T2.card_type_code, COUNT(*) FROM financial_transactions AS T1 JOIN customers_cards AS T2 ON T1.card_id = T2.card_id GROUP BY T2.card_type_code | spider |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_labitems (
row_id number,
itemid numbe... | SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28447)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt'... | mimic_iii |
CREATE TABLE table_name_70 (
safari VARCHAR,
internet_explorer VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the safari value with a 28.0% internet explorer?
| SELECT safari FROM table_name_70 WHERE internet_explorer = "28.0%" | sql_create_context |
CREATE TABLE table_36576 (
"Season" real,
"Series" text,
"Team" text,
"Races" text,
"Wins" text,
"Poles" text,
"F/Laps" text,
"Podiums" text,
"Points" text,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What race was ... | SELECT "Races" FROM table_36576 WHERE "Series" = 'formula one' AND "Poles" = 'test driver' | wikisql |
CREATE TABLE Patient (
SSN INTEGER,
Name VARCHAR(30),
Address VARCHAR(30),
Phone VARCHAR(30),
InsuranceID INTEGER,
PCP INTEGER
)
CREATE TABLE Affiliated_With (
Physician INTEGER,
Department INTEGER,
PrimaryAffiliation BOOLEAN
)
CREATE TABLE On_Call (
Nurse INTEGER,
BlockFlo... | SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Patient AS T2 ON T1.Patient = T2.SSN GROUP BY Name ORDER BY COUNT(Name) DESC | nvbench |
CREATE TABLE table_18971 (
"High School" text,
"Location" text,
"Founded" real,
"Affiliation" text,
"Enrollment" real,
"Nickname" text,
"Division" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was Skyline High School founded?
| SELECT COUNT("Founded") FROM table_18971 WHERE "High School" = 'Skyline' | wikisql |
CREATE TABLE candidate (
candidate_id number,
people_id number,
poll_source text,
date text,
support_rate number,
consider_rate number,
oppose_rate number,
unsure_rate number
)
CREATE TABLE people (
people_id number,
sex text,
name text,
date_of_birth text,
height nu... | SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t2.support_rate < t2.oppose_rate | spider |
CREATE TABLE college (
cname text,
state text,
enr number
)
CREATE TABLE tryout (
pid number,
cname text,
ppos text,
decision text
)
CREATE TABLE player (
pid number,
pname text,
ycard text,
hs number
)
-- Using valid SQLite, answer the following questions for the tables ... | SELECT pname FROM player WHERE hs BETWEEN 500 AND 1500 | spider |
CREATE TABLE table_7696 (
"Rank" text,
"Runs" text,
"Player" text,
"Average" text,
"Season" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many runs were ranked 4?
| SELECT "Runs" FROM table_7696 WHERE "Rank" = '4' | wikisql |
CREATE TABLE table_name_64 (
d_44 VARCHAR,
d_43 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the D44 when D43 is R 14?
| SELECT d_44 FROM table_name_64 WHERE d_43 = "r 14" | sql_create_context |
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2152" AND procedures.short_title = "Left heart cardiac cath" | mimicsql_data |
CREATE TABLE table_203_98 (
id number,
"title" text,
"year" number,
"director" text,
"budget" text,
"gross (worldwide)" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which morgan creek film grossed the most worldwide ?
| SELECT "title" FROM table_203_98 ORDER BY "gross (worldwide)" DESC LIMIT 1 | squall |
CREATE TABLE table_76313 (
"University" text,
"Location" text,
"Enrollment" real,
"Founded" real,
"Religious affiliation" text,
"Athletics nickname" text,
"School colors" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the religious ... | SELECT "Religious affiliation" FROM table_76313 WHERE "Athletics nickname" = 'lords/ladies' | wikisql |
CREATE TABLE table_name_3 (
qual VARCHAR,
laps INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Qual with less than 68 laps?
| SELECT qual FROM table_name_3 WHERE laps < 68 | sql_create_context |
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 procedures (
... | SELECT demographic.admission_type, demographic.days_stay FROM demographic WHERE demographic.subject_id = "7273" | mimicsql_data |
CREATE TABLE customer_orders (
order_id number,
customer_id number,
order_status text,
order_date time,
order_details text
)
CREATE TABLE order_items (
order_id number,
product_id number,
order_quantity text
)
CREATE TABLE customer_addresses (
customer_id number,
address_id num... | SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id | spider |
CREATE TABLE Video_Games (
GameID INTEGER,
GName VARCHAR(40),
GType VARCHAR(40)
)
CREATE TABLE Plays_Games (
StuID INTEGER,
GameID INTEGER,
Hours_Played INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Ma... | SELECT LName, COUNT(LName) FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.OnScholarship = 'Y' GROUP BY LName ORDER BY COUNT(LName) DESC | nvbench |
CREATE TABLE pilot (
pilot_id number,
name text,
age number
)
CREATE TABLE airport (
airport_id number,
airport_name text,
total_passengers number,
%_change_2007 text,
international_passengers number,
domestic_passengers number,
transit_passengers number,
aircraft_movements ... | SELECT SUM(domestic_passengers) FROM airport WHERE airport_name LIKE "%London%" | spider |
CREATE TABLE table_20446 (
"Information" text,
"Akimel A-al The name is Tohono Oodham for children of the river" text,
"Altade\u00f1a" text,
"Aprende" text,
"Centennial" text,
"Kyrene MS" text,
"del Pueblo" text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT "Centennial" FROM table_20446 WHERE "Akimel A-al The name is Tohono Oodham for children of the river" = '1992' | wikisql |
CREATE TABLE table_20854943_2 (
loa__metres_ VARCHAR,
sail_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the LOA (metres) of boat with sail number M10?
| SELECT loa__metres_ FROM table_20854943_2 WHERE sail_number = "M10" | sql_create_context |
CREATE TABLE Teachers (
first_name VARCHAR,
last_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the first names and last names of teachers in alphabetical order of last name.
| SELECT first_name, last_name FROM Teachers ORDER BY last_name | sql_create_context |
CREATE TABLE table_name_22 (
year INTEGER,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was the game that ended with a score of 24-14?
| SELECT AVG(year) FROM table_name_22 WHERE result = "24-14" | sql_create_context |
CREATE TABLE table_name_12 (
position VARCHAR,
pick__number VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Position has a Pick # smaller than 23, and a Player of garrett sutherland?
| SELECT position FROM table_name_12 WHERE pick__number < 23 AND player = "garrett sutherland" | sql_create_context |
CREATE TABLE table_46191 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the place when the score is 76-69-71-70=286?
| SELECT "Place" FROM table_46191 WHERE "Score" = '76-69-71-70=286' | wikisql |
CREATE TABLE table_27603010_14 (
points VARCHAR,
team__number1 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Team 1 Junior's points?
| SELECT points FROM table_27603010_14 WHERE team__number1 = "Junior" | sql_create_context |
CREATE TABLE table_24225238_1 (
supporting_actress VARCHAR,
film VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the supporting actress in 'For Whom the Bell Tolls'?
| SELECT supporting_actress FROM table_24225238_1 WHERE film = "For Whom the Bell Tolls" | sql_create_context |
CREATE TABLE table_5316 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On May 9 after Game 3, what was the Opponent?
| SELECT "Opponent" FROM table_5316 WHERE "Game" > '3' AND "Date" = 'may 9' | wikisql |
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 t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hypertension' A... | eicu |
CREATE TABLE table_204_71 (
id number,
"rank" number,
"heat" number,
"name" text,
"nationality" text,
"time" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who finished directly before akinremi ?
| SELECT "name" FROM table_204_71 WHERE "rank" = (SELECT "rank" FROM table_204_71 WHERE "name" = 'christy akinremi') - 1 | squall |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "55" AND prescriptions.formulary_drug_cd = "WARF1" | mimicsql_data |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label te... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd GROUP BY diagnoses_icd.icd9_code) AS t1 WHERE t1.c1 <= 5) | mimic_iii |
CREATE TABLE table_10574 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Replaced by" text,
"Date of appointment" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want the outgoing manager for craig brewster
| SELECT "Outgoing manager" FROM table_10574 WHERE "Replaced by" = 'craig brewster' | wikisql |
CREATE TABLE Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER,
Room VARCHAR(5),
Building VARCHAR(13)
)
CREATE TABLE Activity (
actid INTEGER,
... | SELECT Rank, COUNT(Rank) FROM Faculty GROUP BY Rank | nvbench |
CREATE TABLE table_49715 (
"Model number" text,
"Frequency" text,
"L2 cache" text,
"Mult." text,
"Voltage" text,
"Socket" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Model Number, when Voltage is 2.0V, and when Frequency is 350 mhz?
| SELECT "Model number" FROM table_49715 WHERE "Voltage" = '2.0v' AND "Frequency" = '350 mhz' | wikisql |
CREATE TABLE Maintenance_Contracts (
maintenance_contract_id INTEGER,
maintenance_contract_company_id INTEGER,
contract_start_date DATETIME,
contract_end_date DATETIME,
other_contract_details VARCHAR(255)
)
CREATE TABLE Fault_Log (
fault_log_entry_id INTEGER,
asset_id INTEGER,
recorded_... | SELECT T1.part_name, T1.part_id FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id = T2.part_id | nvbench |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
d... | SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 96937) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'sodium') AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-109 mon... | mimic_iii |
CREATE TABLE table_9192 (
"Member" text,
"Party" text,
"Electorate" text,
"State" text,
"Term of office" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What party was the member peter howson part of?
| SELECT "Party" FROM table_9192 WHERE "Member" = 'peter howson' | wikisql |
CREATE TABLE table_9999 (
"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.
-- What Tournament had a Winning score of 6 (73-68-72-69=282)?
| SELECT "Tournament" FROM table_9999 WHERE "Winning score" = '–6 (73-68-72-69=282)' | wikisql |
CREATE TABLE table_77149 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country is Pete Cooper, who made $816, from?
| SELECT "Country" FROM table_77149 WHERE "Money ( $ )" = '816' AND "Player" = 'pete cooper' | wikisql |
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 MED_SER_ORG_NO FROM t_kc21 WHERE PERSON_NM = '柏子萱' GROUP BY MED_SER_ORG_NO ORDER BY COUNT(*) DESC | css |
CREATE TABLE table_66099 (
"Continent" text,
"Location" text,
"City" text,
"Date" text,
"Year" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was the expansion in the city of San Juan?
| SELECT COUNT("Year") FROM table_66099 WHERE "City" = 'san juan' | wikisql |
CREATE TABLE table_2849652_2 (
sport VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many first tournaments are associated with bowling?
| SELECT COUNT(1 AS st_tournament) FROM table_2849652_2 WHERE sport = "Bowling" | sql_create_context |
CREATE TABLE table_35692 (
"Category" text,
"Type" text,
"Attribute" text,
"Bubbles" text,
"Cancelable" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which bubbles has an atribute of onlostpointercapture?
| SELECT "Bubbles" FROM table_35692 WHERE "Attribute" = 'onlostpointercapture' | wikisql |
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "WHITE" AND procedures.short_title = "Dx ultrasound-heart" | mimicsql_data |
CREATE TABLE table_name_51 (
year VARCHAR,
finish VARCHAR,
chassis VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year did Team of Andretti Green Racing have a finish smaller than 8 with a Dallara chassis?
| SELECT year FROM table_name_51 WHERE chassis = "dallara" AND team = "andretti green racing" AND finish < 8 | sql_create_context |
CREATE TABLE player (
Player_ID int,
name text,
Position text,
Club_ID int,
Apps real,
Tries real,
Goals text,
Points real
)
CREATE TABLE club_rank (
Rank real,
Club_ID int,
Gold real,
Silver real,
Bronze real,
Total real
)
CREATE TABLE competition (
Competi... | SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type | nvbench |
CREATE TABLE table_60495 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the to par for t10 and Colin Montgomerie?
| SELECT "To par" FROM table_60495 WHERE "Place" = 't10' AND "Player" = 'colin montgomerie' | wikisql |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | SELECT DISTINCT course_offering.end_time, course_offering.start_time, semester.semester, semester.year FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'RCCORE' AND c... | advising |
CREATE TABLE table_29367 (
"Vertical" real,
"Horizontal" real,
"Aspect ratio" text,
"Pixel aspect ratio" text,
"Scanning" text,
"Frame rate ( Hz )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the aspect ratio for smpte 259m and interlace... | SELECT "Aspect ratio" FROM table_29367 WHERE "Pixel aspect ratio" = 'SMPTE 259M' AND "Scanning" = 'interlaced' | wikisql |
CREATE TABLE torrents (
groupname text,
totalsnatched number,
artist text,
groupyear number,
releasetype text,
groupid number,
id number
)
CREATE TABLE tags (
index number,
id number,
tag text
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT artist FROM torrents GROUP BY artist ORDER BY AVG(totalsnatched) DESC LIMIT 1 | whatcdhiphop |
CREATE TABLE member (
member_id number,
card_number text,
name text,
hometown text,
level number
)
CREATE TABLE branch (
branch_id number,
name text,
open_year text,
address_road text,
city text,
membership_amount text
)
CREATE TABLE membership_register_branch (
member_... | SELECT MIN(membership_amount), MAX(membership_amount) FROM branch WHERE open_year = 2011 OR city = 'London' | spider |
CREATE TABLE table_204_696 (
id number,
"issue" number,
"volume" number,
"title" text,
"main feature story" text,
"first/early appearance story/stories" text,
"release date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which has the larges... | SELECT "title" FROM table_204_696 ORDER BY "volume" DESC LIMIT 1 | squall |
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 t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '7880116' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_CD | css |
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND procedures.long_title = "(Aorto)coronary bypass of three coronary arteries" | mimicsql_data |
CREATE TABLE table_73286 (
"Season" real,
"Episode" real,
"Episode Summary" text,
"Premier date" text,
"External Link" text,
"Coach" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the coach for episode 15?
| SELECT "Coach" FROM table_73286 WHERE "Episode" = '15' | wikisql |
CREATE TABLE table_71518 (
"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.
-- Which of the events only lasted no more than 0:55?
| SELECT "Event" FROM table_71518 WHERE "Time" = '0:55' | wikisql |
CREATE TABLE table_79160 (
"Position" real,
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Difference" text,
"Points 1" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Positi... | SELECT MAX("Position") FROM table_79160 WHERE "Goals For" = '52' AND "Goals Against" > '70' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.hospitaldischargetime IS NULL AND patient.age BETWEEN 30 AND 39 | eicu |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
... | SELECT AllergyType, COUNT(AllergyType) FROM Allergy_Type GROUP BY AllergyType ORDER BY COUNT(AllergyType) | nvbench |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_... | SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 540 OR course.number = 628) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ... | advising |
CREATE TABLE table_name_46 (
league_goals INTEGER,
fa_cup_apps VARCHAR,
total_apps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest league goals that have 0 as the FA Cup Apps, with 1 (3) as totals apps?
| SELECT MIN(league_goals) FROM table_name_46 WHERE fa_cup_apps = "0" AND total_apps = "1 (3)" | sql_create_context |
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2165" AND diagnoses.long_title = "Hepatitis, unspecified" | mimicsql_data |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9cod... | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-77687')) AND medication.routeadmin = 'dialysis' AND DATETIME(me... | eicu |
CREATE TABLE table_name_5 (
trainer VARCHAR,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the trainer of the winner skylighter?
| SELECT trainer FROM table_name_5 WHERE winner = "skylighter" | sql_create_context |
CREATE TABLE table_name_37 (
game VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the game with the golden state warriors?
| SELECT game FROM table_name_37 WHERE team = "golden state warriors" | sql_create_context |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEP... | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
CREATE TABLE table_name_21 (
date VARCHAR,
race VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date did Contac 12 Hours of Sebring take place?
| SELECT date FROM table_name_21 WHERE race = "contac 12 hours of sebring" | sql_create_context |
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 jybgb.BGDH FROM jybgb WHERE jybgb.JZLSH = '13021515758' AND NOT jybgb.KSMC LIKE '%手术%' | css |
CREATE TABLE table_7794 (
"Year" real,
"Track" text,
"50 cc" text,
"125 cc" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the track for 1978?
| SELECT "Track" FROM table_7794 WHERE "Year" = '1978' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.