context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_3264 (
"Season #" real,
"Title Italian" text,
"Title English" text,
"Directed by" text,
"Original air date" text
) | Name the least season # for the first time | SELECT MIN("Season #") FROM table_3264 WHERE "Title English" = 'The first time' | wikisql |
CREATE TABLE table_12050 (
"Points" real,
"Name" text,
"Club" text,
"Apps" real,
"Tries" real,
"Drop" real
) | Who had points less than 73 and drop more than 0? | SELECT "Name" FROM table_12050 WHERE "Points" < '73' AND "Drop" > '0' | wikisql |
CREATE TABLE Product_Suppliers (
product_id INTEGER,
supplier_id INTEGER,
date_supplied_from DATETIME,
date_supplied_to DATETIME,
total_amount_purchased VARCHAR(80),
total_value_purchased DECIMAL(19,4)
)
CREATE TABLE Addresses (
address_id INTEGER,
address_details VARCHAR(255)
)
CREATE... | What is the average price for each type of product Visualize by bar chart, and could you sort by the X-axis in asc please? | SELECT product_type_code, AVG(product_price) FROM Products GROUP BY product_type_code ORDER BY product_type_code | nvbench |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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,
H... | 药品编码为197695488-q在医疗就诊96226130185中的医疗机构三大目录编码及名称是什么? | SELECT t_kc22.MED_DIRE_CD, t_kc22.MED_DIRE_NM 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 = '96226130185' AND t_kc22.SOC_SRT_DIRE_CD = '197695488-q' | css |
CREATE TABLE table_18190 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
) | what's the result with district illinois 15 | SELECT "Result" FROM table_18190 WHERE "District" = 'Illinois 15' | wikisql |
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,
... | how many patients who belong to the religion christian scientist had lab test named mchc? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "CHRISTIAN SCIENTIST" AND lab.label = "MCHC" | mimicsql_data |
CREATE TABLE table_7532 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What average total has cuba as the nation, and a bronze greater than 1? | SELECT AVG("Total") FROM table_7532 WHERE "Nation" = 'cuba' AND "Bronze" > '1' | wikisql |
CREATE TABLE table_39404 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | Which Overall is the highest one that has a Name of daimon shelton, and a Round larger than 6? | SELECT MAX("Overall") FROM table_39404 WHERE "Name" = 'daimon shelton' AND "Round" > '6' | wikisql |
CREATE TABLE table_14696 (
"Name" text,
"Years" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
) | What is the average decile of Westport South School? | SELECT AVG("Decile") FROM table_14696 WHERE "Name" = 'westport south school' | wikisql |
CREATE TABLE table_name_7 (
venue VARCHAR,
result VARCHAR
) | Where was the competition that took place that had a 5-1 result? | SELECT venue FROM table_name_7 WHERE result = "5-1" | sql_create_context |
CREATE TABLE table_80292 (
"NBR number" real,
"Year" real,
"Original operator" text,
"Class" text,
"Wheel arrangement" text,
"Road number" real,
"Location" text
) | Which class starts after 1939 and has a road number smaller than 3508? | SELECT "Class" FROM table_80292 WHERE "Year" > '1939' AND "Road number" < '3508' | wikisql |
CREATE TABLE table_6695 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Time" text,
"Att." text,
"Record" text
) | What was the time of the game on April 5? | SELECT "Time" FROM table_6695 WHERE "Date" = 'april 5' | wikisql |
CREATE TABLE table_563 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | How many tries for are for 473 points for? | SELECT COUNT("Tries for") FROM table_563 WHERE "Points for" = '473' | wikisql |
CREATE TABLE Orders (
order_id INTEGER,
customer_id INTEGER,
order_status VARCHAR(10),
date_order_placed DATETIME,
order_details VARCHAR(255)
)
CREATE TABLE Customers (
customer_id INTEGER,
customer_name VARCHAR(80),
customer_details VARCHAR(255)
)
CREATE TABLE Shipment_Items (
shi... | For each customer who has at least two orders, find the customer name and number of orders made. Visualize by bar chart. | SELECT customer_name, COUNT(*) FROM Orders AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id | nvbench |
CREATE TABLE table_2781227_4 (
pick INTEGER,
player VARCHAR
) | For player is jamal mayers mention the minimum pick | SELECT MIN(pick) FROM table_2781227_4 WHERE player = "Jamal Mayers" | sql_create_context |
CREATE TABLE table_name_63 (
week INTEGER,
result VARCHAR
) | What week was the result of l 38 21? | SELECT MAX(week) FROM table_name_63 WHERE result = "l 38–21" | 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 hz_info (
KH text,
KLX number... | 54857048630这个住院就诊的出院病区叫什么?代码是什么?以及出院的床位是哪一个 | SELECT zyjzjlb.CYBQDM, zyjzjlb.CYBQMC, zyjzjlb.CYCWH FROM zyjzjlb WHERE zyjzjlb.JZLSH = '54857048630' | css |
CREATE TABLE table_69063 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" text,
"Class" text,
"FCC info" text
) | Which call sign has a Class of A, and a Frequency MHz of 88.7? | SELECT "Call sign" FROM table_69063 WHERE "Class" = 'a' AND "Frequency MHz" = '88.7' | wikisql |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 30567808患者的身高和体重情况是啥样的? | SELECT mzjzjlb.SG, mzjzjlb.TZ FROM hz_info JOIN mzjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM... | css |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | Top 100 programmers in Marrakesh, Morocco. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Location, Reputation FROM Users WHERE LOWER(Location) LIKE '%marrakesh%' ORDER BY Reputation DESC LIMIT 100 | sede |
CREATE TABLE table_52257 (
"Location" text,
"Abb." text,
"Enzyme" text,
"Disorder" text,
"Measurements" text
) | What lab measurements can help diagnosie ornithine transcarbamylase deficiency? | SELECT "Measurements" FROM table_52257 WHERE "Disorder" = 'ornithine transcarbamylase deficiency' | wikisql |
CREATE TABLE table_48829 (
"Rank" real,
"Location" text,
"2008" real,
"2009" real,
"2010" real,
"2011" real,
"2012" real
) | Which 2011 has a 2012 larger than 9,998,000? | SELECT MAX("2011") FROM table_48829 WHERE "2012" > '9,998,000' | wikisql |
CREATE TABLE table_27734577_8 (
record VARCHAR,
team VARCHAR
) | What's the record of the @ miami team? | SELECT record FROM table_27734577_8 WHERE team = "@ Miami" | sql_create_context |
CREATE TABLE table_204_302 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | how many total medals did argentina win ? | SELECT "total" FROM table_204_302 WHERE "nation" = 'argentina' | squall |
CREATE TABLE table_name_98 (
rank INTEGER,
laps VARCHAR
) | What is the average rank of one who is at 76 laps? | SELECT AVG(rank) FROM table_name_98 WHERE laps = 76 | 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,
... | in 2105, what were the top three most common intakes? | SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%intake%' AND STRFTIME('%y', intakeoutput.intakeoutputtime) = '2105' GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 3 | eicu |
CREATE TABLE table_name_38 (
loss VARCHAR,
record VARCHAR
) | Which Loss has a Record of 41 32 6? | SELECT loss FROM table_name_38 WHERE record = "41–32–6" | sql_create_context |
CREATE TABLE table_1348246_3 (
Radio VARCHAR,
secretariat VARCHAR
) | What are radio electricals when secretariat is wtr i? | SELECT Radio AS electrical FROM table_1348246_3 WHERE secretariat = "WTR I" | sql_create_context |
CREATE TABLE WINE (
YEAR VARCHAR,
Price INTEGER
) | What are the average prices of wines for different years? | SELECT AVG(Price), YEAR FROM WINE GROUP BY YEAR | sql_create_context |
CREATE TABLE Ref_Transaction_Types (
transaction_type_code VARCHAR(10),
transaction_type_description VARCHAR(80)
)
CREATE TABLE Sales (
sales_transaction_id INTEGER,
sales_details VARCHAR(255)
)
CREATE TABLE Investors (
investor_id INTEGER,
Investor_details VARCHAR(255)
)
CREATE TABLE Transac... | Show the average transaction amount for different transaction types, I want to display by the total number in ascending please. | SELECT transaction_type_code, AVG(amount_of_transaction) FROM Transactions GROUP BY transaction_type_code ORDER BY AVG(amount_of_transaction) | nvbench |
CREATE TABLE table_45982 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What was the Attendance after Week 4 on October 10, 1971? | SELECT AVG("Attendance") FROM table_45982 WHERE "Date" = 'october 10, 1971' AND "Week" > '4' | wikisql |
CREATE TABLE table_name_65 (
frequency VARCHAR,
website VARCHAR
) | what is the frequency of visits to elmanana.com.mx | SELECT frequency FROM table_name_65 WHERE website = "elmanana.com.mx" | sql_create_context |
CREATE TABLE table_60609 (
"Official Name" text,
"Status" text,
"Area km 2" real,
"Population" real,
"Census Ranking" text
) | Which Census Ranking has an Area km 2 larger than 753.06, and an Official Name of stanley? | SELECT "Census Ranking" FROM table_60609 WHERE "Area km 2" > '753.06' AND "Official Name" = 'stanley' | wikisql |
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,
... | provide the number of patients whose death status is 1 and drug code is alte1/5i? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "1" AND prescriptions.formulary_drug_cd = "ALTE1/5I" | mimicsql_data |
CREATE TABLE table_17467578_1 (
written_by VARCHAR,
us_viewers__million_ VARCHAR
) | Who wrote the episode 'The Cold Turkey', which was viewed by 3.73 million viewers? | SELECT written_by FROM table_17467578_1 WHERE us_viewers__million_ = "3.73" | sql_create_context |
CREATE TABLE invoices (
invoice_number number,
invoice_date time,
invoice_details text
)
CREATE TABLE shipments (
shipment_id number,
order_id number,
invoice_number number,
shipment_tracking_number text,
shipment_date time,
other_shipment_details text
)
CREATE TABLE customers (
... | What are the dates of the orders made by the customer named 'Jeramie'? | SELECT T2.date_order_placed FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = "Jeramie" | spider |
CREATE TABLE table_15834 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | what is the total number of times the tournament was pga championship and evens is less than 4? | SELECT COUNT("Top-5") FROM table_15834 WHERE "Tournament" = 'pga championship' AND "Events" < '4' | wikisql |
CREATE TABLE table_11274401_2 (
timeslot VARCHAR,
no VARCHAR
) | Which timeslot did episode no. 15 hold? | SELECT timeslot FROM table_11274401_2 WHERE no = 15 | sql_create_context |
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,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | How many patients on elective admission had a personal history of surgery to other organs? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND diagnoses.long_title = "Personal history of surgery to other organs" | mimicsql_data |
CREATE TABLE table_46264 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | Which Total has a Country of united states, and a Player of andy north? | SELECT AVG("Total") FROM table_46264 WHERE "Country" = 'united states' AND "Player" = 'andy north' | wikisql |
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE airline (
airline_code varc... | what is the flight schedule of the F28 from PITTSBURGH to BALTIMORE | SELECT DISTINCT FLIGHT_0.arrival_time, FLIGHT_0.departure_time FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, flight AS FLIGHT_0, flight AS FLIGHT_1, flight_leg WHERE (aircraft.aircraft_code = 'F28' AND CITY_1.city_code = AI... | atis |
CREATE TABLE table_name_3 (
Id VARCHAR
) | What shows for 1992 when 2001 is 1r, 1994 is 1r, and the 2002 is qf? | SELECT 1992 FROM table_name_3 WHERE 2001 = "1r" AND 1994 = "1r" AND 2002 = "qf" | sql_create_context |
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE hz_info (
KH text,
KLX number... | 之前患者62748683的就诊医院是哪里 | (SELECT mzjzjlb.YLJGDM 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.RYBH = '62748683') UNION (SELECT zyjzjlb.YLJGDM FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.K... | css |
CREATE TABLE songs (
songid number,
title text
)
CREATE TABLE performance (
songid number,
bandmate number,
stageposition text
)
CREATE TABLE vocals (
songid number,
bandmate number,
type text
)
CREATE TABLE albums (
aid number,
title text,
year number,
label text,
... | Find all the songs produced by artists with first name 'Marianne'. | SELECT T3.title FROM performance AS T1 JOIN band AS T2 ON T1.bandmate = T2.id JOIN songs AS T3 ON T3.songid = T1.songid WHERE T2.firstname = "Marianne" | spider |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | Is there a section of HBEHED 900 that occurs after 07:15 P.M. ? | SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.start_time > '07:15' AND course.course_id = course_offering.course_id AND course.department = 'HBEHED' AND course.number = 900 AND semester.semester = 'WN' AN... | advising |
CREATE TABLE table_name_50 (
opponent VARCHAR,
attendance VARCHAR
) | What two teams were competing in the match with 103,158 in attendance? | SELECT opponent FROM table_name_50 WHERE attendance = "103,158" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE l... | when did patient 017-83061 leave hospital for the last time? | SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '017-83061' ORDER BY patient.hospitaldischargetime DESC LIMIT 1 | eicu |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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,
JOB_ID varchar(10),
SALARY decimal(8,2),
CO... | For those employees who was hired before 2002-06-21, give me the comparison about the sum of salary over the hire_date bin hire_date by weekday by a bar chart. | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE table_204_784 (
id number,
"player" text,
"league" number,
"cup" number,
"europa league" number,
"total" number
) | which players have at least 4 in the europa league ? | SELECT "player" FROM table_204_784 WHERE "europa league" >= 4 | squall |
CREATE TABLE table_55525 (
"Goal" real,
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | On what date did Goal 24 take place? | SELECT "Date" FROM table_55525 WHERE "Goal" = '24' | wikisql |
CREATE TABLE table_name_50 (
home_team VARCHAR,
away_team VARCHAR
) | What home team played North Melbourne? | SELECT home_team FROM table_name_50 WHERE away_team = "north melbourne" | sql_create_context |
CREATE TABLE table_51932 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | what is the lowest grid when the laps is more than 7 and the driver is rubens barrichello? | SELECT MIN("Grid") FROM table_51932 WHERE "Laps" > '7' AND "Driver" = 'rubens barrichello' | wikisql |
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 ... | 在20322309987号的检验结果中指标记录的结果定性和结果定量以及定量单位都啥样? | SELECT jyjgzbb.JCZBJGDX, jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '20322309987' | css |
CREATE TABLE table_68357 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( \u00a3 )" text
) | Name the money for the to par of -6 | SELECT "Money ( \u00a3 )" FROM table_68357 WHERE "To par" = '-6' | wikisql |
CREATE TABLE table_name_59 (
record VARCHAR,
date VARCHAR
) | What record has September 21 as the date? | SELECT record FROM table_name_59 WHERE date = "september 21" | sql_create_context |
CREATE TABLE customer_orders (
order_id number,
customer_id number,
order_status_code text,
order_date time
)
CREATE TABLE product_suppliers (
product_id number,
supplier_id number,
date_supplied_from time,
date_supplied_to time,
total_amount_purchased text,
total_value_purchase... | What are the distinct names of customers with an order status of Pending, sorted by customer id? | SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = "Pending" ORDER BY T2.customer_id | spider |
CREATE TABLE table_18129 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text,
"Candidates" text
) | Who were the candidates in district Pennsylvania 3? | SELECT "Candidates" FROM table_18129 WHERE "District" = 'Pennsylvania 3' | wikisql |
CREATE TABLE table_24565004_15 (
appearances¹ VARCHAR,
goals¹ VARCHAR
) | How many games had less than 7 goals scored? | SELECT COUNT(appearances¹) FROM table_24565004_15 WHERE goals¹ = 7 | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | give me the number of patients whose drug name is caspofungin? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Caspofungin" | mimicsql_data |
CREATE TABLE table_48977 (
"Competition" text,
"Played" real,
"Millwall wins" real,
"Drawn" real,
"West Ham wins" real,
"Millwall goals" real,
"West Ham goals" real
) | What is the least number of wins West Ham got when they tied 27 times? | SELECT MIN("West Ham wins") FROM table_48977 WHERE "Drawn" > '27' | wikisql |
CREATE TABLE table_name_53 (
volume_lbs VARCHAR,
set_4 VARCHAR
) | How many lbs does a set 4 of 115lb x 8reps have? | SELECT volume_lbs FROM table_name_53 WHERE set_4 = "115lb x 8reps" | sql_create_context |
CREATE TABLE table_41006 (
"Year" text,
"Matches" real,
"Wins" real,
"Losses" real,
"No Result" real,
"Success Rate" text,
"Away Wins" real,
"Away Losses" real
) | What is the highest No Result when there were less than 7 losses, and more than 3 away wins, with a success Rate of 50.00%? | SELECT MAX("No Result") FROM table_41006 WHERE "Losses" > '7' AND "Away Wins" > '3' AND "Success Rate" = '50.00%' | wikisql |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGui... | Count of users with a well-received question or answer by month. Well-received means: 1) not closed (for questions) 2) not deleted 3) positive score after 30 days | WITH Raw AS (SELECT Posts.Id, MIN(Posts.OwnerUserId) AS UserId, MIN(DATEFROMPARTS(DATEPART(yyyy, Posts.CreationDate), DATEPART(mm, Posts.CreationDate), 1)) AS Month, MIN(Posts.PostTypeId) AS PostTypeId, SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE -1 END) AS Score FROM Posts, Votes WHERE Posts.PostTypeId BETWEEN 1 AND 2 AN... | sede |
CREATE TABLE table_name_28 (
yacht_name VARCHAR,
overall_place VARCHAR
) | What is the name of the yacht where 12 is the overall place? | SELECT yacht_name FROM table_name_28 WHERE overall_place = "12" | sql_create_context |
CREATE TABLE table_68369 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | How many laps were ridden in the race that had a Time/Retired of +37.351? | SELECT COUNT("Laps") FROM table_68369 WHERE "Time/Retired" = '+37.351' | wikisql |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 在医院4995921中的门诊患者45839715在诊断的名称包含焦虑这几个字的门诊就诊记录都有啥? | SELECT * FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '45839715' AND hz_info.YLJGDM = '4995921' AND txmzjzjlb.JZZDSM LIKE '%焦虑%' UNION SELECT * FROM hz_info JOIN ftxmzjzjlb ON hz_info.YLJGDM = ftxmzjzjlb.YLJGDM AND hz... | css |
CREATE TABLE table_name_54 (
hindi VARCHAR,
kannada VARCHAR
) | WHAT HINDI HAS Kannada of shukravara? | SELECT hindi FROM table_name_54 WHERE kannada = "shukravara" | sql_create_context |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
... | Top 20 posts and the scores. | SELECT ViewCount, Score, Id AS "post_link" FROM Posts ORDER BY ViewCount DESC LIMIT 20 | sede |
CREATE TABLE table_name_54 (
nickname VARCHAR,
location VARCHAR
) | What is the nickname of the school located in Manchester, New Hampshire? | SELECT nickname FROM table_name_54 WHERE location = "manchester, new hampshire" | sql_create_context |
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 minimum days of hospital stay of patients whose primary disease is left colon cancer? | SELECT MIN(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "LEFT COLON CANCER" | mimicsql_data |
CREATE TABLE table_1941183_2 (
game_site VARCHAR,
opponent VARCHAR
) | In how many locations was the game against Barcelona Dragons played? | SELECT COUNT(game_site) FROM table_1941183_2 WHERE opponent = "Barcelona Dragons" | sql_create_context |
CREATE TABLE table_name_4 (
song VARCHAR,
played_for VARCHAR,
artist VARCHAR
) | Which Rush song was played for Mike Fincke? | SELECT song FROM table_name_4 WHERE played_for = "mike fincke" AND artist = "rush" | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9cod... | had patient 022-43717 been prescribed a prescription of any drug? | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-43717')) | eicu |
CREATE TABLE table_name_55 (
venue VARCHAR,
position VARCHAR
) | What venue did he finish 7th? | SELECT venue FROM table_name_55 WHERE position = "7th" | sql_create_context |
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... | 在2004年12月22日到08年7月12日内患者33538055所有检验人为72481499的检验结果指标记录的检验指标流水号具体都有啥? | SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '33538055' AND jyjgzbb.JYRQ BETWEEN '2004-12-2... | css |
CREATE TABLE wdmzjzjlb (
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... | 名叫葛歌韵的患者在2019年12月22日到2020年12月16日期间开出的全部检验报告单的检验报告单号都是什么? | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND 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 person_info.XM = '葛... | css |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE hz_info_mzjzjlb (
JZLSH number,
YLJGDM number,
mzjzjlb_id number
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
... | 患者65531997在01年7月20日到15年10月22日,是找的哪些工号及姓名的医务人员检测指标116352的 | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyj... | css |
CREATE TABLE table_1416612_1 (
state VARCHAR,
highest_point VARCHAR
) | what's the state with highest point being mount katahdin | SELECT state FROM table_1416612_1 WHERE highest_point = "Mount Katahdin" | sql_create_context |
CREATE TABLE table_22102732_1 (
year__ceremony_ VARCHAR,
english_title VARCHAR
) | What year and the corresponding ceremony was the english titled movie 'time out' submitted? | SELECT year__ceremony_ FROM table_22102732_1 WHERE english_title = "Time Out" | sql_create_context |
CREATE TABLE table_56217 (
"Candidate" text,
"Money Raised, 3Q" text,
"Loans Received, 3Q" text,
"Money Spent, 3Q" text,
"Total Receipts" text,
"Cash On Hand" text,
"After Debt" text
) | How much money has been raised that has $5,821,587 cash on hand? | SELECT "Money Raised, 3Q" FROM table_56217 WHERE "Cash On Hand" = '$5,821,587' | wikisql |
CREATE TABLE table_27238 (
"No." real,
"#" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
) | What was the title of the episode directed by Jesse Warn? | SELECT "Production code" FROM table_27238 WHERE "Directed by" = 'Jesse Warn' | wikisql |
CREATE TABLE table_name_62 (
date VARCHAR,
ground VARCHAR
) | What date was the Colonial Stadium? | SELECT date FROM table_name_62 WHERE ground = "colonial stadium" | sql_create_context |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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 employees (
EMPLOYEE_I... | For those employees who was hired before 2002-06-21, show me about the change of employee_id over hire_date in a line chart. | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE table_22389 (
"Episode" text,
"Garfield Episode 1" text,
"U.S. Acres Episode" text,
"Garfield Episode 2" text,
"Original Airdate" text
) | What is the title of the first episode of Garfield that is followed by the second episode of Garfield titled Mamma Manicotti? | SELECT "Garfield Episode 1" FROM table_22389 WHERE "Garfield Episode 2" = 'Mamma Manicotti' | wikisql |
CREATE TABLE table_204_339 (
id number,
"season" number,
"age" number,
"overall" number,
"slalom" number,
"giant\nslalom" number,
"super g" text,
"downhill" number,
"combined" text
) | which year was rosi mittermaier 's last season ? | SELECT MAX("season") FROM table_204_339 | squall |
CREATE TABLE table_train_204 (
"id" int,
"systolic_blood_pressure_sbp" int,
"plasma_glucose_concentration" int,
"fasting_plasma_glucose_fpg" float,
"increase_risk_of_intervention" bool,
"diastolic_blood_pressure_dbp" int,
"life_span" bool,
"body_mass_index_bmi" float,
"NOUSE" float
) | medical conditions likely to limit life span and / or increase risk of intervention | SELECT * FROM table_train_204 WHERE life_span = 1 OR increase_risk_of_intervention = 1 | criteria2sql |
CREATE TABLE table_name_98 (
Id VARCHAR
) | What is the value for 2005 when A is 2009 and 2000? | SELECT 2005 FROM table_name_98 WHERE 2009 = "a" AND 2000 = "a" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | count the number of patients whose admission type is emergency and diagnoses short title is respiratory distress syn? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.short_title = "Respiratory distress syn" | mimicsql_data |
CREATE TABLE table_5890 (
"Year" real,
"Class" text,
"Team" text,
"Points" real,
"Rank" text,
"Wins" real
) | What's the average Year that has Points that's smaller than 9 with a Rank of 24th? | SELECT AVG("Year") FROM table_5890 WHERE "Points" < '9' AND "Rank" = '24th' | wikisql |
CREATE TABLE table_44934 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is Score, when Location Attendance is 'US Airways Center 18,422', and when Game is less than 22? | SELECT "Score" FROM table_44934 WHERE "Location Attendance" = 'us airways center 18,422' AND "Game" < '22' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
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,... | 从07年11月14日到20年9月19日,肿瘤内科有多少住院人数 | SELECT COUNT(*) FROM zyjzjlb WHERE JZKSMC = '化疗科' AND RYDJSJ BETWEEN '2007-11-14' AND '2020-09-19' | css |
CREATE TABLE table_name_91 (
license VARCHAR,
name VARCHAR
) | What is the license for Jriver Media Center? | SELECT license FROM table_name_91 WHERE name = "jriver media center" | sql_create_context |
CREATE TABLE table_203_746 (
id number,
"date" text,
"opponent" text,
"score" text,
"leading scorer" text,
"attendance" number,
"record" text
) | how many people attended the game on june 24 ? | SELECT "attendance" FROM table_203_746 WHERE "date" = 'june 24' | squall |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,... | how much weight was patient 25965's first weight until 11/2105? | 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 = 25965)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt'... | mimic_iii |
CREATE TABLE table_name_58 (
mdt___6_utc_ VARCHAR,
edt___4_utc_ VARCHAR,
pdt___7_utc_ VARCHAR
) | What time is MDT when EDT is set and PDT is 6:00 a.m.? | SELECT mdt___6_utc_ FROM table_name_58 WHERE edt___4_utc_ = "set" AND pdt___7_utc_ = "6:00 a.m." | sql_create_context |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE S... | count of users by location. | SELECT COUNT(*), Users.Location FROM Users WHERE LOWER(Users.Location) = '%india%' GROUP BY Users.Location | sede |
CREATE TABLE table_204_964 (
id number,
"team" text,
"seasons" number,
"games" number,
"wins" number,
"ties" number,
"losses" number,
"goals\nfor" number,
"goals\nagainst" number,
"goal\ndiff" number,
"points" number
) | how many total points has the lost angeles kings scored ? | SELECT "team" FROM table_204_964 WHERE "team" = 'los angeles kings' | squall |
CREATE TABLE table_201_39 (
id number,
"no" number,
"title" text,
"directed by" text,
"released" number
) | which person has directed most of the titles ? | SELECT "directed by" FROM table_201_39 GROUP BY "directed by" ORDER BY COUNT("title") DESC LIMIT 1 | squall |
CREATE TABLE table_2086 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | What country is Alain Labrecque from? | SELECT "Nationality" FROM table_2086 WHERE "Player" = 'Alain Labrecque' | wikisql |
CREATE TABLE table_75180 (
"Pick #" real,
"Round" text,
"Player" text,
"Position" text,
"College" text
) | What is the sum of pick# for Don Majkowski?3 | SELECT SUM("Pick #") FROM table_75180 WHERE "Player" = 'don majkowski' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.