instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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 jybgb (
BBCJBW text,
BBDM tex... | 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 = '94709761' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2014-02-18') | css |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREA... | SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '008-10139' AND patient.hospitaladmitsource = 'emergency department' AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | eicu |
CREATE TABLE table_name_7 (
rank INTEGER,
industry VARCHAR,
revenue_in_usd VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the rank of the petroleum company who has a revenue of $481.7 billion?
| SELECT MIN(rank) FROM table_name_7 WHERE industry = "petroleum" AND revenue_in_usd = "$481.7 billion" | sql_create_context |
CREATE TABLE table_69846 (
"Team" text,
"Car No." text,
"MNZ SPR" text,
"MNZ FEA" text,
"SPA SPR" text,
"SPA FEA" text,
"MON FEA" text,
"SIL SPR" text,
"SIL FEA" text,
"HUN SPR" text,
"HUN FEA" text,
"LMS SPR" text,
"LMS FEA" text,
"CAT SPR" text,
"CAT FEA" te... | SELECT "SPA FEA" FROM table_69846 WHERE "LMS FEA" = '5' | wikisql |
CREATE TABLE table_name_87 (
zares VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the percentage for Zares on May 21 22?
| SELECT zares FROM table_name_87 WHERE date = "may 21–22" | sql_create_context |
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 Nationality, AVG(ID) FROM swimmer GROUP BY Nationality ORDER BY Nationality | nvbench |
CREATE TABLE table_name_33 (
country VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the country of player curtis strange?
| SELECT country FROM table_name_33 WHERE player = "curtis strange" | sql_create_context |
CREATE TABLE table_46777 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the Record that has the Game smaller than 76?
| SELECT "Record" FROM table_46777 WHERE "Game" < '76' | wikisql |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TA... | 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_7737 (
"Tournament" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the tournament with a 2006 value of... | SELECT "Tournament" FROM table_7737 WHERE "2006" = 'a' AND "2011" = '1r' | wikisql |
CREATE TABLE table_name_66 (
home_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team is based at junction oval?
| SELECT home_team FROM table_name_66 WHERE venue = "junction oval" | sql_create_context |
CREATE TABLE table_name_86 (
week VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Week has a Opponent of tennessee titans?
| SELECT week FROM table_name_86 WHERE opponent = "tennessee titans" | sql_create_context |
CREATE TABLE table_33375 (
"BRNo." real,
"SRNo." text,
"Name" text,
"Builder" text,
"Whenbuilt" text,
"Withdrawn" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the locomotive named fighter command built?
| SELECT "Whenbuilt" FROM table_33375 WHERE "Name" = 'fighter command' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospit... | SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =... | eicu |
CREATE TABLE degrees (
degrees INTEGER,
campus VARCHAR,
year VARCHAR
)
CREATE TABLE campuses (
campus VARCHAR,
id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- report the total number of degrees granted between 1998 and 2002.
| SELECT T1.campus, SUM(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id = T2.campus WHERE T2.year >= 1998 AND T2.year <= 2002 GROUP BY T1.campus | 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 hz_info_zyjzjlb (
JZLSH number,
... | 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 = '45714321' AND NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2014-09-08') | css |
CREATE TABLE table_15893 (
"Player" text,
"Years Played" text,
"Total W-L" text,
"Singles W-L" text,
"Doubles W-L" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the doubles w-l with years played value of 1 (1968)
| SELECT "Doubles W-L" FROM table_15893 WHERE "Years Played" = '1 (1968)' | wikisql |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number... | SELECT Post.Id AS "post_link", Type.Name AS "type", Post.Score AS "score", Post.CreationDate AS "creationdate", COALESCE(Post.Tags, Parent.Tags) AS "tags" FROM Posts AS Post LEFT JOIN PostTypes AS Type ON Type.Id = Post.PostTypeId LEFT JOIN Posts AS Parent ON Parent.Id = Post.ParentId WHERE Post.OwnerDisplayName = '##U... | sede |
CREATE TABLE table_68312 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the rank of the player in lane 6?
| SELECT AVG("Rank") FROM table_68312 WHERE "Lane" = '6' | wikisql |
CREATE TABLE table_name_76 (
attendance INTEGER,
tie_no VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people on average attended when Eastwood Town was the away team, and the tie number was less than 8?
| SELECT AVG(attendance) FROM table_name_76 WHERE tie_no < 8 AND away_team = "eastwood town" | sql_create_context |
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 COUNT(*) FROM (SELECT MED_ORG_DEPT_CD FROM t_kc21 WHERE MED_SER_ORG_NO = '5403493' GROUP BY MED_ORG_DEPT_CD HAVING MAX(IN_HOSP_DAYS) < 18) AS T | css |
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 COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '彭志勇' AND t_kc22.STA_DATE BETWEEN '2004-04-21' AND '2013-03-18' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjz... | css |
CREATE TABLE Statements (
Statement_ID INTEGER,
Statement_Details VARCHAR(255)
)
CREATE TABLE Projects (
Project_ID INTEGER,
Project_Details VARCHAR(255)
)
CREATE TABLE Ref_Budget_Codes (
Budget_Type_Code CHAR(15),
Budget_Type_Description VARCHAR(255)
)
CREATE TABLE Accounts (
Account_ID ... | SELECT Document_Type_Code, COUNT(*) FROM Documents GROUP BY Document_Type_Code ORDER BY COUNT(*) DESC | 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 T2.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Revenue DESC | nvbench |
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 Main_Industry, SUM(Market_Value) FROM company GROUP BY Main_Industry | nvbench |
CREATE TABLE table_name_67 (
partially_deleted VARCHAR,
cerclis_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- when was the site partially deleted when the cerclis id is az7570028582?
| SELECT partially_deleted FROM table_name_67 WHERE cerclis_id = "az7570028582" | sql_create_context |
CREATE TABLE table_204_344 (
id number,
"player" text,
"games played" number,
"field goals" number,
"free throws" number,
"points" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total amount of free throws by ralf woods ?
| SELECT "free throws" FROM table_204_344 WHERE "player" = 'ralf woods' | squall |
CREATE TABLE table_204_590 (
id number,
"year" number,
"division" number,
"league" text,
"regular season" text,
"playoffs" text,
"open cup" text,
"avg. attendance" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- of those years in which ... | SELECT "year" FROM table_204_590 WHERE "playoffs" = 'did not qualify' AND "league" <> 'usl first division' | squall |
CREATE TABLE table_name_40 (
aircraft_flown VARCHAR,
axis_unit VARCHAR,
enemy_aircraft VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the aircraft flown when the axis unit was luftwaffe (**) and the enemy aircraft was ju.88?
| SELECT aircraft_flown FROM table_name_40 WHERE axis_unit = "luftwaffe (**)" AND enemy_aircraft = "ju.88" | 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 Height, Weight FROM people GROUP BY Sex | nvbench |
CREATE TABLE mountain (
id int,
name text,
Height real,
Prominence real,
Range text,
Country text
)
CREATE TABLE camera_lens (
id int,
brand text,
name text,
focal_length_mm real,
max_aperture real
)
CREATE TABLE photos (
id int,
camera_lens_id int,
mountain_id ... | SELECT T1.name, COUNT(*) FROM camera_lens AS T1 JOIN photos AS T2 ON T1.id = T2.camera_lens_id GROUP BY T1.id ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_70915 (
"Year" real,
"Total Region" real,
"Belyando" real,
"Broadsound" real,
"Nebo" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Before the Year 1947, what is the sum of Broadsound that have a Belyando greater than 11,362, and ... | SELECT SUM("Broadsound") FROM table_70915 WHERE "Belyando" > '11,362' AND "Total Region" = '5,016' AND "Year" < '1947' | wikisql |
CREATE TABLE table_204_795 (
id number,
"date" text,
"opponent" text,
"score" text,
"result" text,
"location" text,
"attendance" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- were more points scored against butler or purdue ?
| SELECT "opponent" FROM table_204_795 WHERE "opponent" IN ('butler', 'purdue') ORDER BY "score" + "score" DESC LIMIT 1 | squall |
CREATE TABLE table_73508 (
"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.
-- List t... | SELECT COUNT("Location Attendance") FROM table_73508 WHERE "Record" = '45-22' | wikisql |
CREATE TABLE table_name_93 (
position VARCHAR,
pick VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position has 217 as the pick?
| SELECT position FROM table_name_93 WHERE pick = 217 | sql_create_context |
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 jybgb.SQRGH, jybgb.SQRXM FROM jybgb WHERE jybgb.BGDH = '51684992743' | css |
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "URGENT" AND diagnoses.icd9_code = "725" | mimicsql_data |
CREATE TABLE table_56536 (
"Club" text,
"Wins" text,
"Last win" text,
"Runners-up" text,
"Last final lost" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the final loss of the club last won in 2001 and has a total of 3 wins?
| SELECT "Last final lost" FROM table_56536 WHERE "Wins" = '3' AND "Last win" = '2001' | wikisql |
CREATE TABLE table_46341 (
"Title" text,
"Release date" text,
"Format" text,
"Code" text,
"UK Singles Chart" text,
"US Modern Rock" text,
"Album" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the US modern rock rank of code bad 0003... | SELECT "US Modern Rock" FROM table_46341 WHERE "Code" = 'bad 0003' | wikisql |
CREATE TABLE table_39205 (
"Number" real,
"Company" text,
"Business" text,
"Country" text,
"Price" text,
"Used as or integrated with" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What company is numbered larger than 5 and priced at $389M?
| SELECT "Company" FROM table_39205 WHERE "Number" > '5' AND "Price" = '$389m' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM t... | SELECT COUNT(*) FROM mzjzjlb WHERE ZZYSGH = '34115354' AND JZKSRQ BETWEEN '2005-01-17' AND '2019-09-19' | css |
CREATE TABLE table_19783 (
"English gloss" text,
"Santee-Sisseton" text,
"Yankton-Yanktonai" text,
"Northern Lakota" text,
"Southern Lakota" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the southern lakota for wak ye a
| SELECT "Southern Lakota" FROM table_19783 WHERE "Yankton-Yanktonai" = 'wakȟáŋyeža' | wikisql |
CREATE TABLE elimination (
Name VARCHAR,
Wrestler_ID VARCHAR
)
CREATE TABLE wrestler (
Name VARCHAR,
Wrestler_ID VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the names of wrestlers that have not been eliminated.
| SELECT Name FROM wrestler WHERE NOT Wrestler_ID IN (SELECT Wrestler_ID FROM elimination) | sql_create_context |
CREATE TABLE table_name_8 (
role VARCHAR,
notes VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the name of the role that has co-protagonist in the notes field and the years of 2008-2009?
| SELECT role FROM table_name_8 WHERE notes = "co-protagonist" AND year = "2008-2009" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND prescriptions.formulary_drug_cd = "FOLI1" | mimicsql_data |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE l... | SELECT 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 = '012-29464')) AND treatment.treatmentname = 'transplant surgery co... | eicu |
CREATE TABLE table_23486853_6 (
game INTEGER,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the game number when the opposing team was the Buffalo Sabres?
| SELECT MIN(game) FROM table_23486853_6 WHERE opponent = "Buffalo Sabres" | 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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2182" AND lab.fluid = "Urine" | mimicsql_data |
CREATE TABLE table_name_43 (
state VARCHAR,
name VARCHAR,
title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In which state did Marquis Li rule?
| SELECT state FROM table_name_43 WHERE name = "li" AND title = "marquis" | sql_create_context |
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_of_completion DATETIME
)
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARC... | SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment ORDER BY COUNT(date_of_enrolment) | 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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab."CATEGORY" = "Blood Gas" | mimicsql_data |
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_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE... | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(DEPARTMENT_ID) | nvbench |
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 jybgb.KSBM, jybgb.KSMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '陈... | css |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT T2.Name, MAX(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name | nvbench |
CREATE TABLE table_name_62 (
position VARCHAR,
game_1 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position has colin scott as game 1?
| SELECT position FROM table_name_62 WHERE game_1 = "colin scott" | sql_create_context |
CREATE TABLE table_110 (
"Track #" real,
"Song" text,
"Singers" text,
"Picturization" text,
"Length" text,
"Lyricist" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest track number?
| SELECT MAX("Track #") FROM table_110 | wikisql |
CREATE TABLE table_name_65 (
number_ VARCHAR,
_name VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number & name with an Undergoing overhaul, restoration or repairs date?
| SELECT number_ & _name FROM table_name_65 WHERE date = "undergoing overhaul, restoration or repairs" | sql_create_context |
CREATE TABLE table_10015132_2 (
years_in_toronto VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- During which years was Marcus Banks in Toronto?
| SELECT years_in_toronto FROM table_10015132_2 WHERE player = "Marcus Banks" | sql_create_context |
CREATE TABLE table_name_29 (
average_score INTEGER,
artist VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest score for Black Milk?
| SELECT MAX(average_score) FROM table_name_29 WHERE artist = "black milk" | sql_create_context |
CREATE TABLE table_name_27 (
winning_driver VARCHAR,
constructor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the winning driver that has a construction of brm?
| SELECT winning_driver FROM table_name_27 WHERE constructor = "brm" | sql_create_context |
CREATE TABLE table_name_81 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which 2011 is the lowest one that has a 1948 smaller than 15872624, and a 1966 of 263103, and a 1992 larger than 266308?
| SELECT MIN(2011) FROM table_name_81 WHERE 1948 < 15872624 AND 1966 = 263103 AND 1992 > 266308 | sql_create_context |
CREATE TABLE table_70337 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the 2nd leg for team 1 of hamburg
| SELECT "2nd leg" FROM table_70337 WHERE "Team 1" = 'hamburg' | wikisql |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE state (
state_code text,
... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '... | atis |
CREATE TABLE table_203_637 (
id number,
"player" text,
"for" text,
"against" text,
"result" text,
"date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- name the players for tottenham hotspur .
| SELECT "player" FROM table_203_637 WHERE "for" = 'tottenham hotspur' | squall |
CREATE TABLE table_train_256 (
"id" int,
"mini_mental_state_examination_mmse" int,
"language" string,
"mild_cognitive_impairment" bool,
"moca_score" int,
"dementia" bool,
"body_mass_index_bmi" float,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions... | SELECT * FROM table_train_256 WHERE dementia = 0 OR (mild_cognitive_impairment = 0 OR moca_score <= 25) | criteria2sql |
CREATE TABLE table_203_352 (
id number,
"position" number,
"swara" text,
"short name" text,
"notation" text,
"mnemonic" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what swara is above shatshruti dhaivata ?
| SELECT "swara" FROM table_203_352 WHERE id = (SELECT id FROM table_203_352 WHERE "swara" = 'shatshruti dhaivata') - 1 | squall |
CREATE TABLE table_name_3 (
format VARCHAR,
label VARCHAR,
region VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the format for geffen of the united states
| SELECT format FROM table_name_3 WHERE label = "geffen" AND region = "united states" | 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 t_kc21.MED_ORG_DEPT_CD, t_kc21.OUT_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '4313090' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.OUT_DIAG_DIS_CD | css |
CREATE TABLE table_name_3 (
pick INTEGER,
round VARCHAR,
school_club_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average pick of school/club team kutztown state with a round 4?
| SELECT AVG(pick) FROM table_name_3 WHERE round = 4 AND school_club_team = "kutztown state" | sql_create_context |
CREATE TABLE table_27539272_4 (
points INTEGER,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most points for 1-3-1 record
| SELECT MAX(points) FROM table_27539272_4 WHERE record = "1-3-1" | sql_create_context |
CREATE TABLE table_16034882_4 (
position INTEGER,
loses VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position did the team with 3 losses finish?
| SELECT MIN(position) FROM table_16034882_4 WHERE loses = 3 | sql_create_context |
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 Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
CREATE TABLE Lives_in (
stuid INTEGER,
... | SELECT city_code, COUNT(*) FROM Student GROUP BY city_code | nvbench |
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 text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime ti... | SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 <= 4 | mimic_iii |
CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),
STU_DOB datetime,
STU_HRS int,
STU_CLASS varchar(2),
STU_GPA float(8),
STU_TRANSFER numeric,
DEPT_CODE varchar(18),
STU_PHONE varchar(4),
PROF_NUM int
)
CREATE TABLE PR... | SELECT DEPT_CODE, COUNT(*) FROM STUDENT GROUP BY DEPT_CODE | nvbench |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,... | SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65401) AND microbiologyevents.spec_type_desc = 'abscess' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.charttime, 'start o... | mimic_iii |
CREATE TABLE table_train_43 (
"id" int,
"anemia" bool,
"cystinuria" bool,
"hyperoxaluria" bool,
"acute_gout_attack" bool,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- known hyperoxaluria
| SELECT * FROM table_train_43 WHERE hyperoxaluria = 1 | criteria2sql |
CREATE TABLE table_62402 (
"Player" text,
"Ranking" real,
"Record" text,
"Hardcourt" text,
"Clay" text,
"Grass" text,
"Carpet" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Shahar Pe'er's record?
| SELECT "Record" FROM table_62402 WHERE "Player" = 'shahar pe''er' | wikisql |
CREATE TABLE table_73609 (
"County" text,
"Kerry%" text,
"Kerry#" real,
"Bush%" text,
"Bush#" real,
"Others%" text,
"Others#" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What percentage of the votes in Oneida did Kerry win?
| SELECT "Kerry%" FROM table_73609 WHERE "County" = 'Oneida' | wikisql |
CREATE TABLE table_name_36 (
krypton VARCHAR,
physical_property VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Krypton has a Physical property of critical pressure (atm)?
| SELECT krypton FROM table_name_36 WHERE physical_property = "critical pressure (atm)" | sql_create_context |
CREATE TABLE table_name_92 (
against INTEGER,
opposing_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest Against, when Opposing Team is Queensland?
| SELECT MIN(against) FROM table_name_92 WHERE opposing_team = "queensland" | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "ANGIOEDEMA" | mimicsql_data |
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 demographic.days_stay, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "28588" | mimicsql_data |
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 jybgb (
BBCJBW text,
BBDM tex... | SELECT jybgb.BGJGDM, jybgb.BGJGMC FROM jybgb WHERE jybgb.BGDH = '33869497970' | css |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CIT... | atis |
CREATE TABLE table_name_9 (
region INTEGER,
name VARCHAR,
population VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which region in Saint-Simon-Les-Mines has a population smaller than 458?
| SELECT MAX(region) FROM table_name_9 WHERE name = "saint-simon-les-mines" AND population < 458 | sql_create_context |
CREATE TABLE table_68519 (
"Artist" text,
"Country of origin" text,
"Period active" text,
"Release-year of first charted record" real,
"Genre" text,
"Claimed sales" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the genre for release-year o... | SELECT "Genre" FROM table_68519 WHERE "Release-year of first charted record" = '1988' | wikisql |
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Student (
StuID INTEGE... | SELECT Fname, COUNT(Fname) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' GROUP BY Fname ORDER BY Fname DESC | nvbench |
CREATE TABLE field (
fieldid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid ... | SELECT DISTINCT cite.citedpaperid, COUNT(cite.citedpaperid) FROM cite, keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'semantic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = cite.citedpaperid AND paper.paperid = paperkeyphrase.paperid GROUP BY cite.citedpaperid OR... | scholar |
CREATE TABLE table_name_98 (
goals INTEGER,
rank VARCHAR,
years VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest number of goals for the player from 2008-present named tony beltran, ranked lower than 7?
| SELECT MIN(goals) FROM table_name_98 WHERE years = "2008-present" AND player = "tony beltran" AND rank > 7 | sql_create_context |
CREATE TABLE table_24365 (
"Type of Record" text,
"Attendance" real,
"Date/Year" text,
"Stadium" text,
"Result/Games" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What type of record is the result of the game Montreal 31 @ Calgary 32?
| SELECT "Type of Record" FROM table_24365 WHERE "Result/Games" = 'Montreal 31 @ Calgary 32' | wikisql |
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 COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.ZZYSGH = '34115354' AND wdmzjzjlb.JZKSRQ BETWEEN '2005-01-17' AND '2019-09-19' UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.ZZYSGH = '34115354' AND bdmzjzjlb.JZKSRQ BETWEEN '2005-01-17' AND '2019-09-19' | css |
CREATE TABLE table_32944 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What opponent did they have a bye result against before week 14?
| SELECT "Opponent" FROM table_32944 WHERE "Result" = 'bye' AND "Week" < '14' | wikisql |
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 COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '2009184' AND t_kc21.IN_HOSP_DATE BETWEEN '2010-09-09' AND '2020-09-29' AND t_kc21.INSURED_STS = '未就业' AND t_kc21.MED_AMOUT >= 720.31 | css |
CREATE TABLE table_203_762 (
id number,
"#" number,
"date" text,
"film" text,
"gross" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total number of films released ?
| SELECT COUNT("film") FROM table_203_762 | squall |
CREATE TABLE table_name_81 (
australian VARCHAR,
short_vowels VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Australian sound is equivalent to e / /?
| SELECT australian FROM table_name_81 WHERE short_vowels = "e /ɛ/" | sql_create_context |
CREATE TABLE basketball_match (
team_id number,
school_id number,
team_name text,
acc_regular_season text,
acc_percent text,
acc_home text,
acc_road text,
all_games text,
all_games_percent number,
all_home text,
all_road text,
all_neutral text
)
CREATE TABLE university (... | SELECT COUNT(*) FROM university WHERE NOT school_id IN (SELECT school_id FROM basketball_match) | spider |
CREATE TABLE table_204_301 (
id number,
"nationality" text,
"name" text,
"term as a deputy judge" text,
"reason for termination" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- was rafael erich a deputy judge before or after mihajlo jovanovic ?
| SELECT (SELECT "term as a deputy judge" FROM table_204_301 WHERE "name" = 'rafael erich') < (SELECT "term as a deputy judge" FROM table_204_301 WHERE "name" = 'mihajlo jovanovic') | squall |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE ground_service (
city_code text,
airp... | SELECT DISTINCT flight.flight_id FROM airport AS AIRPORT_0, airport AS AIRPORT_1, flight WHERE (flight.to_airport = AIRPORT_0.airport_code AND AIRPORT_0.airport_code = 'MKE') OR (flight.from_airport = AIRPORT_1.airport_code AND AIRPORT_1.airport_code = 'MKE') | atis |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | SELECT Id AS "user_link", Location, Reputation FROM Users WHERE UPPER(Location) LIKE UPPER('%##location##%') ORDER BY Reputation DESC | sede |
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 qtb.MED_ORG_DEPT_CD, qtb.MED_ORG_DEPT_NM FROM qtb WHERE qtb.MED_CLINIC_ID = '91661477964' UNION SELECT gyb.MED_ORG_DEPT_CD, gyb.MED_ORG_DEPT_NM FROM gyb WHERE gyb.MED_CLINIC_ID = '91661477964' UNION SELECT zyb.MED_ORG_DEPT_CD, zyb.MED_ORG_DEPT_NM FROM zyb WHERE zyb.MED_CLINIC_ID = '91661477964' UNION SELECT mzb.... | css |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.