context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_22980 (
"Athlete" text,
"Class" text,
"Event" text,
"Bout 1" text,
"Bout 2" text,
"Bout 3" text,
"Bout 4" text,
"Bout 5" text,
"Bout 6" text,
"Rank" text,
"1/8 Finals" text,
"Quarterfinals" text,
"Semifinals" text
) | what were the result in semifinals when saengsawang ( tha ) l 9-15 was in 1/8 finals? | SELECT "Semifinals" FROM table_22980 WHERE "1/8 Finals" = 'Saengsawang ( THA ) L 9-15' | wikisql |
CREATE TABLE table_name_46 (
opponent VARCHAR,
surface VARCHAR,
date VARCHAR
) | Who is the opponent on November 22, 2009, clay surface? | SELECT opponent FROM table_name_46 WHERE surface = "clay" AND date = "november 22, 2009" | sql_create_context |
CREATE TABLE table_name_87 (
founded INTEGER,
coach VARCHAR,
location VARCHAR
) | What is the average year that the club located in enfield was founded with an unknown coach? | SELECT AVG(founded) FROM table_name_87 WHERE coach = "unknown" AND location = "enfield" | sql_create_context |
CREATE TABLE table_name_44 (
uefa_cup VARCHAR,
total INTEGER
) | What is the total number of UEFA Cup(s), when Total is greater than 3? | SELECT COUNT(uefa_cup) FROM table_name_44 WHERE total > 3 | sql_create_context |
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... | provide the number of patients whose marital status is single and diagnoses long title is other preterm infants, 2,500 grams and over? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.long_title = "Other preterm infants, 2,500 grams and over" | mimicsql_data |
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,
... | what are the genders of patient 006-99708? | SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '006-99708' | eicu |
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 patient (
uniquep... | what was the organism found in the last sputum, expectorated of patient 031-15417 until 27 months ago? | SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-15417')) AND microlab.culturesite = 'sputum, expectorated' AND DATETI... | eicu |
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
... | what are the cities that AA serves | SELECT DISTINCT city.city_code FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND flight.airline_code = 'AA' AND flight.from_airport = airport_service.airport_code | atis |
CREATE TABLE market (
Market_ID int,
Country text,
Number_cities int
)
CREATE TABLE film (
Film_ID int,
Title text,
Studio text,
Director text,
Gross_in_dollar int
)
CREATE TABLE film_market_estimation (
Estimation_ID int,
Low_Estimate real,
High_Estimate real,
Film_ID ... | How many films in each type? Show me a pie chart. | SELECT Type, COUNT(Type) FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Type | nvbench |
CREATE TABLE table_name_81 (
inclination VARCHAR,
eccentricity VARCHAR
) | What Inclination has Eccentricity of 0.06 +0.06 0.11? | SELECT inclination FROM table_name_81 WHERE eccentricity = "0.06 +0.06 −0.11" | sql_create_context |
CREATE TABLE table_203_510 (
id number,
"township" text,
"fips" number,
"population\ncenter" text,
"population" number,
"population\ndensity\n(/mi2)" number,
"population\ndensity\n(/km2)" number,
"land area\n(mi2)" number,
"land area\n(km2)" number,
"water area\n(mi2)" number,
... | how much greater is the population of clark township than freeman township ? | SELECT (SELECT "population" FROM table_203_510 WHERE "township" = 'clark') - (SELECT "population" FROM table_203_510 WHERE "township" = 'freeman') | squall |
CREATE TABLE table_name_57 (
year INTEGER,
venue VARCHAR
) | What year was the venue in Barcelona, Spain? | SELECT MIN(year) FROM table_name_57 WHERE venue = "barcelona, spain" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | what is gender of subject id 26285? | SELECT demographic.gender FROM demographic WHERE demographic.subject_id = "26285" | mimicsql_data |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
... | i'd like to book a flight from SAN DIEGO to TORONTO | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN DIEGO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TORO... | atis |
CREATE TABLE table_24463470_1 (
setting VARCHAR,
difficulty VARCHAR
) | What is the setting for the hard difficulty? | SELECT setting FROM table_24463470_1 WHERE difficulty = "Hard" | sql_create_context |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose... | is patient 22753's heart rate last measured on the last icu visit less than than first measured on the last icu visit? | SELECT (SELECT chartevents.valuenum 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 = 22753) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents... | mimic_iii |
CREATE TABLE table_name_57 (
outcome VARCHAR,
score VARCHAR
) | What was the Outcome of the match with a Score of w/o? | SELECT outcome FROM table_name_57 WHERE score = "w/o" | sql_create_context |
CREATE TABLE table_name_78 (
trophy VARCHAR,
season VARCHAR
) | What is the Trophy with a Season with 2008 2009? | SELECT trophy FROM table_name_78 WHERE season = "2008–2009" | sql_create_context |
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimme... | Find meter_200 and the average of meter_100 , and group by attribute meter_200, and visualize them by a bar chart, I want to list mean meter 100 from low to high order. | SELECT meter_200, AVG(meter_100) FROM swimmer GROUP BY meter_200 ORDER BY AVG(meter_100) | nvbench |
CREATE TABLE table_204_170 (
id number,
"player" text,
"position" text,
"games\nstarted" text,
"hometown" text,
"height" text,
"weight" number,
"age" number
) | james bland catlett and john maulbetsch played which position in common ? | SELECT "position" FROM table_204_170 WHERE "player" = 'james bland catlett' | squall |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
Creati... | closes votes per question batchsize. Inspired on this question http://meta.stackoverflow.com/questions/208311/regarding-the-stack-overflow-close-review-queue | SELECT cnt, COUNT(*) AS num_of_Q FROM (SELECT v.PostId, COUNT(*) AS cnt FROM Votes AS v INNER JOIN Posts AS p ON p.Id = v.PostId WHERE VoteTypeId = 6 AND p.PostTypeId = 1 AND p.ClosedDate IS NULL GROUP BY v.PostId) AS rawcnt GROUP BY cnt ORDER BY cnt DESC | sede |
CREATE TABLE table_79045 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real
) | Which player won in 1993? | SELECT "Player" FROM table_79045 WHERE "Year(s) won" = '1993' | wikisql |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswer... | Top users in Vancouver in 2017. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Age FROM Users WHERE LastAccessDate > '20170101' AND (LOWER(Location) LIKE '%vancouver%') ORDER BY Reputation DESC | sede |
CREATE TABLE table_57631 (
"Name of horse" text,
"Year inducted" real,
"Year foaled" text,
"Sire" text,
"Broodmare sire" text,
"Discipline" text
) | What horse was induced in 2011 with a sire of cowboy p-12? | SELECT "Name of horse" FROM table_57631 WHERE "Year inducted" = '2011' AND "Broodmare sire" = 'cowboy p-12' | wikisql |
CREATE TABLE table_6480 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | Which record has a date of January 29? | SELECT "Record" FROM table_6480 WHERE "Date" = 'january 29' | wikisql |
CREATE TABLE table_203_321 (
id number,
"sheriff" text,
"start of term" number
) | who was the sheriff in suffolk county before amza biggs first term there as sheriff ? | SELECT "sheriff" FROM table_203_321 WHERE "start of term" < (SELECT "start of term" FROM table_203_321 WHERE "sheriff" = 'amza biggs' ORDER BY "start of term" LIMIT 1) ORDER BY "start of term" DESC LIMIT 1 | squall |
CREATE TABLE table_name_83 (
attendance VARCHAR,
date VARCHAR
) | How many were in Attendance on the Date May 29? | SELECT COUNT(attendance) FROM table_name_83 WHERE date = "may 29" | sql_create_context |
CREATE TABLE product (
product_id number,
product text,
dimensions text,
dpi number,
pages_per_minute_color number,
max_page_size text,
interface text
)
CREATE TABLE store (
store_id number,
store_name text,
type text,
area_size number,
number_of_product_category number,... | Find all the distinct district names ordered by city area in descending. | SELECT DISTINCT district_name FROM district ORDER BY city_area DESC | spider |
CREATE TABLE table_8600 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | What is the outcome of the match with opponent Jade Curtis? | SELECT "Outcome" FROM table_8600 WHERE "Opponent" = 'jade curtis' | wikisql |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 有哪些医疗费用明细项目是名称包含超声的科室在25464397708就诊过程中开出的? | SELECT * FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '25464397708' AND t_kc22.MED_ORG_DEPT_NM LIKE '%超声%' | css |
CREATE TABLE table_42730 (
"Date" text,
"Tournament" text,
"Winning score" text,
"To par" text,
"Margin of victory" text,
"Runner(s)-up" text
) | What is the Date for the wgc-accenture match play championship? | SELECT "Date" FROM table_42730 WHERE "Tournament" = 'wgc-accenture match play championship' | wikisql |
CREATE TABLE table_61733 (
"Result" text,
"Record" text,
"Opponent" text,
"Method" text,
"Location" text
) | What is the location when the record is 9-7? | SELECT "Location" FROM table_61733 WHERE "Record" = '9-7' | wikisql |
CREATE TABLE teachers (
teacher_id number,
address_id number,
first_name text,
middle_name text,
last_name text,
gender text,
cell_mobile_number text,
email_address text,
other_details text
)
CREATE TABLE ref_address_types (
address_type_code text,
address_type_description t... | Find all information about student addresses, and sort by monthly rental in descending order. | SELECT * FROM student_addresses ORDER BY monthly_rental DESC | spider |
CREATE TABLE table_57445 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the home team score with Away team Richmond? | SELECT "Home team score" FROM table_57445 WHERE "Away team" = 'richmond' | wikisql |
CREATE TABLE table_68097 (
"Year" real,
"Group" text,
"Award" text,
"Film/Show" text,
"Result" text
) | After 2008, which Group has the Result, nominated, and the Award, Best Lead Actor in a Television Drama? | SELECT "Group" FROM table_68097 WHERE "Result" = 'nominated' AND "Year" > '2008' AND "Award" = 'best lead actor in a television drama' | wikisql |
CREATE TABLE table_43045 (
"Volume" text,
"Series" text,
"Title" text,
"Cover" text,
"Published" text,
"ISBN" text
) | What cover has a published date of May 27, 2009 (hc) May 20, 2009 (tpb)? | SELECT "Cover" FROM table_43045 WHERE "Published" = 'may 27, 2009 (hc) may 20, 2009 (tpb)' | wikisql |
CREATE TABLE store_product (
Store_ID int,
Product_ID int
)
CREATE TABLE store (
Store_ID int,
Store_Name text,
Type text,
Area_size real,
Number_of_product_category real,
Ranking int
)
CREATE TABLE district (
District_ID int,
District_name text,
Headquartered_City text,
... | Find the number of stores in each city Plot them as bar chart, and show in descending by the y axis please. | SELECT Headquartered_City, COUNT(*) FROM store AS t1 JOIN store_district AS t2 ON t1.Store_ID = t2.Store_ID JOIN district AS t3 ON t2.District_ID = t3.District_ID GROUP BY t3.Headquartered_City ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_45069 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | what is the date when the away team is crystal palace? | SELECT "Date" FROM table_45069 WHERE "Away team" = 'crystal palace' | wikisql |
CREATE TABLE table_24535095_2 (
listed_owner_s_ VARCHAR,
crew_chief VARCHAR
) | Name the listed owner for mike garvey | SELECT listed_owner_s_ FROM table_24535095_2 WHERE crew_chief = "Mike Garvey" | sql_create_context |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ tim... | 患者28348727的检验结果指标均异常的检验报告单号是什么 | SELECT jybgb.BGDH FROM hz_info JOIN wdmzjzjlb JOIN jybgb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '28348727' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FRO... | css |
CREATE TABLE table_name_24 (
draw INTEGER,
televoting VARCHAR,
jury VARCHAR
) | Televoting of 9, and a Jury smaller than 10 had what sum of draw? | SELECT SUM(draw) FROM table_name_24 WHERE televoting = 9 AND jury < 10 | sql_create_context |
CREATE TABLE table_48736 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Which Record has a Score of w 107 102 (ot)? | SELECT "Record" FROM table_48736 WHERE "Score" = 'w 107–102 (ot)' | wikisql |
CREATE TABLE table_475 (
"Stage" real,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Intergiro classification" text,
"Trofeo Fast Team" text
) | What is the trofeo fast team on stage 8? | SELECT "Trofeo Fast Team" FROM table_475 WHERE "Stage" = '8' | wikisql |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 药品963819在哪几家医院患者27333560被开出过? | SELECT t_kc22.t_kc21_MED_SER_ORG_NO FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '27333560' AND t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '963819') | css |
CREATE TABLE table_29023680_2 (
company VARCHAR,
date_of_election_commission VARCHAR
) | How many company commanders were commissioned or elected on November 12, 1861? | SELECT COUNT(company) AS Commander FROM table_29023680_2 WHERE date_of_election_commission = "November 12, 1861" | sql_create_context |
CREATE TABLE table_62015 (
"Outcome" text,
"Edition" real,
"Round" text,
"Opponent Team" text,
"Surface" text,
"Opponent" text,
"Score" text
) | What is Score, when Outcome is Loser, and when Edition is 2011? | SELECT "Score" FROM table_62015 WHERE "Outcome" = 'loser' AND "Edition" = '2011' | wikisql |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE program (
program_id int,
name varchar,
... | Which upper level classes aren 't going to require 556 ? | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite, program_course WHERE NOT COURSE_1.course_id IN (SELECT course_prerequisite.pre_course_id FROM course AS COURSE_0, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.cours... | advising |
CREATE TABLE table_name_23 (
attendance INTEGER,
away_team VARCHAR
) | How many in total were in attendance at games where Chelsea was the away team? | SELECT SUM(attendance) FROM table_name_23 WHERE away_team = "chelsea" | sql_create_context |
CREATE TABLE mzjybgb (
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,
... | 那个在2001年11月11日到15年3月7日这段时间里,16229426病患的全部检察结果指标记录的检测人为66553479的检查指标流水号是多少? | SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGD... | css |
CREATE TABLE table_2789 (
"Date" text,
"Location" text,
"Opponent" text,
"Cyclones Points" real,
"Opp. Points" real,
"Record" text
) | When did the team play against Niagara? | SELECT "Date" FROM table_2789 WHERE "Opponent" = 'Niagara' | wikisql |
CREATE TABLE table_name_34 (
score VARCHAR,
runner_up VARCHAR,
country VARCHAR,
champion VARCHAR
) | What is the score of the match played in England where Peter McEvoy was the champion and Paul McKellar was runner-up? | SELECT score FROM table_name_34 WHERE country = "england" AND champion = "peter mcevoy" AND runner_up = "paul mckellar" | sql_create_context |
CREATE TABLE table_1939405_2 (
latin_americans_2011 INTEGER,
province VARCHAR
) | How many Latin Americans lived in 2011 in Saskatchewan? | SELECT MIN(latin_americans_2011) FROM table_1939405_2 WHERE province = "Saskatchewan" | sql_create_context |
CREATE TABLE table_2781227_9 (
position VARCHAR,
player VARCHAR
) | What position(s) does barrie moore play? | SELECT position FROM table_2781227_9 WHERE player = "Barrie Moore" | sql_create_context |
CREATE TABLE table_11545282_12 (
nationality VARCHAR,
player VARCHAR
) | Which country is Jim Les from? | SELECT nationality FROM table_11545282_12 WHERE player = "Jim Les" | sql_create_context |
CREATE TABLE table_name_18 (
away_team VARCHAR
) | What was Fitzroy's score when they were the away team? | SELECT away_team AS score FROM table_name_18 WHERE away_team = "fitzroy" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | count the number of office admitted patients who had idiopathic normal pressure hydrocephalus diagnoses. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND diagnoses.long_title = "Idiopathic normal pressure hydrocephalus (INPH)" | mimicsql_data |
CREATE TABLE employees (
employee_id number,
role_code text,
employee_name text,
gender_mfu text,
date_of_birth time,
other_details text
)
CREATE TABLE ref_locations (
location_code text,
location_name text,
location_description text
)
CREATE TABLE all_documents (
document_id n... | List all document type codes and document type names. | SELECT document_type_code, document_type_name FROM ref_document_types | spider |
CREATE TABLE table_name_60 (
class VARCHAR,
number_at_lincoln VARCHAR,
wheel_arrangement VARCHAR
) | Which Class has a Number at Lincoln smaller than 1 and a Wheel Arrangement of 0-6-0? | SELECT class FROM table_name_60 WHERE number_at_lincoln < 1 AND wheel_arrangement = "0-6-0" | sql_create_context |
CREATE TABLE table_name_37 (
Id VARCHAR
) | What is the 1952 rate when the 1954 is more than 4.2? | SELECT SUM(1952) FROM table_name_37 WHERE 1954 > 4.2 | sql_create_context |
CREATE TABLE table_name_75 (
score VARCHAR,
team VARCHAR
) | WHAT IS THE SCORE WITH THE TEAM OF INDIANA? | SELECT score FROM table_name_75 WHERE team = "indiana" | sql_create_context |
CREATE TABLE table_18987377_1 (
film_title_used_in_nomination VARCHAR,
director VARCHAR
) | Name the film titled for marcel camus category:articles with hcards | SELECT film_title_used_in_nomination FROM table_18987377_1 WHERE director = "Marcel Camus Category:Articles with hCards" | sql_create_context |
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 lab (
subject_id text,
hadm_id text,
... | find out the birth date and drug prescribed to patient jerry deberry. | SELECT demographic.dob, prescriptions.drug FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Jerry Deberry" | mimicsql_data |
CREATE TABLE table_76442 (
"Date" text,
"Event" text,
"City" text,
"Oil Pattern" text,
"Winner (Title #)" text,
"Runner-up" text,
"Score" text
) | Which Score has an Event of constructionjobs.com classic? | SELECT "Score" FROM table_76442 WHERE "Event" = 'constructionjobs.com classic' | wikisql |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
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 T... | For all employees who have the letters D or S in their first name, draw a bar chart about the distribution of hire_date and the sum of manager_id bin hire_date by weekday, and I want to sort by the Y-axis in asc. | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(MANAGER_ID) | nvbench |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospit... | tell me the name of the lab tests that patient 033-12085 first received until 38 months ago? | SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-12085')) AND DATETIME(lab.labresulttime) <= DATETIME(CURRENT_TIME(), '-38 month') ORD... | eicu |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 把2000年2月4日到2011年8月12日期间患者方芳芳一共在医院看过多少次病查看一下 | SELECT (SELECT COUNT(*) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.person_info_XM = '方芳芳' AND mzjzjlb.JZKSRQ BETWEEN '2000-02-04' AND '2011-08-12') + (SELECT COUNT(*) FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AN... | css |
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 zyjzjlb (
CYBQDM text,
CYBQMC... | 患有精神发育迟滞的人在门诊诊断确诊后其转铁蛋白数值的平均值以及最值数据是什么样子的? | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDSM = '精神发育迟滞' AND jyjgzbb.JCZBMC = ... | css |
CREATE TABLE table_name_2 (
outcome VARCHAR,
score VARCHAR
) | What is the Outcome of the match with a Score of 6 3, 6 4? | SELECT outcome FROM table_name_2 WHERE score = "6–3, 6–4" | sql_create_context |
CREATE TABLE table_name_44 (
competition VARCHAR,
result VARCHAR
) | Which competition had a result of 1-0? | SELECT competition FROM table_name_44 WHERE result = "1-0" | sql_create_context |
CREATE TABLE table_57979 (
"Player" text,
"Position" text,
"Date of Birth (Age)" text,
"Caps" real,
"Club/province" text
) | What player is a lock with 1 cap? | SELECT "Player" FROM table_57979 WHERE "Position" = 'lock' AND "Caps" = '1' | wikisql |
CREATE TABLE table_name_23 (
location VARCHAR,
individual VARCHAR
) | What is the Location when the individual was jos maria ca izares? | SELECT location FROM table_name_23 WHERE individual = "josé maria cañizares" | sql_create_context |
CREATE TABLE table_1140083_2 (
date VARCHAR,
race VARCHAR
) | How many days is the Monaco Grand Prix? | SELECT COUNT(date) FROM table_1140083_2 WHERE race = "Monaco Grand Prix" | sql_create_context |
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
)
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
) | Show me the total number of the flag of ships that are not steered by any captain with Midshipman rank using a bar graph, show in ascending by the x axis. | SELECT Flag, COUNT(Flag) FROM Ship WHERE NOT Ship_ID IN (SELECT Ship_ID FROM captain WHERE Rank = 'Midshipman') GROUP BY Flag ORDER BY Flag | nvbench |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(4... | For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of first_name and commission_pct . | SELECT FIRST_NAME, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_26250155_1 (
original_artist VARCHAR,
theme VARCHAR
) | Who was the original artist of the group performance theme? | SELECT original_artist FROM table_26250155_1 WHERE theme = "Group Performance" | sql_create_context |
CREATE TABLE table_2293402_2 (
nickname VARCHAR,
founded VARCHAR
) | Name the nickname that was founded 1798 | SELECT nickname FROM table_2293402_2 WHERE founded = 1798 | sql_create_context |
CREATE TABLE table_name_37 (
away_team VARCHAR,
home_team VARCHAR
) | What did the away team score when playing Footscray? | SELECT away_team AS score FROM table_name_37 WHERE home_team = "footscray" | sql_create_context |
CREATE TABLE table_25595209_1 (
state_country VARCHAR,
skipper VARCHAR
) | How many states is Grant Wharington from? | SELECT COUNT(state_country) FROM table_25595209_1 WHERE skipper = "Grant Wharington" | sql_create_context |
CREATE TABLE table_1143966_1 (
pct__percentage VARCHAR,
won VARCHAR
) | Name the percentage where the amount won was 25 | SELECT pct__percentage FROM table_1143966_1 WHERE won = 25 | sql_create_context |
CREATE TABLE table_19861 (
"Year" real,
"Player" text,
"Country" text,
"Score" text,
"Margin of victory" text,
"Winners share ( $ )" real,
"Honoree(s)" text
) | For which country does Keith Fergus play? | SELECT "Country" FROM table_19861 WHERE "Player" = 'Keith Fergus' | wikisql |
CREATE TABLE table_23248940_6 (
high_points VARCHAR,
game VARCHAR
) | Who are all high points in game 14? | SELECT high_points FROM table_23248940_6 WHERE game = 14 | sql_create_context |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC... | 那个在2001年11月11日到15年3月7日这段时间里,16229426病患的全部检察结果指标记录的检测人为66553479的检查指标流水号是多少? | SELECT jyjgzbb.JYZBLSH 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 jybgb.BGDH = jyjgzbb.B... | css |
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 departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
... | Find employee with ID and name of the country presently where (s)he is working Visualize by bar chart, could you list Y in descending order? | SELECT COUNTRY_NAME, SUM(EMPLOYEE_ID) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID JOIN locations AS T3 ON T2.LOCATION_ID = T3.LOCATION_ID JOIN countries AS T4 ON T3.COUNTRY_ID = T4.COUNTRY_ID GROUP BY COUNTRY_NAME ORDER BY SUM(EMPLOYEE_ID) DESC | nvbench |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | provide the number of patients whose admission type is newborn and diagnoses long title is encephalopathy, unspecified? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "NEWBORN" AND diagnoses.long_title = "Encephalopathy, unspecified" | mimicsql_data |
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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE T... | For those employees who did not have any job in the past, return a bar chart about the distribution of hire_date and the average of salary bin hire_date by time, and sort the average of salary from high to low order please. | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(SALARY) DESC | nvbench |
CREATE TABLE table_27319183_7 (
date VARCHAR,
weekly_rank VARCHAR
) | What date was the show's weekly ranking 12? | SELECT date FROM table_27319183_7 WHERE weekly_rank = 12 | sql_create_context |
CREATE TABLE table_80326 (
"Week" real,
"Date" text,
"Visiting Team" text,
"Final Score" text,
"Host Team" text
) | What was the final score on week 14 ? | SELECT "Final Score" FROM table_80326 WHERE "Week" = '14' | wikisql |
CREATE TABLE table_name_66 (
grid INTEGER,
driver VARCHAR,
laps VARCHAR
) | What is the average grid for jack brabham going over 32 laps? | SELECT AVG(grid) FROM table_name_66 WHERE driver = "jack brabham" AND laps > 32 | sql_create_context |
CREATE TABLE table_name_84 (
score VARCHAR,
partner VARCHAR
) | what score is it with tathiana garbin as partner? | SELECT score FROM table_name_84 WHERE partner = "tathiana garbin" | sql_create_context |
CREATE TABLE table_15297 (
"First game" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Percentage" text
) | how many times is there more than 0 draws and more than 0 losses? | SELECT COUNT("Played") FROM table_15297 WHERE "Drawn" > '0' AND "Lost" > '0' | wikisql |
CREATE TABLE table_12329 (
"Name" text,
"No. Specimens" real,
"Abbr." text,
"Country" text,
"City" text
) | What is the abbreviation for the University of Tartu? | SELECT "Abbr." FROM table_12329 WHERE "Name" = 'university of tartu' | wikisql |
CREATE TABLE table_12095519_1 (
train_no VARCHAR,
destination VARCHAR
) | What train number is heading to amritsar? | SELECT train_no FROM table_12095519_1 WHERE destination = "Amritsar" | sql_create_context |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | Users with first-day closure and welcome comment. | SELECT udfp.OwnerUserId, COUNT(ph.Id) AS numclosures FROM (SELECT p.OwnerUserId, MIN(p.CreationDate) AS dfp FROM Posts AS p WHERE p.PostTypeId < 3 GROUP BY p.OwnerUserId) AS udfp LEFT OUTER JOIN Posts AS p ON p.OwnerUserId = udfp.OwnerUserId AND p.PostTypeId < 3 LEFT OUTER JOIN Comments AS c ON UPPER(c.Text) LIKE '%WEL... | sede |
CREATE TABLE table_18054886_1 (
title VARCHAR,
viewers__millions_ VARCHAR,
directed_by VARCHAR
) | Which title, directed by David Kendall, had 3.7 million viewers? | SELECT title FROM table_18054886_1 WHERE viewers__millions_ = "3.7" AND directed_by = "David Kendall" | sql_create_context |
CREATE TABLE table_name_23 (
full_name VARCHAR,
age¹ VARCHAR,
occupation² VARCHAR
) | What is Full Name, when Age is '20', and when Occupation is 'Student'? | SELECT full_name FROM table_name_23 WHERE age¹ = 20 AND occupation² = "student" | sql_create_context |
CREATE TABLE table_73241 (
"Cardinal direction" text,
"Burmese" text,
"Sanskrit" text,
"English" text,
"Planet" text,
"Sign" text
) | state the name of day in english where cardinal direction is east | SELECT "English" FROM table_73241 WHERE "Cardinal direction" = 'East' | wikisql |
CREATE TABLE table_56124 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who was the home team at Junction Oval when attendance was over 16,000? | SELECT "Home team" FROM table_56124 WHERE "Crowd" > '16,000' AND "Venue" = 'junction oval' | wikisql |
CREATE TABLE table_30917 (
"No. overall" real,
"No. for series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"UK viewers (million)" text
) | How many directed by entries have UK viewership over 6.16 million? | SELECT COUNT("Directed by") FROM table_30917 WHERE "UK viewers (million)" = '6.16' | wikisql |
CREATE TABLE table_36045 (
"State" text,
"Name" text,
"Hometown" text,
"Age 1" real,
"Talent" text
) | Whose talent was ballet en pointe? | SELECT "Name" FROM table_36045 WHERE "Talent" = 'ballet en pointe' | wikisql |
CREATE TABLE table_name_59 (
game VARCHAR,
date VARCHAR
) | What is the playoff Game on April 30? | SELECT game FROM table_name_59 WHERE date = "april 30" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.