context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_57470 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
) | What is the ERP W number where the frequency is smaller than 91.1? | SELECT MAX("ERP W") FROM table_57470 WHERE "Frequency MHz" < '91.1' | wikisql |
CREATE TABLE table_name_82 (
year VARCHAR,
notes VARCHAR
) | In what year is the notes distance 1.83m? | SELECT year FROM table_name_82 WHERE notes = "1.83m" | sql_create_context |
CREATE TABLE table_name_90 (
run_2 INTEGER,
run_1 VARCHAR,
run_3 VARCHAR
) | What is the lowest run 2 of the athlete with a run 1 of 52.44 and a run 3 less than 52.35? | SELECT MIN(run_2) FROM table_name_90 WHERE run_1 = 52.44 AND run_3 < 52.35 | 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 person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE zzmzjzjlb.JZZDSM = '过敏性皮炎' GROUP BY person_info.JGDM UNION SELECT p... | css |
CREATE TABLE table_7380 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | Which Date has a Catalog of vcrt 106? | SELECT "Date" FROM table_7380 WHERE "Catalog" = 'vcrt 106' | wikisql |
CREATE TABLE table_61049 (
"Model" text,
"Years" text,
"Engine" text,
"Power" text,
"0\u2013100km/h (62mph)" text,
"Top Speed" text
) | Which model has a top speed of 231km/h (143mph)? | SELECT "Model" FROM table_61049 WHERE "Top Speed" = '231km/h (143mph)' | wikisql |
CREATE TABLE table_test_7 (
"id" int,
"bleeding" int,
"left_ventricular_ejection_fraction_lvef" int,
"intra_aortic_balloon_pump_iabp" bool,
"systolic_blood_pressure_sbp" int,
"dialysis" bool,
"intravenous_pressors" bool,
"non_infarct_related_vessel" bool,
"heart_disease" bool,
"b... | platelet count < 100000 / mm3 | SELECT * FROM table_test_7 WHERE platelet_count < 100000 | criteria2sql |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE ReviewTasks (... | Activity tab for top users. | SELECT Id AS "user_link", Reputation, activity = 'site://users/' + CAST(Id AS TEXT) + '?tab=topactivity|Activity', profile = 'site://users/' + CAST(Id AS TEXT) + '?tab=profile|Profile' FROM Users ORDER BY Reputation DESC LIMIT 200 | sede |
CREATE TABLE table_name_78 (
bronze INTEGER,
total VARCHAR,
rank VARCHAR,
nation VARCHAR
) | What is the average Bronze, when Rank is greater than 6, when Nation is Italy (ITA), and when Total is less than 1? | SELECT AVG(bronze) FROM table_name_78 WHERE rank > 6 AND nation = "italy (ita)" AND total < 1 | sql_create_context |
CREATE TABLE allergy_type (
allergy text,
allergytype text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE has_allergy (
stuid number,
allergy text
) | Which city does the student whose last name is 'Kim' live in? | SELECT city_code FROM student WHERE lname = "Kim" | spider |
CREATE TABLE Apartment_Facilities (
apt_id INTEGER,
facility_code CHAR(15)
)
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_... | Bar graph to show the number of booking end date from different booking end date, could you list in desc by the how many booking end date? | SELECT booking_end_date, COUNT(booking_end_date) FROM Apartment_Bookings ORDER BY COUNT(booking_end_date) DESC | nvbench |
CREATE TABLE table_15240 (
"Company" text,
"Plan name" text,
"Technology" text,
"Maximum download speed/ kbps" text,
"Data limit/ GB" text,
"Monthly price incl. VAT/ CZK" text
) | What is the maximum download speed for the Internet premium 3G plan? | SELECT "Maximum download speed/ kbps" FROM table_15240 WHERE "Technology" = '3g' AND "Plan name" = 'internet premium' | wikisql |
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 zzmzjzjlb (
HXPLC number,
HZX... | 患者谢修雅就诊科室名称不包含小儿在医院6550085中的所有门诊就诊记录的流水号各是什么? | SELECT zzmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '谢修雅' AND hz_info.YLJGDM = '6550085' AND NOT zzmzjzjlb.JZKSMC LIKE '%小儿%' UNION SELECT fzzmzjz... | css |
CREATE TABLE table_name_53 (
competition VARCHAR,
venue VARCHAR
) | Which Competition has a Venue of hong kong? | SELECT competition FROM table_name_53 WHERE venue = "hong kong" | sql_create_context |
CREATE TABLE table_name_71 (
player VARCHAR,
score VARCHAR
) | What is Player, when Score is '68-67-75-70=280'? | SELECT player FROM table_name_71 WHERE score = 68 - 67 - 75 - 70 = 280 | sql_create_context |
CREATE TABLE invoices (
id number,
customer_id number,
invoice_date time,
billing_address text,
billing_city text,
billing_state text,
billing_country text,
billing_postal_code text,
total number
)
CREATE TABLE artists (
id number,
name text
)
CREATE TABLE invoice_lines (
... | What are the names of all tracks that belong to the Rock genre and whose media type is MPEG? | SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id JOIN media_types AS T3 ON T3.id = T2.media_type_id WHERE T1.name = "Rock" OR T3.name = "MPEG audio file" | spider |
CREATE TABLE table_21056 (
"Poll Source" text,
"Dates administered" text,
"Democrat: Carl Levin" text,
"Republican: Jack Hoogendyk" text,
"Lead Margin" real
) | What was the poll source when Democrat Carl Levin had 54% and the lead margin was 28? | SELECT "Poll Source" FROM table_21056 WHERE "Democrat: Carl Levin" = '54%' AND "Lead Margin" = '28' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,... | 编号为43827517的患者被门诊诊断为胃炎,看看检测指标983873的结果定量及其单位 | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '胃炎' AND hz_info.RYBH = '... | css |
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 microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,... | the previous day, was patient 739's arterial bp mean ever greater than 78.0? | SELECT COUNT(*) > 0 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 = 739)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp mean' A... | mimic_iii |
CREATE TABLE table_37432 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team" text
) | What is the position of Dale Craigwell? | SELECT "Position" FROM table_37432 WHERE "Player" = 'dale craigwell' | wikisql |
CREATE TABLE table_52615 (
"Block A" text,
"Akira" text,
"Atsushi Aoki" text,
"Black Tiger V" text,
"Jado" text,
"Milano Collection A.T." text,
"Prince Devitt" text,
"Tiger Mask IV" text
) | What is the Akira when Prince Devitt is Devitt (7:20)? | SELECT "Akira" FROM table_52615 WHERE "Prince Devitt" = 'devitt (7:20)' | wikisql |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
... | show me the flights from PHILADELPHIA to ATLANTA | 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 = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'A... | atis |
CREATE TABLE table_name_27 (
moving_to VARCHAR,
country VARCHAR
) | WHAT IS THE MOVING TO LOCATION WITH BEL AS COUNTRY? | SELECT moving_to FROM table_name_27 WHERE country = "bel" | sql_create_context |
CREATE TABLE table_32187 (
"Year" real,
"Date contested" text,
"Sport" text,
"Winning team" text,
"Losing team" text,
"Final score" text
) | What was the final score of a baseball game that happened before 2005? | SELECT "Final score" FROM table_32187 WHERE "Sport" = 'baseball' AND "Year" < '2005' | wikisql |
CREATE TABLE table_72731 (
"N\u00b0" real,
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"DAR" text,
"HDTV" text,
"Package/Option" text
) | How many television service are in italian and n is greater than 856.0? | SELECT "Television service" FROM table_72731 WHERE "Language" = 'Italian' AND "N\u00b0" > '856.0' | wikisql |
CREATE TABLE table_15187735_3 (
episode VARCHAR,
segment_c VARCHAR
) | Name the number of episode for phyllo dough | SELECT COUNT(episode) FROM table_15187735_3 WHERE segment_c = "Phyllo Dough" | 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... | A scatter chart shows the correlation between School_ID and All_Games_Percent . | SELECT School_ID, All_Games_Percent FROM basketball_match | nvbench |
CREATE TABLE table_18664 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | how many incumbent with first elected being 1932 | SELECT COUNT("Incumbent") FROM table_18664 WHERE "First elected" = '1932' | wikisql |
CREATE TABLE table_14923 (
"Station" text,
"Frequency" real,
"Network Affiliation" text,
"Format" text,
"City of License" text,
"Status" text
) | What is the total frequency have a Status of owned by cumulus media, and a Format of news? | SELECT SUM("Frequency") FROM table_14923 WHERE "Status" = 'owned by cumulus media' AND "Format" = 'news' | wikisql |
CREATE TABLE fzzmzjzjlb (
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... | 编号为72960308的这位患者被门诊诊断为疾病I69.303,查一下他在874346这个检测指标的结果定量及其单位 | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jyb... | css |
CREATE TABLE table_204_590 (
id number,
"year" number,
"division" number,
"league" text,
"regular season" text,
"playoffs" text,
"open cup" text,
"avg. attendance" number
) | how many times did the usl a league reach the quarterfinals ? | SELECT COUNT(*) FROM table_204_590 WHERE "league" = 'usl a-league' AND "playoffs" = 'quarterfinals' | squall |
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password VARCHAR(10),
personal_name VARCHAR(40),
middle_name VARCHAR(40),
family_name VARCHAR(40)
)
CREATE TABLE Course_Authors_and_Tutors (
author_id IN... | Return the number of the completion date for all the tests that have 'Fail' result, and rank by the bar in asc. | SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail" GROUP BY date_of_completion ORDER BY date_of_completion | nvbench |
CREATE TABLE table_17039 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"MLB Draft" text
) | Who was drafted from the school Mountain Pointe High School? | SELECT "MLB Draft" FROM table_17039 WHERE "School" = 'Mountain Pointe High School' | wikisql |
CREATE TABLE table_name_90 (
name VARCHAR,
wins VARCHAR,
matches VARCHAR
) | What are the names of those who made less than 3 wins in 15 matches? | SELECT name FROM table_name_90 WHERE wins < 3 AND matches < 15 | sql_create_context |
CREATE TABLE table_name_55 (
winning_score VARCHAR,
tournament VARCHAR
) | What was the Winning score for the Mynavi ABC Championship Tournament? | SELECT winning_score FROM table_name_55 WHERE tournament = "mynavi abc championship" | sql_create_context |
CREATE TABLE table_17918238_1 (
length VARCHAR,
maximum_diameter VARCHAR
) | What is the length for a diameter totaling 450 mm? | SELECT length FROM table_17918238_1 WHERE maximum_diameter = "450 mm" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | give me the number of patients whose admission location is emergency room admit and primary disease is atrial septal defect\mitral valve replacement;repair atrial-septal defect/sda? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.diagnosis = "ATRIAL SEPTAL DEFECT\MITRAL VALVE REPLACEMENT;REPAIR ATRIAL-SEPTAL DEFECT/SDA" | mimicsql_data |
CREATE TABLE table_53170 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Date" text
) | What is the home team of the game where Geelong was the away team? | SELECT "Home team" FROM table_53170 WHERE "Away team" = 'geelong' | wikisql |
CREATE TABLE artists (
id number,
name text
)
CREATE TABLE playlists (
id number,
name text
)
CREATE TABLE invoices (
id number,
customer_id number,
invoice_date time,
billing_address text,
billing_city text,
billing_state text,
billing_country text,
billing_postal_code... | What are the names of all tracks that are on the Movies playlist but not in the music playlist? | SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Movies' EXCEPT SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T2.playlist_id = T3.id WHERE T3.name = 'Music' | spider |
CREATE TABLE table_2683116_1 (
E VARCHAR,
vap VARCHAR,
turnout VARCHAR
) | What is the e/vap value for a turnout of exactly 85.7%? | SELECT E / vap FROM table_2683116_1 WHERE turnout = "85.7%" | sql_create_context |
CREATE TABLE table_204_145 (
id number,
"representative" text,
"state" text,
"district(s)" text,
"served" text,
"party" text,
"date of birth" text,
"date of death" text,
"age" text
) | how many years did william r poage serve ? | SELECT "served" - "served" FROM table_204_145 WHERE "representative" = 'william r. poage' | squall |
CREATE TABLE table_35060 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text
) | Which party had a Retired Democratic hold? | SELECT "Party" FROM table_35060 WHERE "Result" = 'retired democratic hold' | 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... | how many patients whose drug type is main and lab test name is lipase? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.drug_type = "MAIN" AND lab.label = "Lipase" | mimicsql_data |
CREATE TABLE table_40540 (
"Date" text,
"Cover model" text,
"Centerfold model" text,
"Interview subject" text,
"20 Questions" text
) | When has a Centerfold model of pilar lastra? | SELECT "Date" FROM table_40540 WHERE "Centerfold model" = 'pilar lastra' | wikisql |
CREATE TABLE table_53798 (
"Conference" text,
"Division" text,
"Appearances" real,
"Wins" real,
"Losses" real
) | Which division in the AFC Conference had a total of 10 wins and appeared more than 18 times? | SELECT "Division" FROM table_53798 WHERE "Conference" = 'afc' AND "Wins" = '10' AND "Appearances" > '18' | 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... | 被开出苯巴比妥片的患者张温书在2004年11月1日到2006年9月7日期间开了多少次? | SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '张温书' AND t_kc22.STA_DATE BETWEEN '2004-11-01' AND '2006-09-07' AND t_kc22.SOC_SRT_DIRE_NM = '苯巴比妥片' | css |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE Comments (
Id number,
PostId number,
Score numb... | Get all users of provided location. | SELECT Id, DisplayName FROM Users WHERE Location IN (SELECT DISTINCT (Location) FROM Users WHERE Location LIKE '%urgaon%') | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | calculate the average age of living patients who had home health care discharge. | SELECT AVG(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.discharge_location = "HOME HEALTH CARE" | mimicsql_data |
CREATE TABLE list (
classroom VARCHAR,
grade VARCHAR
) | Which classrooms are used by grade 5? | SELECT DISTINCT classroom FROM list WHERE grade = 5 | sql_create_context |
CREATE TABLE table_13498403_1 (
trainer VARCHAR,
jockey VARCHAR
) | how many people work with N Rawiller | SELECT COUNT(trainer) FROM table_13498403_1 WHERE jockey = "N Rawiller" | sql_create_context |
CREATE TABLE table_63042 (
"Heat" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
) | What is the average lane of the athlete from japan with a time of 4:37.35 and a heat less than 3? | SELECT AVG("Lane") FROM table_63042 WHERE "Nationality" = 'japan' AND "Time" = '4:37.35' AND "Heat" < '3' | wikisql |
CREATE TABLE photos (
id int,
camera_lens_id int,
mountain_id int,
color text,
name text
)
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_len... | What are the number of the names of photos taken with the lens brand 'Sigma' or 'Olympus'?, could you list by the name in ascending? | SELECT T1.name, COUNT(T1.name) FROM camera_lens AS T1 JOIN photos AS T2 ON T2.camera_lens_id = T1.id WHERE T1.brand = 'Sigma' OR T1.brand = 'Olympus' GROUP BY T1.name ORDER BY T1.name | nvbench |
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE paperfield (
fieldid int,
paper... | what topics does oren etzioni write about most ? | SELECT DISTINCT COUNT(paperkeyphrase.keyphraseid), paperkeyphrase.keyphraseid FROM author, paper, paperkeyphrase, writes WHERE author.authorname = 'oren etzioni' AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid GROUP BY paperkeyphrase.keyphraseid ORDER ... | scholar |
CREATE TABLE table_70373 (
"Language" text,
"Number" text,
"percentage (%)" text,
"males" text,
"females" text
) | Name the language that has number of 14 | SELECT "Language" FROM table_70373 WHERE "Number" = '14' | wikisql |
CREATE TABLE files (
f_id number,
artist_name text,
file_size text,
duration text,
formats text
)
CREATE TABLE artist (
artist_name text,
country text,
gender text,
preferred_genre text
)
CREATE TABLE song (
song_name text,
artist_name text,
country text,
f_id numbe... | What are the names of all songs that are approximately 4 minutes long or are in English? | SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.duration LIKE "4:%" UNION SELECT song_name FROM song WHERE languages = "english" | spider |
CREATE TABLE table_49522 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | What is the Home team on April 2? | SELECT "Home" FROM table_49522 WHERE "Date" = 'april 2' | wikisql |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TA... | is us US | SELECT DISTINCT airline_code FROM airline WHERE airline_code = 'US' AND airline_name LIKE 'USAIR' | atis |
CREATE TABLE table_75184 (
"Company" text,
"Type" text,
"Principal activities" text,
"Incorporated in" text,
"Group's Equity Shareholding (10 March 2010)" text
) | Which company's type is joint venture, and has principle activities listed as Cargo Airline and an incorporation of China? | SELECT "Company" FROM table_75184 WHERE "Type" = 'joint venture' AND "Principal activities" = 'cargo airline' AND "Incorporated in" = 'china' | wikisql |
CREATE TABLE table_24708 (
"Pos" real,
"Team" text,
"07 Pts" real,
"08 Pts" real,
"09 Pts" real,
"Total Pts" real,
"Total Pld" real,
"Avg" text
) | If the POS is 3, what is the 08 points? | SELECT "08 Pts" FROM table_24708 WHERE "Pos" = '3' | wikisql |
CREATE TABLE table_52463 (
"Week" text,
"Date" text,
"Opponent" text,
"Result" text,
"Kickoff [a ]" text,
"Game site" text,
"Attendance" text,
"Record" text
) | Which week was the game against the San Diego Chargers? | SELECT "Week" FROM table_52463 WHERE "Opponent" = 'san diego chargers' | wikisql |
CREATE TABLE table_56108 (
"Week" text,
"Date" text,
"Opponent" text,
"Result" text,
"Kickoff [a ]" text,
"Game site" text,
"Attendance" text,
"Record" text
) | Who is the opponent on the game that will be played at metropolitan stadium? | SELECT "Opponent" FROM table_56108 WHERE "Game site" = 'metropolitan stadium' | 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... | how many patients use the neonatal syringe? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Syringe (Neonatal)" | mimicsql_data |
CREATE TABLE table_45738 (
"Season" text,
"Team 1" text,
"Score" text,
"Team 2" text,
"Venue" text
) | Team 2 Al-Ain played in what venue? | SELECT "Venue" FROM table_45738 WHERE "Team 2" = 'al-ain' | wikisql |
CREATE TABLE table_203_532 (
id number,
"rebounds" number,
"off" number,
"def" number,
"player" text,
"team" text,
"date" text,
"opponent" text,
"score" text,
"minutes played" text,
"points" number,
"assists" number,
"steals" number,
"blocks" number,
"20-20" t... | how many rebounds were there total , according to this table , in 1978 ? | SELECT SUM("rebounds") FROM table_203_532 WHERE "date" = 1978 | squall |
CREATE TABLE table_2725949_6 (
starts VARCHAR,
season VARCHAR
) | Name the starts for 2009 | SELECT starts FROM table_2725949_6 WHERE season = 2009 | sql_create_context |
CREATE TABLE table_name_24 (
winning_score VARCHAR,
runner_up VARCHAR,
year VARCHAR
) | Name the winning score for jim barnes and year of 1924 | SELECT winning_score FROM table_name_24 WHERE runner_up = "jim barnes" AND year = 1924 | sql_create_context |
CREATE TABLE table_53353 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which away team scored at 15.17 (107) at an away game? | SELECT "Away team" FROM table_53353 WHERE "Away team score" = '15.17 (107)' | wikisql |
CREATE TABLE table_name_90 (
earnings___ INTEGER,
events VARCHAR,
wins VARCHAR
) | What is the high earnings for players with 34 events and over 2 wins? | SELECT MAX(earnings___) AS $__ FROM table_name_90 WHERE events = 34 AND wins > 2 | sql_create_context |
CREATE TABLE table_name_20 (
hot_digital_songs_reaction VARCHAR,
week VARCHAR,
performer_s_ VARCHAR
) | What is the digital reaction for week of top 5 for Taylor Hicks? | SELECT hot_digital_songs_reaction FROM table_name_20 WHERE week = "top 5" AND performer_s_ = "taylor hicks" | 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... | tell me the number of patients who were born in or before 2132. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dod_year <= "2132.0" | mimicsql_data |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt ... | do you have a flight from ATLANTA to BOSTON that will stop in WASHINGTON | 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 = 'BOSTON' AND CITY_2.cit... | atis |
CREATE TABLE table_name_29 (
venue VARCHAR,
player VARCHAR
) | For player Les Ames, what was the venue? | SELECT venue FROM table_name_29 WHERE player = "les ames" | sql_create_context |
CREATE TABLE table_name_1 (
works_number INTEGER,
date VARCHAR,
number VARCHAR,
type VARCHAR
) | Which Works number has a Number larger than 807, and a Type of 0-6-0, and a Date of 1920? | SELECT AVG(works_number) FROM table_name_1 WHERE number > 807 AND type = "0-6-0" AND date = 1920 | 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... | 列出患者45393885出院科室名称不包含康复科的住院就诊记录在医院3398838中有哪些? | SELECT * FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '45393885' AND hz_info.YLJGDM = '3398838' AND NOT wdmzjzjlb.CYKSMC LIKE '%康复科%' UNION SELECT * FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjlb.YLJGDM AND... | css |
CREATE TABLE table_1461 (
"Season" text,
"Winner" text,
"Winning Song" text,
"Winning Song (English Title)" text,
"Debut Album" text
) | What is the debut album for the artist with the winning song kemenangan hati? | SELECT "Debut Album" FROM table_1461 WHERE "Winning Song" = 'Kemenangan Hati' | wikisql |
CREATE TABLE table_50452 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | Average round for 22 pick that is overall smaller than 229? | SELECT AVG("Round") FROM table_50452 WHERE "Pick" = '22' AND "Overall" < '229' | wikisql |
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... | Find the number of students living in each city with a bar chart, I want to show by the city_code in ascending please. | SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY city_code | nvbench |
CREATE TABLE table_51875 (
"Stadium" text,
"Games" real,
"City" text,
"State" text,
"Capacity" real,
"Best Crowd" text
) | What is the city where the Telstra Dome is? | SELECT "City" FROM table_51875 WHERE "Stadium" = 'telstra dome' | 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... | let me know the number of government health insurance patients who have ntprobnp lab test. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Government" AND lab.label = "NTproBNP" | mimicsql_data |
CREATE TABLE gwyjzb (
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,
... | 医院0795185入院诊断疾病结果与出院诊断疾病结果在2005-08-27到2019-02-22内不同的医疗就诊有哪些记录? | SELECT * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '0795185' AND gwyjzb.IN_HOSP_DATE BETWEEN '2005-08-27' AND '2019-02-22' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '0795185' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2005-08-27' AND '2019-02-22' EXCEPT SELECT * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '079518... | css |
CREATE TABLE table_name_88 (
total_population__2010_ INTEGER,
_percentage_asian_american VARCHAR,
asian_american_population__2010_ VARCHAR
) | What's the total population when there are 5.7% Asian American and fewer than 126,965 Asian American Population? | SELECT MIN(total_population__2010_) FROM table_name_88 WHERE _percentage_asian_american = 5.7 AND asian_american_population__2010_ < 126 OFFSET 965 | sql_create_context |
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... | 医院8511727的住院医疗记录的数量有多少,在2002-07-15到2008-05-02这六年里? | SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '8511727' AND gwyjzb.IN_HOSP_DATE BETWEEN '2002-07-15' AND '2008-05-02' AND gwyjzb.CLINIC_TYPE = '住院' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '8511727' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2002-07-15' AND '2008-05-02' AND fgwyjzb.CLINIC_TY... | css |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | provide the number of patients whose insurance is private and procedure icd9 code is 8968. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.icd9_code = "8968" | mimicsql_data |
CREATE TABLE table_17781 (
"Day (see Irregularities )" text,
"Monday First Day" text,
"Tuesday Second Day" text,
"Wednesday Third Day" text,
"Thursday Fourth Day" text,
"Friday Fifth Day" text,
"Saturday Sixth Day" text,
"Sunday Seventh Day" text
) | How do you say Friday in Polish? | SELECT "Friday Fifth Day" FROM table_17781 WHERE "Day (see Irregularities )" = 'Polish' | wikisql |
CREATE TABLE table_23612439_2 (
location VARCHAR,
date VARCHAR
) | Which location has the date of October 28? | SELECT location FROM table_23612439_2 WHERE date = "October 28" | sql_create_context |
CREATE TABLE table_29897962_1 (
directed_by VARCHAR,
us_viewers__million_ VARCHAR
) | Who directed the episode that had 3.55 million viewers? | SELECT directed_by FROM table_29897962_1 WHERE us_viewers__million_ = "3.55" | sql_create_context |
CREATE TABLE table_79534 (
"Year" real,
"Event" text,
"Venue" text,
"Place" text,
"Weight class (kg)" real
) | What is the lowest year that has edmonton, canada as the venue with a weight class (kg) greater than 100? | SELECT MIN("Year") FROM table_79534 WHERE "Venue" = 'edmonton, canada' AND "Weight class (kg)" > '100' | wikisql |
CREATE TABLE table_name_82 (
kuala_lumpur INTEGER,
durban VARCHAR,
mar_del_plata VARCHAR
) | What is the highest Kuala Lumpur value with a Durban value less than 1 and a Mar Del Plata value greater than 0? | SELECT MAX(kuala_lumpur) FROM table_name_82 WHERE durban < 1 AND mar_del_plata > 0 | sql_create_context |
CREATE TABLE table_204_162 (
id number,
"team" text,
"constructor" text,
"motorcycle" text,
"tyres" text,
"no" number,
"rider" text,
"rounds" text
) | give the total number of riders listed . | SELECT COUNT("rider") FROM table_204_162 | squall |
CREATE TABLE table_20606 (
"Missouri vs." text,
"Overall Record" text,
"at Columbia" text,
"at Opponents Venue" text,
"at Neutral Site" text,
"Last 5 Meetings" text,
"Last 10 Meetings" text,
"Current Streak" text
) | How many times did the team achieve an overrall record of mu, 21-19? | SELECT COUNT("Last 5 Meetings") FROM table_20606 WHERE "Overall Record" = 'MU, 21-19' | wikisql |
CREATE TABLE table_name_86 (
became_consort VARCHAR,
spouse VARCHAR
) | On what date did the woman married to Louis II become consort? | SELECT became_consort FROM table_name_86 WHERE spouse = "louis ii" | sql_create_context |
CREATE TABLE table_4763 (
"Team" text,
"Chassis" text,
"Engine" text,
"Tires" text,
"Drivers" text
) | Who drove for Arciero Racing? | SELECT "Drivers" FROM table_4763 WHERE "Team" = 'arciero racing' | wikisql |
CREATE TABLE table_36067 (
"Place" text,
"Player" text,
"Nation" text,
"Score" text,
"To par" text,
"Money ( $ )" real
) | What was the score in a place of t5 in the United States? | SELECT "Score" FROM table_36067 WHERE "Place" = 't5' AND "Nation" = 'united states' | wikisql |
CREATE TABLE table_name_51 (
drawn VARCHAR,
points_against VARCHAR
) | If points against was 371, what is the drawn? | SELECT drawn FROM table_name_51 WHERE points_against = "371" | sql_create_context |
CREATE TABLE Claims (
Claim_ID INTEGER,
Policy_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amount_Settled INTEGER
)
CREATE TABLE Customers (
Customer_ID INTEGER,
Customer_Details VARCHAR(255)
)
CREATE TABLE Customer_Policies (
Policy_ID INTEGE... | Return the number of the claim start date for the claims whose claimed amount is no more than the average | SELECT Date_Claim_Made, COUNT(Date_Claim_Made) FROM Claims WHERE Amount_Settled <= (SELECT AVG(Amount_Settled) FROM Claims) | nvbench |
CREATE TABLE projects (
project_id number,
project_details text
)
CREATE TABLE ref_document_types (
document_type_code text,
document_type_name text,
document_type_description text
)
CREATE TABLE ref_budget_codes (
budget_type_code text,
budget_type_description text
)
CREATE TABLE account... | Show the budget type code and description and the corresponding document id. | SELECT T2.budget_type_code, T2.budget_type_description, T1.document_id FROM documents_with_expenses AS T1 JOIN ref_budget_codes AS T2 ON T1.budget_type_code = T2.budget_type_code | spider |
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
)
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
) | Draw a bar chart for what is the average age for each gender? | SELECT gender, AVG(age) FROM Person GROUP BY gender | nvbench |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE SuggestedEdits (
Id number,
Pos... | Top 20 Most Answered Questions. Top 20 Most Answered Questions on your site. This is intended for sites like Puzzling.SE or Code Golf, but it should work anywhere. | SELECT AnswerCount AS "answers", Id AS "post_link", CommentCount AS "comments" FROM Posts ORDER BY AnswerCount DESC LIMIT 20 | sede |
CREATE TABLE table_30945 (
"Episode" real,
"Broadcast date" text,
"Guest(s)" text,
"Singer(s)" text,
"Comedian" text,
"Ratings" text
) | Name the singer for joe wilkinson | SELECT "Singer(s)" FROM table_30945 WHERE "Comedian" = 'Joe Wilkinson' | wikisql |
CREATE TABLE table_name_21 (
run_4 VARCHAR,
run_2 VARCHAR
) | What is Run 4, when Run 2 is 1:25.84? | SELECT run_4 FROM table_name_21 WHERE run_2 = "1:25.84" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.