instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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 procedures (
... | SELECT demographic.diagnosis, demographic.admittime FROM demographic WHERE demographic.name = "Bessie Giordano" | mimicsql_data |
CREATE TABLE table_35596 (
"Length of game" text,
"Date" text,
"Away team" text,
"Score" text,
"Home team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How long did the game go that was played with the Houston Oilers at home?
| SELECT "Length of game" FROM table_35596 WHERE "Home team" = 'houston oilers' | wikisql |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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),
CO... | SELECT EMAIL, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMAIL DESC | nvbench |
CREATE TABLE track (
Track_ID int,
Name text,
Location text,
Seating real,
Year_Opened real
)
CREATE TABLE race (
Race_ID int,
Name text,
Class text,
Date text,
Track_ID text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Draw a bar ... | SELECT Class, COUNT(*) FROM race GROUP BY Class | nvbench |
CREATE TABLE table_22353 (
"No." real,
"Album" text,
"Artist" text,
"Record label" text,
"Released" text,
"Chart peak" real,
"Number of times certified platinum" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When cannot handle non-empty tim... | SELECT "No." FROM table_22353 WHERE "Released" = 'Cannot handle non-empty timestamp argument! 2007' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.discharge_location = "SNF" | mimicsql_data |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON 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 hz_info.RYBH = '56134698' AND jyjgzbb.JYRQ BETWEEN... | css |
CREATE TABLE table_11236195_2 (
losingteam VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which losing team had a score of 24-12?
| SELECT losingteam FROM table_11236195_2 WHERE score = "24-12" | sql_create_context |
CREATE TABLE table_18951 (
"Ep. No." real,
"Title" text,
"Director" text,
"Written by" text,
"Original Air Date" text,
"Production No." real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the director of the episode 'rain of terror' that was w... | SELECT "Director" FROM table_18951 WHERE "Written by" = 'John Brown' AND "Title" = 'Rain of Terror' | wikisql |
CREATE TABLE table_9759 (
"Coach" text,
"Years" text,
"Seasons" real,
"Record" text,
"Winning %" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many times is the seasons 2 and the coach guy lowman?
| SELECT COUNT("Winning %") FROM table_9759 WHERE "Seasons" = '2' AND "Coach" = 'guy lowman' | wikisql |
CREATE TABLE table_name_14 (
played INTEGER,
lost VARCHAR,
drawn VARCHAR,
percentage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest number of matches played that has more than 0 draws, a percentage of 12.50%, and fewer than 3 losse... | SELECT MIN(played) FROM table_name_14 WHERE drawn > 0 AND percentage = "12.50%" AND lost < 3 | sql_create_context |
CREATE TABLE table_9049 (
"Year" real,
"Winner" text,
"Score" text,
"Runner(s)-up" text,
"Winner's share ($)" real,
"Course" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the highest share for the winners in 1959?
| SELECT MAX("Winner's share ($)") FROM table_9049 WHERE "Year" = '1959' | wikisql |
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 locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(... | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(SALARY) DESC | nvbench |
CREATE TABLE table_37247 (
"Goal" real,
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the result of the friendly match?
| SELECT "Result" FROM table_37247 WHERE "Competition" = 'friendly' | wikisql |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '周兴业' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-02-07' AND '2017-11-24' | css |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT jybgb.BBCJBW FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = ... | css |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '9223333' AND jybgb.BGRQ BETWEEN '2010-12-18' AND '2020-10-25' GROUP BY jybgb.KSBM HAVING COUNT(*) >= 13) AS T | css |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtim... | SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-37411')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.ce... | eicu |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '19618355' AND NOT zyjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ >= '2011-06-30' UNION SELECT mzjybgb.JZLSH FROM mzjybgb WHERE mzjybgb... | css |
CREATE TABLE table_name_72 (
score VARCHAR,
competition VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Competition of friendly, and a Date of 03-jun-62 had what score?
| SELECT score FROM table_name_72 WHERE competition = "friendly" AND date = "03-jun-62" | sql_create_context |
CREATE TABLE hall_of_fame (
player_id text,
yearid number,
votedby text,
ballots text,
needed text,
votes text,
inducted text,
category text,
needed_note text
)
CREATE TABLE player_award (
player_id text,
award_id text,
year number,
league_id text,
tie text,
... | SELECT T1.birth_country FROM hall_of_fame AS T2 JOIN player AS T1 ON T1.player_id = T2.player_id WHERE T2.inducted = "Y" AND T2.yearid >= 1871 | thehistoryofbaseball |
CREATE TABLE table_34124 (
"Name" text,
"Number of sequences Number of sequences: ." text,
"Alignment Alignment: predicts an alignment , ." text,
"Structure Structure: predicts structure , ." text,
"Link" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT "Number of sequences Number of sequences: ." FROM table_34124 WHERE "Name" = 'alifoldz' | wikisql |
CREATE TABLE table_name_59 (
nationality VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What nationality is Larry McMorran?
| SELECT nationality FROM table_name_59 WHERE player = "larry mcmorran" | sql_create_context |
CREATE TABLE table_7185 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Venue with an Attendance that is larger than 6,938?
| SELECT "Venue" FROM table_7185 WHERE "Attendance" > '6,938' | wikisql |
CREATE TABLE table_203_8 (
id number,
"player" text,
"rec." number,
"yards" number,
"avg." number,
"td's" number,
"long" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the difference in touchdowns between raymond philyaw and jerel ... | SELECT ABS((SELECT "td's" FROM table_203_8 WHERE "player" = 'raymond philyaw') - (SELECT "td's" FROM table_203_8 WHERE "player" = 'jerel myers')) | squall |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '40108491' AND NOT mzjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ <= '2011-09-11') | css |
CREATE TABLE table_72589 (
"Position" real,
"Sail number" text,
"Yacht" text,
"State/country" text,
"Yacht type" text,
"LOA (Metres)" text,
"Skipper" text,
"Corrected time d:hh:mm:ss" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What a... | SELECT "Sail number" FROM table_72589 WHERE "Yacht" = 'Yendys' | wikisql |
CREATE TABLE table_6273 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score of the game that had a decision of Parent, home t... | SELECT "Score" FROM table_6273 WHERE "Decision" = 'parent' AND "Home" = 'philadelphia' AND "Visitor" = 'pittsburgh' | wikisql |
CREATE TABLE table_name_86 (
venue VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the venue in 2002?
| SELECT venue FROM table_name_86 WHERE year = "2002" | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-86136... | eicu |
CREATE TABLE table_name_15 (
grid INTEGER,
rider VARCHAR,
laps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- with more than 32 laps and sylvain guintoli as rider, what's the lowest grid ?
| SELECT MIN(grid) FROM table_name_15 WHERE rider = "sylvain guintoli" AND laps > 32 | sql_create_context |
CREATE TABLE table_1603807_2 (
status VARCHAR,
line VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the status of the airport line?
| SELECT status FROM table_1603807_2 WHERE line = "Airport line" | sql_create_context |
CREATE TABLE table_11406866_2 (
record VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the record where result is l 24-10
| SELECT record FROM table_11406866_2 WHERE result = "L 24-10" | sql_create_context |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
econom... | 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, food_service WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAND' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND food_s... | atis |
CREATE TABLE table_80079 (
"Chapter" real,
"Chinese" text,
"Pinyin" text,
"Translation" text,
"Subject" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the subject of shiyan
| SELECT "Subject" FROM table_80079 WHERE "Pinyin" = 'shiyan' | wikisql |
CREATE TABLE table_name_93 (
bats VARCHAR,
surname VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player has a last name of baron?
| SELECT bats FROM table_name_93 WHERE surname = "baron" | sql_create_context |
CREATE TABLE table_9533 (
"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 was Laura Davies the runner-up?
| SELECT "Tournament" FROM table_9533 WHERE "Runner(s)-up" = 'laura davies' | wikisql |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime tim... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 82132 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'albuterol neb soln' ORDER BY prescriptions.s... | mimic_iii |
CREATE TABLE table_name_32 (
platform INTEGER,
destination VARCHAR,
frequency__per_hour_ VARCHAR,
operator VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the highest platform number when the frequency (per hour) is 4, the operator is london o... | SELECT MAX(platform) FROM table_name_32 WHERE frequency__per_hour_ = 4 AND operator = "london overground" AND destination = "west croydon" | sql_create_context |
CREATE TABLE table_name_44 (
character VARCHAR,
result VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which character won before 2006?
| SELECT character FROM table_name_44 WHERE result = "won" AND year < 2006 | sql_create_context |
CREATE TABLE table_54140 (
"Year" real,
"Pick" text,
"Player name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the cornerback from 1997?
| SELECT "Player name" FROM table_54140 WHERE "Position" = 'cornerback' AND "Year" = '1997' | wikisql |
CREATE TABLE table_30962 (
"Episode" text,
"First broadcast" text,
"Andrew and Georgies guest Lee Mack replaced Andrew Flintoff as team captain for one week in series 4, episode 2." text,
"Jamie and Johns guest" text,
"Scores" text
)
-- Using valid SQLite, answer the following questions for the ta... | SELECT "First broadcast" FROM table_30962 WHERE "Jamie and Johns guest" = 'Andy Murray' | wikisql |
CREATE TABLE table_17247 (
"Full Name" text,
"Nickname" text,
"Gender" text,
"Weight at birth" text,
"Meaning" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of meaning where full name is chidinma anulika?
| SELECT COUNT("Meaning") FROM table_17247 WHERE "Full Name" = 'Chidinma Anulika' | wikisql |
CREATE TABLE table_name_98 (
live___studio VARCHAR,
year INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Is it live or studio before 1983?
| SELECT live___studio FROM table_name_98 WHERE year < 1983 | sql_create_context |
CREATE TABLE table_name_45 (
currency VARCHAR,
central_rate VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which currency has a central rate of 3.45280?
| SELECT currency FROM table_name_45 WHERE central_rate = "3.45280" | sql_create_context |
CREATE TABLE Rooms (
beds INTEGER,
bedtype VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many king beds are there?
| SELECT SUM(beds) FROM Rooms WHERE bedtype = 'King' | sql_create_context |
CREATE TABLE table_23242950_1 (
production_code VARCHAR,
us_viewers__millions_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the production code of the episode seen by 7.49 million people in the US?
| SELECT production_code FROM table_23242950_1 WHERE us_viewers__millions_ = "7.49" | sql_create_context |
CREATE TABLE table_50925 (
"Institution" text,
"Location" text,
"Nickname" text,
"Enrollment" real,
"Established" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the enrollment of the university established in or after 2011?
| SELECT "Enrollment" FROM table_50925 WHERE "Established" > '2011' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
... | SELECT SHRGH, SHRXM FROM jybgb WHERE JZLSH = '69185287770' GROUP BY SHRGH HAVING COUNT(*) > 17 | css |
CREATE TABLE table_1140116_5 (
winning_driver VARCHAR,
circuit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won the Modena circuit?
| SELECT winning_driver FROM table_1140116_5 WHERE circuit = "Modena" | sql_create_context |
CREATE TABLE table_name_99 (
record VARCHAR,
loss VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Loss of finley (8-7) had what record?
| SELECT record FROM table_name_99 WHERE loss = "finley (8-7)" | sql_create_context |
CREATE TABLE table_name_84 (
soap_opera VARCHAR,
duration VARCHAR,
actor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the soap opera that has a duration of 13 years, with marina giulia cavalli as the actor?
| SELECT soap_opera FROM table_name_84 WHERE duration = "13 years" AND actor = "marina giulia cavalli" | sql_create_context |
CREATE TABLE table_203_121 (
id number,
"name" text,
"pos." text,
"caps" number,
"goals" number,
"club" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the total number of goals scored by all of the national team players in the 1947/1948... | SELECT SUM("goals") FROM table_203_121 | squall |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jo... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program, program_course, semester WHERE course.course_id = course_offering.course_id AND program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.prog... | advising |
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 Team_Name, All_Games_Percent FROM basketball_match | nvbench |
CREATE TABLE table_name_30 (
result VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- With a score of 2-2, what was the Result?
| SELECT result FROM table_name_30 WHERE score = "2-2" | sql_create_context |
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_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '99940959667' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.SELF_PAY_AMO) DES... | css |
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 prescriptions (
subject_id text,
hadm_id... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND demographic.days_stay = "14" | mimicsql_data |
CREATE TABLE table_19059 (
"Team" text,
"Stadium" text,
"Capacity" real,
"Highest" real,
"Lowest" real,
"Average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the team with stadium being borough briggs
| SELECT "Team" FROM table_19059 WHERE "Stadium" = 'Borough Briggs' | wikisql |
CREATE TABLE table_60124 (
"Name" text,
"Volume" text,
"Engine" text,
"Fuel" text,
"Output" text,
"Torque" text,
"Engine ID code(s)" text,
"0\u2013100km/h,s" real,
"Top speed" text,
"CO 2" text,
"Years" text
)
-- Using valid SQLite, answer the following questions for the ta... | SELECT "Fuel" FROM table_60124 WHERE "Output" = 'ps (kw; hp) @6000 rpm' | wikisql |
CREATE TABLE Faculty (
Rank VARCHAR,
building VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Professors are in building NEB?
| SELECT COUNT(*) FROM Faculty WHERE Rank = "Professor" AND building = "NEB" | sql_create_context |
CREATE TABLE table_55105 (
"Team" text,
"City/Area" text,
"Arena" text,
"Capacity" text,
"Last season" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the capacity for the arena in Chester?
| SELECT "Capacity" FROM table_55105 WHERE "City/Area" = 'chester' | wikisql |
CREATE TABLE table_203_784 (
id number,
"no. in\nseries" number,
"no. in\nseason" number,
"performer" text,
"appearance" text,
"air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many episodes only had one performer ?
| SELECT COUNT(*) FROM table_203_784 | squall |
CREATE TABLE table_name_80 (
driver VARCHAR,
race_1 VARCHAR,
points VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which driver for Bob Holden Motors has fewer than 36 points and placed 7 in race 1?
| SELECT driver FROM table_name_80 WHERE points < 36 AND team = "bob holden motors" AND race_1 = "7" | sql_create_context |
CREATE TABLE table_14070062_3 (
losing_bonus VARCHAR,
won VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the losing bonus count for the club with 9 won games?
| SELECT losing_bonus FROM table_14070062_3 WHERE won = "9" | sql_create_context |
CREATE TABLE table_name_15 (
total VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total when the name is Carl Robinson Category:Articles with hcards?
| SELECT total FROM table_name_15 WHERE name = "carl robinson category:articles with hcards" | sql_create_context |
CREATE TABLE table_29261215_4 (
points INTEGER,
peeter_vähi VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the maximum points received when Peeter V hl gave a 9?
| SELECT MIN(points) FROM table_29261215_4 WHERE peeter_vähi = 9 | sql_create_context |
CREATE TABLE table_29630 (
"#" real,
"No." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Viewers" real,
"Original airdate" text,
"Prod. code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest numbered epis... | SELECT MIN("#") FROM table_29630 | wikisql |
CREATE TABLE Customers (
Customer_ID INTEGER,
Customer_Details VARCHAR(255)
)
CREATE TABLE Claims (
Claim_ID INTEGER,
Policy_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amount_Settled INTEGER
)
CREATE TABLE Payments (
Payment_ID INTEGER,
S... | SELECT Date_Payment_Made, AVG(Amount_Payment) FROM Payments WHERE Payment_Method_Code = 'Visa' ORDER BY AVG(Amount_Payment) | nvbench |
CREATE TABLE loan (
cust_id VARCHAR
)
CREATE TABLE customer (
cust_name VARCHAR,
credit_score VARCHAR,
cust_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the name and credit score of the customers who have some loans.
| SELECT DISTINCT T1.cust_name, T1.credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id | sql_create_context |
CREATE TABLE table_58195 (
"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.
-- Who is the away team that played home team Hawth... | SELECT "Away team" FROM table_58195 WHERE "Home team" = 'hawthorn' | wikisql |
CREATE TABLE table_name_59 (
venue VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what venue was the hosted away team Essendon?
| SELECT venue FROM table_name_59 WHERE away_team = "essendon" | sql_create_context |
CREATE TABLE table_train_10 (
"id" int,
"severe_sepsis" bool,
"consent" bool,
"raising_legs_or_head" bool,
"intention_to_arterial_catheter" bool,
"allergy_to_adhesive" bool,
"intention_to_central_venous_catheter" bool,
"septic_shock" bool,
"age" float,
"NOUSE" float
)
-- Using ... | SELECT * FROM table_train_10 WHERE age >= 18 | criteria2sql |
CREATE TABLE table_11677691_9 (
school VARCHAR,
hometown VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which school is located in the hometown of Centerville, Ohio?
| SELECT school FROM table_11677691_9 WHERE hometown = "Centerville, Ohio" | sql_create_context |
CREATE TABLE table_203_313 (
id number,
"name" text,
"pennant" text,
"builder" text,
"launched" text,
"original name" text,
"fate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which other ship was launched in the same year as the wave vict... | SELECT "name" FROM table_203_313 WHERE "name" <> 'wave victor' AND "launched" = (SELECT "launched" FROM table_203_313 WHERE "name" = 'wave victor') | squall |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id 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 lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Lymphs" | mimicsql_data |
CREATE TABLE table_name_6 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What 1935 has 4 as a 1953?
| SELECT 1935 FROM table_name_6 WHERE 1953 = "4" | sql_create_context |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END... | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(SALARY) DESC | nvbench |
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | SELECT Name, Height FROM people ORDER BY Height DESC | nvbench |
CREATE TABLE table_68179 (
"Year" real,
"Winner" text,
"Jockey" text,
"Trainer" text,
"Owner" text,
"Distance (Miles)" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the trainer when Crowd Pleaser won?
| SELECT "Trainer" FROM table_68179 WHERE "Winner" = 'crowd pleaser' | wikisql |
CREATE TABLE table_name_36 (
part_2 VARCHAR,
class VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the part 2 entry for class 3a?
| SELECT part_2 FROM table_name_36 WHERE class = "3a" | sql_create_context |
CREATE TABLE Order_Items (
order_item_id INTEGER,
order_id INTEGER,
product_id INTEGER
)
CREATE TABLE Products (
product_id INTEGER,
product_type_code VARCHAR(10),
product_name VARCHAR(80),
product_price DECIMAL(19,4)
)
CREATE TABLE Customer_Addresses (
customer_id INTEGER,
address... | SELECT product_type_code, AVG(product_price) FROM Products GROUP BY product_type_code | nvbench |
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, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name | nvbench |
CREATE TABLE table_28768 (
"Season #" real,
"Series #" real,
"Episode title" text,
"Original air date" text,
"Nick prod. #" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date did season 12 premiere?
| SELECT "Original air date" FROM table_28768 WHERE "Season #" = '12' | wikisql |
CREATE TABLE table_27083 (
"Year" real,
"Engine" text,
"Power" text,
"Torque" text,
"Transmission" text,
"0\u2013100km/h (60mph)" text,
"Top speed" text,
"CO2" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- when0 100km/h (60mph) is 5.5 s... | SELECT "Top speed" FROM table_27083 WHERE "0\u2013100km/h (60mph)" = '5.5 seconds (5.2)' | wikisql |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
... | 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_train_236 (
"id" int,
"renal_disease" bool,
"creatinine_clearance_cl" float,
"estimated_glomerular_filtration_rate_egfr" int,
"hba1c" float,
"fbg" int,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- impaired renal... | SELECT * FROM table_train_236 WHERE renal_disease = 1 AND creatinine_clearance_cl > 1.5 | criteria2sql |
CREATE TABLE department (
dept_name VARCHAR,
budget VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which department has the lowest budget?
| SELECT dept_name FROM department ORDER BY budget LIMIT 1 | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "OXYC10" | mimicsql_data |
CREATE TABLE table_name_87 (
name VARCHAR,
lane VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the swimmer in lane 6?
| SELECT name FROM table_name_87 WHERE lane = 6 | sql_create_context |
CREATE TABLE table_13388681_1 (
to_par VARCHAR,
country VARCHAR,
winning_score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of 'to par' in Mexico with a winning score of 67-67-69-70=273?
| SELECT to_par FROM table_13388681_1 WHERE country = "Mexico" AND winning_score = 67 - 67 - 69 - 70 = 273 | sql_create_context |
CREATE TABLE table_45862 (
"Player" text,
"Club" text,
"Games" real,
"Goals" real,
"Assists" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Goals, when Assists is greater than 28, and when Player is Steve Walker?
| SELECT "Goals" FROM table_45862 WHERE "Assists" > '28' AND "Player" = 'steve walker' | wikisql |
CREATE TABLE film_market_estimation (
Estimation_ID int,
Low_Estimate real,
High_Estimate real,
Film_ID int,
Type text,
Market_ID int,
Year int
)
CREATE TABLE market (
Market_ID int,
Country text,
Number_cities int
)
CREATE TABLE film (
Film_ID int,
Title text,
Stud... | SELECT Title, COUNT(Title) FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Type, Title | nvbench |
CREATE TABLE table_27019 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the surface for nathalie tauziat
| SELECT "Surface" FROM table_27019 WHERE "Partner" = 'Nathalie Tauziat' | wikisql |
CREATE TABLE table_29923 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's... | SELECT "Record" FROM table_29923 WHERE "High rebounds" = 'Greg Monroe (8)' | wikisql |
CREATE TABLE table_22784 (
"No." real,
"#" real,
"Title" text,
"Directed by" text,
"Written by" text,
"U.S. air date" text,
"Production code" text,
"U.S. viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When there are 3.... | SELECT "Production code" FROM table_22784 WHERE "U.S. viewers (million)" = '3.39' | wikisql |
CREATE TABLE table_name_76 (
crowd VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How big was the crowd in game that featured the visiting team of north melbourne?
| SELECT crowd FROM table_name_76 WHERE away_team = "north melbourne" | sql_create_context |
CREATE TABLE table_name_16 (
catalog VARCHAR,
region VARCHAR,
label VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Catalog, when the Region is UK, and when Label is Razor Records?
| SELECT catalog FROM table_name_16 WHERE region = "uk" AND label = "razor records" | sql_create_context |
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 jyjgzbb (
BGDH text,
BGRQ tim... | SELECT jybgb.JYLX FROM jybgb WHERE jybgb.BGDH = '35125613493' | css |
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 inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttim... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8888 AND admissions.dischtime IS NULL) AND transfers.careunit = 'tsicu' ORDER BY transfers.intime LIMIT 1 | mimic_iii |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.