context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostTags (
PostId num... | SELECT * FROM votes WHERE postId = 12505377;. | SELECT * FROM Votes WHERE PostId = 12505377 | sede |
CREATE TABLE table_name_48 (
division_record VARCHAR,
team VARCHAR
) | What is the Panthers' Division Record? | SELECT division_record FROM table_name_48 WHERE team = "panthers" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | provide the number of patients whose gender is m and days of hospital stay is greater than 6? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.days_stay > "6" | mimicsql_data |
CREATE TABLE Ref_Address_Types (
address_type_code VARCHAR(15),
address_type_description VARCHAR(80)
)
CREATE TABLE Student_Addresses (
student_id INTEGER,
address_id INTEGER,
date_address_from DATETIME,
date_address_to DATETIME,
monthly_rental DECIMAL(19,4),
other_details VARCHAR(255)
... | What is the number of end dates for incidents with incident type code 'NOISE'? Bin by weekday and return a bar chart, and order in ascending by the y-axis. | SELECT date_incident_start, COUNT(date_incident_start) FROM Behavior_Incident WHERE incident_type_code = "NOISE" ORDER BY COUNT(date_incident_start) | nvbench |
CREATE TABLE table_203_573 (
id number,
"name" text,
"rank - 2000" number,
"number" number,
"country of origin" text,
"england - 2001" text
) | which are they only two names that have spain as their country of origin ? | SELECT "name" FROM table_203_573 WHERE "country of origin" = 'spain' | squall |
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,
... | 提供检测指标名称和结果定量单位与记录12267094021相同,但检测指标结果定量大于等于他的检验指标记录详情 | SELECT * FROM jyjgzbb WHERE JCZBMC = (SELECT JCZBMC FROM jyjgzbb WHERE JYZBLSH = '12267094021') AND JCZBJGDW = (SELECT JCZBJGDW FROM jyjgzbb WHERE JYZBLSH = '12267094021') AND JCZBJGDL >= (SELECT JCZBJGDL FROM jyjgzbb WHERE JYZBLSH = '12267094021') | css |
CREATE TABLE table_69732 (
"Outcome" text,
"Date" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
) | What's the Outcome for the Date of July 16, 2011? | SELECT "Outcome" FROM table_69732 WHERE "Date" = 'july 16, 2011' | wikisql |
CREATE TABLE architect (
id VARCHAR,
name VARCHAR
)
CREATE TABLE bridge (
architect_id VARCHAR
) | What are the ids and names of the architects who built at least 3 bridges ? | SELECT T1.id, T1.name FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id GROUP BY T1.id HAVING COUNT(*) >= 3 | sql_create_context |
CREATE TABLE table_name_1 (
driver VARCHAR,
chassis VARCHAR,
rounds VARCHAR
) | Who drove the car with the n175 chassis in round 13? | SELECT driver FROM table_name_1 WHERE chassis = "n175" AND rounds = "13" | sql_create_context |
CREATE TABLE table_train_206 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"systolic_blood_pressure_sbp" int,
"hematocrit_hct" float,
"diabetic" string,
"contraception" bool,
"diastolic_blood_pressure_dbp" int,
"serum_creatinine" float,
"NOUSE" float
) | type i diabetes | SELECT * FROM table_train_206 WHERE diabetic = 'i' | criteria2sql |
CREATE TABLE table_26267607_2 (
pole_position VARCHAR,
winning_driver VARCHAR,
circuit VARCHAR
) | In the circuit Showevent Olympiastadion M nchen, where the winning driver is Bruno Spengler, what is the pole position? | SELECT pole_position FROM table_26267607_2 WHERE winning_driver = "Bruno Spengler" AND circuit = "Showevent Olympiastadion München" | sql_create_context |
CREATE TABLE table_45029 (
"Driver" text,
"Points" real,
"Wins" real,
"Top 5" real,
"Top 10" real
) | What is Frank Kimmel's lowest top 5 with more than 0 wins and fewer than 14 top 10s? | SELECT MIN("Top 5") FROM table_45029 WHERE "Wins" > '0' AND "Driver" = 'frank kimmel' AND "Top 10" < '14' | wikisql |
CREATE TABLE table_name_61 (
outcome VARCHAR,
championship VARCHAR,
score_in_the_final VARCHAR
) | Which Outcome has a Championship of us championships, and a Score in the final of 5 7, 6 1, 6 3, 6 3? | SELECT outcome FROM table_name_61 WHERE championship = "us championships" AND score_in_the_final = "5–7, 6–1, 6–3, 6–3" | sql_create_context |
CREATE TABLE table_48668 (
"Cat. #" text,
"Artist" text,
"Title" text,
"Release date" text,
"Format" text,
"Other information" text
) | What is the title released on 24 July 2005? | SELECT "Title" FROM table_48668 WHERE "Release date" = '24 july 2005' | wikisql |
CREATE TABLE table_name_70 (
coding VARCHAR,
variant_id VARCHAR
) | Which 5'utr splice's coding is 1a 2, when the Variant id is abd'1a 2? | SELECT 5 AS ’utr_splice FROM table_name_70 WHERE coding = "1a 2" AND variant_id = "abd'1a 2" | 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... | what is minimum age of patients whose gender is f and age is greater than or equal to 89? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.age >= "89" | mimicsql_data |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | what was the last hospital discharge time of patient 029-27704? | SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '029-27704' ORDER BY patient.hospitaldischargetime DESC LIMIT 1 | eicu |
CREATE TABLE table_10257 (
"Team" text,
"Stadium" text,
"Capacity" real,
"Highest" real,
"Lowest" real,
"Average" real
) | What is the sum of the lowest in attendance when the average is 1,166 and most in attendance is less than 2,215? | SELECT SUM("Lowest") FROM table_10257 WHERE "Average" = '1,166' AND "Highest" < '2,215' | wikisql |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment tex... | Top 10 users with the most questions.. | SELECT DisplayName AS "user", COUNT(Posts.Id) AS Questions FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId WHERE PostTypeId = 2 GROUP BY Users.Id, DisplayName ORDER BY 'questions' DESC LIMIT 10 | sede |
CREATE TABLE table_52612 (
"Block A" text,
"Akira" text,
"Atsushi Aoki" text,
"Black Tiger V" text,
"Jado" text,
"Milano Collection A.T." text,
"Prince Devitt" text,
"Tiger Mask IV" text
) | What is the Akira when Tiger Mask IV is Akira (10:05)? | SELECT "Akira" FROM table_52612 WHERE "Tiger Mask IV" = 'akira (10:05)' | 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... | provide the number of patients whose admission year is less than 2105 and diagnoses long title is personal history of other malignant neoplasm of skin? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2105" AND diagnoses.long_title = "Personal history of other malignant neoplasm of skin" | mimicsql_data |
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... | 在2019-07-16之前,患者任斯伯有哪些住院就诊的检验报告单?看一下住院就诊的流水号 | SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '任斯伯' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2019-07-16') | css |
CREATE TABLE table_11947 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the lowest Crowd Size for the Home Team of North Melbourne? | SELECT MIN("Crowd") FROM table_11947 WHERE "Home team" = 'north melbourne' | wikisql |
CREATE TABLE table_54839 (
"Block A" text,
"Antonio Thomas" text,
"Hikaru Sato" text,
"Hiroshi Yamato" text,
"Kaz Hayashi" text,
"Minoru" text,
"Super Crazy" text
) | Tell me the block A for antonio thomas of kondo (13:24) | SELECT "Block A" FROM table_54839 WHERE "Antonio Thomas" = 'kondo (13:24)' | wikisql |
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, give me the comparison about the sum of code over the name , and group by attribute name, and could you display total number in desc order please? | 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 university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Return a bar chart about the distribution of All_Home and the amount of All_Home , and group by attribute All_Home, I want to sort by the total number from low to high. | SELECT All_Home, COUNT(All_Home) FROM basketball_match GROUP BY All_Home ORDER BY COUNT(All_Home) | nvbench |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | 整理出患者年龄在3岁以下的医疗记录的平均医疗费总额 | SELECT AVG(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_AGE <= 3) | css |
CREATE TABLE table_895 (
"Model Number" text,
"Stepping" text,
"Frequency" text,
"L2 Cache" text,
"HT" text,
"Multi 1" text,
"V Core" text,
"TDP" text,
"Socket" text,
"Release Date" text,
"Part Number(s)" text
) | What is the frequency of the model whose part number is ado520biaa5do? | SELECT "Frequency" FROM table_895 WHERE "Part Number(s)" = 'ADO520BIAA5DO' | wikisql |
CREATE TABLE table_20530 (
"Institution" text,
"Location" text,
"Founded" real,
"Affiliation" text,
"Enrollment" real,
"Team Nickname" text,
"Primary conference" text
) | What year was the university that is located in Ellensburg, Washington established? | SELECT MIN("Founded") FROM table_20530 WHERE "Location" = 'Ellensburg, Washington' | wikisql |
CREATE TABLE table_26002 (
"Province" text,
"Mahmoud Ahmadinejad" real,
"Mehdi Karroubi" real,
"Mir-Hossein Mousavi" real,
"Mohsen Rezaee" real,
"Spoiled ballots" real,
"Total votes" real
) | What was the highest number of votes for mir-hossein mousavi when the number of invalid votes is 5683 | SELECT MAX("Mir-Hossein Mousavi") FROM table_26002 WHERE "Spoiled ballots" = '5683' | wikisql |
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,... | does TW have a flight from INDIANAPOLIS to HOUSTON arriving at 1100 | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'HOUSTON' AND flight.arrival_time = 1100 AND flight.to_airport = AIRPORT_SERVICE_1.airpor... | atis |
CREATE TABLE table_name_20 (
date VARCHAR,
distance VARCHAR,
course VARCHAR
) | What is the date with the distance of km (mi) at the course of roccaraso to san giorgio del sannio? | SELECT date FROM table_name_20 WHERE distance = "km (mi)" AND course = "roccaraso to san giorgio del sannio" | sql_create_context |
CREATE TABLE table_name_66 (
club VARCHAR,
league_goals VARCHAR
) | Which Club has a League goals of 21? | SELECT club FROM table_name_66 WHERE league_goals = "21" | sql_create_context |
CREATE TABLE table_22788 (
"Match no." real,
"Match Type" text,
"Team Europe" text,
"Score" text,
"Team USA" text,
"Progressive Total" text
) | How many different scores did Team Europe get when Mika Koivuniemi played for them? | SELECT COUNT("Score") FROM table_22788 WHERE "Team Europe" = 'Mika Koivuniemi' | wikisql |
CREATE TABLE Transactions_Lots (
transaction_id INTEGER,
lot_id INTEGER
)
CREATE TABLE Investors (
investor_id INTEGER,
Investor_details VARCHAR(255)
)
CREATE TABLE Purchases (
purchase_transaction_id INTEGER,
purchase_details VARCHAR(255)
)
CREATE TABLE Sales (
sales_transaction_id INTEG... | Find the transaction type descriptions and dates if the share count is smaller than 10, group by transaction type, count the date of transaction, and bin the date into the weekday interval Show the result with a grouping line chart, and could you sort from high to low by the X-axis? | SELECT T2.date_of_transaction, COUNT(T2.date_of_transaction) FROM Ref_Transaction_Types AS T1 JOIN Transactions AS T2 ON T1.transaction_type_code = T2.transaction_type_code WHERE T2.share_count < 10 GROUP BY transaction_type_description ORDER BY date_of_transaction DESC | nvbench |
CREATE TABLE table_name_17 (
episodes INTEGER,
tv_station VARCHAR,
japanese_title VARCHAR
) | Which Episodes have a TV Station of ntv, and a Japanese Title of ? | SELECT AVG(episodes) FROM table_name_17 WHERE tv_station = "ntv" AND japanese_title = "あいのうた" | sql_create_context |
CREATE TABLE table_name_60 (
year VARCHAR,
original_title VARCHAR
) | What was the year of Meg ll az Id ? | SELECT year FROM table_name_60 WHERE original_title = "megáll az idö" | sql_create_context |
CREATE TABLE table_70475 (
"Year" real,
"Chassis" text,
"Engine" text,
"Tyres" text,
"Points" real
) | What is the least Points with Chassis of forti fg01b forti fg03, and a year less than 1996? | SELECT MIN("Points") FROM table_70475 WHERE "Chassis" = 'forti fg01b forti fg03' AND "Year" < '1996' | wikisql |
CREATE TABLE table_203_631 (
id number,
"year" number,
"name of show" text,
"episodes" text,
"other guests" text,
"winner(s)" text
) | how many episodes was charmaine sheh on in the variety show super trio 2 : movie buff champions | SELECT "episodes" FROM table_203_631 WHERE "name of show" = 'super trio series 2: movie buff championship' | squall |
CREATE TABLE table_name_60 (
segment_d VARCHAR,
segment_a VARCHAR
) | Name the segment D for umbrellas | SELECT segment_d FROM table_name_60 WHERE segment_a = "umbrellas" | sql_create_context |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
... | i'd like to see all flights from DENVER to PHILADELPHIA | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADE... | atis |
CREATE TABLE table_204_394 (
id number,
"year" number,
"album" text,
"label" text,
"peak chart\npositions\nus" number,
"peak chart\npositions\nus r&b" number
) | in what year was the only album on the fontana label ? | SELECT "year" FROM table_204_394 WHERE "label" = 'fontana' | squall |
CREATE TABLE mzjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
... | 在门诊检查的邹元良患者在查出疾病F78.797时的检测指标290838的结果定量及其单位各是多少? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZ... | css |
CREATE TABLE table_45450 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | what is the place for gary player? | SELECT "Place" FROM table_45450 WHERE "Player" = 'gary player' | wikisql |
CREATE TABLE table_34470 (
"Party" text,
"Votes" real,
"Share" text,
"Change" text,
"Seats" text
) | Name the change for english democrats | SELECT "Change" FROM table_34470 WHERE "Party" = 'english democrats' | wikisql |
CREATE TABLE table_name_72 (
score VARCHAR,
game VARCHAR
) | What is the score of game 37? | SELECT score FROM table_name_72 WHERE game = 37 | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | how many patients whose diagnoses short title is alzheimer's disease and drug route is po/ng? | 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 = "Alzheimer's disease" AND prescriptions.route = "PO/NG" | mimicsql_data |
CREATE TABLE table_57281 (
"Last" text,
"First" text,
"Year" real,
"Sport" text,
"Country" text
) | Name the last for softball before 2000 | SELECT "Last" FROM table_57281 WHERE "Year" < '2000' AND "Sport" = 'softball' | wikisql |
CREATE TABLE table_1413 (
"Country" text,
"Freedom in the World 2013" text,
"2013 Index of Economic Freedom" text,
"2013 Press Freedom Index" text,
"2012 Democracy Index" text
) | What type of government does Kyrgyzstan have? | SELECT "2012 Democracy Index" FROM table_1413 WHERE "Country" = 'Kyrgyzstan' | wikisql |
CREATE TABLE table_224672_2 (
term_began VARCHAR,
term_ended VARCHAR
) | When did the term begin that ended January 3, 1995? | SELECT term_began FROM table_224672_2 WHERE term_ended = "January 3, 1995" | sql_create_context |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 从2006年8月11日开始,截止到2020年3月21日,请把马静慧的这位患者总共被开出的所有药物的编码、名称、数量、单价、金额给列出来 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '马静慧' AND gwyjzb.IN_HOSP_DATE BETWEEN '2006-08-11' AND '2020-03-21' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_... | css |
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... | 病患40717294诊断为I86.192疾病时在门诊检测指标763289的结果定量及其单位各是多少? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb... | css |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length in... | what is the cheapest fare from BALTIMORE to DALLAS in any class | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.ci... | atis |
CREATE TABLE documents_mailed (
document_id number,
mailed_to_address_id number,
mailing_date time
)
CREATE TABLE ref_document_status (
document_status_code text,
document_status_description text
)
CREATE TABLE document_drafts (
document_id number,
draft_number number,
draft_details te... | List the document ids for any documents with the status code done and the type code paper. | SELECT document_id FROM documents WHERE document_status_code = "done" AND document_type_code = "Paper" | spider |
CREATE TABLE table_name_64 (
year INTEGER,
album VARCHAR,
us_hot_100 VARCHAR
) | Which Year has an Album of airwaves, and a US Hot 100 of ? | SELECT MAX(year) FROM table_name_64 WHERE album = "airwaves" AND us_hot_100 = "–" | sql_create_context |
CREATE TABLE table_58075 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the Away team score for mcg? | SELECT "Away team score" FROM table_58075 WHERE "Venue" = 'mcg' | wikisql |
CREATE TABLE table_27478 (
"Rank" real,
"Rank w/o Hydropower" real,
"State" text,
"% Renewable" text,
"% Renewable w/o Hydro" text,
"Renewable electricity (GW\u00b7h)" real,
"Renewable electricity w/o Hydro (GW\u00b7h)" real,
"Total electricity (GW\u00b7h)" real
) | What was the maximum rank of the source with renewable percentage w/o hydro is 2.17%? | SELECT MAX("Rank") FROM table_27478 WHERE "% Renewable w/o Hydro" = '2.17%' | 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 (... | what is minimum age of patients whose marital status is single and primary disease is left colon cancer? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.diagnosis = "LEFT COLON CANCER" | mimicsql_data |
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_description VARCHAR(255)
)
CREATE TABLE Student_Tests_Taken (
registration_id INTEGER,
date_test_taken DATETIME,
test_result VARCHAR(255)
)
CREATE TABLE Students (
stud... | Return a histogram on what is the name of each course and the corresponding number of student enrollment?, and order total number in desc order. | SELECT course_name, COUNT(*) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_1820752_1 (
signal_power___kw__ VARCHAR,
arrival_date VARCHAR
) | If the arrival date is January 2059, what is the total amount of signal power? | SELECT COUNT(signal_power___kw__) FROM table_1820752_1 WHERE arrival_date = "January 2059" | sql_create_context |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 病人89609630为疾病U85.955,门诊诊断的检测指标023380的结果定量是什么?单位是什么? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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 = jybgb_jyjgzbb.Y... | css |
CREATE TABLE table_name_10 (
score VARCHAR,
year VARCHAR
) | What was the score for 1911? | SELECT score FROM table_name_10 WHERE year = 1911 | sql_create_context |
CREATE TABLE table_17598822_11 (
league VARCHAR,
player VARCHAR
) | Name the total number of league cup for mark roberts | SELECT COUNT(league) AS Cup FROM table_17598822_11 WHERE player = "Mark Roberts" | sql_create_context |
CREATE TABLE table_name_30 (
zone INTEGER,
champion VARCHAR
) | Which Zone has a Champion of surozh sudak? | SELECT SUM(zone) FROM table_name_30 WHERE champion = "surozh sudak" | sql_create_context |
CREATE TABLE table_203_5 (
id number,
"season" text,
"competition" text,
"round" text,
"opponent" text,
"home" text,
"away" text,
"aggregate" text
) | how many home games did st. gallen win ? | SELECT COUNT(*) FROM table_203_5 WHERE "home" > "home" | squall |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE T... | (fork) Post Count by Tag. | SELECT T.TagName, COUNT(*) AS "total", SUM(CASE WHEN NOT P.AcceptedAnswerId IS NULL THEN 1 ELSE 0 END) AS "answered", SUM(CASE WHEN NOT p.ClosedDate IS NULL THEN 1 ELSE 0 END) AS "closed", AVG(CAST(p.Score AS FLOAT)) AS "average_score", STDEV(CAST(p.Score AS FLOAT)) AS "std._dev" FROM Posts AS P INNER JOIN PostTags AS ... | sede |
CREATE TABLE table_204_644 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"record" text,
"game site" text,
"bye" text
) | which game did they score more , week 10 or 12 ? | SELECT "week" FROM table_204_644 WHERE "week" IN (10, 12) ORDER BY "result" DESC LIMIT 1 | squall |
CREATE TABLE table_29112 (
"Series #" real,
"Season #" real,
"Title" text,
"Director" text,
"Writer" text,
"Original Airdate" text
) | How many episodes are directed by ricardo mendez matta? | SELECT COUNT("Season #") FROM table_29112 WHERE "Director" = 'Ricardo Mendez Matta' | wikisql |
CREATE TABLE table_27421 (
"Year" real,
"Competition Description" text,
"Location" text,
"Apparatus" text,
"Rank-Final" real,
"Score-Final" text,
"Rank-Qualifying" real,
"Score-Qualifying" text
) | What was the qualifying score of the competition whose final score was 12.200? | SELECT "Score-Qualifying" FROM table_27421 WHERE "Score-Final" = '12.200' | wikisql |
CREATE TABLE table_78818 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Kickoff Time" text,
"Attendance" text
) | What is the result of the game with 57,234 people in attendance? | SELECT "Result" FROM table_78818 WHERE "Attendance" = '57,234' | wikisql |
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, visualize a bar chart about the distribution of name and the sum of code , and group by attribute name. | SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name | nvbench |
CREATE TABLE table_17255 (
"Station Number" text,
"District" text,
"Location" text,
"Type" text,
"Appliances" text,
"Registrations" text
) | what are all the location where station number is c11 | SELECT "Location" FROM table_17255 WHERE "Station Number" = 'C11' | wikisql |
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 demographic ... | how many patients diagnosed with abdominal pain,other specified site had drug type as main? | 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.long_title = "Abdominal pain, other specified site" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE table_70727 (
"Artist" text,
"Country of origin" text,
"Period active" text,
"Release-year of first charted record" real,
"Genre" text,
"Claimed sales" text
) | What is the Genre, when the Release-year of first charted record is 1968, and when the Country of origin is United States? | SELECT "Genre" FROM table_70727 WHERE "Release-year of first charted record" = '1968' AND "Country of origin" = 'united states' | wikisql |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val... | what's the difference between the total input and output today for patient 4401? | SELECT (SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4401)) AND DATETIME(inputevents_cv.charttime, 'start of day') = DATETIME(CURRENT_T... | mimic_iii |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,... | 知道40049431病人的检验报告单对应的检验结果指标均正常的检验报告单号吗 | SELECT jyjgzbb.BGDH 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 = '40049431' AND NOT jyjgzbb.BGDH IN (SELECT jyjgzb... | css |
CREATE TABLE table_1061075_1 (
aggregate VARCHAR
) | what is the total number of 2nd leg where aggregate is 7-2 | SELECT COUNT(2 AS nd_leg) FROM table_1061075_1 WHERE aggregate = "7-2" | sql_create_context |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
va... | has patient 18159 been prescribed albuterol 0.083% neb soln, labetalol hcl, or filgrastim in 12/2105. | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18159) AND prescriptions.drug IN ('albuterol 0.083% neb soln', 'labetalol hcl', 'filgrastim') AND STRFTIME('%y-%m', prescriptions.startdate) = '2105-12' | mimic_iii |
CREATE TABLE table_50715 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the average bronze when the total is 2, silver is less than 1 and gold is more than 1? | SELECT AVG("Bronze") FROM table_50715 WHERE "Total" = '2' AND "Silver" < '1' AND "Gold" > '1' | wikisql |
CREATE TABLE table_name_21 (
team_nickname VARCHAR,
enrollment INTEGER
) | Name the team nickname for enrollment more than 42,326 | SELECT team_nickname FROM table_name_21 WHERE enrollment > 42 OFFSET 326 | sql_create_context |
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | What is the minimum weights for people of each sex? Show a bar chart. | SELECT Sex, MIN(Weight) FROM people GROUP BY Sex | nvbench |
CREATE TABLE table_name_24 (
time_retired VARCHAR,
laps VARCHAR
) | what is the time/retired when the laps is 52? | SELECT time_retired FROM table_name_24 WHERE laps = 52 | sql_create_context |
CREATE TABLE table_name_97 (
pct INTEGER,
years VARCHAR,
lost VARCHAR
) | What is the average percent for the coach from 1905 and more than 7 losses? | SELECT AVG(pct) FROM table_name_97 WHERE years = "1905" AND lost > 7 | sql_create_context |
CREATE TABLE table_51654 (
"Race" text,
"Circuit" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Constructor" text,
"Tyre" text,
"Report" text
) | Which race did Alberto Ascari have both the Pole position and the win, but Luigi Villoresi set the fastest lap time? | SELECT "Race" FROM table_51654 WHERE "Pole position" = 'alberto ascari' AND "Winning driver" = 'alberto ascari' AND "Fastest lap" = 'luigi villoresi' | wikisql |
CREATE TABLE table_46857 (
"Sport" text,
"League" text,
"Club" text,
"Founded" real,
"Venue" text,
"League championships" real,
"Championship years" text
) | How much Founded has a League championships larger than 0, and a Club of penn state nittany lions women's volleyball? | SELECT COUNT("Founded") FROM table_46857 WHERE "League championships" > '0' AND "Club" = 'penn state nittany lions women''s volleyball' | wikisql |
CREATE TABLE table_17718 (
"Year" real,
"Total Region" real,
"Rockhampton" real,
"Livingstone" real,
"Fitzroy" real,
"Mt Morgan" real
) | what's the livingstone with fitzroy being 9499 | SELECT "Livingstone" FROM table_17718 WHERE "Fitzroy" = '9499' | wikisql |
CREATE TABLE Player (
pID numeric(5,0),
pName varchar(20),
yCard varchar(3),
HS numeric(5,0)
)
CREATE TABLE College (
cName varchar(20),
state varchar(2),
enr numeric(5,0)
)
CREATE TABLE Tryout (
pID numeric(5,0),
cName varchar(20),
pPos varchar(8),
decision varchar(3)
) | A bar chart about how many students are enrolled in colleges that have student accepted during tryouts, and in which states are those colleges?, and rank by the state in descending. | SELECT state, enr FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes' ORDER BY state DESC | nvbench |
CREATE TABLE table_26914076_3 (
story_by VARCHAR,
us_viewers__millions_ VARCHAR
) | Who wrote the story viewed by 0.53 million viewers? | SELECT story_by FROM table_26914076_3 WHERE us_viewers__millions_ = "0.53" | sql_create_context |
CREATE TABLE table_name_14 (
year VARCHAR,
title VARCHAR
) | What is the Year of Rio? | SELECT year FROM table_name_14 WHERE title = "rio" | sql_create_context |
CREATE TABLE table_63629 (
"Rank" real,
"Canton" text,
"Highest point" text,
"Highest elevation" text,
"Lowest point" text,
"Lowest elevation" text
) | What is the highest elevation for the highest point of Schnebelhorn? | SELECT "Highest elevation" FROM table_63629 WHERE "Highest point" = 'schnebelhorn' | wikisql |
CREATE TABLE loan (
loan_id text,
loan_type text,
cust_id text,
branch_id text,
amount number
)
CREATE TABLE bank (
branch_id number,
bname text,
no_of_customers number,
city text,
state text
)
CREATE TABLE customer (
cust_id text,
cust_name text,
acc_type text,
... | Count the number of different account types. | SELECT COUNT(DISTINCT acc_type) FROM customer | spider |
CREATE TABLE Activity (
activity_name VARCHAR
) | What activities do we have? | SELECT activity_name FROM Activity | sql_create_context |
CREATE TABLE university (
school_id number,
school text,
location text,
founded number,
affiliation text,
enrollment number,
nickname text,
primary_conference text
)
CREATE TABLE basketball_match (
team_id number,
school_id number,
team_name text,
acc_regular_season text... | How many schools do not participate in the basketball match? | SELECT COUNT(*) FROM university WHERE NOT school_id IN (SELECT school_id FROM basketball_match) | spider |
CREATE TABLE table_name_5 (
title VARCHAR,
pages VARCHAR,
vol__number VARCHAR
) | What is the title of the edition with more than 128 pages and a volume # of 5? | SELECT title FROM table_name_5 WHERE pages > 128 AND vol__number = 5 | sql_create_context |
CREATE TABLE table_31794 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the lowest value for bronze with a total of 3 and a value for silver greater than 1 while the value of gold is smaller than 1? | SELECT MIN("Bronze") FROM table_31794 WHERE "Total" = '3' AND "Silver" > '1' AND "Gold" < '1' | wikisql |
CREATE TABLE table_name_59 (
campus VARCHAR,
location VARCHAR
) | What campus is in Brgy. Alangilan, Batangas City? | SELECT campus FROM table_name_59 WHERE location = "brgy. alangilan, batangas city" | sql_create_context |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReas... | usage of with in data.table answers. | SELECT CONCAT('https://stackoverflow.com/a/', CAST(Id AS TEXT)) FROM Posts WHERE ParentId IN (SELECT DISTINCT PostId FROM PostTags WHERE TagId = (SELECT Id FROM Tags WHERE TagName = 'data.table')) AND PostTypeId = 2 AND (Body LIKE '%with=F%' OR Body LIKE '%with =F%' OR Body LIKE '%with= F%' OR Body LIKE '%with = F%') A... | sede |
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE... | Visualize a bar chart about the distribution of meter_400 and ID , sort in asc by the y axis. | SELECT meter_400, ID FROM swimmer ORDER BY ID | nvbench |
CREATE TABLE table_2582 (
"Position" text,
"Horse" text,
"Jockey" text,
"Age" real,
"Handicap (st-lb)" text,
"SP" text,
"Distance" text,
"Prize money" text
) | How old was the horse when the SP was 200/1? | SELECT COUNT("Age") FROM table_2582 WHERE "SP" = '200/1' | wikisql |
CREATE TABLE table_name_75 (
total INTEGER,
bronze VARCHAR,
silver VARCHAR,
gold VARCHAR
) | With a silver greater than 0, gold of 9 and a bronze less than 9, what is the lowest total listed? | SELECT MIN(total) FROM table_name_75 WHERE silver > 0 AND gold = 9 AND bronze < 9 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.