context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_38010 (
"Surname" text,
"First" text,
"D.O.B." text,
"Uni#" real,
"Bats" text,
"Throws" text,
"Position" text
) | What's the Uni# of Timms, who has bats of R? | SELECT "Uni#" FROM table_38010 WHERE "Bats" = 'r' AND "Surname" = 'timms' | wikisql |
CREATE TABLE table_name_22 (
losing_bonus VARCHAR,
drawn VARCHAR,
lost VARCHAR
) | What is the losing bonus with 1 draw and 13 losses? | SELECT losing_bonus FROM table_name_22 WHERE drawn = "1" AND lost = "13" | sql_create_context |
CREATE TABLE table_name_85 (
engine_† VARCHAR,
chassis VARCHAR,
driver VARCHAR
) | Which constructor manufactured the car with a c24 chassis and which is driven by Jacques Villeneuve? | SELECT engine_† FROM table_name_85 WHERE chassis = "c24" AND driver = "jacques villeneuve" | sql_create_context |
CREATE TABLE table_1341930_38 (
candidates VARCHAR,
incumbent VARCHAR
) | How many incumbents come from alvin bush's district? | SELECT COUNT(candidates) FROM table_1341930_38 WHERE incumbent = "Alvin Bush" | sql_create_context |
CREATE TABLE ftxmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZD... | 44952998423的门诊结束就诊的日期是哪天 | SELECT txmzjzjlb.JZJSSJ FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '44952998423' UNION SELECT ftxmzjzjlb.JZJSSJ FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '44952998423' | css |
CREATE TABLE table_name_35 (
crowd INTEGER,
venue VARCHAR
) | What is the sum of all crowds present at the Glenferrie Oval venue? | SELECT SUM(crowd) FROM table_name_35 WHERE venue = "glenferrie oval" | sql_create_context |
CREATE TABLE table_67293 (
"Name" text,
"Country" text,
"Status" text,
"Moving to" text,
"Transfer window" text,
"Transfer fee" text
) | What is the item 'Moving to', when the Transfer fee is 300,000? | SELECT "Moving to" FROM table_67293 WHERE "Transfer fee" = '£300,000' | wikisql |
CREATE TABLE table_name_4 (
total_seats INTEGER,
share_of_votes VARCHAR
) | When the share of votes is 33.9%, what's the highest total amount of seats? | SELECT MAX(total_seats) FROM table_name_4 WHERE share_of_votes = "33.9%" | sql_create_context |
CREATE TABLE COURSE (
CName VARCHAR,
Credits VARCHAR
) | List all names of courses with 1 credit? | SELECT CName FROM COURSE WHERE Credits = 1 | sql_create_context |
CREATE TABLE table_73782 (
"Song" text,
"Singer" text,
"Co-Singers" text,
"Music Director" text,
"Lyricist" text,
"Co-Stars" text,
"Movie/Album" text,
"Year" real,
"Additional Info" text
) | How many co-singers were there when Parveen Babi co-starred? | SELECT COUNT("Co-Singers") FROM table_73782 WHERE "Co-Stars" = 'Parveen Babi' | wikisql |
CREATE TABLE txmzjzjlb (
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,
MZZYZDZ... | 哪些门诊就诊记录中鲁良骏患者的对应的检验报告单的报告日期均在2006年4月4日之后以及门诊就诊流水号是什么? | SELECT txmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE person_info.XM = '鲁良骏' AND NOT txmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2006-04-0... | css |
CREATE TABLE table_name_24 (
weight__kg_ INTEGER,
position VARCHAR
) | What is the highest weight of the position scrum half? | SELECT MAX(weight__kg_) FROM table_name_24 WHERE position = "scrum half" | 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,
... | how many days it has been since patient 005-87465 last received a alkaline phos. lab test on this hospital visit? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', lab.labresulttime)) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-87465' AND patient.hospi... | eicu |
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 of the patients on urgent admission had open and other right hemicolectomy? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.long_title = "Open and other right hemicolectomy" | mimicsql_data |
CREATE TABLE table_204_961 (
id number,
"title" text,
"director" text,
"production" text,
"music" text,
"cast" text,
"release date" text
) | who did the music of the first title arunthathi ? | SELECT "music" FROM table_204_961 WHERE "title" = 'arunthathi' | squall |
CREATE TABLE table_43850 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | Who is the opponent for the game played on august 20, 2006? | SELECT "Opponent" FROM table_43850 WHERE "Date" = 'august 20, 2006' | wikisql |
CREATE TABLE table_name_63 (
method VARCHAR,
record VARCHAR
) | What is the method when the record was 3-2? | SELECT method FROM table_name_63 WHERE record = "3-2" | sql_create_context |
CREATE TABLE club_rank (
Rank real,
Club_ID int,
Gold real,
Silver real,
Bronze real,
Total real
)
CREATE TABLE competition_result (
Competition_ID int,
Club_ID_1 int,
Club_ID_2 int,
Score text
)
CREATE TABLE player (
Player_ID int,
name text,
Position text,
Clu... | How many competitions for each country? | SELECT Country, COUNT(Country) FROM competition GROUP BY Country | nvbench |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
... | Low rep users using tag. | SELECT (SELECT COUNT(*) FROM Posts, Users AS u WHERE Tags LIKE '%<##tag##>%' AND OwnerUserId = u.Id AND u.Reputation < 300) AS "below 300 rep", (SELECT COUNT(*) FROM Posts, Users AS u WHERE Tags LIKE '%<##tag##>%' AND OwnerUserId = u.Id) AS "total" | sede |
CREATE TABLE table_name_23 (
class VARCHAR,
points VARCHAR
) | Which class had 110 points? | SELECT class FROM table_name_23 WHERE points = 110 | sql_create_context |
CREATE TABLE Products_in_Events (
Product_in_Event_ID INTEGER,
Event_ID INTEGER,
Product_ID INTEGER
)
CREATE TABLE Events (
Event_ID INTEGER,
Address_ID INTEGER,
Channel_ID INTEGER,
Event_Type_Code CHAR(15),
Finance_ID INTEGER,
Location_ID INTEGER
)
CREATE TABLE Locations (
Loc... | What is the total number of names of products?, rank by the y-axis in ascending. | SELECT Product_Name, COUNT(Product_Name) FROM Products GROUP BY Product_Name ORDER BY COUNT(Product_Name) | nvbench |
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,
... | 严鸿波这位患者自10.1.9起,到21.3.26止,在医疗机构1002933看病时共开走了多少西药 | SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '严鸿波' AND t_kc22.STA_DATE BETWEEN '2010-01-09' AND '2021-03-26' AND gwyjzb.MED_SER_ORG_NO = '1002933' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_... | css |
CREATE TABLE table_16331025_2 (
sellout___percentage_ VARCHAR,
gross_sales VARCHAR
) | What is the sellout % when the gross sales is $1,727,400? | SELECT sellout___percentage_ FROM table_16331025_2 WHERE gross_sales = "$1,727,400" | sql_create_context |
CREATE TABLE table_33893 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What was the Score on September 29, 2003? | SELECT "Score" FROM table_33893 WHERE "Date" = 'september 29, 2003' | wikisql |
CREATE TABLE table_39775 (
"Date" text,
"Cover model" text,
"Centerfold model" text,
"20 Questions" text,
"Pictorials" text
) | Which Centerfold model has a Cover model of irina voronina? | SELECT "Centerfold model" FROM table_39775 WHERE "Cover model" = 'irina voronina' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | what is admission time and diagnoses short title of subject id 9575? | SELECT demographic.admittime, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "9575" | mimicsql_data |
CREATE TABLE table_name_11 (
tonnage___grt__ VARCHAR,
date VARCHAR,
fate VARCHAR,
deaths VARCHAR
) | Which Tonnage has a Fate of sunk, and Deaths smaller than 17, and a Date of 16 november 1940? | SELECT tonnage___grt__ FROM table_name_11 WHERE fate = "sunk" AND deaths < 17 AND date = "16 november 1940" | sql_create_context |
CREATE TABLE table_26166836_1 (
distance VARCHAR,
road_race VARCHAR
) | How long was the great manchester run? | SELECT distance FROM table_26166836_1 WHERE road_race = "Great Manchester Run" | sql_create_context |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | Show the name of the product that is cheapest in each product category with their minimum price with a bar graph, and rank in descending by the Y please. | SELECT Name, MIN(Price) FROM Products GROUP BY Name ORDER BY MIN(Price) DESC | nvbench |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TAB... | what is the name of the prescription drug patient 005-5915 was prescribed within the same day after being diagnosed with hepatic dysfunction - acute in 07/2101? | SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-5915') AND diagnosis.diagnosi... | eicu |
CREATE TABLE table_74605 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which team was at Corio Oval on 4 June 1927? | SELECT "Away team" FROM table_74605 WHERE "Date" = '4 june 1927' AND "Venue" = 'corio oval' | wikisql |
CREATE TABLE table_74279 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | What nationality is the draft pick player going to Minnesota North Stars? | SELECT "Nationality" FROM table_74279 WHERE "NHL team" = 'Minnesota North Stars' | wikisql |
CREATE TABLE table_80167 (
"School" text,
"Location" text,
"Mascot" text,
"County" text,
"Joined" text,
"Previous Conference" text,
"Left" text,
"Conference joined" text
) | When doeas Mascot of blue devils in Gary Froebel School? | SELECT "Joined" FROM table_80167 WHERE "Mascot" = 'blue devils' | wikisql |
CREATE TABLE table_name_73 (
hydroelectricity INTEGER,
year VARCHAR,
wind_power VARCHAR
) | In 2011 with a less than 13.333 wind power what is the mean hydroelectricity? | SELECT AVG(hydroelectricity) FROM table_name_73 WHERE year > 2011 AND wind_power < 13.333 | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age te... | how many days have elapsed since the last time patient 006-2586 was prescribed propofol 10 mg/1 ml 100ml sdv inj during their current hospital visit. | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', medication.drugstarttime)) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-258... | eicu |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | give me the number of patients discharged to skilled nursing facility who were hospitalized for more than 20 days. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SNF" AND demographic.days_stay > "20" | mimicsql_data |
CREATE TABLE table_42271 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | What is the Label with a Catalog that is mhcl-20017? | SELECT "Label" FROM table_42271 WHERE "Catalog" = 'mhcl-20017' | wikisql |
CREATE TABLE table_name_63 (
decile INTEGER,
roll VARCHAR
) | Name the lelast decile for roll of 428 | SELECT MIN(decile) FROM table_name_63 WHERE roll = 428 | sql_create_context |
CREATE TABLE Apartment_Buildings (
building_id INTEGER,
building_short_name CHAR(15),
building_full_name VARCHAR(80),
building_description VARCHAR(255),
building_address VARCHAR(255),
building_manager VARCHAR(50),
building_phone VARCHAR(80)
)
CREATE TABLE Apartments (
apt_id INTEGER,
... | Show the number of apartment bookings for each weekday and bin booking start date by weekday interval in a bar chart, and rank in ascending by the Y-axis please. | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id ORDER BY COUNT(booking_start_date) | nvbench |
CREATE TABLE table_name_76 (
date VARCHAR,
score VARCHAR
) | On what Date was the Score 4 1? | SELECT date FROM table_name_76 WHERE score = "4–1" | sql_create_context |
CREATE TABLE table_56263 (
"Player" text,
"No.(s)" real,
"Height in Ft." text,
"Position" text,
"Years for Rockets" text,
"School/Club Team/Country" text
) | What school, club team, or country did the player with a number smaller than 4 come from? | SELECT "School/Club Team/Country" FROM table_56263 WHERE "No.(s)" < '4' | wikisql |
CREATE TABLE table_6159 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team" text
) | What is the college club that plays before round 3? | SELECT "College/Junior/Club Team" FROM table_6159 WHERE "Round" < '3' | wikisql |
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city... | For each faculty rank, show the number of faculty members who have it Show bar chart, display by the y axis from high to low please. | SELECT Rank, COUNT(*) FROM Faculty GROUP BY Rank ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_name_34 (
year_s__won VARCHAR,
player VARCHAR,
total VARCHAR,
to_par VARCHAR
) | In what year(s) did Raymond Floyd have a total of less than 291 and a To par of +10? | SELECT year_s__won FROM table_name_34 WHERE total < 291 AND to_par = "+10" AND player = "raymond floyd" | sql_create_context |
CREATE TABLE t_kc21 (
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,
... | 患者07451583在编号为6810321的医院有哪些出院诊断结果是姓钱的医生诊断的 | SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '07451583' AND t_kc21.MED_SER_ORG_NO = '6810321' AND t_kc21.OUT_DIAG_DOC_NM LIKE '钱%' | css |
CREATE TABLE csu_fees (
campusfee INTEGER,
YEAR VARCHAR
) | Find the average fee on a CSU campus in 1996 | SELECT AVG(campusfee) FROM csu_fees WHERE YEAR = 1996 | sql_create_context |
CREATE TABLE table_7141 (
"RANK" real,
"NAME" text,
"TEAM" text,
"COUNTRY" text,
"POINTS" real
) | What is the highest rank for PSV - FC Barcelona? | SELECT MAX("RANK") FROM table_7141 WHERE "TEAM" = 'psv - fc barcelona' | wikisql |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
CREATE TABLE t_kc21 (
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... | 从06年9月17日开始,截止到11年3月29日,病患在医疗机构6831757接受治疗需要平均住院多长时间 | SELECT AVG(t_kc21.IN_HOSP_DAYS) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '6831757' AND t_kc21.IN_HOSP_DATE BETWEEN '2006-09-17' AND '2011-03-29' | css |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellv... | what are the four most common procedures for patients with ages 50s since 4 years ago? | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 50 AND 59) AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-4 yea... | eicu |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | User questions sorted by quality. | SELECT Id AS "post_link", CreationDate, Score, ViewCount, CAST(Score AS FLOAT) / ViewCount AS Quality FROM Posts WHERE Id IN (SELECT ParentId FROM Posts WHERE PostTypeId = 1 AND OwnerUserId = '##UserId##') ORDER BY Quality DESC | sede |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location ... | i want to fly from MILWAUKEE to ORLANDO on wednesday evening | 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, date_day, days, flight WHERE (((flight.departure_time BETWEEN 1800 AND 2200) AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_... | atis |
CREATE TABLE table_1912276_2 (
rank INTEGER,
__750m VARCHAR
) | If -750 is 45.505, what is the maximum rank? | SELECT MAX(rank) FROM table_1912276_2 WHERE __750m = "45.505" | sql_create_context |
CREATE TABLE table_47782 (
"Date" text,
"Home" text,
"Score" text,
"Away" text,
"Attendance" real
) | What was the highest attendance for the Hispano team? | SELECT MAX("Attendance") FROM table_47782 WHERE "Home" = 'hispano' | wikisql |
CREATE TABLE table_74520 (
"Year" real,
"Recipient" text,
"Role" text,
"Play" text,
"Production" text
) | Name the recipientof the year for 1976 | SELECT "Recipient" FROM table_74520 WHERE "Year" = '1976' | wikisql |
CREATE TABLE table_name_43 (
fa_cup INTEGER,
total VARCHAR,
championship VARCHAR
) | What is the highest value for FA cups, that has a total of 0 4, with less than 4 championships? | SELECT MAX(fa_cup) FROM table_name_43 WHERE total = "0 4" AND championship < 4 | sql_create_context |
CREATE TABLE Customers (
customer_id INTEGER,
customer_name VARCHAR(80),
customer_details VARCHAR(255)
)
CREATE TABLE Orders (
order_id INTEGER,
customer_id INTEGER,
order_status VARCHAR(10),
date_order_placed DATETIME,
order_details VARCHAR(255)
)
CREATE TABLE Products (
product_i... | Compute the proportion of names of each product by a pie chart. | SELECT product_name, COUNT(product_name) FROM Orders AS T1 JOIN Order_Items AS T2 JOIN Products AS T3 ON T1.order_id = T2.order_id AND T2.product_id = T3.product_id GROUP BY product_name | nvbench |
CREATE TABLE table_55224 (
"Event" text,
"Record" text,
"Athlete" text,
"Nationality" text,
"Date" text
) | Which event was Tatyana Lebedeva in? | SELECT "Event" FROM table_55224 WHERE "Athlete" = 'tatyana lebedeva' | wikisql |
CREATE TABLE table_70642 (
"Season" text,
"Games" real,
"Lost" real,
"Points" real,
"Goalsfor" real,
"Goalsagainst" real
) | Goals for of 288, and Points smaller than 85 what is the highest goals against? | SELECT MAX("Goalsagainst") FROM table_70642 WHERE "Goalsfor" = '288' AND "Points" < '85' | wikisql |
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... | did patient 23070 had gastric tube output in 12/2105? | SELECT COUNT(*) > 0 FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23070)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'gastric tube' ... | mimic_iii |
CREATE TABLE table_30246 (
"No." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"U.S. viewers (million)" text
) | Who wrote the episode that had 6.05 million U.s. viewers? | SELECT "Written by" FROM table_30246 WHERE "U.S. viewers (million)" = '6.05' | wikisql |
CREATE TABLE table_67389 (
"Member" text,
"Party" text,
"Electorate" text,
"State" text,
"Term in office" text
) | What term did Stewart Mcarthur from Vic serve in office? | SELECT "Term in office" FROM table_67389 WHERE "State" = 'vic' AND "Member" = 'stewart mcarthur' | wikisql |
CREATE TABLE table_48097 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | Which Rider has Laps smaller than 24, and a Grid smaller than 12, and a Manufacturer of aprilia? | SELECT "Rider" FROM table_48097 WHERE "Laps" < '24' AND "Grid" < '12' AND "Manufacturer" = 'aprilia' | wikisql |
CREATE TABLE table_203_781 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
) | list each venue where the 3rd position was achieved ? | SELECT "venue" FROM table_203_781 WHERE "position" = 3 | squall |
CREATE TABLE table_10228 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | How many spectators at the game with a home team score of 16.15 (111)? | SELECT SUM("Crowd") FROM table_10228 WHERE "Home team score" = '16.15 (111)' | wikisql |
CREATE TABLE table_name_23 (
rank INTEGER,
nation VARCHAR,
bronze VARCHAR
) | what is the highest rank when the nation is united states (usa) and bronze is more than 1? | SELECT MAX(rank) FROM table_name_23 WHERE nation = "united states (usa)" AND bronze > 1 | 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
)
... | count the number of patients whose insurance is government and lab test name is o2 flow? | 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 = "O2 Flow" | mimicsql_data |
CREATE TABLE table_name_17 (
afc_cup VARCHAR,
name VARCHAR
) | Which AFC cup does Masahiro Fukasawa have? | SELECT afc_cup FROM table_name_17 WHERE name = "masahiro fukasawa" | sql_create_context |
CREATE TABLE table_17941032_3 (
points VARCHAR,
tries_for VARCHAR
) | Name the points when tries for is 49 | SELECT points FROM table_17941032_3 WHERE tries_for = "49" | sql_create_context |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAno... | Delay between question and answer in answered questions for Beam / Dataflow. | SELECT Questions.Id AS "Question", Questions.CreationDate AS "QuestionDate", COUNT(Answers.Id) AS "AnswerCount", MIN(Answers.CreationDate) AS "QuickestAnswerDate", CAST((JULIANDAY(MIN(Answers.CreationDate)) - JULIANDAY(Questions.CreationDate)) * 86400.0 AS INT) / 3600.0 AS "Delay" FROM Posts AS Questions INNER JOIN Pos... | sede |
CREATE TABLE fgwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 二零零四年十一月二十七日到二零一三年八月二十三日,患者凤欣合的住院情况如何 | SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.PERSON_NM = '凤欣合' AND gwyjzb.IN_HOSP_DATE BETWEEN '2004-11-27' AND '2013-08-03' AND gwyjzb.CLINIC_TYPE = '住院' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '凤欣合' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2004-11-27' AND '2013-08-03' AND fgwyjzb.CLINIC_TYPE = '住院' | css |
CREATE TABLE table_30301 (
"Year Location" text,
"Mens Singles" text,
"Womens Singles" text,
"Mens Doubles" text,
"Womens Doubles" text
) | What year and where was the tournament when fan ying won the womens singles? | SELECT "Year Location" FROM table_30301 WHERE "Womens Singles" = 'Fan Ying' | wikisql |
CREATE TABLE table_name_19 (
name VARCHAR,
college VARCHAR,
pick VARCHAR,
overall VARCHAR,
round VARCHAR
) | Which player was drafted overall from the college of Nebraska in a round under 6, pick of 15, and overall under 224? | SELECT name FROM table_name_19 WHERE overall < 224 AND round < 6 AND pick = 15 AND college = "nebraska" | sql_create_context |
CREATE TABLE table_203_667 (
id number,
"year" number,
"driver" text,
"co-driver" text,
"car" text,
"notes" text
) | how many times was charlie lubega a driver ? | SELECT COUNT(*) FROM table_203_667 WHERE "driver" = 'charlie lubega' | squall |
CREATE TABLE table_50212 (
"Opposing Team" text,
"Against" real,
"Date" text,
"Venue" text,
"Round" text
) | What was the round for 29 January 1949, when the against was 1? | SELECT "Round" FROM table_50212 WHERE "Against" = '1' AND "Date" = '29 january 1949' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text,
person_info_CSD text,
person_info_CSRQ time,
person_info_GJDM text,
person_info_GJMC text,
person_info_JGDM text,
person_info_JGMC text,
person_info_MZDM text,
person_info_MZMC text,
person_info_XBDM ... | 从2012年10月17日到2017年12月25日之间名叫张静雅的患者就诊过多少个医生? | SELECT COUNT(mzjzjlb.ZZYSGH) 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 '2012-10-17' AND '2017-12-25' | css |
CREATE TABLE table_59353 (
"Player" text,
"Round" real,
"Pick" real,
"Position" text,
"NFL Club" text
) | Who is the player from round 13 that plays center? | SELECT "Player" FROM table_59353 WHERE "Round" = '13' AND "Position" = 'center' | wikisql |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 患者鲁鹏池的既往病历里最主要的病是什么,时间是从12年8月17日到17年12月15日 | SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '鲁鹏池' AND IN_HOSP_DATE BETWEEN '2012-08-17' AND '2017-12-15' GROUP BY IN_DIAG_DIS_CD ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE Drama_Workshop_Groups (
Workshop_Group_ID INTEGER,
Address_ID INTEGER,
Currency_Code CHAR(15),
Marketing_Region_Code CHAR(15),
Store_Name VARCHAR(255),
Store_Phone VARCHAR(255),
Store_Email_Address VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Bookings_Services (
... | Bar chart of the number of planned delivery date from each planned delivery date, list by the total number in asc. | SELECT Planned_Delivery_Date, COUNT(Planned_Delivery_Date) FROM Bookings ORDER BY COUNT(Planned_Delivery_Date) | nvbench |
CREATE TABLE table_4973 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | Tell me the name for round of 1 | SELECT "Name" FROM table_4973 WHERE "Round" = '1' | wikisql |
CREATE TABLE table_name_56 (
tournament VARCHAR,
date VARCHAR
) | Where was the tournament played on Oct. 8, 2006? | SELECT tournament FROM table_name_56 WHERE date = "oct. 8, 2006" | sql_create_context |
CREATE TABLE table_70802 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text
) | What was the score of the game with a loss of Myers (5-6)? | SELECT "Score" FROM table_70802 WHERE "Loss" = 'myers (5-6)' | wikisql |
CREATE TABLE table_name_63 (
material_or_non_material VARCHAR,
suits VARCHAR,
opponents VARCHAR
) | Is it material or non-material when there are 2 suits for either opponent? | SELECT material_or_non_material FROM table_name_63 WHERE suits = "2" AND opponents = "either" | sql_create_context |
CREATE TABLE table_66934 (
"Stage" text,
"Time (EEST)" text,
"Name" text,
"Length" text,
"Winner" text,
"Time" text,
"Avg. spd." text,
"Rally leader" text
) | Who is the Winner when the Length is 21.27km? | SELECT "Winner" FROM table_66934 WHERE "Length" = '21.27km' | wikisql |
CREATE TABLE table_73216 (
"Shareholder" text,
"s A share" real,
"s B share" real,
"Percent of capital" text,
"Percent of votes" text
) | What is the s B share for Handelsbanken funds incl XACT? | SELECT "s B share" FROM table_73216 WHERE "Shareholder" = 'Handelsbanken funds incl XACT' | wikisql |
CREATE TABLE table_name_86 (
quantity INTEGER,
axle_arrangement VARCHAR
) | Which Quantity has an Axle arrangement of 2 c h2? | SELECT AVG(quantity) FROM table_name_86 WHERE axle_arrangement = "2′c h2" | sql_create_context |
CREATE TABLE table_204_418 (
id number,
"date" text,
"opponent" text,
"score" text,
"overall record" text,
"scba record" text
) | how many games did cal state fullerton 's baseball team play during april 1979 ? | SELECT COUNT(*) FROM table_204_418 | squall |
CREATE TABLE table_name_65 (
gold INTEGER,
nation VARCHAR
) | How many gold medals did Denmark win? | SELECT MIN(gold) FROM table_name_65 WHERE nation = "denmark" | sql_create_context |
CREATE TABLE table_47627 (
"Year" real,
"Winner" text,
"Runners-up" text,
"Aggregate" text,
"1st leg" text,
"2nd leg" text
) | What is the 2nd leg when San Pedro was the winner? | SELECT "2nd leg" FROM table_47627 WHERE "Winner" = 'san pedro' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | give me the number of patients whose year of birth is less than 2052 and procedure long title is combined right and left heart cardiac catheterization? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2052" AND procedures.long_title = "Combined right and left heart cardiac catheterization" | mimicsql_data |
CREATE TABLE film (
film_id SMALLINT UNSIGNED,
title VARCHAR(255),
description TEXT,
release_year YEAR,
language_id TINYINT UNSIGNED,
original_language_id TINYINT UNSIGNED,
rental_duration TINYINT UNSIGNED,
rental_rate DECIMAL(4,2),
length SMALLINT UNSIGNED,
replacement_cost DECI... | A bar chart for what are the number of the payment dates for any payments that have an amount greater than 10 or were handled by a staff member with the first name Elsa?, and I want to display by the Y in descending. | SELECT payment_date, COUNT(payment_date) FROM payment WHERE amount > 10 UNION SELECT T1.payment_date FROM payment AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Elsa' ORDER BY COUNT(payment_date) DESC | nvbench |
CREATE TABLE table_name_96 (
years_in_orlando VARCHAR,
school_club_team VARCHAR
) | Which Years in Orlando has a School/Club Team of kentucky? | SELECT years_in_orlando FROM table_name_96 WHERE school_club_team = "kentucky" | sql_create_context |
CREATE TABLE table_71433 (
"Rank" real,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the Total with 0 Silver and Gold, 1 Bronze and Rank larger than 2? | SELECT MIN("Total") FROM table_71433 WHERE "Rank" > '2' AND "Bronze" = '1' AND "Silver" > '0' AND "Gold" < '0' | wikisql |
CREATE TABLE table_name_89 (
played VARCHAR,
points_for VARCHAR
) | How many games played when the points for is 369? | SELECT played FROM table_name_89 WHERE points_for = "369" | sql_create_context |
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 jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decima... | For those employees who do not work in departments with managers that have ids between 100 and 200, find email and manager_id , and visualize them by a bar chart, and I want to list from low to high by the x axis. | SELECT EMAIL, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMAIL | nvbench |
CREATE TABLE customers (
customer_id number,
customer_details text
)
CREATE TABLE settlements (
settlement_id number,
claim_id number,
date_claim_made time,
date_claim_settled time,
amount_claimed number,
amount_settled number,
customer_policy_id number
)
CREATE TABLE customer_poli... | Return the claim start date for the claims whose claimed amount is no more than the average | SELECT date_claim_made FROM claims WHERE amount_settled <= (SELECT AVG(amount_settled) FROM claims) | spider |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 查一下给患者金晴画开阿卡波糖片这个药的医院有哪些 | SELECT gwyjzb.MED_SER_ORG_NO FROM gwyjzb WHERE gwyjzb.PERSON_NM = '金晴画' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '阿卡波糖片') UNION SELECT fgwyjzb.MED_SER_ORG_NO FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '金晴画' AND fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID ... | css |
CREATE TABLE table_name_24 (
name_of_mill VARCHAR,
type VARCHAR
) | What is the Name of the Grondzeiler Mill? | SELECT name_of_mill FROM table_name_24 WHERE type = "grondzeiler" | sql_create_context |
CREATE TABLE table_name_29 (
short_term_capital_gain_rate VARCHAR,
long_term_gain_on_collectibles VARCHAR
) | What is short-term capital gain rate with long-term gain on collectibles at 15%? | SELECT short_term_capital_gain_rate FROM table_name_29 WHERE long_term_gain_on_collectibles = "15%" | sql_create_context |
CREATE TABLE table_39391 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalogue" text
) | What is the Date of Catalogue number 602517739468? | SELECT "Date" FROM table_39391 WHERE "Catalogue" = '602517739468' | wikisql |
CREATE TABLE table_34328 (
"Player" text,
"Position" text,
"Starter" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
) | What's the number of touchdowns that there are 0 field goals, less than 5 points, and had Joe Maddock playing? | SELECT SUM("Touchdowns") FROM table_34328 WHERE "Field goals" = '0' AND "Player" = 'joe maddock' AND "Points" < '5' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.