instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE claims (
claim_id number,
policy_id number,
date_claim_made time,
date_claim_settled time,
amount_claimed number,
amount_settled number
)
CREATE TABLE payments (
payment_id number,
settlement_id number,
payment_method_code text,
date_payment_made time,
amount_pa... | SELECT payment_method_code FROM payments GROUP BY payment_method_code ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE gyb (
CLINIC_ID 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,
INSU_TYPE text,
IN... | SELECT * FROM qtb WHERE qtb.MED_SER_ORG_NO = '4040000' AND qtb.IN_HOSP_DATE BETWEEN '2000-10-19' AND '2016-12-23' UNION SELECT * FROM gyb WHERE gyb.MED_SER_ORG_NO = '4040000' AND gyb.IN_HOSP_DATE BETWEEN '2000-10-19' AND '2016-12-23' UNION SELECT * FROM zyb WHERE zyb.MED_SER_ORG_NO = '4040000' AND zyb.IN_HOSP_DATE BETW... | css |
CREATE TABLE farm_competition (
competition_id number,
year number,
theme text,
host_city_id number,
hosts text
)
CREATE TABLE farm (
farm_id number,
year number,
total_horses number,
working_horses number,
total_cattle number,
oxen number,
bulls number,
cows number,... | SELECT official_name FROM city WHERE NOT city_id IN (SELECT host_city_id FROM farm_competition) | spider |
CREATE TABLE table_16541 (
"Year" real,
"Title" text,
"Format" text,
"Studio" text,
"Release Date" text,
"Copyright Information" text,
"Catalog Number" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- where title is beginning callanetics , wha... | SELECT COUNT("Format") FROM table_16541 WHERE "Title" = 'Beginning Callanetics' | wikisql |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE dual_c... | SELECT DISTINCT airport_code FROM airport | atis |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | SELECT * FROM jyjgzbb WHERE JCZBMC = (SELECT JCZBMC FROM jyjgzbb WHERE JYZBLSH = '55650809331') AND JCZBJGDW = (SELECT JCZBJGDW FROM jyjgzbb WHERE JYZBLSH = '55650809331') AND JCZBJGDL <> (SELECT JCZBJGDL FROM jyjgzbb WHERE JYZBLSH = '55650809331') | css |
CREATE TABLE table_12148 (
"Seat" real,
"Series 1" text,
"Series 3" text,
"Series 4" text,
"Series 5" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the series 3 with more than 4 seats?
| SELECT "Series 3" FROM table_12148 WHERE "Seat" > '4' | wikisql |
CREATE TABLE customer_addresses (
customer_id number,
address_id number,
date_address_from time,
address_type text,
date_address_to time
)
CREATE TABLE products (
product_id number,
product_details text
)
CREATE TABLE customer_orders (
order_id number,
customer_id number,
order... | SELECT DISTINCT payment_method FROM customers | spider |
CREATE TABLE Guests (
guest_id INTEGER,
gender_code CHAR(1),
guest_first_name VARCHAR(80),
guest_last_name VARCHAR(80),
date_of_birth DATETIME
)
CREATE TABLE View_Unit_Status (
apt_id INTEGER,
apt_booking_id INTEGER,
status_date DATETIME,
available_yn BIT
)
CREATE TABLE Apartment_B... | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings ORDER BY COUNT(booking_start_date) DESC | nvbench |
CREATE TABLE table_14372 (
"January" text,
"February" text,
"March" text,
"April" text,
"June" text,
"July" text,
"August" text,
"September" text,
"October" text,
"November" text,
"December" text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT "January" FROM table_14372 WHERE "September" = 'nikki schieler' | wikisql |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABL... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'oliguria & anuria') AND STRFTIME('%y', diagnoses_icd.chart... | mimic_iii |
CREATE TABLE table_name_48 (
attendance INTEGER,
opponent VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the largest attendance number when the Chicago Cardinals were the opponent and the week was less than 4?
| SELECT MAX(attendance) FROM table_name_48 WHERE opponent = "chicago cardinals" AND week < 4 | sql_create_context |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT All_Games, ACC_Percent FROM basketball_match ORDER BY All_Games | nvbench |
CREATE TABLE table_204_938 (
id number,
"year" number,
"edmonton\nhundred" number,
"elthorne\nhundred" number,
"gore\nhundred" number,
"isleworth\nhundred" number,
"ossulstone\nhundred\nholborn\ndivision" number,
"ossulstone\nhundred\nfinsbury\ndivision" number,
"ossulstone\nhundred\... | SELECT ABS("elthorne\nhundred" - "gore\nhundred") FROM table_204_938 WHERE "year" = 1831 | squall |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
... | SELECT COUNT(*) FROM Posts WHERE PostTypeId = 1 AND NOT ClosedDate IS NULL AND LOWER(Body) LIKE '%stackoverflow.com%' | sede |
CREATE TABLE table_name_3 (
points VARCHAR,
engine VARCHAR,
chassis VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points did the Ford V8 with a Tyrrell 007 have?
| SELECT points FROM table_name_3 WHERE engine = "ford v8" AND chassis = "tyrrell 007" | sql_create_context |
CREATE TABLE Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER,
Room VARCHAR(5),
Building VARCHAR(13)
)
CREATE TABLE Activity (
actid INTEGER,
... | SELECT Rank, COUNT(Rank) FROM Faculty GROUP BY Rank ORDER BY Rank | nvbench |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT MED_ORG_DEPT_NM, IN_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '0655431' GROUP BY MED_ORG_DEPT_NM, IN_DIAG_DIS_NM HAVING AVG(PERSON_AGE) < 3 | css |
CREATE TABLE table_name_32 (
away_team VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Collingwood's away team score?
| SELECT away_team AS score FROM table_name_32 WHERE home_team = "collingwood" | sql_create_context |
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
... | SELECT AllergyType, COUNT(AllergyType) FROM Allergy_Type GROUP BY AllergyType ORDER BY AllergyType DESC | nvbench |
CREATE TABLE table_name_40 (
conference_joined VARCHAR,
mascot VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What conference includes the Indians?
| SELECT conference_joined FROM table_name_40 WHERE mascot = "indians" | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND lab.itemid = "51229" | mimicsql_data |
CREATE TABLE table_name_58 (
college_junior_club_team VARCHAR,
position VARCHAR,
nationality VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the College/Junior/Club Team that has the Position of defence, and the Nationality of czechoslovak... | SELECT college_junior_club_team FROM table_name_58 WHERE position = "defence" AND nationality = "czechoslovakia" | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.short_title = "Hx-rectal & anal malign" | mimicsql_data |
CREATE TABLE table_25800134_11 (
season__number INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest season #?
| SELECT MIN(season__number) FROM table_25800134_11 | 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 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '027-203413' AND patient.unitdischargetime IS NULL | eicu |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BG... | css |
CREATE TABLE table_204_761 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many countries did not win any gold medals ?
| SELECT COUNT("nation") FROM table_204_761 WHERE "gold" = 0 | squall |
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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
... | SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 31260 AND admissions.admission_location = 'emergency room admit' AND STRFTIME('%y', admissions.admittime) = '2105' | mimic_iii |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment tex... | WITH Data(CreationDate) AS (SELECT CreationDate FROM Posts WHERE NOT ClosedDate IS NULL AND (Score >= 250 OR ViewCount >= 150000) LIMIT 100) SELECT SUM(CASE WHEN YEAR(CreationDate) = 2008 THEN 1 ELSE 0 END) AS AskedIn2008, SUM(CASE WHEN YEAR(CreationDate) = 2011 THEN 1 ELSE 0 END) AS AskedIn2011 FROM Data | sede |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "55" AND procedures.long_title = "Enteral infusion of concentrated nutritional substances" | mimicsql_data |
CREATE TABLE table_41331 (
"Season" text,
"Competition" text,
"Round" text,
"Opponent" text,
"Home" text,
"Away" text,
"Series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Round with an Opponent that is torpedo moscow?
| SELECT "Round" FROM table_41331 WHERE "Opponent" = 'torpedo moscow' | wikisql |
CREATE TABLE table_43875 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( \u00a3 )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Place of the Player with a Score of 68-73-66-74=281?
| SELECT "Place" FROM table_43875 WHERE "Score" = '68-73-66-74=281' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE cost (
costid number,
u... | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-15837')) AND intakeoutput.cellpath LIKE '%output%... | eicu |
CREATE TABLE table_25740548_2 (
original_air_date VARCHAR,
directed_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many episodes were directed by Rod Hardy?
| SELECT COUNT(original_air_date) FROM table_25740548_2 WHERE directed_by = "Rod Hardy" | sql_create_context |
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight real
)
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 re... | SELECT Sex, AVG(Height) FROM people GROUP BY Sex | nvbench |
CREATE TABLE table_name_20 (
year_s__won VARCHAR,
total VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The golfer from Spain with a total less than 294 won in what year (s)?
| SELECT year_s__won FROM table_name_20 WHERE total < 294 AND country = "spain" | sql_create_context |
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.Y... | css |
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 FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '61785002' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE ... | css |
CREATE TABLE table_9824 (
"Model number" text,
"sSpec number" text,
"Frequency" text,
"GPU frequency" text,
"L2 cache" text,
"I/O bus" text,
"Memory" text,
"Voltage" text,
"Socket" text,
"Release date" text,
"Part number(s)" text
)
-- Using valid SQLite, answer the followin... | SELECT "GPU frequency" FROM table_9824 WHERE "Frequency" = '1.67 ghz' AND "sSpec number" = 'slbx9(a0)' | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "1" AND prescriptions.formulary_drug_cd = "CLIN300L" | mimicsql_data |
CREATE TABLE fgwyjzb (
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 MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '1943196' AND gwyjzb.IN_DIAG_DIS_NM = '慢性支气管炎' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '1943196' AND fgwyjzb.IN_DIAG... | css |
CREATE TABLE table_name_43 (
score VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of Game 48?
| SELECT score FROM table_name_43 WHERE game = "48" | sql_create_context |
CREATE TABLE Transactions_Lots (
transaction_id INTEGER,
lot_id INTEGER
)
CREATE TABLE Sales (
sales_transaction_id INTEGER,
sales_details VARCHAR(255)
)
CREATE TABLE Purchases (
purchase_transaction_id INTEGER,
purchase_details VARCHAR(255)
)
CREATE TABLE Ref_Transaction_Types (
transact... | SELECT date_of_transaction, AVG(share_count) FROM Transactions ORDER BY date_of_transaction | nvbench |
CREATE TABLE enzyme (
id int,
name text,
Location text,
Product text,
Chromosome text,
OMIM int,
Porphyria text
)
CREATE TABLE medicine (
id int,
name text,
Trade_Name text,
FDA_approved text
)
CREATE TABLE medicine_enzyme_interaction (
enzyme_id int,
medicine_id in... | SELECT Trade_Name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id ORDER BY id DESC | nvbench |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
... | SELECT MIN(vitalperiodic.respiration) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-141930')) AND NOT vitalperiodic.respiration IS... | eicu |
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 T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Code DESC | 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 mzjzjlb WHERE mzjzjlb.JZKSMC = '小儿心血管外科' AND mzjzjlb.JZKSRQ BETWEEN '2002-07-14' AND '2006-12-26' | css |
CREATE TABLE table_name_95 (
location VARCHAR,
name_in_malay VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the location of the institution whose name in Malay is kolej kemahiran belia nasional, pontian?
| SELECT location FROM table_name_95 WHERE name_in_malay = "kolej kemahiran belia nasional, pontian" | sql_create_context |
CREATE TABLE table_name_12 (
crew_chief VARCHAR,
owner_s_ VARCHAR,
driver_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What crew chief has an owner name Jack Roush and driver Greg Biffle?
| SELECT crew_chief FROM table_name_12 WHERE owner_s_ = "jack roush" AND driver_s_ = "greg biffle" | sql_create_context |
CREATE TABLE table_name_40 (
goals_scored INTEGER,
points VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the total of Goals Scored with Points that's smaller than 27, and a Team of C.D. Atl tico Balboa?
| SELECT SUM(goals_scored) FROM table_name_40 WHERE points < 27 AND team = "c.d. atlético balboa" | sql_create_context |
CREATE TABLE table_22871316_6 (
high_points VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who did the high points in the game played on December 2?
| SELECT high_points FROM table_22871316_6 WHERE date = "December 2" | sql_create_context |
CREATE TABLE table_name_6 (
goals_for INTEGER,
played VARCHAR,
drawn VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of goals scored for the Al Wahda team with less than 4 drawn and more than 22 plays?
| SELECT SUM(goals_for) FROM table_name_6 WHERE drawn < 4 AND team = "al wahda" AND played > 22 | sql_create_context |
CREATE TABLE student (
name VARCHAR,
dept_name VARCHAR,
tot_cred VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the name of the students and their department names sorted by their total credits in ascending order.
| SELECT name, dept_name FROM student ORDER BY tot_cred | sql_create_context |
CREATE TABLE table_name_18 (
mission VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the mission when the location is brasilia?
| SELECT mission FROM table_name_18 WHERE location = "brasilia" | sql_create_context |
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | SELECT COUNT(DISTINCT flight.flight_id) FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_... | atis |
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_DIRE_CD text,
MED_DIRE_NM text,... | SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_NM = '陈建元' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '6907') | css |
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 demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.dod_year <= "2138.0" | mimicsql_data |
CREATE TABLE torrents (
groupname text,
totalsnatched number,
artist text,
groupyear number,
releasetype text,
groupid number,
id number
)
CREATE TABLE tags (
index number,
id number,
tag text
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT DISTINCT groupname FROM torrents WHERE totalsnatched > 100 AND releasetype = "album" | whatcdhiphop |
CREATE TABLE table_40940 (
"Pilot" text,
"Original Airdate" text,
"Musical Guest/Song performed" text,
"YouTube Hero" text,
"MySpace Band" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the MySpace Band with an Original Airdate o... | SELECT "MySpace Band" FROM table_40940 WHERE "Original Airdate" = '25 march 2008' | wikisql |
CREATE TABLE table_name_80 (
chassis VARCHAR,
engine VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- A ferrari flat-12 engine with more than 1 point has what kind of chassis?
| SELECT chassis FROM table_name_80 WHERE engine = "ferrari flat-12" AND points > 1 | sql_create_context |
CREATE TABLE table_name_96 (
charting VARCHAR,
blogs VARCHAR,
discussion VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT CHARTING HAS NO BLOGS OR DISCUSSION?
| SELECT charting FROM table_name_96 WHERE blogs = "no" AND discussion = "no" | sql_create_context |
CREATE TABLE weather (
date TEXT,
max_temperature_f INTEGER,
mean_temperature_f INTEGER,
min_temperature_f INTEGER,
max_dew_point_f INTEGER,
mean_dew_point_f INTEGER,
min_dew_point_f INTEGER,
max_humidity INTEGER,
mean_humidity INTEGER,
min_humidity INTEGER,
max_sea_level_pre... | SELECT city, COUNT(*) FROM station GROUP BY city ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_17001658_7 (
score VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many scores are listed for game 37?
| SELECT COUNT(score) FROM table_17001658_7 WHERE game = 37 | sql_create_context |
CREATE TABLE table_name_60 (
score VARCHAR,
tournament VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Score on October 24, 1982 in Tokyo, Japan?
| SELECT score FROM table_name_60 WHERE tournament = "tokyo, japan" AND date = "october 24, 1982" | sql_create_context |
CREATE TABLE table_11106 (
"Suburb" text,
"Population (in 2008)" real,
"Median age (in 2006)" text,
"Mean household size (in 2006)" text,
"Area (km\u00b2)" real,
"Density (/km\u00b2)" real,
"Date first settled as a suburb" real,
"Gazetted as a Division Name" text
)
-- Using valid SQLit... | SELECT MAX("Area (km\u00b2)") FROM table_11106 WHERE "Mean household size (in 2006)" = '3.1 persons' | wikisql |
CREATE TABLE table_61511 (
"Date" text,
"Opponent" text,
"Site" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Attendance has a Result of l12 21?
| SELECT "Attendance" FROM table_61511 WHERE "Result" = 'l12–21' | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.label = "Acetaminophen" | mimicsql_data |
CREATE TABLE table_49924 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Away Team, when Date is '25 January 1986', and when Tie No is '6'?
| SELECT "Away team" FROM table_49924 WHERE "Date" = '25 january 1986' AND "Tie no" = '6' | wikisql |
CREATE TABLE table_1788 (
"Country" text,
"Population (2011)" real,
"GDP (nominal) (2010, US$ millions)" real,
"Military expenditures (2011, US$ millions)" real,
"Military expenditures (2011, % of GDP)" text,
"Defence expenditures, (2011, per capita)" real,
"Deployable military (2011, thousa... | SELECT "Military expenditures (2011, US$ millions)" FROM table_1788 WHERE "Country" = 'Romania' | wikisql |
CREATE TABLE table_1680 (
"Position" real,
"Team" text,
"Played" real,
"Won" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Average 1" text,
"Points 2" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-... | SELECT MAX("Points 2") FROM table_1680 WHERE "Goal Average 1" = '0.65' | wikisql |
CREATE TABLE table_11017 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the least amount of laps for Luca Badoer?
| SELECT MIN("Laps") FROM table_11017 WHERE "Driver" = 'luca badoer' | wikisql |
CREATE TABLE table_203_808 (
id number,
"rank" number,
"peak name" text,
"elevation" text,
"location" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many feet separate the 7th and 8th ranked highest peaks ?
| SELECT (SELECT "elevation" FROM table_203_808 WHERE "rank" = 7) - (SELECT "elevation" FROM table_203_808 WHERE "rank" = 8) | squall |
CREATE TABLE table_67790 (
"Year" text,
"Start" text,
"Qual" text,
"Rank" text,
"Finish" text,
"Laps" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of laps with rank of 8
| SELECT COUNT("Laps") FROM table_67790 WHERE "Rank" = '8' | wikisql |
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.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '86694077' | css |
CREATE TABLE table_name_77 (
first_elected VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was Barclay Henley first elected?
| SELECT COUNT(first_elected) FROM table_name_77 WHERE incumbent = "barclay henley" | sql_create_context |
CREATE TABLE table_name_1 (
date_of_birth__age_ VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was brian lemay born?
| SELECT date_of_birth__age_ FROM table_name_1 WHERE player = "brian lemay" | sql_create_context |
CREATE TABLE table_71945 (
"Rank" real,
"Name" text,
"Height ft (m)" text,
"Floors" real,
"Year" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When Regions center has a rank less than 11, what is the greatest number o floors?
| SELECT MAX("Floors") FROM table_71945 WHERE "Name" = 'regions center' AND "Rank" < '11' | wikisql |
CREATE TABLE table_38540 (
"Station Code" text,
"Station" text,
"Arrival" text,
"Departure" text,
"Kilometers" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's listed for the Station Code that has the Arrival of 02:20?
| SELECT "Station Code" FROM table_38540 WHERE "Arrival" = '02:20' | wikisql |
CREATE TABLE table_21636599_2 (
security_forces VARCHAR,
civilians VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the security forces when the civilians are 202?
| SELECT security_forces FROM table_21636599_2 WHERE civilians = "202" | sql_create_context |
CREATE TABLE table_name_8 (
date VARCHAR,
margin_of_victory VARCHAR,
to_par VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- A tournament on which date has a margin of victory of 2 strokes and a par of 16?
| SELECT date FROM table_name_8 WHERE margin_of_victory = "2 strokes" AND to_par = "−16" | sql_create_context |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT CLINIC_ID FROM t_kc21 WHERE MED_CLINIC_ID = '34573036541' | css |
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREATE TABLE Dorm_amenity (
amenid ... | SELECT gender, COUNT(*) FROM Dorm GROUP BY gender ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_name_31 (
opponent_in_final VARCHAR,
surface VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Opponent in Final, when Surface is 'Hard', and when Date is '13 January 1992'?
| SELECT opponent_in_final FROM table_name_31 WHERE surface = "hard" AND date = "13 january 1992" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepi... | SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'sedative agent' A... | eicu |
CREATE TABLE table_52600 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Trofeo Fast Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Trofeo Fast Team has a Winner of alessandro paganessi?
| SELECT "Trofeo Fast Team" FROM table_52600 WHERE "Winner" = 'alessandro paganessi' | wikisql |
CREATE TABLE table_21007615_1 (
record VARCHAR,
sun_devils_points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record for the Sun Devils when they scored 44 points?
| SELECT record FROM table_21007615_1 WHERE sun_devils_points = 44 | sql_create_context |
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 MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.MED_SER_ORG_NO = '4152205' AND qtb.IN_DIAG_DIS_NM = '精神分裂症' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.MED_SER_ORG_NO = '4152205' AND gyb.IN_DIAG_DIS_NM = '精神分裂症' UNION SELEC... | css |
CREATE TABLE table_23487 (
"Season" real,
"Network" text,
"Host" text,
"Contestants" real,
"Winner" text,
"Destination" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the latest season with 20 contestants?
| SELECT MAX("Season") FROM table_23487 WHERE "Contestants" = '20' | wikisql |
CREATE TABLE driver (
Driver_ID int,
Name text,
Party text,
Home_city text,
Age int
)
CREATE TABLE school (
School_ID int,
Grade text,
School text,
Location text,
Type text
)
CREATE TABLE school_bus (
School_ID int,
Driver_ID int,
Years_Working int,
If_full_time... | SELECT Party, COUNT(*) FROM driver GROUP BY Party | nvbench |
CREATE TABLE Customer_Contact_Channels (
customer_id INTEGER,
channel_code VARCHAR(15),
active_from_date DATETIME,
active_to_date DATETIME,
contact_number VARCHAR(50)
)
CREATE TABLE Addresses (
address_id INTEGER,
address_content VARCHAR(80),
city VARCHAR(50),
zip_postcode VARCHAR(2... | SELECT active_from_date, COUNT(active_from_date) FROM Customers AS t1 JOIN Customer_Contact_Channels AS t2 ON t1.customer_id = t2.customer_id WHERE t2.channel_code = 'Email' GROUP BY customer_name ORDER BY COUNT(active_from_date) DESC | nvbench |
CREATE TABLE table_174491_1 (
winter_olympics VARCHAR,
fis_nordic_world_ski_championships VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what year did the winner of the FIS championship in 1982 win the Winter Olympics?
| SELECT winter_olympics FROM table_174491_1 WHERE fis_nordic_world_ski_championships = "1982" | sql_create_context |
CREATE TABLE table_204_63 (
id number,
"round" number,
"circuit" text,
"date" text,
"pole position" text,
"winning driver" text,
"winning team" text,
"trophy winner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- was it azeta racing or t... | SELECT "winning team" FROM table_204_63 WHERE "circuit" = 'misano world circuit' | squall |
CREATE TABLE table_name_54 (
country VARCHAR,
place VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country has is Len Mattiace in T10 place?
| SELECT country FROM table_name_54 WHERE place = "t10" AND player = "len mattiace" | sql_create_context |
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 Manufacturer, Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter | nvbench |
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 demographic.admityear < "2172" AND procedures.long_title = "Other phototherapy" | mimicsql_data |
CREATE TABLE station (
station_id number,
name text,
annual_entry_exit number,
annual_interchanges number,
total_passengers number,
location text,
main_services text,
number_of_platforms number
)
CREATE TABLE train (
train_id number,
name text,
time text,
service text
)
... | SELECT name, main_services FROM station ORDER BY total_passengers DESC LIMIT 3 | spider |
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 diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime ti... | SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20898) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemid IN (... | mimic_iii |
CREATE TABLE table_23001 (
"Pos" real,
"Member Association" text,
"Points (total 500)" real,
"Clubs" text,
"Group stage" real,
"Play-off" real,
"AFC Cup" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest position?
| SELECT MAX("Pos") FROM table_23001 | wikisql |
CREATE TABLE table_name_75 (
score INTEGER,
place VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS AVERAGE SCORE WITH T3 PLACE, FOR DOUG SANDERS?
| SELECT AVG(score) FROM table_name_75 WHERE place = "t3" AND player = "doug sanders" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.