instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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 labevents (
r... | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'triiodothyronine (t3)')) | 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 T1.Name, MAX(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name | nvbench |
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 WHERE demographic.marital_status = "SINGLE" AND demographic.admityear < "2180" | mimicsql_data |
CREATE TABLE table_11602313_4 (
release_date VARCHAR,
sspec_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the release date for the model with sspec number sla4h(m0)?
| SELECT release_date FROM table_11602313_4 WHERE sspec_number = "SLA4H(M0)" | sql_create_context |
CREATE TABLE table_name_91 (
category VARCHAR,
award VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which category does drama league award belong to?
| SELECT category FROM table_name_91 WHERE award = "drama league award" | sql_create_context |
CREATE TABLE table_463 (
"Name" text,
"Pennant" text,
"Builder" text,
"Laid Down" text,
"Launched" text,
"Commissioned" text,
"Fate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of fate for pennant of u33?
| SELECT COUNT("Fate") FROM table_463 WHERE "Pennant" = 'U33' | wikisql |
CREATE TABLE table_204_204 (
id number,
"rank" number,
"heat" number,
"country" text,
"cyclists" text,
"result" number,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what country finished after great britain ?
| SELECT "country" FROM table_204_204 WHERE "rank" = (SELECT "rank" FROM table_204_204 WHERE "country" = 'great britain') + 1 | squall |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
... | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27703) AND prescriptions.drug = 'metronidazole (flagyl)' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year... | 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 bdmzjzjlb (
HXPLC number,
HZX... | SELECT wdmzjzjlb.JZZTDM, wdmzjzjlb.JZZTMC FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '47624266393' UNION SELECT bdmzjzjlb.JZZTDM, bdmzjzjlb.JZZTMC FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '47624266393' | css |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int... | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE (COURSE_1.number = 592 OR COURSE_1.number = 281) AND COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.depar... | advising |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
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,
t... | SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN course ON course.course_id = course_offering.course_id INNER JOIN semester... | advising |
CREATE TABLE table_25192 (
"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.
-- Name t... | SELECT "Location Attendance" FROM table_25192 WHERE "Record" = '22-8' | wikisql |
CREATE TABLE table_72971 (
"Segment description" text,
"Date opened" text,
"Line(s)" text,
"Endpoints" text,
"# of new stations" text,
"Length (miles)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the length (miles) when pico to 7th st... | SELECT "Length (miles)" FROM table_72971 WHERE "Endpoints" = 'Pico to 7th St/Metro Center' | wikisql |
CREATE TABLE Apartments (
apt_number VARCHAR,
room_count VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Return the apartment number and the number of rooms for each apartment.
| SELECT apt_number, room_count FROM Apartments | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT demographic.name, demographic.language FROM demographic WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE table_name_6 (
date VARCHAR,
network_brand_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date was Movistar accredited?
| SELECT date FROM table_name_6 WHERE network_brand_name = "movistar" | sql_create_context |
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 SUM(PER_ACC_PAY) FROM t_kc24 WHERE PERSON_ID = '44293279' AND CLINIC_SLT_DATE BETWEEN '2001-05-11' AND '2018-01-25' | css |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE microlab (
microl... | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '006-76924') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medica... | eicu |
CREATE TABLE table_name_45 (
laps INTEGER,
time VARCHAR,
grid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the least Laps for grid larger than 2 with 35:26.734
| SELECT MIN(laps) FROM table_name_45 WHERE time = "35:26.734" AND grid > 2 | sql_create_context |
CREATE TABLE table_48620 (
"Date" text,
"Pos." text,
"Player" text,
"From club" text,
"Transfer fee" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Pos., when From Club is 'Chelsea', and when Date is '30 July 2008'?
| SELECT "Pos." FROM table_48620 WHERE "From club" = 'chelsea' AND "Date" = '30 july 2008' | wikisql |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_l... | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course_offeri... | advising |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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... | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM txmzjzjlb JOIN jybgb JOIN jyjgzbb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE txmzjzjlb.JZZDBM = 'L64.876' AND jyjgzbb.JCZBMC = '... | css |
CREATE TABLE table_1691 (
"Province" text,
"Provincial capital" text,
"Largest city" text,
"Area (km 2 )" real,
"Population (2013)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the numbe of provincial captial where the population is 116290... | SELECT COUNT("Provincial capital") FROM table_1691 WHERE "Population (2013)" = '1162900' | wikisql |
CREATE TABLE table_5372 (
"Date" text,
"Result" text,
"Score" text,
"Brazil scorers" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Brazil scorers have a 2-1 Score?
| SELECT "Brazil scorers" FROM table_5372 WHERE "Score" = '2-1' | wikisql |
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.formulary_drug_cd = "D545NS1000" | 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 WHERE demographic.discharge_location = "HOME" AND demographic.days_stay > "13" | mimicsql_data |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
... | SELECT DATEADD(mm, (YEAR(Posts.CreationDate) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, Tags.TagName, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName IN ... | sede |
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 instructor.name 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 INNER JOIN offering_instructor ON offering_instr... | advising |
CREATE TABLE table_22265716_1 (
director VARCHAR,
original_title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who directed the film with the original title of ?
| SELECT director FROM table_22265716_1 WHERE original_title = "Три летња дана" | sql_create_context |
CREATE TABLE table_33348 (
"Translator Call Letters" text,
"B Mountain Channel" text,
"Laurel Mountain Channel" text,
"PSIP" text,
"Station Call Letters" text,
"Network Affiliation ID" text,
"Original Channel" text,
"Signal Quality" text
)
-- Using valid SQLite, answer the following qu... | SELECT "B Mountain Channel" FROM table_33348 WHERE "Station Call Letters" = 'k41go' | wikisql |
CREATE TABLE table_name_44 (
final VARCHAR,
athlete VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the final round result of Mohammad Reza Samadi?
| SELECT final FROM table_name_44 WHERE athlete = "mohammad reza samadi" | sql_create_context |
CREATE TABLE table_name_43 (
city VARCHAR,
icao VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where has an ICAO of EPWA?
| SELECT city FROM table_name_43 WHERE icao = "epwa" | sql_create_context |
CREATE TABLE table_name_5 (
team VARCHAR,
city VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team is located in brooklyn?
| SELECT team FROM table_name_5 WHERE city = "brooklyn" | sql_create_context |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TAB... | SELECT DISTINCT course.department, course.name, course.number, program_course.category FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND program_course.category IN ('PreMajor', 'MDE') AND program_course.course_id = course.course_id AND semester.semester = 'Spr... | advising |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number... | SELECT Users.Id AS "user_link", MAX(Age) AS Age, MAX(Location) AS Location, MAX(WebsiteUrl) AS Website, MAX(Reputation) AS Rep, COUNT(Answers.Id) AS Answers, SUM(Answers.Score) AS Score, CAST(AVG(CAST(Answers.Score AS FLOAT)) AS FLOAT(6, 1)) AS "avg" FROM Tags JOIN PostTags ON PostTags.TagId = Tags.Id JOIN Posts ON Pos... | sede |
CREATE TABLE table_22406 (
"Episode" text,
"Garfield Episode 1" text,
"U.S. Acres Episode" text,
"Garfield Episode 2" text,
"Original Airdate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the episodes for 'Crime and Nourishment'?
| SELECT "Episode" FROM table_22406 WHERE "Garfield Episode 2" = 'Crime and Nourishment' | wikisql |
CREATE TABLE customer (
cust_ID varchar(3),
cust_name varchar(20),
acc_type char(1),
acc_bal int,
no_of_loans int,
credit_score int,
branch_ID int,
state varchar(20)
)
CREATE TABLE bank (
branch_ID int,
bname varchar(20),
no_of_customers int,
city varchar(10),
state ... | SELECT cust_name, acc_bal FROM customer WHERE cust_name LIKE '%a%' ORDER BY cust_name | nvbench |
CREATE TABLE table_994 (
"Variant id" text,
"5\u2019UTR splice" text,
"Coding" text,
"3\u2019UTR sequence" text,
"GenBank id" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 3utr sequence when the genbank id is hq021437?
| SELECT "3\u2019UTR sequence" FROM table_994 WHERE "GenBank id" = 'HQ021437' | wikisql |
CREATE TABLE table_name_1 (
host_team VARCHAR,
stadium VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the name of the host team at Texas stadium?
| SELECT host_team FROM table_name_1 WHERE stadium = "texas stadium" | sql_create_context |
CREATE TABLE table_28196105_1 (
written_by VARCHAR,
_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who wrote episode number 18?
| SELECT written_by FROM table_28196105_1 WHERE _number = 18 | sql_create_context |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE time_int... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND date_day.day_number = 10 AND date_day.month_number = 8 AND... | atis |
CREATE TABLE table_name_29 (
total_points INTEGER,
bonus_pts VARCHAR,
matches VARCHAR,
rides VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total for 34 matches with 111 rides, but no more than 15 bonus points?
| SELECT AVG(total_points) FROM table_name_29 WHERE matches = 34 AND rides = 111 AND bonus_pts > 15 | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code... | SELECT inputevents_cv.charttime 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 = 31854)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label... | mimic_iii |
CREATE TABLE table_25256368_1 (
february_2010 VARCHAR,
june_2010 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the bed 2010 for 6.5%
| SELECT february_2010 FROM table_25256368_1 WHERE june_2010 = "6.5%" | sql_create_context |
CREATE TABLE table_3736 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Bonus points" text,
"Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which club had 5 bonu... | SELECT "Club" FROM table_3736 WHERE "Bonus points" = '5' | wikisql |
CREATE TABLE CLASS (
CLASS_CODE varchar(5),
CRS_CODE varchar(10),
CLASS_SECTION varchar(2),
CLASS_TIME varchar(20),
CLASS_ROOM varchar(8),
PROF_NUM int
)
CREATE TABLE PROFESSOR (
EMP_NUM int,
DEPT_CODE varchar(10),
PROF_OFFICE varchar(50),
PROF_EXTENSION varchar(4),
PROF_HIG... | SELECT MAX(STU_GPA), MIN(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE | 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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT demographic.dischtime, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "21796" | mimicsql_data |
CREATE TABLE classroom (
building varchar(15),
room_number varchar(7),
capacity numeric(4,0)
)
CREATE TABLE instructor (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
salary numeric(8,2)
)
CREATE TABLE department (
dept_name varchar(20),
building varchar(15),
budget n... | SELECT dept_name, AVG(salary) FROM instructor GROUP BY dept_name ORDER BY AVG(salary) | nvbench |
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 COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_inf... | css |
CREATE TABLE table_28200 (
"Date" text,
"Tournament" text,
"Location" text,
"Purse ( $ )" real,
"Winner" text,
"Score" text,
"1st Prize ( $ )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the winner for jan 24
| SELECT "Winner" FROM table_28200 WHERE "Date" = 'Jan 24' | wikisql |
CREATE TABLE table_47489 (
"Game" real,
"November" real,
"Opponent" text,
"Score" text,
"Decision" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Record for a game smaller than 24, Lundqvist was the decision, November ... | SELECT "Record" FROM table_47489 WHERE "Game" < '24' AND "Decision" = 'lundqvist' AND "November" < '8' AND "Opponent" = 'new york islanders' | wikisql |
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 TIME_TO_STR(CreationDate, '%h') AS hour, COUNT(*) AS comments, AVG(CAST(Score AS FLOAT)) AS "average comment score" FROM Comments GROUP BY TIME_TO_STR(CreationDate, '%h') ORDER BY hour | sede |
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE... | SELECT meter_200, COUNT(meter_200) FROM swimmer GROUP BY meter_200 ORDER BY COUNT(meter_200) DESC | nvbench |
CREATE TABLE cinema (
cinema_id number,
name text,
openning_year number,
capacity number,
location text
)
CREATE TABLE schedule (
cinema_id number,
film_id number,
date text,
show_times_per_day number,
price number
)
CREATE TABLE film (
film_id number,
rank_in_series nu... | SELECT name, location FROM cinema WHERE capacity > (SELECT AVG(capacity) FROM cinema) | spider |
CREATE TABLE gas_station (
Station_ID int,
Open_Year int,
Location text,
Manager_Name text,
Vice_Manager_Name text,
Representative_Name text
)
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
)
CREATE TABLE company (
Company_ID int,
Rank i... | SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters ORDER BY Headquarters | nvbench |
CREATE TABLE table_65773 (
"Voting order" real,
"Country" text,
"Spokespersons" text,
"Commentator" text,
"Broadcaster" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the voting order when bunny carr was the commentator?
| SELECT SUM("Voting order") FROM table_65773 WHERE "Commentator" = 'bunny carr' | wikisql |
CREATE TABLE follows (
f1 number,
f2 number
)
CREATE TABLE tweets (
id number,
uid number,
text text,
createdate time
)
CREATE TABLE user_profiles (
uid number,
name text,
email text,
partitionid number,
followers number
)
-- Using valid SQLite, answer the following quest... | SELECT COUNT(*) FROM follows GROUP BY f1 | spider |
CREATE TABLE table_203_660 (
id number,
"county" text,
"obama%" text,
"obama#" number,
"mccain%" text,
"mccain#" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the total listed for camden county ?
| SELECT "total" FROM table_203_660 WHERE "county" = 'camden' | squall |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
... | SELECT u.Id AS "user_link", u.Location AS "location", u.LastAccessDate AS "last_access", u.WebsiteUrl AS "url", u.Reputation AS "rep", u.AboutMe AS AboutMe FROM Users AS u WHERE LOWER(AboutMe) LIKE '##aboutme:string##' ORDER BY Reputation DESC LIMIT 300 | sede |
CREATE TABLE table_73868 (
"Constituency" text,
"Candidate" text,
"Affiliation" text,
"Result - votes" real,
"Result - %" text,
"Loss/gain" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every affiliation for the Tottenham constituency?
| SELECT "Affiliation" FROM table_73868 WHERE "Constituency" = 'Tottenham' | wikisql |
CREATE TABLE table_name_74 (
elimination VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the elimination number for the time 13:43?
| SELECT elimination FROM table_name_74 WHERE time = "13:43" | sql_create_context |
CREATE TABLE table_47073 (
"Nat." text,
"Name" text,
"Moving from" text,
"Type" text,
"Transfer window" text,
"Ends" real,
"Transfer fee" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Moving From, when Ends is before 2011?
| SELECT "Moving from" FROM table_47073 WHERE "Ends" < '2011' | wikisql |
CREATE TABLE table_27268238_5 (
team VARCHAR,
economy VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the team when the economy is 5.73?
| SELECT team FROM table_27268238_5 WHERE economy = "5.73" | sql_create_context |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE transfers (
row_id number... | 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 = 19175)) AND DATETIME(inputevents_cv.... | mimic_iii |
CREATE TABLE table_30688 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people dir... | SELECT COUNT("Directed by") FROM table_30688 WHERE "Title" = 'A Little Death' | wikisql |
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_season int,
Title text,
Directed_by text,
Original_air_date text,
Production_code text
)
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE schedule... | SELECT Location, COUNT(*) FROM cinema GROUP BY Location ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_28366 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the original air date of 'kiss the girls an... | SELECT "Original air date" FROM table_28366 WHERE "Title" = 'Kiss the Girls and Make Them Die' | wikisql |
CREATE TABLE table_name_89 (
opponent VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which opponent has a Score of 15.4.94?
| SELECT opponent FROM table_name_89 WHERE score = "15.4.94" | 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 procedures.icd9_code = "4105" | mimicsql_data |
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 demographic.ethnicity FROM demographic WHERE demographic.name = "Jerry Deberry" | mimicsql_data |
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 HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(DEPARTMENT_ID) | nvbench |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostFeedback (
Id number,
PostId numb... | SELECT LENGTH(Body) AS body_len, Score FROM Posts WHERE CommunityOwnedDate IS NULL AND ClosedDate IS NULL AND PostTypeId = 2 ORDER BY NEWID() LIMIT 1000 | sede |
CREATE TABLE table_name_71 (
females VARCHAR,
language VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What females speak Romanian?
| SELECT females FROM table_name_71 WHERE language = "romanian" | 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 prescriptions.drug_type FROM prescriptions WHERE prescriptions.drug = "Colchicine" | 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 SUM(cost.cost) FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-17316') AND STRFTIME('%y', cost.chargetime) >= '2105' | eicu |
CREATE TABLE table_test_15 (
"id" int,
"anemia" bool,
"cell_therapy" bool,
"hiv_infection" bool,
"hemoglobin_a1c_hba1c" float,
"body_weight" float,
"renal_disease" bool,
"creatinine_clearance_cl" float,
"active_hepatitis" bool,
"chronic_inflammatory_disease" bool,
"platelet_c... | SELECT * FROM table_test_15 WHERE anemia = 1 OR hemoglobin_a1c_hba1c < 8.5 | criteria2sql |
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 demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Arthrocentesis" | 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 admissions.insurance FROM admissions WHERE admissions.subject_id = 9619 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_13836704_4 (
total_passengers_2008 INTEGER,
change_2008_09 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what being the maximum total passengers 2008 with change 2008/09 being 6.5%
| SELECT MAX(total_passengers_2008) FROM table_13836704_4 WHERE change_2008_09 = "6.5%" | 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 * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE person_info.XM = '陈清心'... | css |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE program_course.catego... | advising |
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.OUT_DIAG_DOC_CD, t_kc21.OUT_DIAG_DOC_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '鲁光亮' GROUP BY t_kc21.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC | 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_Road, ACC_Percent FROM basketball_match ORDER BY All_Road | nvbench |
CREATE TABLE table_935 (
"Number" real,
"Astronaut" text,
"Agency" text,
"Total EVAs" real,
"Total Time Hours:Minutes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How long was the walk numbered at 17?
| SELECT "Total Time Hours:Minutes" FROM table_935 WHERE "Number" = '17' | wikisql |
CREATE TABLE table_name_42 (
pim VARCHAR,
gf VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the P.I.M. for the G.F. of 55?
| SELECT pim FROM table_name_42 WHERE gf = "55" | sql_create_context |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.religion = "JEWISH" AND diagnoses.long_title = "Other postoperative infection" | mimicsql_data |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT ACC_Road, AVG(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY AVG(Team_ID) DESC | nvbench |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicationid number,
pat... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', lab.labresulttime)) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-172277' AND patient.hos... | eicu |
CREATE TABLE table_name_36 (
tv_station VARCHAR,
average_ratings VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the tv station when the average ratings is 19.5%?
| SELECT tv_station FROM table_name_36 WHERE average_ratings = "19.5%" | sql_create_context |
CREATE TABLE table_name_84 (
score_in_final VARCHAR,
opponents_in_final VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score when the Shingo Kunieda Satoshi Saida were the opponents?
| SELECT score_in_final FROM table_name_84 WHERE opponents_in_final = "shingo kunieda satoshi saida" | sql_create_context |
CREATE TABLE table_30299 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided ab... | SELECT "Original air date" FROM table_30299 WHERE "Production code" = '3X6316' | wikisql |
CREATE TABLE table_25429986_1 (
position VARCHAR,
number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what position is number 22?
| SELECT position FROM table_25429986_1 WHERE number = 22 | sql_create_context |
CREATE TABLE table_41204 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest total when the nation is Sweden?
| SELECT MIN("Total") FROM table_41204 WHERE "Nation" = 'sweden' | wikisql |
CREATE TABLE table_48662 (
"Province" text,
"Region" text,
"Capital" text,
"Districts" real,
"UBIGEO" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Chep n's average UBIGEO?
| SELECT AVG("UBIGEO") FROM table_48662 WHERE "Province" = 'chepén' | wikisql |
CREATE TABLE table_80298 (
"Year" text,
"Start" text,
"Qual" text,
"Rank" text,
"Finish" text,
"Laps" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year did he start at 13?
| SELECT "Year" FROM table_80298 WHERE "Start" = '13' | wikisql |
CREATE TABLE table_5813 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where is the location of attenda... | SELECT "Location Attendance" FROM table_5813 WHERE "Date" = 'december 14' | wikisql |
CREATE TABLE table_67149 (
"Ship" text,
"Site" text,
"Guns" real,
"Naval constructor" text,
"Superintendent" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the site when the superintendent was James Sever?
| SELECT "Site" FROM table_67149 WHERE "Superintendent" = 'james sever' | wikisql |
CREATE TABLE table_73034 (
"Township" text,
"County" text,
"Pop. (2010)" real,
"Land ( sqmi )" text,
"Water (sqmi)" text,
"Latitude" text,
"Longitude" text,
"GEO ID" real,
"ANSI code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wh... | SELECT "Land ( sqmi )" FROM table_73034 WHERE "Latitude" = '48.763937' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospita... | SELECT MAX(vitalperiodic.systemicsystolic) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-24054' AND patient.hospitaldischargetime ... | eicu |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE VoteTypes (
Id number,
Name text... | SELECT COUNT(DISTINCT (p.Id)) FROM Posts AS p WHERE p.PostTypeId = 2 AND P.Score < 0 | sede |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.