instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_70896 (
"Year" text,
"Category" text,
"Genre" text,
"Recording" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the year with the best female pop vocal album and result of won
| SELECT "Year" FROM table_70896 WHERE "Category" = 'best female pop vocal album' AND "Result" = 'won' | wikisql |
CREATE TABLE management (
department_ID int,
head_ID int,
temporary_acting text
)
CREATE TABLE head (
head_ID int,
name text,
born_state text,
age real
)
CREATE TABLE department (
Department_ID int,
Name text,
Creation text,
Ranking int,
Budget_in_Billions real,
Num... | SELECT Name, Budget_in_Billions FROM department ORDER BY Budget_in_Billions | nvbench |
CREATE TABLE ftxmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZD... | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM txmzjzjlb JOIN jybgb JOIN jyjgzbb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE txmzjzjlb.JZZDBM = 'C83.461' AND jyjgzbb.JCZBMC = '... | css |
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
basePrice INTEGER,
decor TEXT
)
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adul... | SELECT decor, COUNT(*) FROM Rooms WHERE basePrice > 120 GROUP BY decor ORDER BY decor DESC | nvbench |
CREATE TABLE people (
people_id number,
name text,
age number,
height number,
hometown text
)
CREATE TABLE gymnast (
gymnast_id number,
floor_exercise_points number,
pommel_horse_points number,
rings_points number,
vault_points number,
parallel_bars_points number,
horizo... | SELECT name FROM people ORDER BY name | spider |
CREATE TABLE table_42958 (
"Member state" text,
"Population millions" real,
"MEPs" real,
"Inhabitants per MEP" real,
"Influence" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of the population in millions that has an influence less ... | SELECT SUM("Population millions") FROM table_42958 WHERE "Influence" < '2.91' AND "MEPs" < '13' AND "Member state" = 'latvia' AND "Inhabitants per MEP" > '286,875' | wikisql |
CREATE TABLE table_38212 (
"Character Name" text,
"Voice Actor (Japanese)" text,
"Voice Actor (English 1997 / Saban)" text,
"Voice Actor (English 1998 / Pioneer)" text,
"Voice Actor (English 2006 / FUNimation)" text
)
-- Using valid SQLite, answer the following questions for the tables provided ab... | SELECT "Character Name" FROM table_38212 WHERE "Voice Actor (Japanese)" = 'naoko watanabe' | wikisql |
CREATE TABLE table_36507 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent in which the bout ended in rou... | SELECT "Opponent" FROM table_36507 WHERE "Round" = '2' | wikisql |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
... | SELECT COUNT(*) AS num, RejectionReasonId, MIN(Name) AS Name, MIN(Description) AS Description, Comment FROM ReviewTaskResults AS t LEFT JOIN ReviewRejectionReasons AS r ON t.RejectionReasonId = r.Id WHERE ReviewTaskResultTypeId = 3 GROUP BY RejectionReasonId, Comment ORDER BY COUNT(*) DESC LIMIT 200 | sede |
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 demographic.dod FROM demographic WHERE demographic.subject_id = "6983" | mimicsql_data |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeou... | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'anemia - acute blood loss anemia' AND DA... | eicu |
CREATE TABLE table_80313 (
"Year" real,
"Total Region" real,
"Biggenden" real,
"Eidsvold" real,
"Gayndah" real,
"Monto" real,
"Mundubbera" real,
"Perry" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which is the year with Mundubbera bei... | SELECT SUM("Year") FROM table_80313 WHERE "Mundubbera" < '2,395' AND "Biggenden" < '1,506' | wikisql |
CREATE TABLE table_66629 (
"Position" real,
"Name" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Lost has Points smaller than 15, and a Name of sc forst, and Drawn smaller than 0?
| SELECT AVG("Lost") FROM table_66629 WHERE "Points" < '15' AND "Name" = 'sc forst' AND "Drawn" < '0' | wikisql |
CREATE TABLE products (
product_id number,
product_details text
)
CREATE TABLE customer_contact_channels (
customer_id number,
channel_code text,
active_from_date time,
active_to_date time,
contact_number text
)
CREATE TABLE addresses (
address_id number,
address_content text,
... | SELECT t2.product_details, t2.product_id FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY SUM(t1.order_quantity) LIMIT 1 | spider |
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 AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDBM = 'W44.704' AND jyjgzbb.JCZBMC = '游离前列腺特异性... | css |
CREATE TABLE table_48558 (
"Tournament" text,
"Surface" text,
"Week" text,
"Winner and score" text,
"Finalist" text,
"Semifinalists" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the surface that was played on during the week of March ... | SELECT "Surface" FROM table_48558 WHERE "Week" = 'march 16' | wikisql |
CREATE TABLE table_43831 (
"Team" text,
"Manager" text,
"Home city" text,
"Stadium" text,
"Capacity" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the home city when the stadium was Gradski Stadion U Poljudu?
| SELECT "Home city" FROM table_43831 WHERE "Stadium" = 'gradski stadion u poljudu' | wikisql |
CREATE TABLE table_10772 (
"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.
-- Who ha... | SELECT "High rebounds" FROM table_10772 WHERE "Date" = 'february 14' | wikisql |
CREATE TABLE flight (
flno number(4,0),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
departure_date date,
arrival_date date,
price number(7,2),
aid number(9,0)
)
CREATE TABLE certificate (
eid number(9,0),
aid number(9,0)
)
CREATE TABLE employee (
ei... | SELECT name, COUNT(*) FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_name_83 (
location_attendance VARCHAR,
high_points VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the location attendance of the game with Kobe Bryant (18) with the highest points on November 18?
| SELECT location_attendance FROM table_name_83 WHERE high_points = "kobe bryant (18)" AND date = "november 18" | sql_create_context |
CREATE TABLE table_name_34 (
platelet_count VARCHAR,
condition VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Platelet count has a Condition of bernard-soulier syndrome?
| SELECT platelet_count FROM table_name_34 WHERE condition = "bernard-soulier syndrome" | sql_create_context |
CREATE TABLE table_name_51 (
recnet VARCHAR,
frequency VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is listed for the RECNet that also has a Frequency of 91.1 FM?
| SELECT recnet FROM table_name_51 WHERE frequency = "91.1 fm" | sql_create_context |
CREATE TABLE table_25457 (
"#" real,
"Date" text,
"Visitor" text,
"Score" text,
"Arena Attendance" text,
"High Points" text,
"High Rebounds" text,
"High Assists" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the ... | SELECT "Visitor" FROM table_25457 WHERE "Date" = 'March 23' | wikisql |
CREATE TABLE table_23399481_3 (
series__number VARCHAR,
us_viewers__in_millions_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What episode had 1.42 million viewers?
| SELECT series__number FROM table_23399481_3 WHERE us_viewers__in_millions_ = "1.42" | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "ASIAN" AND diagnoses.long_title = "Major depressive affective disorder, single episode, unspecified" | mimicsql_data |
CREATE TABLE table_42908 (
"Year" real,
"Champion" text,
"Runner-up" text,
"Third place" text,
"Fourth place" text,
"Jack Tompkins Trophy (MVP)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Fourth place with a Year that is 1978?
| SELECT "Fourth place" FROM table_42908 WHERE "Year" = '1978' | 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 WHERE demographic.gender = "M" AND demographic.discharge_location = "LONG TERM CARE HOSPITAL" | mimicsql_data |
CREATE TABLE table_15270 (
"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 date has a Decision of osgood, and a Score of 3 4?
| SELECT "Date" FROM table_15270 WHERE "Decision" = 'osgood' AND "Score" = '3 – 4' | wikisql |
CREATE TABLE table_name_72 (
capacity__mw_ INTEGER,
state_province VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total capacity (MW) of the windfarm located in the state/province of Gansu?
| SELECT SUM(capacity__mw_) FROM table_name_72 WHERE state_province = "gansu" | sql_create_context |
CREATE TABLE table_29619494_2 (
season INTEGER,
denim_demons VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the most recent season where the Denim Demons placed 3rd?
| SELECT MAX(season) FROM table_29619494_2 WHERE denim_demons = "3rd" | sql_create_context |
CREATE TABLE table_63430 (
"Contestant Name" text,
"Episode #" text,
"Date Premiered (2009)" text,
"Winning Amount" text,
"Eliminated Contestant" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What eliminated contestant has October 10, 2009 as the d... | SELECT "Eliminated Contestant" FROM table_63430 WHERE "Date Premiered (2009)" = 'october 10' | wikisql |
CREATE TABLE table_19283982_4 (
leader VARCHAR,
_percentage_of_popular_vote VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of leaders for % of popular vote being 11.05%
| SELECT COUNT(leader) FROM table_19283982_4 WHERE _percentage_of_popular_vote = "11.05%" | sql_create_context |
CREATE TABLE table_name_22 (
name VARCHAR,
notes VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Name of the dinosaur, whose notes are, 'n ornithischia of uncertain placement'?
| SELECT name FROM table_name_22 WHERE notes = "n ornithischia of uncertain placement" | sql_create_context |
CREATE TABLE table_name_91 (
date_of_appointment VARCHAR,
manner_of_departure VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want the date of appointment for manner of departure being sacked
| SELECT date_of_appointment FROM table_name_91 WHERE manner_of_departure = "sacked" | sql_create_context |
CREATE TABLE table_62081 (
"Companion (in order from star)" text,
"Mass" text,
"Semimajor axis ( AU )" text,
"Orbital period ( s day )" text,
"Eccentricity" text,
"Inclination" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Inclination has ... | SELECT "Inclination" FROM table_62081 WHERE "Mass" = '≥ 6.6 +1.1 −1.0 m⊕' | wikisql |
CREATE TABLE table_204_693 (
id number,
"place" text,
"total" number,
"men" number,
"women" number,
"children" number,
"elderly" number,
"serbs" number,
"jews" number,
"romani" number,
"rusyns" number,
"hungarians" number,
"russians" number
)
-- Using valid SQLite, ... | SELECT "total" FROM table_204_693 WHERE "place" = 'vilovo' | squall |
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_kc22.t_kc21_MED_SER_ORG_NO FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '59714640' AND t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '硫酸氢氯吡格雷片') | css |
CREATE TABLE actor (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many actors are there?
| SELECT COUNT(*) FROM actor | sql_create_context |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | SELECT COUNT(*) FROM jybgb WHERE jybgb.JZLSH = '08934000082' | 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 MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '2171159' AND t_kc21.IN_DIAG_DIS_CD = 'D38.070') | css |
CREATE TABLE table_204_651 (
id number,
"date" text,
"championship" text,
"location" text,
"category" text,
"surface" text,
"prev. result" text,
"prev. points" number,
"new points" number,
"outcome" text
)
-- Using valid SQLite, answer the following questions for the tables pro... | SELECT COUNT(*) FROM table_204_651 WHERE "outcome" = 'withdrew due to left foot injury' | 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 cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id... | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_... | mimic_iii |
CREATE TABLE table_203_800 (
id number,
"#" number,
"president" text,
"president's party" text,
"senate with" number,
"senate opposed" number,
"house with" number,
"house opposed" number,
"years served" number,
"elections won" number
)
-- Using valid SQLite, answer the followin... | SELECT COUNT(*) FROM table_203_800 WHERE "president's party" = 'whig' | squall |
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 (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREAT... | SELECT Sex, COUNT(*) FROM Student WHERE Age > (SELECT AVG(Age) FROM Student) GROUP BY Sex ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_name_97 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the 1861 with 1851 of 5291
| SELECT 1861 FROM table_name_97 WHERE 1851 = "5291" | sql_create_context |
CREATE TABLE table_1373542_1 (
date_completed VARCHAR,
date_announced VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was the asset acquisition that was announced on February 22, 2007 completed?
| SELECT date_completed FROM table_1373542_1 WHERE date_announced = "February 22, 2007" | sql_create_context |
CREATE TABLE table_name_6 (
theme VARCHAR,
days VARCHAR,
series VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the theme for a series of season 3 with smaller than 148 days?
| SELECT theme FROM table_name_6 WHERE days < 148 AND series = "season 3" | 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_Home, Team_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY All_Home | nvbench |
CREATE TABLE table_4573 (
"Commodity" text,
"2001-02" text,
"2002-03" text,
"2003-04" text,
"2004-05" text,
"2005-06" text,
"2006-07" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the production in 2004-05 for the commodity that pr... | SELECT "2004-05" FROM table_4573 WHERE "2001-02" = '1,725' | wikisql |
CREATE TABLE table_16156 (
"Model" real,
"Introduction" text,
"Discontinued" text,
"CPU Speed" text,
"Print resolution (DPI) Resolution is given in dots per inch (DPI)" text,
"Print speed (PPM)" text,
"Standard memory" text,
"Maximum memory" text
)
-- Using valid SQLite, answer the fol... | SELECT "Print resolution (DPI) Resolution is given in dots per inch (DPI)" FROM table_16156 WHERE "Introduction" = 'December 2002' | wikisql |
CREATE TABLE performance (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many performances are there?
| SELECT COUNT(*) FROM performance | 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 SUM(t_kc22.AMOUNT) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '1161667' AND t_kc22.STA_DATE BETWEEN '2003-07-21' AND '2018-07-27' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT SUM(t_kc22.AMOUNT) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc... | css |
CREATE TABLE table_63133 (
"Match" real,
"Date" text,
"Competition or tour" text,
"Ground" text,
"Opponent" text,
"Score1" text,
"Scorers" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score 1 for the major league soccer all-sta... | SELECT "Score1" FROM table_63133 WHERE "Competition or tour" = 'major league soccer all-star game' | wikisql |
CREATE TABLE table_name_54 (
opponent VARCHAR,
result VARCHAR,
type VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who did Tony Oakey win against when he had type of w pts 12?
| SELECT opponent FROM table_name_54 WHERE result = "win" AND type = "w pts 12" | sql_create_context |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE lives_in (
stuid number,
dormid number,
room_number number
)
CREATE TABLE has_amenity (
dormid number,
amenid number
)
CRE... | SELECT T1.fname, T1.lname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge') | spider |
CREATE TABLE table_27383390_2 (
shirt_sponsor VARCHAR,
head_coach VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What sponsor has the head coach Samad Marfavi?
| SELECT shirt_sponsor FROM table_27383390_2 WHERE head_coach = "Samad Marfavi" | sql_create_context |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT All_Road, All_Games_Percent FROM basketball_match | nvbench |
CREATE TABLE table_204_154 (
id number,
"player" text,
"matches" number,
"innings" number,
"runs" number,
"average" number,
"100s" number,
"50s" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- name a player whose average was above 25 .
| SELECT "player" FROM table_204_154 WHERE "average" > 25 | squall |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
... | SELECT jybgb.JYLX FROM jybgb WHERE jybgb.BGDH = '48426577162' | css |
CREATE TABLE table_name_28 (
season VARCHAR,
points VARCHAR,
races VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What season had less than 301 points and 17 races?
| SELECT season FROM table_name_28 WHERE points < 301 AND races = 17 | sql_create_context |
CREATE TABLE table_name_50 (
away_team VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Away team score with north melbourne as home team?
| SELECT away_team AS score FROM table_name_50 WHERE home_team = "north melbourne" | sql_create_context |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT ACC_Road, School_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY ACC_Road DESC | nvbench |
CREATE TABLE table_69396 (
"Riding" text,
"Candidate's Name" text,
"Gender" text,
"Residence" text,
"Occupation" text,
"Votes" real,
"Rank" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The candidate with Riding of st. john's south mount pe... | SELECT "Gender" FROM table_69396 WHERE "Riding" = 'st. john''s south—mount pearl' | wikisql |
CREATE TABLE table_52395 (
"Rank" real,
"Movie" text,
"Year" real,
"Studio(s)" text,
"Opening Week Nett Gross" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest rank of Jab Tak Hai Jaan, which has an opening week net gross less than... | SELECT MAX("Rank") FROM table_52395 WHERE "Opening Week Nett Gross" < '99,00,00,000' AND "Movie" = 'jab tak hai jaan' AND "Year" > '2012' | wikisql |
CREATE TABLE table_14126 (
"Constituency number" text,
"Name" text,
"Reserved for ( SC / ST /None)" text,
"District" text,
"Number of electorates (2009)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Name has a Reserved for of none, and a Con... | SELECT "Name" FROM table_14126 WHERE "Reserved for ( SC / ST /None)" = 'none' AND "Constituency number" = '7' | wikisql |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT All_Home, SUM(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY SUM(School_ID) | nvbench |
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 COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'chest pain' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2102') AS t1 JOIN (SELECT patient.uniquepid, tre... | eicu |
CREATE TABLE table_name_3 (
rank VARCHAR,
county VARCHAR,
tally VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- With a Tally of 0-14, what is the Rank in Kilkenny County?
| SELECT COUNT(rank) FROM table_name_3 WHERE county = "kilkenny" AND tally = "0-14" | sql_create_context |
CREATE TABLE Complaints (
complaint_id INTEGER,
product_id INTEGER,
customer_id INTEGER,
complaint_outcome_code VARCHAR(20),
complaint_status_code VARCHAR(20),
complaint_type_code VARCHAR(20),
date_complaint_raised DATETIME,
date_complaint_closed DATETIME,
staff_id INTEGER
)
CREATE ... | SELECT product_name, COUNT(*) FROM Products AS t1 JOIN Complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name | nvbench |
CREATE TABLE table_58159 (
"Rank" real,
"Player" text,
"Country" text,
"Earnings ( $ )" real,
"Events" real,
"Wins" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the average wins for earnings more than 120,367 and events less than 13
| SELECT AVG("Wins") FROM table_58159 WHERE "Earnings ( $ )" > '120,367' AND "Events" < '13' | wikisql |
CREATE TABLE table_name_47 (
frequency INTEGER,
brand VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the sum of frequecy with brand of exa fm
| SELECT SUM(frequency) FROM table_name_47 WHERE brand = "exa fm" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wa... | SELECT MAX(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-15837')) AND intakeoutput.celllabel = 'stool... | eicu |
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 mzjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '窦嘉美' UNION SELECT zyjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_i... | 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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.long_title = "Atherosclerosis of native arteries of the extremities with gangrene" | mimicsql_data |
CREATE TABLE table_50533 (
"Season" text,
"Skip" text,
"Third" text,
"Second" text,
"Lead" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Season has a Skip of Eve Muirhead with a thirs of Jackie Lockhart (e/o) Kelly Wood (w)?
| SELECT "Season" FROM table_50533 WHERE "Skip" = 'eve muirhead' AND "Third" = 'jackie lockhart (e/o) kelly wood (w)' | wikisql |
CREATE TABLE table_39281 (
"Dance" text,
"Best dancer(s)" text,
"Best score" text,
"Worst dancer(s)" text,
"Worst score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which dance has the worst dancer(s) as marissa jaret winokur?
| SELECT "Dance" FROM table_39281 WHERE "Worst dancer(s)" = 'marissa jaret winokur' | wikisql |
CREATE TABLE table_22215 (
"Position" real,
"Channel" text,
"Analogue terrestrial channel" text,
"Digital terrestrial channel" text,
"Internet" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the position of digital channel 5 44 (+1)?
| SELECT "Position" FROM table_22215 WHERE "Digital terrestrial channel" = '5 44 (+1)' | wikisql |
CREATE TABLE table_15416002_1 (
chi VARCHAR,
nhc_advisory_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the CHI (Carvill Hurricane Index) when the NHC advisory number is equal to 49b?
| SELECT chi FROM table_15416002_1 WHERE nhc_advisory_number = "49B" | sql_create_context |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes nu... | SELECT Tags, Body, Id FROM Posts WHERE Id IN (SELECT AcceptedAnswerId FROM Posts WHERE Tags LIKE '%php%' AND Body LIKE '%<code>%') | sede |
CREATE TABLE table_name_56 (
build_date VARCHAR,
prr_class VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the build date of the model with PRR Class brs24?
| SELECT build_date FROM table_name_56 WHERE prr_class = "brs24" | sql_create_context |
CREATE TABLE table_34981 (
"City" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which city has an ICAO of VCCJ?
| SELECT "City" FROM table_34981 WHERE "ICAO" = 'vccj' | wikisql |
CREATE TABLE pilot_record (
Record_ID int,
Pilot_ID int,
Aircraft_ID int,
Date text
)
CREATE TABLE aircraft (
Aircraft_ID int,
Order_Year int,
Manufacturer text,
Model text,
Fleet_Series text,
Powertrain text,
Fuel_Propulsion text
)
CREATE TABLE pilot (
Pilot_ID int,
... | SELECT Nationality, COUNT(*) FROM pilot GROUP BY Nationality | nvbench |
CREATE TABLE table_name_63 (
icao VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Cuba's ICAO?
| SELECT icao FROM table_name_63 WHERE country = "cuba" | sql_create_context |
CREATE TABLE table_2409041_3 (
production_code VARCHAR,
no_in_series VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many production codes were in series 39?
| SELECT COUNT(production_code) FROM table_2409041_3 WHERE no_in_series = 39 | sql_create_context |
CREATE TABLE Order_items (
product_id VARCHAR,
order_id VARCHAR
)
CREATE TABLE Products (
product_name VARCHAR,
product_id VARCHAR
)
CREATE TABLE Orders (
order_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show all product names and the nu... | SELECT T2.product_name, COUNT(*) FROM Order_items AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id JOIN Orders AS T3 ON T3.order_id = T1.order_id GROUP BY T2.product_name | sql_create_context |
CREATE TABLE table_39639 (
"Episode #" real,
"Season #" real,
"Format #" text,
"Title" text,
"Original Airdate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average episode number with q146 format?
| SELECT AVG("Episode #") FROM table_39639 WHERE "Format #" = 'q146' | wikisql |
CREATE TABLE table_65992 (
"Year" real,
"Formula" text,
"Driver" text,
"Constructor" text,
"Location" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest year with a formula of Grand Prix?
| SELECT MAX("Year") FROM table_65992 WHERE "Formula" = 'grand prix' | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.dob_year < "2083" | mimicsql_data |
CREATE TABLE sales (
sales_transaction_id number,
sales_details text
)
CREATE TABLE transactions (
transaction_id number,
investor_id number,
transaction_type_code text,
date_of_transaction time,
amount_of_transaction number,
share_count text,
other_details text
)
CREATE TABLE lots... | SELECT DISTINCT lot_details FROM lots | spider |
CREATE TABLE Statements (
Statement_ID INTEGER,
Statement_Details VARCHAR(255)
)
CREATE TABLE Accounts (
Account_ID INTEGER,
Statement_ID INTEGER,
Account_Details VARCHAR(255)
)
CREATE TABLE Projects (
Project_ID INTEGER,
Project_Details VARCHAR(255)
)
CREATE TABLE Documents (
Documen... | SELECT Document_Type_Description, COUNT(Document_Type_Description) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Description ORDER BY COUNT(Document_Type_Description) DESC | nvbench |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TA... | SELECT STRFTIME('%j', patient.unitdischargetime) - STRFTIME('%j', patient.unitadmittime) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-53970') AND NOT patient.unitadmittime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1 | eicu |
CREATE TABLE table_name_7 (
score VARCHAR,
place VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Score, when Place is 'T5', and when Player is 'George Archer'?
| SELECT score FROM table_name_7 WHERE place = "t5" AND player = "george archer" | sql_create_context |
CREATE TABLE table_name_23 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the production in 2010 with 2011 production of 2,240,000?
| SELECT 2010 FROM table_name_23 WHERE 2011 = "2,240,000" | sql_create_context |
CREATE TABLE table_23004 (
"House name" text,
"House mascot" text,
"House colour" text,
"Year opened" real,
"House leader" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the house colour associated with the house name of Kupe?
| SELECT "House colour" FROM table_23004 WHERE "House name" = 'Kupe' | wikisql |
CREATE TABLE artist (
artistid number,
name text
)
CREATE TABLE playlist (
playlistid number,
name text
)
CREATE TABLE invoiceline (
invoicelineid number,
invoiceid number,
trackid number,
unitprice number,
quantity number
)
CREATE TABLE album (
albumid number,
title text,... | SELECT T2.name, T1.artistid FROM album AS T1 JOIN artist AS T2 ON T1.artistid = T2.artistid GROUP BY T1.artistid HAVING COUNT(*) >= 3 ORDER BY T2.name | spider |
CREATE TABLE table_name_76 (
illustration VARCHAR,
design VARCHAR,
first_day_cover_cancellation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Illustration with a Design of tim nokes, and a First Day Cover Cancellation with calgary, alberta?
| SELECT illustration FROM table_name_76 WHERE design = "tim nokes" AND first_day_cover_cancellation = "calgary, alberta" | sql_create_context |
CREATE TABLE table_1341395_36 (
party VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Incumbent Deborah Pryce was a member of what party?
| SELECT party FROM table_1341395_36 WHERE incumbent = "Deborah Pryce" | sql_create_context |
CREATE TABLE table_11608735_3 (
other_local_sources VARCHAR,
state_ VARCHAR,
_federal VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of local sources for state and federal 12,929,489
| SELECT other_local_sources FROM table_11608735_3 WHERE state_ & _federal = "12,929,489" | sql_create_context |
CREATE TABLE table_name_31 (
away_team VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the away team when bournemouth was the home team?
| SELECT away_team FROM table_name_31 WHERE home_team = "bournemouth" | sql_create_context |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE ground_service (
city_code text,
airport_co... | SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((flight.airline_code = 'TW') AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.to_airport = AIRP... | atis |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.