instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_24023 (
"Ep." real,
"Season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Prod. Code" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who directed the episode that originally aired o... | SELECT "Directed by" FROM table_24023 WHERE "Original air date" = 'March 18, 1988' | wikisql |
CREATE TABLE table_name_89 (
score VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the Score that has the Team of memphis?
| SELECT score FROM table_name_89 WHERE team = "memphis" | sql_create_context |
CREATE TABLE table_79784 (
"Season" text,
"Date" text,
"Driver" text,
"Chassis" text,
"Engine" text,
"Series" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which engine is responsible for the USAC Championship Car?
| SELECT "Engine" FROM table_79784 WHERE "Series" = 'usac championship car' | wikisql |
CREATE TABLE table_name_38 (
pick__number INTEGER,
nfl_team VARCHAR,
college VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What draft pick number attended syracuse and was drafted by the Carolina panthers?
| SELECT SUM(pick__number) FROM table_name_38 WHERE nfl_team = "carolina panthers" AND college = "syracuse" | sql_create_context |
CREATE TABLE table_203_95 (
id number,
"year" text,
"democratic\nparty" number,
"republican\nparty" number,
"independent\n/ other" text,
"majority" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the only years without representatives f... | SELECT "year" FROM table_203_95 WHERE "democratic\nparty" = 0 AND "republican\nparty" = 0 | squall |
CREATE TABLE table_71806 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the outcome of the match opponents in t... | SELECT "Outcome" FROM table_71806 WHERE "Opponents in the final" = 'marius călugăru ciprian petre porumb' | wikisql |
CREATE TABLE injury_accident (
game_id int,
id int,
Player text,
Injury text,
Number_of_matches text,
Source text
)
CREATE TABLE stadium (
id int,
name text,
Home_Games int,
Average_Attendance real,
Total_Attendance real,
Capacity_Percentage real
)
CREATE TABLE game (
... | SELECT Season, COUNT(Season) FROM game GROUP BY Away_team, Season ORDER BY Season DESC | nvbench |
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 demographic (... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.insurance = "Medicaid" | mimicsql_data |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT MAX(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-1517' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitala... | eicu |
CREATE TABLE table_57138 (
"Year" text,
"Security Forces" text,
"Insurgents" text,
"Civilians" text,
"Total:" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the security forces with civilians being 67
| SELECT "Security Forces" FROM table_57138 WHERE "Civilians" = '67' | wikisql |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT PHONE_NUMBER, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SALARY DESC | nvbench |
CREATE TABLE table_name_1 (
record VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Date of October 25, 1964 involves what record?
| SELECT record FROM table_name_1 WHERE date = "october 25, 1964" | sql_create_context |
CREATE TABLE table_name_14 (
date VARCHAR,
venue VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did they play the swindon wildcats away?
| SELECT date FROM table_name_14 WHERE venue = "away" AND opponent = "swindon wildcats" | sql_create_context |
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 text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Private" AND lab.label = "Cholesterol, Total" | mimicsql_data |
CREATE TABLE table_80430 (
"Season" text,
"Team Name" text,
"Games" real,
"Losses" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the total number of games with more than 20 points for the 1976 season?
| SELECT COUNT("Games") FROM table_80430 WHERE "Season" = '1976' AND "Points" > '20' | wikisql |
CREATE TABLE table_182298_5 (
total VARCHAR,
mens_open VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many are the total winners if 7 won the Men's Open?
| SELECT total FROM table_182298_5 WHERE mens_open = 7 | sql_create_context |
CREATE TABLE accounts (
custid number,
name text
)
CREATE TABLE checking (
custid number,
balance number
)
CREATE TABLE savings (
custid number,
balance number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the names of customers who have ... | SELECT T1.name, T3.balance + T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T3.balance < T2.balance | spider |
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 lab (
subject_id text,
hadm_id text,
... | SELECT diagnoses.long_title, procedures.long_title FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "30011" | mimicsql_data |
CREATE TABLE table_54711 (
"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 smallest crowd size for away team s... | SELECT MIN("Crowd") FROM table_54711 WHERE "Away team" = 'st kilda' | wikisql |
CREATE TABLE table_11869952_1 (
institutional_authority VARCHAR,
rocket_launch VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which authority has a rocket launch called rehnuma-8?
| SELECT institutional_authority FROM table_11869952_1 WHERE rocket_launch = "Rehnuma-8" | sql_create_context |
CREATE TABLE table_35376 (
"Previous season" text,
"Team" text,
"Town" text,
"Arena (capacity)" text,
"Website" text,
"Head Coach" text,
"Foreign Players (max. 2)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Head Coach of Novy... | SELECT "Head Coach" FROM table_35376 WHERE "Town" = 'novy urengoy' | wikisql |
CREATE TABLE table_58291 (
"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.
-- Name the location of record 5-3
| SELECT "Location" FROM table_58291 WHERE "Record" = '5-3' | wikisql |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-15417' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi... | eicu |
CREATE TABLE Addresses (
address_id INTEGER,
address_details VARCHAR(255)
)
CREATE TABLE Product_Suppliers (
product_id INTEGER,
supplier_id INTEGER,
date_supplied_from DATETIME,
date_supplied_to DATETIME,
total_amount_purchased VARCHAR(80),
total_value_purchased DECIMAL(19,4)
)
CREATE... | SELECT product_type_code, AVG(product_price) FROM Products GROUP BY product_type_code ORDER BY AVG(product_price) DESC | nvbench |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | SELECT MIN(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11064 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)) AND outpu... | mimic_iii |
CREATE TABLE table_name_40 (
surface VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the surface of the score, 7 6 (7 3) , 6 3?
| SELECT surface FROM table_name_40 WHERE score = "7–6 (7–3) , 6–3" | sql_create_context |
CREATE TABLE table_name_79 (
position VARCHAR,
cross_code_debut VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position has a Cross-code debut of 1st ru test v ireland?
| SELECT position FROM table_name_79 WHERE cross_code_debut = "1st ru test v ireland" | sql_create_context |
CREATE TABLE table_69374 (
"Place" real,
"Team" text,
"Played" real,
"Draw" real,
"Lost" real,
"Goals Scored" real,
"Goals Conceded" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of the place that has less... | SELECT SUM("Place") FROM table_69374 WHERE "Lost" < '2' | wikisql |
CREATE TABLE table_name_9 (
to_par INTEGER,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest par for Bobby Cruickshank?
| SELECT MIN(to_par) FROM table_name_9 WHERE player = "bobby cruickshank" | sql_create_context |
CREATE TABLE table_10222 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" text,
"Record" text,
"Streak" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record that has the Rose Gard... | SELECT "Record" FROM table_10222 WHERE "Attendance" = 'rose garden 20,126' | wikisql |
CREATE TABLE table_43200 (
"s Member state" text,
"GDP 2012 millions of euro" text,
"Population in millions" real,
"GDP (PPP) per capita 2012 euro" text,
"GDP (Nominal) per capita 2012 euro" text,
"GDP (PPP) per capita 2012 EU27 = 100" text
)
-- Using valid SQLite, answer the following questio... | SELECT "GDP (PPP) per capita 2012 euro" FROM table_43200 WHERE "Population in millions" > '10.8' AND "GDP (Nominal) per capita 2012 euro" = '25,600' | wikisql |
CREATE TABLE table_204_200 (
id number,
"iso/iec standard" text,
"title" text,
"status" text,
"description" text,
"wg" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many iso/iec were published in 2011 ?
| SELECT COUNT("iso/iec standard") FROM table_204_200 WHERE "status" = 2011 | squall |
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.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T1.Code DESC | nvbench |
CREATE TABLE table_11727969_1 (
species_in_the_peruvian_amazon INTEGER,
taxonomy VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the minimum species in the peruvian amazon with taxonomy s fern ( pteridophyta )
| SELECT MIN(species_in_the_peruvian_amazon) FROM table_11727969_1 WHERE taxonomy = "s Fern ( Pteridophyta )" | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | SELECT demographic.days_stay, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "52012" | mimicsql_data |
CREATE TABLE table_23764 (
"Year ended" real,
"Revenue (\u20acmillion)" real,
"Earnings before interest and taxes (\u20acm)" text,
"Net profit (\u20acm)" text,
"Earnings per share (\u20ac)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the rev... | SELECT MAX("Revenue (\u20acmillion)") FROM table_23764 WHERE "Earnings per share (\u20ac)" = '1.19' | wikisql |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.label = "Ferritin" | mimicsql_data |
CREATE TABLE Customers (
customer_id INTEGER,
payment_method VARCHAR(15),
customer_name VARCHAR(80),
customer_phone VARCHAR(80),
customer_email VARCHAR(80),
customer_address VARCHAR(255),
customer_login VARCHAR(80),
customer_password VARCHAR(10)
)
CREATE TABLE Customer_Orders (
orde... | SELECT premises_type, COUNT(premises_type) FROM Customer_Addresses AS T1 JOIN Premises AS T2 ON T1.premise_id = T2.premise_id GROUP BY address_type_code, premises_type ORDER BY premises_type | nvbench |
CREATE TABLE table_45605 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many rounds did the match last when his record was 6-6?
| SELECT "Round" FROM table_45605 WHERE "Record" = '6-6' | wikisql |
CREATE TABLE table_56045 (
"Rank" text,
"Country (or dependent territory)" text,
"July 1, 2013 projection" real,
"% of pop." real,
"Average relative annual growth (%)" real,
"Average absolute annual growth" real
)
-- Using valid SQLite, answer the following questions for the tables provided ab... | SELECT AVG("% of pop.") FROM table_56045 WHERE "Country (or dependent territory)" = 'tunisia' AND "Average relative annual growth (%)" < '1.03' | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "56212" AND prescriptions.route = "ED" | mimicsql_data |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2138" AND diagnoses.long_title = "Adrenal cortical steroids causing adverse effects in therapeutic use" | mimicsql_data |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.days_stay = "2" | mimicsql_data |
CREATE TABLE table_80268 (
"Episode title" text,
"Villain(s)" text,
"Identity(ies)" text,
"Original airdate" text,
"DVD volume" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the episode that aired october 8, 1988
| SELECT "Episode title" FROM table_80268 WHERE "Original airdate" = 'october 8, 1988' | wikisql |
CREATE TABLE table_name_62 (
notes VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What notes have 2 as the rank?
| SELECT notes FROM table_name_62 WHERE rank = 2 | sql_create_context |
CREATE TABLE greatermanchestercrime (
crimeid text,
crimets time,
location text,
lsoa text,
type text,
outcome text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the top 3 area of crime conducted?
| SELECT location FROM greatermanchestercrime GROUP BY location ORDER BY COUNT(*) DESC LIMIT 3 | greatermanchestercrime |
CREATE TABLE table_19908313_2 (
team VARCHAR,
listed_owner_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many teams does Jeff Wyler own?
| SELECT COUNT(team) FROM table_19908313_2 WHERE listed_owner_s_ = "Jeff Wyler" | sql_create_context |
CREATE TABLE table_8620 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Pick that has a round greater than 6 and an overall greater than 216?... | SELECT MAX("Pick") FROM table_8620 WHERE "Round" > '6' AND "Overall" > '216' | wikisql |
CREATE TABLE table_204_572 (
id number,
"rank" number,
"county" text,
"per capita\nincome" text,
"median\nhousehold\nincome" text,
"median\nfamily\nincome" text,
"population" number,
"number of\nhouseholds" number
)
-- Using valid SQLite, answer the following questions for the tables p... | SELECT "county" FROM table_204_572 WHERE "county" IN ('fallon', 'phillips') ORDER BY "number of\nhouseholds" DESC LIMIT 1 | squall |
CREATE TABLE table_10960 (
"Year" real,
"Result" text,
"Award" text,
"Category" text,
"Film or series" text,
"Character" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what category was character Jacqui Mcqueen nominated before 2011?
| SELECT "Category" FROM table_10960 WHERE "Character" = 'jacqui mcqueen' AND "Year" < '2011' | wikisql |
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "LIDO5T" AND lab.fluid = "Joint Fluid" | mimicsql_data |
CREATE TABLE table_name_50 (
year INTEGER,
actor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the latest Year with Marianne Jean-Baptiste as the Golden Globe Actor?
| SELECT MAX(year) FROM table_name_50 WHERE actor = "marianne jean-baptiste" | sql_create_context |
CREATE TABLE table_67456 (
"State" text,
"Date" text,
"Yes vote" text,
"No vote" text,
"Vote outcome" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many positive votes for Tennessee in 2006?
| SELECT "Yes vote" FROM table_67456 WHERE "Date" = '2006' AND "State" = 'tennessee' | wikisql |
CREATE TABLE table_26151 (
"Copper Age" text,
"Chalcolithic (4500 BC - 3300 BC)" text,
"Early Chalcolithic" text,
"4500 BC - 4000 BC" text,
"Ubaid period in Mesopotamia" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the second intermediate per... | SELECT COUNT("Early Chalcolithic") FROM table_26151 WHERE "Ubaid period in Mesopotamia" = 'Second Intermediate Period of Egypt' | wikisql |
CREATE TABLE table_22533 (
"Ethnic Group" text,
"2001 (%)" text,
"2001 (people)" text,
"2006 (%)" text,
"2006 (people)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the ethnic group that in 2001 had 117,513?
| SELECT "Ethnic Group" FROM table_22533 WHERE "2001 (people)" = '117,513' | wikisql |
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.JYLX FROM jybgb WHERE jybgb.BGDH = '54720580552' | css |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREAT... | SELECT AVG(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-51980')) AND intakeoutput.celllabel = 'urine... | eicu |
CREATE TABLE table_56823 (
"Chemical class" text,
"Group" text,
"Formula" text,
"Prefix" text,
"Suffix" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which group has the RNCS formula?
| SELECT "Group" FROM table_56823 WHERE "Formula" = 'rncs' | 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 Affiliation, SUM(Enrollment) FROM university GROUP BY Affiliation ORDER BY SUM(Enrollment) DESC | nvbench |
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password VARCHAR(10),
personal_name VARCHAR(40),
middle_name VARCHAR(40),
family_name VARCHAR(40)
)
CREATE TABLE Course_Authors_and_Tutors (
author_id IN... | SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail" ORDER BY COUNT(date_of_completion) | nvbench |
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... | SELECT DISTINCT course.department, course.name, course.number, instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.name LIKE '%Political Sociology%' AND NOT instructor.name LIKE '%Men%' AND offering_instructor.instructor_id = instru... | advising |
CREATE TABLE table_204_658 (
id number,
"week" number,
"date" text,
"kickoff" text,
"opponent" text,
"results\nfinal score" text,
"results\nteam record" text,
"game site" text,
"attendance" number
)
-- Using valid SQLite, answer the following questions for the tables provided above... | SELECT "date" FROM table_204_658 ORDER BY "date" LIMIT 1 | squall |
CREATE TABLE table_name_69 (
construction VARCHAR,
name__wade_giles_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which Construction is named heng-hai?
| SELECT construction FROM table_name_69 WHERE name__wade_giles_ = "heng-hai" | sql_create_context |
CREATE TABLE table_15038373_1 (
version VARCHAR,
software VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the version with sbagen software?
| SELECT version FROM table_15038373_1 WHERE software = "SBaGen" | sql_create_context |
CREATE TABLE table_name_88 (
surface VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What surface was the April 24, 2003 match played on?
| SELECT surface FROM table_name_88 WHERE date = "april 24, 2003" | 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 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.religion = "PROTESTANT QUAKER" AND diagnoses.long_title = "Hydronephrosis" | mimicsql_data |
CREATE TABLE table_24837750_1 (
turbine_manufacturer VARCHAR,
date_in_service VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the turbine manufacturer of the wind farm that started service on 2005?
| SELECT turbine_manufacturer FROM table_24837750_1 WHERE date_in_service = "2005" | sql_create_context |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational... | 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 '%Megan Berkobien%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.o... | advising |
CREATE TABLE table_name_50 (
react INTEGER,
lane VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the lowest React that has the Lane of 5?
| SELECT MIN(react) FROM table_name_50 WHERE lane = 5 | sql_create_context |
CREATE TABLE table_name_63 (
date VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Date has a Score of 102 113?
| SELECT date FROM table_name_63 WHERE score = "102–113" | sql_create_context |
CREATE TABLE table_12113888_1 (
built VARCHAR,
number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the built data for number 34?
| SELECT built FROM table_12113888_1 WHERE number = 34 | sql_create_context |
CREATE TABLE table_name_13 (
goals INTEGER,
apps VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number of goals of the player with 234 apps and a rank above 8?
| SELECT AVG(goals) FROM table_name_13 WHERE apps = 234 AND rank < 8 | sql_create_context |
CREATE TABLE table_name_97 (
date VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date did the opponent George Khrikadze play?
| SELECT date FROM table_name_97 WHERE opponent = "george khrikadze" | sql_create_context |
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airline (
airline_co... | SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LOS ANGEL... | atis |
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 gwyjzb.MED_SER_ORG_NO FROM gwyjzb WHERE gwyjzb.PERSON_ID = '31149555' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '阿立哌唑片') UNION SELECT fgwyjzb.MED_SER_ORG_NO FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '31149555' AND fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_... | css |
CREATE TABLE table_name_78 (
school VARCHAR,
location VARCHAR,
previous_conference VARCHAR,
year_joined VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which School has a Previous Conference of none (new school), and a Year Joined larger than 1960, an... | SELECT school FROM table_name_78 WHERE previous_conference = "none (new school)" AND year_joined > 1960 AND location = "versailles" | sql_create_context |
CREATE TABLE table_26029 (
"#" real,
"Airdate" text,
"Episode" text,
"Rating" text,
"Share" real,
"Rating/Share (18\u201349)" text,
"Viewers (millions)" text,
"Rank (Timeslot)" real,
"Rank (Night)" real
)
-- Using valid SQLite, answer the following questions for the tables provided... | SELECT COUNT("Rank (Timeslot)") FROM table_26029 WHERE "Airdate" = 'May 2, 2010' | wikisql |
CREATE TABLE table_name_17 (
competition VARCHAR,
played VARCHAR,
lost VARCHAR,
drew VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What competition did they have 1 lost, 3 draws, and played 9 games?
| SELECT competition FROM table_name_17 WHERE lost = "1" AND drew = "3" AND played = "9" | sql_create_context |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score num... | SELECT q.Id, q.Title, 'https://math.stackexchange.com/questions/' + CAST(q.Id AS TEXT(16)), q.Tags FROM Posts AS q INNER JOIN Users AS u ON u.Id = q.OwnerUserId WHERE u.Reputation < 102 AND q.PostTypeId = 1 AND q.AcceptedAnswerId IS NULL ORDER BY q.LastEditDate DESC | sede |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CR... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3403) AND STRFTIME('%y-%m', labevents.charttime) >= '2105-04' ORDER BY labevents.charttime LIMIT 1) | mimic_iii |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT Headquarter, SUM(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter | nvbench |
CREATE TABLE table_name_71 (
background VARCHAR,
hometown VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Background of the contestant with a Hometown listed as Los Angeles, California?
| SELECT background FROM table_name_71 WHERE hometown = "los angeles, california" | sql_create_context |
CREATE TABLE table_4129 (
"Pick" text,
"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.
-- Which pick has marko makinen as the player?
| SELECT "Pick" FROM table_4129 WHERE "Player" = 'Marko Makinen' | wikisql |
CREATE TABLE table_2199290_2 (
outcome VARCHAR,
score_in_the_final VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the outcome when the final score was 7 6(9), 7 6(1)?
| SELECT outcome FROM table_2199290_2 WHERE score_in_the_final = "7–6(9), 7–6(1)" | sql_create_context |
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '58996582' AND t_kc22.t_kc21_IN_HOSP_DATE BETWEEN '2000-12-06' AND '2013-03-02' | css |
CREATE TABLE table_name_66 (
record VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Record has a Team of philadelphia?
| SELECT record FROM table_name_66 WHERE team = "philadelphia" | sql_create_context |
CREATE TABLE payment (
payment_id number,
customer_id number,
staff_id number,
rental_id number,
amount number,
payment_date time,
last_update time
)
CREATE TABLE rental (
rental_id number,
rental_date time,
inventory_id number,
customer_id number,
return_date time,
... | SELECT T1.title, T2.inventory_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id JOIN rental AS T3 ON T2.inventory_id = T3.inventory_id GROUP BY T2.inventory_id ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_20963074_1 (
original_title VARCHAR,
film_title_used_in_nomination VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the originl title for no stars in the jungle
| SELECT original_title FROM table_20963074_1 WHERE film_title_used_in_nomination = "No Stars in the Jungle" | sql_create_context |
CREATE TABLE table_7236 (
"State or territory" text,
"Hillary Clinton" real,
"Barack Obama" real,
"Uncommitted" real,
"Unassigned" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest number of uncommitted superdelegat... | SELECT MIN("Uncommitted") FROM table_7236 WHERE "Total" > '16' AND "Hillary Clinton" = '2' | wikisql |
CREATE TABLE table_name_78 (
date VARCHAR,
score VARCHAR,
tie_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Date of Tie no 35 with a Score of 3 2?
| SELECT date FROM table_name_78 WHERE score = "3–2" AND tie_no = "35" | sql_create_context |
CREATE TABLE table_65233 (
"Fish" text,
"Guernsey Record" text,
"Year" text,
"Location" text,
"British Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was the Guernsey record of 2-3-12 set?
| SELECT "Year" FROM table_65233 WHERE "Guernsey Record" = '2-3-12' | wikisql |
CREATE TABLE table_name_65 (
quantity_made VARCHAR,
quantity_preserved VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the quantity made number for the quantity preserved 4-6-0 ooooo ten-wheeler?
| SELECT quantity_made FROM table_name_65 WHERE quantity_preserved = "4-6-0 — ooooo — ten-wheeler" | sql_create_context |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T1.Code DESC | nvbench |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT t_kc21.MED_CLINIC_ID, t_kc21.PERSON_ID, t_kc21.PERSON_NM, t_kc21.IDENTITY_CARD, t_kc21.PERSON_SEX, t_kc21.PERSON_AGE FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc24.MED_AMOUT = (SELECT t_kc24.... | css |
CREATE TABLE table_64298 (
"World record" text,
"Snatch" text,
"Sergey Filimonov ( KAZ )" text,
"173kg" text,
"Almaty , Kazakhstan" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the snatch for the person holding the Olympic record, and 173k... | SELECT "Snatch" FROM table_64298 WHERE "World record" = 'olympic record' AND "173kg" = '172kg' | wikisql |
CREATE TABLE table_77772 (
"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 did the home team of essendon score?
| SELECT "Home team score" FROM table_77772 WHERE "Home team" = 'essendon' | wikisql |
CREATE TABLE table_3209 (
"Region" text,
"Median income ( Intl.$ )" real,
"Below 40% of median income" text,
"Below 50% of median income" text,
"Below 60% of median income" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what region does 17.4% of ... | SELECT "Region" FROM table_3209 WHERE "Below 50% of median income" = '17.4%' | wikisql |
CREATE TABLE table_14836185_3 (
scoring_average VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In the year where Angela Stanford had a scoring average of 71.62, how many times did she take second place?
| SELECT COUNT(2 AS nd) FROM table_14836185_3 WHERE scoring_average = "71.62" | sql_create_context |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute bronchiolitis' AND DATETIME(diagno... | eicu |
CREATE TABLE table_name_38 (
school VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The wildcats belong to what school?
| SELECT school FROM table_name_38 WHERE team = "wildcats" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.