context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_2617 (
"Office" text,
"Type" text,
"Location" text,
"Elected" text,
"Term began" text,
"Term ended" text
) | When did the term end that began January 3, 2007? | SELECT "Term ended" FROM table_2617 WHERE "Term began" = 'January 3, 2007' | wikisql |
CREATE TABLE table_66852 (
"Round" text,
"Fixtures" real,
"Clubs" text,
"New entries" text,
"Leagues entering" text
) | What is the item for Leagues entering, when the value for Clubs is 8 4? | SELECT "Leagues entering" FROM table_66852 WHERE "Clubs" = '8 → 4' | wikisql |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE... | What courses would be helpful before taking CDB 685 ? | SELECT DISTINCT advisory_requirement FROM course WHERE department = 'CDB' AND number = 685 | advising |
CREATE TABLE table_name_62 (
competition VARCHAR,
venue VARCHAR,
man_of_the_match VARCHAR
) | For what competition was the venue away the n/a the man of the match? | SELECT competition FROM table_name_62 WHERE venue = "away" AND man_of_the_match = "n/a" | sql_create_context |
CREATE TABLE table_44780 (
"Year" real,
"Month" text,
"Single" text,
"Album" text,
"Record label" text
) | What album came out before 1975 with the dawn record label and the single 'lady lady lay'? | SELECT "Album" FROM table_44780 WHERE "Year" < '1975' AND "Record label" = 'dawn' AND "Single" = 'lady lady lay' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | calculate the average age of white ethnic background patients who were hospitalized for 3 days. | SELECT AVG(demographic.age) FROM demographic WHERE demographic.ethnicity = "WHITE" AND demographic.days_stay = "3" | mimicsql_data |
CREATE TABLE table_14692 (
"Location" text,
"Year" text,
"Champions" text,
"Runners-up" text,
"Score" text
) | Who are the runners-up in 1996? | SELECT "Runners-up" FROM table_14692 WHERE "Year" = '1996' | wikisql |
CREATE TABLE table_33981 (
"Tournament" text,
"2006" text,
"2007" text,
"2008-12" text,
"2013" text
) | Which 2013 has a 2007 of A, and a Tournament of french open? | SELECT "2013" FROM table_33981 WHERE "2007" = 'a' AND "Tournament" = 'french open' | wikisql |
CREATE TABLE table_61841 (
"Air Date" text,
"Rating" text,
"18-49" text,
"Viewers" text,
"Weekly Winner" text
) | What is Air Date, when Rating is 'N/A', and when Weekly Winner is 'Wedding DJ Chris Dixon'? | SELECT "Air Date" FROM table_61841 WHERE "Rating" = 'n/a' AND "Weekly Winner" = 'wedding dj chris dixon' | wikisql |
CREATE TABLE table_20278716_2 (
mccain__percentage VARCHAR,
county VARCHAR
) | What percentage of voters choise McCain in Burlington? | SELECT mccain__percentage FROM table_20278716_2 WHERE county = "Burlington" | sql_create_context |
CREATE TABLE table_15626 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What is the result when the score is 8-1? | SELECT "Result" FROM table_15626 WHERE "Score" = '8-1' | wikisql |
CREATE TABLE table_name_19 (
Id VARCHAR
) | What 2009 has 52-75 as the 2010? | SELECT 2009 FROM table_name_19 WHERE 2010 = "52-75" | sql_create_context |
CREATE TABLE table_2840500_3 (
pick VARCHAR,
college_junior_club_team VARCHAR
) | what is the number of the chosen club where the hc dukla tren n (slovakia) is from | SELECT COUNT(pick) FROM table_2840500_3 WHERE college_junior_club_team = "HC Dukla Trenčín (Slovakia)" | sql_create_context |
CREATE TABLE address (
address_id number,
address text,
address2 text,
district text,
city_id number,
postal_code text,
phone text,
last_update time
)
CREATE TABLE inventory (
inventory_id number,
film_id number,
store_id number,
last_update time
)
CREATE TABLE film (
... | What is the name of the language that the film 'AIRPORT POLLOCK' is in? | SELECT T2.name FROM film AS T1 JOIN language AS T2 ON T1.language_id = T2.language_id WHERE T1.title = 'AIRPORT POLLOCK' | spider |
CREATE TABLE table_2001348_1 (
closure_for_signature VARCHAR,
field VARCHAR
) | How many inputs are there in the 'closure for signature' tab under the field 'sea (revised)'? | SELECT COUNT(closure_for_signature) FROM table_2001348_1 WHERE field = "Sea (revised)" | sql_create_context |
CREATE TABLE table_8934 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What's the average amount of Gold medals won when there were more than 1 silver medal won and less than 2 bronze medals won. | SELECT AVG("Gold") FROM table_8934 WHERE "Silver" > '1' AND "Bronze" < '2' | 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... | 手术量排名在2003年5月3日到2017年9月15间是倒数前3的科室的编码和名称都有谁? | SELECT t_kc22.MED_ORG_DEPT_CD, t_kc22.MED_ORG_DEPT_NM FROM t_kc22 WHERE t_kc22.STA_DATE BETWEEN '2003-05-03' AND '2017-09-15' AND t_kc22.MED_INV_ITEM_TYPE = '手术费' GROUP BY t_kc22.MED_ORG_DEPT_CD ORDER BY COUNT(*) LIMIT 3 | css |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDat... | Average accept rate (for the whole site). The average accept rate among all users of the target site. | SELECT AVG(a."accept_rate") AS "average_accept_rate" FROM (SELECT p.OwnerUserId, CAST(CAST(COUNT(p.AcceptedAnswerId) AS FLOAT) / CAST(COUNT(p.Id) AS FLOAT) * 100 AS FLOAT(5, 2)) AS "accept_rate" FROM Posts AS p WHERE p.PostTypeId = 1 AND p.ClosedDate IS NULL AND p.CommunityOwnedDate IS NULL AND p.AnswerCount > 0 AND (N... | sede |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TAB... | how many patients were prescribed k-dur 20 during the same month after their cpap/peep therapy - 5-10 cm h2o, since 4 years ago? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'cpap/peep therapy - 5-10 cm h2o' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-4 year'... | eicu |
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... | what is admission type and days of hospital stay of subject name charley pescatore? | SELECT demographic.admission_type, demographic.days_stay FROM demographic WHERE demographic.name = "Charley Pescatore" | mimicsql_data |
CREATE TABLE table_26339 (
"Team #1" text,
"Points" text,
"Team #2" text,
"1st leg" text,
"2nd leg" text
) | Name the team #2 for river plate | SELECT "Team #2" FROM table_26339 WHERE "Team #1" = 'River Plate' | wikisql |
CREATE TABLE AssignedTo (
Scientist int,
Project char(4)
)
CREATE TABLE Projects (
Code Char(4),
Name Char(50),
Hours int
)
CREATE TABLE Scientists (
SSN int,
Name Char(30)
) | Find the number of scientists involved for the projects that require more than 300 hours. Show a pie chart. | SELECT Name, COUNT(*) FROM Projects AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project WHERE T1.Hours > 300 GROUP BY T1.Name | nvbench |
CREATE TABLE table_24961421_1 (
written_by VARCHAR,
us_viewers__millions_ VARCHAR
) | Who wrote the episode that had 12.15 million viewers? | SELECT written_by FROM table_24961421_1 WHERE us_viewers__millions_ = "12.15" | sql_create_context |
CREATE TABLE table_77195 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | Which Attendance has a Date of september 29, 1968, and a Week smaller than 3? | SELECT MIN("Attendance") FROM table_77195 WHERE "Date" = 'september 29, 1968' AND "Week" < '3' | wikisql |
CREATE TABLE member_attendance (
Member_ID VARCHAR,
Performance_ID VARCHAR
)
CREATE TABLE performance (
Location VARCHAR,
Performance_ID VARCHAR
)
CREATE TABLE member (
Name VARCHAR,
Member_ID VARCHAR
) | Show the names of members and the location of the performances they attended. | SELECT T2.Name, T3.Location FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID | sql_create_context |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | during this year, what are the top five most frequently prescribed drugs to patients within the same hospital visit after they are diagnosed with hypertension? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hypertension' A... | eicu |
CREATE TABLE Organisation_Types (
organisation_type VARCHAR(10),
organisation_type_description VARCHAR(255)
)
CREATE TABLE Research_Outcomes (
outcome_code VARCHAR(10),
outcome_description VARCHAR(255)
)
CREATE TABLE Project_Staff (
staff_id DOUBLE,
project_id INTEGER,
role_code VARCHAR(10... | A pie chart about what are the ids and details for all organizations that have grants of more than 6000 dollars? | SELECT T2.organisation_details, T1.organisation_id FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_details | nvbench |
CREATE TABLE table_name_54 (
mass VARCHAR,
designation VARCHAR
) | What is Mass, when Designation is Prognoz 2? | SELECT mass FROM table_name_54 WHERE designation = "prognoz 2" | sql_create_context |
CREATE TABLE table_17025328_1 (
year__ceremony_ VARCHAR,
original_title VARCHAR
) | Name the year for le confessional | SELECT year__ceremony_ FROM table_17025328_1 WHERE original_title = "Le Confessional" | sql_create_context |
CREATE TABLE table_74595 (
"Year" real,
"Race name" text,
"Rider status" text,
"Winner" text,
"Team/Country" text
) | What is the latest year when Phil Anderson won? | SELECT MAX("Year") FROM table_74595 WHERE "Winner" = 'phil anderson' | wikisql |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday va... | What teacher has the easiest course for PreMajor ? | SELECT DISTINCT instructor.name, program_course.workload 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 program_course ON program_course.course_id = cour... | advising |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE requirement (
requiremen... | In upper-level classes , which ones are 10 credits ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 10 AND program_course.category LIKE 'ULCS' | advising |
CREATE TABLE table_2216245_2 (
wins INTEGER
) | What is his lowest number of wins? | SELECT MIN(wins) FROM table_2216245_2 | sql_create_context |
CREATE TABLE table_72621 (
"English gloss" text,
"Santee-Sisseton" text,
"Yankton-Yanktonai" text,
"Northern Lakota" text,
"Southern Lakota" text
) | Name the english gloss for ha na | SELECT "English gloss" FROM table_72621 WHERE "Santee-Sisseton" = 'haŋȟ’áŋna' | wikisql |
CREATE TABLE table_77125 (
"Date" text,
"Opponent#" text,
"Site" text,
"Result" text,
"Attendance" text
) | What is the Site when the date is 11/11/1950? | SELECT "Site" FROM table_77125 WHERE "Date" = '11/11/1950' | wikisql |
CREATE TABLE table_name_66 (
candidate_name VARCHAR,
votes VARCHAR,
religion VARCHAR
) | Who has a religion of and more than 1853 votes? | SELECT candidate_name FROM table_name_66 WHERE votes > 1853 AND religion = "☪" | sql_create_context |
CREATE TABLE table_48363 (
"Branding" text,
"Callsign" text,
"Frequency" text,
"Power" text,
"Location" text
) | What is the Location of the Frequency with a Callsign of DXBL? | SELECT "Location" FROM table_48363 WHERE "Callsign" = 'dxbl' | wikisql |
CREATE TABLE table_69643 (
"Tournament" text,
"Date" text,
"Surface" text,
"Round" text,
"Opponent" text
) | Name the date for hard surface at maybelline classic with opponent of wendy turnbull | SELECT "Date" FROM table_69643 WHERE "Surface" = 'hard' AND "Tournament" = 'maybelline classic' AND "Opponent" = 'wendy turnbull' | wikisql |
CREATE TABLE table_18308 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What year was Jerry Huckaby first elected? | SELECT "First elected" FROM table_18308 WHERE "Incumbent" = 'Jerry Huckaby' | wikisql |
CREATE TABLE table_name_85 (
played VARCHAR,
position VARCHAR,
points VARCHAR
) | Which Played has a Position of 3, and a Points smaller than 15? | SELECT COUNT(played) FROM table_name_85 WHERE position = 3 AND points < 15 | sql_create_context |
CREATE TABLE table_name_84 (
appearances VARCHAR,
team VARCHAR
) | How many apperances for shakhtar donetsk? | SELECT COUNT(appearances) FROM table_name_84 WHERE team = "shakhtar donetsk" | sql_create_context |
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,... | show me a list of flights from BOSTON to ATLANTA leaving after 1200 and arriving before 1900 | 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 ((flight.arrival_time <= 1900 AND flight.departure_time > 1200) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND flight.to... | atis |
CREATE TABLE table_28664 (
"Week" real,
"Date" text,
"Kickoff" text,
"Opponent" text,
"Final score" text,
"Team record" text,
"Game site" text,
"Attendance" real
) | Name the game site for l 26 42 | SELECT "Game site" FROM table_28664 WHERE "Final score" = 'L 26–42' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | tell me the number of hispanic/latino-puerto rican patients who are less than 67 years of age. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND demographic.age < "67" | mimicsql_data |
CREATE TABLE player (
player_id number,
player text,
years_played text,
total_wl text,
singles_wl text,
doubles_wl text,
team number
)
CREATE TABLE team (
team_id number,
name text
)
CREATE TABLE match_season (
season number,
player text,
position text,
country numb... | What are the names of teams that do no have match season record? | SELECT name FROM team WHERE NOT team_id IN (SELECT team FROM match_season) | spider |
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 d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE chart... | what is the maximum total hospital cost to include inject anticoagulant since 2105? | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'inject anticoagulant')) AND STRFTIME('%y', cost.chargetim... | mimic_iii |
CREATE TABLE table_204_583 (
id number,
"capacitor type" text,
"capacity" text,
"volts" text,
"temp." text,
"energy-to-weight ratio" text,
"power-to-weight ratio" text
) | what comes after 2.7 volts | SELECT "volts" FROM table_204_583 WHERE id > (SELECT id FROM table_204_583 WHERE "volts" = 2.7 ORDER BY id DESC LIMIT 1) ORDER BY id LIMIT 1 | squall |
CREATE TABLE mzb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | 参保人02480290的门诊检查在2000年4月19日到2001年4月10日之间一共花了多少钱? | SELECT SUM(t_kc22.AMOUNT) FROM t_kc22 JOIN mzb ON mzb.MED_ORG_DEPT_CD = t_kc22.MED_CLINIC_ID WHERE mzb.PERSON_NM = '02480290' AND t_kc22.STA_DATE BETWEEN '2000-04-19' AND '2001-04-10' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_typ... | when did first patient 17953 receive a procedure until 2102? | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17953) AND STRFTIME('%y', procedures_icd.charttime) <= '2102' ORDER BY procedures_icd.charttime LIMIT 1 | mimic_iii |
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 ... | 在检验结果指标的记录中标号为94553760413所对应的检验报告单号是多少呢? | SELECT jyjgzbb.BGDH FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '94553760413' | css |
CREATE TABLE zyjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
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,
... | 患者王飞燕有哪些门诊就诊的检验报告日期在2020-10-11以后?查询这些门诊就诊的流水号 | SELECT mzjzjlb.JZLSH 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 = '王飞燕' AND NOT mzjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ <= '2020-10-11' UNI... | css |
CREATE TABLE table_name_37 (
player VARCHAR,
place VARCHAR,
country VARCHAR
) | Who placed t1 in Scotland? | SELECT player FROM table_name_37 WHERE place = "t1" AND country = "scotland" | sql_create_context |
CREATE TABLE pilot (
name VARCHAR,
age INTEGER,
pilot_id VARCHAR
)
CREATE TABLE MATCH (
winning_pilot VARCHAR
) | find the name and age of the pilot who has won the most number of times among the pilots who are younger than 30. | SELECT t1.name, t1.age FROM pilot AS t1 JOIN MATCH AS t2 ON t1.pilot_id = t2.winning_pilot WHERE t1.age < 30 GROUP BY t2.winning_pilot ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TE... | Please give me a bar chart that counts the number of grape of wine, list in ascending by the total number. | SELECT Grape, COUNT(Grape) FROM wine GROUP BY Grape ORDER BY COUNT(Grape) | nvbench |
CREATE TABLE table_name_98 (
county VARCHAR,
location VARCHAR
) | What county is the St. Augustine bridge in? | SELECT county FROM table_name_98 WHERE location = "st. augustine" | sql_create_context |
CREATE TABLE table_58506 (
"Constructor" text,
"Chassis" text,
"Engine" text,
"Tyre" text,
"Driver" text,
"Rounds" text
) | Which rounds did Vic Elford with a Ford cosworth dfv 3.0 v8 engine have? | SELECT "Rounds" FROM table_58506 WHERE "Driver" = 'vic elford' AND "Engine" = 'ford cosworth dfv 3.0 v8' | wikisql |
CREATE TABLE table_3161 (
"Saddle cloth" real,
"Horse" text,
"Trainer" text,
"Jockey" text,
"Weight (kg)" text,
"Barrier [b ]" real,
"Placing" text
) | Who was the trainer when the jockey was Luke Nolen? | SELECT "Trainer" FROM table_3161 WHERE "Jockey" = 'Luke Nolen' | wikisql |
CREATE TABLE table_27882867_8 (
record VARCHAR,
team VARCHAR
) | What was the team's record against philadelphia? | SELECT record FROM table_27882867_8 WHERE team = "Philadelphia" | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE medication (
me... | is patient 022-17495's temperature last measured on the first intensive care unit visit greater than the value second to last measured on the first intensive care unit visit? | SELECT (SELECT vitalperiodic.temperature FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-17495') AND NOT patient.unitdischargetime I... | eicu |
CREATE TABLE table_60432 (
"Date" text,
"Venue" text,
"Score" text,
"Competition" text,
"Report" text
) | What is the Venue of the Competition with a Score of 0 2? | SELECT "Venue" FROM table_60432 WHERE "Score" = '0–2' | wikisql |
CREATE TABLE table_name_8 (
date VARCHAR,
class VARCHAR,
race VARCHAR
) | On which date was the GT class at Monterey Sports Car Grand Prix? | SELECT date FROM table_name_8 WHERE class = "gt" AND race = "monterey sports car grand prix" | sql_create_context |
CREATE TABLE table_30480 (
"Parent unit" text,
"Geschwader Base" text,
"Unit (Gruppe/Staffel)" text,
"Aircraft Type" text,
"Commanding Officer" text
) | Name the aircraft type for furstenau/vorden | SELECT "Aircraft Type" FROM table_30480 WHERE "Geschwader Base" = 'Furstenau/Vorden' | wikisql |
CREATE TABLE table_name_64 (
position VARCHAR,
venue VARCHAR
) | What Position is listed against a Venue of Debrecen, Hungary | SELECT position FROM table_name_64 WHERE venue = "debrecen, hungary" | sql_create_context |
CREATE TABLE table_name_23 (
music VARCHAR,
choreographer_s_ VARCHAR
) | What is the music for choreographer sabina dalfj ll? | SELECT music FROM table_name_23 WHERE choreographer_s_ = "sabina dalfjäll" | sql_create_context |
CREATE TABLE table_204_54 (
id number,
"pondicherry assembly" text,
"duration" text,
"name of m.l.a." text,
"party affiliation" text,
"election year" number
) | was v. vaithilingam a member of the indian national congress or the janata party ? | SELECT "party affiliation" FROM table_204_54 WHERE "name of m.l.a." = 'v. vaithilingam' | squall |
CREATE TABLE table_4554 (
"Round" real,
"Name" text,
"Circuit" text,
"Date" text,
"Winning driver" text,
"Winning car" text
) | What circuit did Rupert Keegan win in round 8? | SELECT "Circuit" FROM table_4554 WHERE "Winning driver" = 'rupert keegan' AND "Round" = '8' | wikisql |
CREATE TABLE geographic (
city_name varchar,
county varchar,
region varchar
)
CREATE TABLE restaurant (
id int,
name varchar,
food_type varchar,
city_name varchar,
rating "decimal
)
CREATE TABLE location (
restaurant_id int,
house_number int,
street_name varchar,
city_n... | where is a arabic restaurant on buchanan in san francisco ? | SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'san francisco' AND location.street_name = 'buchanan' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5 | restaurants |
CREATE TABLE table_45912 (
"Winner" text,
"Country" text,
"Winter Olympics" text,
"FIS Nordic World Ski Championships" text,
"Holmenkollen" text
) | Which Winner has a Winter Olympics of 1968? | SELECT "Winner" FROM table_45912 WHERE "Winter Olympics" = '1968' | wikisql |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE medication (
medi... | has patient 030-53416 been treated with a bronchoscopy? | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-53416')) AND treatment.treatmentname = 'bronchoscopy' | eicu |
CREATE TABLE table_79813 (
"Dish" text,
"Callsign" text,
"Network" text,
"Resolution" text,
"City of License" text,
"Official Website" text
) | Name the resolution for dish of 5270 | SELECT "Resolution" FROM table_79813 WHERE "Dish" = '5270' | wikisql |
CREATE TABLE table_name_22 (
crowd INTEGER,
away_team VARCHAR
) | What is the average crowd size for games with north melbourne as the away side? | SELECT AVG(crowd) FROM table_name_22 WHERE away_team = "north melbourne" | sql_create_context |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
... | did patient 14467 have a albumin laboratory test in 08/this year? | SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'albumin') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14467) AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME()... | mimic_iii |
CREATE TABLE table_5494 (
"Date" text,
"Tournament" text,
"Winning score" text,
"To par" text,
"Margin of victory" text
) | Which Winning score has a Tournament of walt disney world/oldsmobile classic? | SELECT "Winning score" FROM table_5494 WHERE "Tournament" = 'walt disney world/oldsmobile classic' | wikisql |
CREATE TABLE table_203_499 (
id number,
"place" text,
"player" text,
"country" text,
"score" text,
"to par" number,
"money ($)" number
) | who came next after seve ballesteros ? | SELECT "player" FROM table_203_499 WHERE "place" = (SELECT "place" FROM table_203_499 WHERE "player" = 'seve ballesteros') + 1 | squall |
CREATE TABLE table_name_1 (
final VARCHAR,
lane VARCHAR
) | What were the final time for the swimmer on lane 4? | SELECT final FROM table_name_1 WHERE lane = 4 | sql_create_context |
CREATE TABLE table_35302 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | Which venue is the friendly match in? | SELECT "Venue" FROM table_35302 WHERE "Competition" = 'friendly match' | wikisql |
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,
... | calculate the minimum days for which patients who died before 2168 stayed in hospital. | SELECT MIN(demographic.days_stay) FROM demographic WHERE demographic.dod_year < "2168.0" | mimicsql_data |
CREATE TABLE table_18409 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | how many incumbent with district being tennessee 5 | SELECT COUNT("Incumbent") FROM table_18409 WHERE "District" = 'Tennessee 5' | wikisql |
CREATE TABLE table_14139408_1 (
class VARCHAR,
poles INTEGER
) | how many class with poles being bigger than 1.0 | SELECT COUNT(class) FROM table_14139408_1 WHERE poles > 1.0 | sql_create_context |
CREATE TABLE table_name_17 (
high_rebounds VARCHAR,
team VARCHAR
) | What are the high rebounds of team @ Charlotte? | SELECT high_rebounds FROM table_name_17 WHERE team = "@ charlotte" | sql_create_context |
CREATE TABLE table_32658 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Attendance" text
) | When was the game against the Indianapolis Colts? | SELECT "Date" FROM table_32658 WHERE "Opponent" = 'indianapolis colts' | wikisql |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,... | price of flight from NASHVILLE to CLEVELAND | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'NASHVILLE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.ci... | atis |
CREATE TABLE table_name_39 (
enrollment VARCHAR,
ihsaa_class VARCHAR,
mascot VARCHAR
) | What is the enrollment at the school with IHSAA class A and where mascot is the Vikings? | SELECT enrollment FROM table_name_39 WHERE ihsaa_class = "a" AND mascot = "vikings" | sql_create_context |
CREATE TABLE table_name_38 (
county VARCHAR,
ihsaa_class VARCHAR,
mascot VARCHAR
) | Which IHSAA class A school are the Cavaliers from? | SELECT county FROM table_name_38 WHERE ihsaa_class = "a" AND mascot = "cavaliers" | sql_create_context |
CREATE TABLE table_name_12 (
venue VARCHAR,
tournament VARCHAR,
year VARCHAR
) | What Venue held the Olympic games in 2012? | SELECT venue FROM table_name_12 WHERE tournament = "olympic games" AND year = 2012 | sql_create_context |
CREATE TABLE conference (
cid int,
homepage varchar,
name varchar
)
CREATE TABLE writes (
aid int,
pid int
)
CREATE TABLE publication (
abstract varchar,
cid int,
citation_num int,
jid int,
pid int,
reference_num int,
title varchar,
year int
)
CREATE TABLE author (... | return me the author who has the most number of papers in the VLDB conference . | SELECT author.name FROM author, conference, publication, writes WHERE conference.name = 'VLDB' AND publication.cid = conference.cid AND writes.aid = author.aid AND writes.pid = publication.pid GROUP BY author.name ORDER BY COUNT(DISTINCT (publication.title)) DESC LIMIT 1 | academic |
CREATE TABLE table_80087 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
) | Name the loss for record of 71-81 | SELECT "Loss" FROM table_80087 WHERE "Record" = '71-81' | wikisql |
CREATE TABLE table_44797 (
"Date" text,
"Venue" text,
"Opponents" text,
"Score" text,
"Comp" text,
"Attendance" text
) | Which Score has a Venue of idrottsparken? | SELECT "Score" FROM table_44797 WHERE "Venue" = 'idrottsparken' | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | count the number of patients whose age is less than 83 and days of hospital stay is greater than 6? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "83" AND demographic.days_stay > "6" | mimicsql_data |
CREATE TABLE table_46861 (
"Country" text,
"Backstroke leg" text,
"Breaststroke leg" text,
"Butterfly leg" text,
"Freestyle leg" text
) | What is the freestyle leg for the Netherlands? | SELECT "Freestyle leg" FROM table_46861 WHERE "Country" = 'netherlands' | wikisql |
CREATE TABLE table_79991 (
"Game" real,
"Date" text,
"Score" text,
"Location" text,
"Time" text,
"Attendance" real
) | What was the Attendance when the Time was 2:13? | SELECT MIN("Attendance") FROM table_79991 WHERE "Time" = '2:13' | wikisql |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | For all employees who have the letters D or S in their first name, give me the comparison about the sum of manager_id over the job_id , and group by attribute job_id by a bar chart. | SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID | nvbench |
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... | Return a bar chart about the distribution of All_Games and School_ID , and show in ascending by the bar. | SELECT All_Games, School_ID FROM basketball_match ORDER BY All_Games | nvbench |
CREATE TABLE table_name_21 (
attendance INTEGER,
points VARCHAR,
arena VARCHAR
) | What was the lowest Attendance for the Staples Center Arena when the Points were over 14? | SELECT MIN(attendance) FROM table_name_21 WHERE points > 14 AND arena = "staples center" | sql_create_context |
CREATE TABLE table_203_230 (
id number,
"place" text,
"player" text,
"country" text,
"score" text,
"to par" number
) | how many placed in the t4 category ? | SELECT COUNT(*) FROM table_203_230 WHERE "place" = 't4' | squall |
CREATE TABLE table_name_4 (
rank INTEGER,
canton VARCHAR
) | Wich rank is given to the Canton of Schaffhausen? | SELECT SUM(rank) FROM table_name_4 WHERE canton = "schaffhausen" | sql_create_context |
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,
... | 从08年7月20日到13年10月17日这段时间里,患者38917711所有检验结果指标记录中的检测方法都有什么啊? | SELECT jyjgzbb.JCFF FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH... | css |
CREATE TABLE table_name_34 (
tournament VARCHAR
) | In which tournament did Pauline Parmentier finish LQ in 2007? | SELECT tournament FROM table_name_34 WHERE 2007 = "lq" | sql_create_context |
CREATE TABLE table_74230 (
"Year Location" text,
"Mens Singles" text,
"Womens Singles" text,
"Mens Doubles" text,
"Womens Doubles" text
) | Who won Womens Singles in the year that Ma Lin won Mens Singles? | SELECT "Womens Singles" FROM table_74230 WHERE "Mens Singles" = 'Ma Lin' | wikisql |
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 text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | 查查报告单的日期,就是那个编号为61624310832的检验报告单 | SELECT BGRQ FROM jybgb WHERE BGDH = '61624310832' | css |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.