context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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... | 在13年5月27日到21年1月31日期间,参保人99198987购买单一药品的最大购买次数有几次 | SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '99198987' AND t_kc22.STA_DATE BETWEEN '2013-05-27' AND '2021-01-31' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE table_38629 (
"Call sign" text,
"Frequency MHz" text,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
) | What is Charleston, SC ERP W? | SELECT "ERP W" FROM table_38629 WHERE "City of license" = 'charleston, sc' | wikisql |
CREATE TABLE table_38528 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Event" text
) | What the result for the hypo-meeting tournament in 1994? | SELECT "Result" FROM table_38528 WHERE "Year" = '1994' AND "Tournament" = 'hypo-meeting' | wikisql |
CREATE TABLE table_name_40 (
february VARCHAR,
points VARCHAR,
score VARCHAR
) | How many February days have Points of 63 and a Score of 1 2? | SELECT COUNT(february) FROM table_name_40 WHERE points = 63 AND score = "1–2" | sql_create_context |
CREATE TABLE table_name_65 (
lost VARCHAR,
goal_difference VARCHAR,
drawn VARCHAR
) | What is the number of games lost when goal difference is +13 and draws are more than 12? | SELECT COUNT(lost) FROM table_name_65 WHERE goal_difference = "+13" AND drawn > 12 | sql_create_context |
CREATE TABLE table_3390 (
"January\u2013December 2012" text,
"Birth/2012" real,
"Birth/2011" real,
"Death/2012" real,
"Death/2011" real
) | What were the total number of 2012 deaths when 2012 births were 127? | SELECT "Death/2012" FROM table_3390 WHERE "Birth/2012" = '127' | wikisql |
CREATE TABLE table_name_11 (
points_classification_navy_blue_jersey VARCHAR,
mountains_classification_green_jersey VARCHAR,
team_classification VARCHAR
) | What is the Points Classification Navy Blue Jersey that has Yoann le Boulanger, and Gerolsteiner? | SELECT points_classification_navy_blue_jersey FROM table_name_11 WHERE mountains_classification_green_jersey = "yoann le boulanger" AND team_classification = "gerolsteiner" | sql_create_context |
CREATE TABLE table_name_47 (
year INTEGER,
laps VARCHAR,
co_driver VARCHAR,
position VARCHAR
) | What is the lowest Year, when Co-Driver is Warren Luff, when Position is 7th, and when Laps is less than 161? | SELECT MIN(year) FROM table_name_47 WHERE co_driver = "warren luff" AND position = "7th" AND laps < 161 | sql_create_context |
CREATE TABLE table_78462 (
"Series #" real,
"Title" text,
"Directed by" text,
"Original air date" text,
"Production code" real
) | For the 'Downtown Girl' episode, what was the original air date? | SELECT "Original air date" FROM table_78462 WHERE "Title" = 'downtown girl' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
sp... | have patient 3535 undergone any contr abd arteriogrm nec procedure until 1 year ago? | SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'contr abd arteriogrm nec') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3535) AND DATETIME(pro... | mimic_iii |
CREATE TABLE table_48799 (
"Rider" text,
"Manufacturer" text,
"Laps" text,
"Time/Retired" text,
"Grid" text
) | What is the grid of rider shinya nakano? | SELECT "Grid" FROM table_48799 WHERE "Rider" = 'shinya nakano' | wikisql |
CREATE TABLE table_train_156 (
"id" int,
"anemia" bool,
"abnormal_bilirubin" bool,
"hemoglobin_a1c_hba1c" float,
"body_mass_index_bmi" float,
"bilirubin" float,
"NOUSE" float
) | body mass index greater than or equal to 25 and less than 35 kg / m2 | SELECT * FROM table_train_156 WHERE body_mass_index_bmi >= 25 AND body_mass_index_bmi < 35 | criteria2sql |
CREATE TABLE table_72162 (
"Character" text,
"Fate" text,
"Actor" text,
"First Episode" text,
"Final Episode" text,
"Duration" text,
"Final Episode Count" real
) | what's the total number of final epbeingode count with first epbeingode being 'l.a. | SELECT COUNT("Final Episode Count") FROM table_72162 WHERE "First Episode" = 'L.A.' | wikisql |
CREATE TABLE table_name_84 (
sample_size VARCHAR,
date_s__administered VARCHAR
) | How many people were surveyed in the poll from June 30, 2010? | SELECT sample_size FROM table_name_84 WHERE date_s__administered = "june 30, 2010" | sql_create_context |
CREATE TABLE table_69537 (
"Clinical Status" text,
"Compound Name" text,
"Trademark" text,
"Marine Organism \u03b1" text,
"Chemical Class" text,
"Molecular Target" text,
"Clinical Trials \u03b2" text,
"Disease Area" text
) | What is the molecular target of the organism that has a disease area of antiviral? | SELECT "Molecular Target" FROM table_69537 WHERE "Disease Area" = 'antiviral' | wikisql |
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,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | how many american indian/alaska native ethnic background patients have diagnoses icd9 code 59654? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND diagnoses.icd9_code = "59654" | mimicsql_data |
CREATE TABLE table_45137 (
"Date" text,
"Tournament" text,
"Surface" text,
"Partnering" text,
"Opponents in final" text,
"Score in final" text
) | Who is the partnering that had the opponents of Marcelo Melo Andr S ? | SELECT "Partnering" FROM table_45137 WHERE "Opponents in final" = 'marcelo melo andré sá' | wikisql |
CREATE TABLE table_77587 (
"Rank" real,
"Rider" text,
"Team" text,
"Speed" text,
"Time" text
) | Who is the rider with a 399cc Kawasaki? | SELECT "Rider" FROM table_77587 WHERE "Team" = '399cc kawasaki' | wikisql |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | 门诊就诊21319926440开检验报告单开了几份? | SELECT COUNT(*) FROM jybgb WHERE JZLSH = '21319926440' | css |
CREATE TABLE table_18646432_4 (
title VARCHAR,
original_air_date VARCHAR
) | What is the name of the episode originally aired on September 29, 1999? | SELECT title FROM table_18646432_4 WHERE original_air_date = "September 29, 1999" | 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,
... | tell me the cost of a lab test for mcv? | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'lab' AND cost.eventid IN (SELECT lab.labid FROM lab WHERE lab.labname = 'mcv') | eicu |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE diagnoses_icd (
row_id ... | when they came to the hospital first time, when was the last time that patient 75762 was diagnosed with obstructive sleep apnea? | SELECT diagnoses_icd.charttime FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'obstructive sleep apnea') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 75762 AND NOT admi... | mimic_iii |
CREATE TABLE stock (
Shop_ID int,
Device_ID int,
Quantity int
)
CREATE TABLE device (
Device_ID int,
Device text,
Carrier text,
Package_Version text,
Applications text,
Software_Platform text
)
CREATE TABLE shop (
Shop_ID int,
Shop_Name text,
Location text,
Open_Dat... | Give a bar chart showing how many shops in each carrier, and could you show in ascending by the X? | SELECT Carrier, COUNT(Carrier) FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID JOIN shop AS T3 ON T1.Shop_ID = T3.Shop_ID GROUP BY Carrier ORDER BY Carrier | nvbench |
CREATE TABLE table_6179 (
"Model" text,
"Platform & Frequency [MHz]" text,
"RAM [MB]" text,
"Flash Memory [MB]" text,
"Wireless NIC" text,
"WLAN standard [802.11]" text,
"Ethernet port count" text,
"Voltage Input [V/A]" text
) | What is the platform & frequency [MHz] of the whr-g54s model? | SELECT "Platform & Frequency [MHz]" FROM table_6179 WHERE "Model" = 'whr-g54s' | wikisql |
CREATE TABLE classroom (
building varchar(15),
room_number varchar(7),
capacity numeric(4,0)
)
CREATE TABLE prereq (
course_id varchar(8),
prereq_id varchar(8)
)
CREATE TABLE time_slot (
time_slot_id varchar(4),
day varchar(1),
start_hr numeric(2),
start_min numeric(2),
end_hr ... | What is the lowest salary in departments with average salary greater than the overall average Plot them as bar chart, and sort minimal salary in ascending order please. | SELECT dept_name, MIN(salary) FROM instructor GROUP BY dept_name ORDER BY MIN(salary) | nvbench |
CREATE TABLE table_name_74 (
package_option VARCHAR,
television_service VARCHAR
) | What is Package/Option, when Television Service is Sky Inside? | SELECT package_option FROM table_name_74 WHERE television_service = "sky inside" | sql_create_context |
CREATE TABLE table_51993 (
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the average amount of silver medals Montenegro, who has less than 15 bronze and more than 11 total medals, has? | SELECT AVG("Silver") FROM table_51993 WHERE "Bronze" < '15' AND "Nation" = 'montenegro' AND "Total" > '11' | wikisql |
CREATE TABLE country (
Country_id int,
Country_name text,
Capital text,
Official_native_language text
)
CREATE TABLE team (
Team_id int,
Name text
)
CREATE TABLE player (
Player_ID int,
Player text,
Years_Played text,
Total_WL text,
Singles_WL text,
Doubles_WL text,
... | Give me a bar chart that groups and counts the years played for players from team 'Columbus Crew', list Years_Played from high to low order. | SELECT Years_Played, COUNT(Years_Played) FROM player AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = "Columbus Crew" GROUP BY Years_Played ORDER BY Years_Played DESC | nvbench |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)... | how many days has passed since the last time that patient 006-2586 had propofol 10 mg/1 ml 100ml sdv inj prescribed during the current hospital encounter? | 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 table_name_84 (
score VARCHAR,
tie_no VARCHAR,
away_team VARCHAR
) | What was the score of the replay game when watford was the away team? | SELECT score FROM table_name_84 WHERE tie_no = "replay" AND away_team = "watford" | sql_create_context |
CREATE TABLE shipment_items (
shipment_id number,
order_item_id number
)
CREATE TABLE customers (
customer_id number,
customer_name text,
customer_details text
)
CREATE TABLE order_items (
order_item_id number,
product_id number,
order_id number,
order_item_status text,
order_i... | What is the name of the customer who has the largest number of orders? | SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_name_9 (
win_percentage VARCHAR,
wins VARCHAR
) | Where the wins are 46, what is the win%? | SELECT win_percentage FROM table_name_9 WHERE wins = "46" | sql_create_context |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
lan... | during this year how many patients were discharged from the hospital? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE NOT admissions.dischtime IS NULL AND DATETIME(admissions.dischtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | mimic_iii |
CREATE TABLE table_5446 (
"Pos." real,
"Car #" real,
"Driver" text,
"Make" text,
"Team" text
) | What team drove a Dodge vehicle? | SELECT "Team" FROM table_5446 WHERE "Make" = 'dodge' | wikisql |
CREATE TABLE table_12583 (
"Standard order" real,
"English translation" text,
"Transcription (based on Pinyin)" text,
"Traditional Chinese" text,
"Simplified Chinese" text
) | What is the english translation of the traditional Chinese word, ? | SELECT "English translation" FROM table_12583 WHERE "Traditional Chinese" = '哀郢' | wikisql |
CREATE TABLE table_52997 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What's the Result for the Competition of 1994 FIFA World Cup Qualification, with the Date of May 15, 1993? | SELECT "Result" FROM table_52997 WHERE "Competition" = '1994 fifa world cup qualification' AND "Date" = 'may 15, 1993' | wikisql |
CREATE TABLE table_name_60 (
pick VARCHAR,
year VARCHAR,
round VARCHAR
) | What is the pick number in a year earlier than 2009, with a round higher than 1? | SELECT COUNT(pick) FROM table_name_60 WHERE year < 2009 AND round > 1 | sql_create_context |
CREATE TABLE table_name_21 (
against INTEGER,
draws INTEGER
) | What is the smallest number against when the draws are less than 0? | SELECT MIN(against) FROM table_name_21 WHERE draws < 0 | sql_create_context |
CREATE TABLE gas_station (
station_id number,
open_year number,
location text,
manager_name text,
vice_manager_name text,
representative_name text
)
CREATE TABLE station_company (
station_id number,
company_id number,
rank_of_the_year number
)
CREATE TABLE company (
company_id ... | List the company name and rank for all companies in the decreasing order of their sales. | SELECT company, rank FROM company ORDER BY sales_billion DESC | spider |
CREATE TABLE table_23074 (
"Region" text,
"Wing" text,
"Inspection" real,
"Standard" real,
"Indoor" real,
"Outdoor" real,
"Written" real,
"Panel Quiz" real,
"Mile Run" real,
"Points" real,
"Overall" text
) | What is the indoor number for the NJ wing/ | SELECT "Indoor" FROM table_23074 WHERE "Wing" = 'NJ' | wikisql |
CREATE TABLE table_269920_3 (
tdp__w_ INTEGER,
model VARCHAR
) | What's the TDP for the 7130N model? | SELECT MIN(tdp__w_) FROM table_269920_3 WHERE model = "7130N" | sql_create_context |
CREATE TABLE table_name_41 (
venue VARCHAR,
home_team VARCHAR
) | Where did Footscray play as the home team? | SELECT venue FROM table_name_41 WHERE home_team = "footscray" | sql_create_context |
CREATE TABLE table_203_137 (
id number,
"title" text,
"album details" text,
"peak chart positions\nus" number,
"peak chart positions\nus r&b" number,
"certifications" text
) | how many times did a can i bus album reach the top 10 on the us charts ? | SELECT COUNT(*) FROM table_203_137 WHERE "title" = 'can-i-bus' | squall |
CREATE TABLE table_28762 (
"Dist." real,
"Democratic Coalition" text,
"Alliance" text,
"Together We Can Do More" text,
"Independent Regional Force" text,
"Independents" text
) | What is the independent regional force when alliance is (r) iv n norambuena ( udi )? | SELECT "Independent Regional Force" FROM table_28762 WHERE "Alliance" = '(R) Iván Norambuena ( UDI )' | wikisql |
CREATE TABLE table_name_70 (
ungegn VARCHAR,
word_form VARCHAR
) | what's the ungen for ? | SELECT ungegn FROM table_name_70 WHERE word_form = "ត្រីទស" | sql_create_context |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE i... | what were the four most frequently prescribed medications since 1 year ago? | SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 <= 4 | mimic_iii |
CREATE TABLE table_61570 (
"Opposing Teams" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
) | What is the total number of Against, when Date is '27/02/2005'? | SELECT COUNT("Against") FROM table_61570 WHERE "Date" = '27/02/2005' | wikisql |
CREATE TABLE farm (
Farm_ID int,
Year int,
Total_Horses real,
Working_Horses real,
Total_Cattle real,
Oxen real,
Bulls real,
Cows real,
Pigs real,
Sheep_and_Goats real
)
CREATE TABLE city (
City_ID int,
Official_Name text,
Status text,
Area_km_2 real,
Populat... | A bar chart about what are the statuses and average populations of each city?, I want to sort by the the average of population in ascending. | SELECT Status, AVG(Population) FROM city GROUP BY Status ORDER BY AVG(Population) | nvbench |
CREATE TABLE table_204_357 (
id number,
"year" number,
"div." text,
"pos." text,
"cup" text,
"top scorer (league)" text,
"score" number
) | what is the first year listed ? | SELECT "year" FROM table_204_357 WHERE id = 1 | squall |
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
) | For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and the sum of code , and group by attribute name, list Y in desc order. | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Code DESC | nvbench |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
Dup... | Get all of my Votes. | SELECT v.VoteTypeId, COUNT(*) FROM Votes AS v WHERE v.UserId = '##UserID##' GROUP BY v.VoteTypeId | sede |
CREATE TABLE table_name_40 (
hometown_school VARCHAR,
position VARCHAR,
player VARCHAR
) | What is the hometown of Mike White? | SELECT hometown_school FROM table_name_40 WHERE position = "of" AND player = "mike white" | sql_create_context |
CREATE TABLE table_15609 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
) | Who did they lose to on May 20? | SELECT "Loss" FROM table_15609 WHERE "Date" = 'may 20' | wikisql |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
h... | what was patient 24547's first arterial catheterization procedure time during a year before? | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'arterial catheterization') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24547) AND... | mimic_iii |
CREATE TABLE ref_budget_codes (
budget_type_code text,
budget_type_description text
)
CREATE TABLE documents_with_expenses (
document_id number,
budget_type_code text,
document_details text
)
CREATE TABLE projects (
project_id number,
project_details text
)
CREATE TABLE ref_document_types... | What are the ids and details of all accounts? | SELECT account_id, account_details FROM accounts | spider |
CREATE TABLE table_50549 (
"Team" text,
"Chassis" text,
"Engine" text,
"Tire" text,
"Sponsor" text
) | What engine does the Tasman Motorsports team have? | SELECT "Engine" FROM table_50549 WHERE "Team" = 'tasman motorsports' | wikisql |
CREATE TABLE table_74767 (
"Year" text,
"League" text,
"Reg. Season" text,
"Finish" text,
"Owner(s)" text,
"Attendance Average" real,
"Slogan" text
) | What year has the wild side of soccer! as the slogan? | SELECT "Year" FROM table_74767 WHERE "Slogan" = 'the wild side of soccer!' | wikisql |
CREATE TABLE table_24186 (
"Station" text,
"Line" text,
"Planned" real,
"Cancelled" real,
"Proposal" text,
"Details" text
) | Name the number of details for emlyn road | SELECT COUNT("Details") FROM table_24186 WHERE "Station" = 'Emlyn Road' | wikisql |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CR... | Top 10 users Ahmedabad India. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%Ahmedabad%' OR UPPER(Location) LIKE '%Ahmedabad%' OR Location LIKE '%Ahmedabad%' AND Reputation >= 1000 ORDER BY Reputation DESC | sede |
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... | 从08年10月22日起的2年内,患者66306240的395514指标情况记录 | SELECT * 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 WHERE hz_i... | css |
CREATE TABLE qtb (
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... | 哪几家医院为48799651这个患者开了硫酸氢氯吡格雷片这个药物 | SELECT qtb.MED_SER_ORG_NO FROM qtb WHERE qtb.PERSON_ID = '48799651' AND qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '硫酸氢氯吡格雷片') UNION SELECT gyb.MED_SER_ORG_NO FROM gyb WHERE gyb.PERSON_ID = '48799651' AND gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHE... | css |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
... | Questions tagged with [tag] that were closed. | SELECT COUNT(Posts.Id) AS "questions_posted" FROM Posts LEFT JOIN PostHistory AS PH ON PH.PostId = Posts.Id WHERE Posts.PostTypeId = 1 AND STR_POSITION(Posts.Tags, @tag) > 0 AND NOT Posts.ClosedDate IS NULL AND PH.PostHistoryTypeId = @offtopic | sede |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | find .the number of patients who are female and were diagnosed with transient ischemic attack? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "TRANSIENT ISCHEMIC ATTACK" | mimicsql_data |
CREATE TABLE table_name_89 (
penalty VARCHAR,
time VARCHAR
) | What was a penalty given for at time 29:17? | SELECT penalty FROM table_name_89 WHERE time = "29:17" | sql_create_context |
CREATE TABLE table_204_57 (
id number,
"year" number,
"film" text,
"role" text,
"language" text,
"notes" text
) | how many movies did madhurima take part in total ? | SELECT COUNT("film") FROM table_204_57 | squall |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semes... | Who are the professors teaching PHYSED 336 in the Summer 2020 semester ? | SELECT COUNT(DISTINCT instructor.instructor_id) FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'PHYSED' AND course.number = 336 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.off... | advising |
CREATE TABLE table_59695 (
"Election" text,
"First member" text,
"First party" text,
"Second member" text,
"Second party" text
) | Which of the second parties has second member Charles Robert Colvile, a conservative first party, and first member William Mundy? | SELECT "Second party" FROM table_59695 WHERE "Second member" = 'charles robert colvile' AND "First party" = 'conservative' AND "First member" = 'william mundy' | wikisql |
CREATE TABLE table_name_47 (
points INTEGER,
year INTEGER
) | What is the total points before 1963? | SELECT SUM(points) FROM table_name_47 WHERE year < 1963 | sql_create_context |
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departur... | what are the flights from CLEVELAND to INDIANAPOLIS on wednesday may twelfth on either TW DL or CO | 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.airline_code = 'CO') OR flight.airline_code = 'DL') OR (flight.airline_code = 'TW')) AND ((CITY_1.city_code = AIRPORT_SERVICE_1.city_co... | atis |
CREATE TABLE table_34534 (
"Name" text,
"Town/City" text,
"Borough" text,
"Region" text,
"Type" text
) | In what Borough is the Anchorage museum of Natural History? | SELECT "Name" FROM table_34534 WHERE "Borough" = 'anchorage' AND "Type" = 'natural history' | wikisql |
CREATE TABLE table_68052 (
"Name" text,
"Years" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
) | What is the roll number of Orautoha school in Raetihi, which has a decile smaller than 8? | SELECT SUM("Roll") FROM table_68052 WHERE "Area" = 'raetihi' AND "Name" = 'orautoha school' AND "Decile" < '8' | wikisql |
CREATE TABLE table_name_41 (
time_retired VARCHAR,
grid VARCHAR
) | What was the time/retired of the car that started in grid 4? | SELECT time_retired FROM table_name_41 WHERE grid = "4" | sql_create_context |
CREATE TABLE table_16396 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | What CFL teams are part of Simon Fraser college? | SELECT "CFL Team" FROM table_16396 WHERE "College" = 'Simon Fraser' | wikisql |
CREATE TABLE table_44564 (
"Coach" text,
"Years" text,
"Win-Loss" text,
"Win %" text,
"Conference Titles" text
) | What is Coach, when Win % is .352? | SELECT "Coach" FROM table_44564 WHERE "Win %" = '.352' | 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,... | 在2017年12月5日至2018年3月20日期间,编码为74125080的参保人单一药品最大购买次数有多少次? | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '74125080' AND t_kc22.STA_DATE BETWEEN '2017-12-05' AND '2018-03-20' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC L... | css |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
... | Top 5 Users from Pakistan by Reputation. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%pakistan%' OR UPPER(Location) LIKE '%PK' ORDER BY Reputation DESC LIMIT 5 | sede |
CREATE TABLE table_11869952_1 (
derivatives VARCHAR,
rocket_launch VARCHAR
) | Which authority has a rocket launch called rehbar-5? | SELECT COUNT(derivatives) FROM table_11869952_1 WHERE rocket_launch = "Rehbar-5" | sql_create_context |
CREATE TABLE table_4211 (
"Player" text,
"Starts" real,
"Cuts made" real,
"Best finish" text,
"Money list rank" text,
"Earnings ($)" real
) | Which money list ranks had a best finish of 2? | SELECT COUNT("Money list rank") FROM table_4211 WHERE "Best finish" = '2' | wikisql |
CREATE TABLE table_51462 (
"Driver" text,
"Constructor" text,
"Laps" text,
"Time/Retired" text,
"Grid" text
) | Who was the driver with 29 laps? | SELECT "Driver" FROM table_51462 WHERE "Laps" = '29' | wikisql |
CREATE TABLE table_73025 (
"Japanese Title" text,
"Romaji Title" text,
"TV Station" text,
"Time Frame" text,
"Starring Actors" text,
"Theme Song(s)" text,
"Episodes" real,
"Average Ratings" text
) | What are the japanese title(s) for tv asahi? | SELECT "Japanese Title" FROM table_73025 WHERE "TV Station" = 'TV Asahi' | wikisql |
CREATE TABLE table_7711 (
"Draw" real,
"Artist" text,
"Song" text,
"Televote" real,
"Place" real
) | With a draw greater than 11 and the place smaller than 4 what was the televote? | SELECT "Televote" FROM table_7711 WHERE "Draw" > '11' AND "Place" < '4' | wikisql |
CREATE TABLE table_203_778 (
id number,
"representative" text,
"title" text,
"presentation\nof credentials" text,
"termination\nof mission" text,
"appointed by" text
) | which ambassador to honduras served the longest term ? | SELECT "representative" FROM table_203_778 ORDER BY "termination\nof mission" - "presentation\nof credentials" DESC LIMIT 1 | squall |
CREATE TABLE table_65030 (
"Party" text,
"Burnley" real,
"Chorley" real,
"Fylde" real,
"Hyndburn" real,
"Lancaster" real,
"Pendle" real,
"Preston" real,
"Ribble Valley" real,
"Rossendale" real,
"South Ribble" real,
"West Lancashire" real,
"Wyre" real,
"Total" real... | What is the average rating for a Flyde that has a Burnley less than 0? | SELECT AVG("Fylde") FROM table_65030 WHERE "Burnley" < '0' | wikisql |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JO... | For those employees whose first name does not containing the letter M, display their total salary by binning the hire date into Month interval for visualizing a bar chart, and sort in asc by the total number please. | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT FIRST_NAME LIKE '%M%' ORDER BY SUM(SALARY) | nvbench |
CREATE TABLE table_name_13 (
laps INTEGER,
driver VARCHAR,
grid VARCHAR
) | How many laps for denny hulme with under 4 on the grid? | SELECT SUM(laps) FROM table_name_13 WHERE driver = "denny hulme" AND grid < 4 | sql_create_context |
CREATE TABLE Transactions_Lots (
transaction_id INTEGER,
lot_id INTEGER
)
CREATE TABLE Transactions (
transaction_id INTEGER,
investor_id INTEGER,
transaction_type_code VARCHAR(10),
date_of_transaction DATETIME,
amount_of_transaction DECIMAL(19,4),
share_count VARCHAR(40),
other_det... | Return the lot details, group the lot details, and compute the number of each lot details, and could you show x-axis in descending order? | SELECT lot_details, COUNT(lot_details) FROM Lots GROUP BY lot_details ORDER BY lot_details DESC | nvbench |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Descrip... | Find comments that might be no longer needed. | SELECT p.Id AS "post_link" FROM Posts AS p JOIN Comments AS c ON c.PostId = p.Id WHERE DATEDIFF(day, p.LastEditDate, CreationDate) >= 0 AND c.Text LIKE '%##KeywordsInComment##%' AND NOT EXISTS(SELECT ph.PostId FROM PostHistory AS ph WHERE ph.PostHistoryTypeId = 10 AND ph.PostId = p.Id) GROUP BY p.Id ORDER BY p.Id DESC | sede |
CREATE TABLE table_75264 (
"Nation" text,
"Skip" text,
"Third" text,
"Second" text,
"Lead" text
) | What is the name of the second who has Caroline Reed as third? | SELECT "Second" FROM table_75264 WHERE "Third" = 'caroline reed' | wikisql |
CREATE TABLE table_23436 (
"Episode" text,
"First broadcast" text,
"Rufus guest" text,
"Marcus guest" text,
"Winner" text
) | Name the winner for jason byrne | SELECT "Winner" FROM table_23436 WHERE "Marcus guest" = 'Jason Byrne' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | give me the number of patients on dwell route of drug administration who have primary apnea of newborn. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Primary apnea of newborn" AND prescriptions.route = "DWELL" | mimicsql_data |
CREATE TABLE table_63718 (
"Constituency number" text,
"Name" text,
"Reserved for ( SC / ST /None)" text,
"District" text,
"Number of electorates (2009)" real
) | What district has a constituency of 60? | SELECT "District" FROM table_63718 WHERE "Constituency number" = '60' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | count the number of patients whose ethnicity is white and drug route is neb? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE" AND prescriptions.route = "NEB" | mimicsql_data |
CREATE TABLE table_name_13 (
virtue VARCHAR,
acedia VARCHAR,
latin VARCHAR
) | Which virtue is acedia(Latin)? | SELECT virtue FROM table_name_13 WHERE (latin) = acedia | sql_create_context |
CREATE TABLE table_14270 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
) | In what lane did the swimmer get a time of 1:59.42? | SELECT SUM("Lane") FROM table_14270 WHERE "Time" = '1:59.42' | 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... | how many patients whose item id is 51457? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51457" | mimicsql_data |
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 ... | 患者08045413检验的脸部的各项指标结果怎么样? | SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '... | css |
CREATE TABLE table_31183 (
"No." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Featured character(s)" text,
"U.S. viewers (millions)" text,
"Original air date" text
) | How many people directed episode 2? | SELECT COUNT("Directed by") FROM table_31183 WHERE "No." = '2' | wikisql |
CREATE TABLE table_3019 (
"Overall" real,
"No. in series" real,
"Title" text,
"Directed by" text,
"Original air date" text,
"U.S. viewers (in millions)" text
) | What date did the episode that had 1.023 million u.s. viewers originally air? | SELECT "Original air date" FROM table_3019 WHERE "U.S. viewers (in millions)" = '1.023' | wikisql |
CREATE TABLE takes (
id text,
course_id text,
sec_id text,
semester text,
year number,
grade text
)
CREATE TABLE teaches (
id text,
course_id text,
sec_id text,
semester text,
year number
)
CREATE TABLE section (
course_id text,
sec_id text,
semester text,
y... | What are the names of students who took a course in the Fall of 2003? | SELECT name FROM student WHERE id IN (SELECT id FROM takes WHERE semester = 'Fall' AND year = 2003) | spider |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
... | what was patient 017-101426's last output until 06/15/2104? | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-101426')) AND intakeoutput.cellpath LIKE '%output%' AND ... | eicu |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.