context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_54 (
time VARCHAR,
nationality VARCHAR
) | What is the time for Russia? | SELECT time FROM table_name_54 WHERE nationality = "russia" | sql_create_context |
CREATE TABLE table_24136365_2 (
location VARCHAR,
week VARCHAR
) | When 4 is the week what is the location? | SELECT location FROM table_24136365_2 WHERE week = 4 | sql_create_context |
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,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | how much does patient 14982 change in heart rate last measured on the last icu visit compared to the first value measured on the last icu visit? | SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14982) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents... | mimic_iii |
CREATE TABLE table_14304 (
"Rank by average" real,
"Competition finish" real,
"Couple" text,
"Total" real,
"Number of dances" real,
"Average" real
) | Name the total number of competition finish with total of 90 and rank by average more than 5 | SELECT COUNT("Competition finish") FROM table_14304 WHERE "Total" = '90' AND "Rank by average" > '5' | wikisql |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImage... | create while loop with cte. http://stackoverflow.com/questions/12929165/create-while-loop-with-cte | WITH Nums AS (SELECT Digit FROM (VALUES (0), (1), (2), (3), (4), (5), (6), (7), (8), (9)) AS Nums(Digit)) SELECT CAST(id AS TEXT(5)) AS id FROM (SELECT t3.digit * 100 + t2.digit * 10 + t1.digit + 1 AS id FROM Nums AS t1 CROSS JOIN Nums AS t2 CROSS JOIN Nums AS t3) AS t WHERE id <= 884 ORDER BY id | sede |
CREATE TABLE bridge (
length_feet INTEGER
) | What is the average length in feet of the bridges? | SELECT AVG(length_feet) FROM bridge | sql_create_context |
CREATE TABLE table_1137707_2 (
location VARCHAR,
fastest_lap VARCHAR
) | What is the location of thierry boutsen? | SELECT location FROM table_1137707_2 WHERE fastest_lap = "Thierry Boutsen" | sql_create_context |
CREATE TABLE Invoice_Line_Items (
order_item_id INTEGER,
invoice_number INTEGER,
product_id INTEGER,
product_title VARCHAR(80),
product_quantity VARCHAR(50),
product_price DECIMAL(19,4),
derived_product_cost DECIMAL(19,4),
derived_vat_payable DECIMAL(19,4),
derived_total_cost DECIMAL... | How many accounts are opened in each day for all accounts by the customer with first name 'Meaghan' ? Bin the account open day by weekday in a bar chart, and order y axis in ascending order. | SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = 'Meaghan' ORDER BY COUNT(date_account_opened) | nvbench |
CREATE TABLE table_train_116 (
"id" int,
"mini_mental_state_examination_mmse" int,
"hemoglobin_a1c_hba1c" float,
"body_weight" float,
"hepatic_disease" bool,
"geriatric_depression_scale_gds" int,
"NOUSE" float
) | screening geriatric depression ( gds ) _ 15 score less than ( < ) 6 | SELECT * FROM table_train_116 WHERE geriatric_depression_scale_gds <= 6 | criteria2sql |
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 prescriptions... | what is the number of patients whose admission location is trsf within this facility and year of birth is less than 1887? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.dob_year < "1887" | mimicsql_data |
CREATE TABLE Invoices (
invoice_number INTEGER,
order_id INTEGER,
invoice_date DATETIME
)
CREATE TABLE Product_Categories (
production_type_code VARCHAR(15),
product_type_description VARCHAR(80),
vat_rating DECIMAL(19,4)
)
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
a... | What is the relationship between account id and the number of transactions for each account? Return a scatter chart. | SELECT T1.account_id, COUNT(*) FROM Financial_Transactions AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id GROUP BY T1.account_id | nvbench |
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,
... | what number of patients admitted in emergency had drug code enox80i? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.formulary_drug_cd = "ENOX80I" | mimicsql_data |
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... | get the number of patients with procedure icd9 code 4439. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.icd9_code = "4439" | mimicsql_data |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
... | please give me flights from ATLANTA to BOSTON on wednesday morning and thursday afternoon | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((((flight.departure_time BETWEEN 0 AND 1200) AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_na... | atis |
CREATE TABLE table_name_60 (
pick INTEGER,
team VARCHAR
) | What is the lowest pick for the Buffalo Bills? | SELECT MIN(pick) FROM table_name_60 WHERE team = "buffalo bills" | sql_create_context |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE offering_instructor (
offering_ins... | For Winter Other classes who is the professor ? | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr... | advising |
CREATE TABLE table_name_82 (
game VARCHAR,
rams_points VARCHAR
) | In what Game did Rams Points equal 0? | SELECT game FROM table_name_82 WHERE rams_points = 0 | sql_create_context |
CREATE TABLE store_district (
Store_ID int,
District_ID int
)
CREATE TABLE product (
product_id int,
product text,
dimensions text,
dpi real,
pages_per_minute_color real,
max_page_size text,
interface text
)
CREATE TABLE store (
Store_ID int,
Store_Name text,
Type text,... | What are the district names and city populations for all districts that between 200,000 and 2,000,000 residents? Show a bar graph, and rank in desc by the X. | SELECT District_name, City_Population FROM district WHERE City_Population BETWEEN 200000 AND 2000000 ORDER BY District_name DESC | nvbench |
CREATE TABLE table_11190568_7 (
date_of_vacancy VARCHAR,
outgoing_manager VARCHAR
) | When are the vacancy dates for outgoing manager Damien Fox? | SELECT date_of_vacancy FROM table_11190568_7 WHERE outgoing_manager = "Damien Fox" | sql_create_context |
CREATE TABLE table_name_50 (
type VARCHAR,
name__pinyin_ VARCHAR
) | What is the type of Guangjia? | SELECT type FROM table_name_50 WHERE name__pinyin_ = "guangjia" | sql_create_context |
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
)
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
) | what is minimum age for different job title?, and list by the job in desc. | SELECT job, MIN(age) FROM Person GROUP BY job ORDER BY job DESC | nvbench |
CREATE TABLE table_16077 (
"Round" real,
"Choice" real,
"Overall" real,
"Player name" text,
"Position" text,
"College" text
) | What is Bruce Cerone overall? | SELECT MIN("Overall") FROM table_16077 WHERE "Player name" = 'Bruce Cerone' | wikisql |
CREATE TABLE table_42144 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
) | What's the Class for the city the license plate was issued in great barrington, massachusetts? | SELECT "Class" FROM table_42144 WHERE "City of license" = 'great barrington, massachusetts' | wikisql |
CREATE TABLE table_name_98 (
format VARCHAR,
label VARCHAR
) | What is Candlelight Records format? | SELECT format FROM table_name_98 WHERE label = "candlelight records" | sql_create_context |
CREATE TABLE table_name_19 (
district VARCHAR,
reserved_for___sc___st__none_ VARCHAR,
constituency_number VARCHAR
) | Name the District that has a Reserved for ( SC / ST /None) of none and a Constituency number of 242? | SELECT district FROM table_name_19 WHERE reserved_for___sc___st__none_ = "none" AND constituency_number = "242" | sql_create_context |
CREATE TABLE table_22810 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 5" real,
"Top 10" real,
"Poles" real,
"Avg. Start" text,
"Avg. Finish" text,
"Winnings" text,
"Position" text,
"Team(s)" text
) | What's the amount of winnings (in $) in the year with 2 wins? | SELECT "Winnings" FROM table_22810 WHERE "Wins" = '2' | wikisql |
CREATE TABLE table_54562 (
"Name" text,
"Current version" text,
"System" text,
"Platform" text,
"License" text
) | What platform is nds4droid on for the nintendo ds with a license of gpl v2? | SELECT "Platform" FROM table_54562 WHERE "System" = 'nintendo ds' AND "License" = 'gpl v2' AND "Name" = 'nds4droid' | wikisql |
CREATE TABLE table_name_18 (
score VARCHAR,
record VARCHAR
) | What was the score of the game with a record of 18-22-13? | SELECT score FROM table_name_18 WHERE record = "18-22-13" | sql_create_context |
CREATE TABLE apartments (
apt_id number,
building_id number,
apt_type_code text,
apt_number text,
bathroom_count number,
bedroom_count number,
room_count text
)
CREATE TABLE apartment_facilities (
apt_id number,
facility_code text
)
CREATE TABLE apartment_buildings (
building_i... | Which apartments have type code 'Flat'? Give me their apartment numbers. | SELECT apt_number FROM apartments WHERE apt_type_code = "Flat" | spider |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
Owner... | Top 50 SO Users from Madhya Pradesh. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%Madhya pradesh%' OR UPPER(Location) LIKE '%Madhya pradesh%' OR Location LIKE '%Madhya pradesh%' AND Reputation >= 1000 ORDER BY Reputation DESC LIMIT 2500 | sede |
CREATE TABLE table_79086 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text
) | What are the results of the incumbent who was first elected in 1996? | SELECT "Results" FROM table_79086 WHERE "First elected" = '1996' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE patients (
row_id number,... | how much weight was patient 739's last weight in this month? | 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 = 739)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt' A... | mimic_iii |
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 ACC_Road and School_ID , and group by attribute All_Home, and rank by the x axis in desc please. | SELECT ACC_Road, School_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY ACC_Road DESC | nvbench |
CREATE TABLE table_64522 (
"Position" real,
"Name" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Points" real
) | What is the total number of points combined from the teams that played over 14 games? | SELECT COUNT("Points") FROM table_64522 WHERE "Played" > '14' | wikisql |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jo... | Does Prof. Bradley Smith teach 475 next Winter ? | SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 475 AND instructor.name LIKE '%Bradley Smith%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_i... | advising |
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,
... | 患者褚博瀚腰部的各项指标检验结果是怎么样的? | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb 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 = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE person_info.XM = '褚博瀚'... | css |
CREATE TABLE table_train_215 (
"id" int,
"hemoglobin_a1c_hba1c" float,
"hgba1c" float,
"estimated_glomerular_filtration_rate_egfr" int,
"kidney_disease" bool,
"body_mass_index_bmi" float,
"age" float,
"NOUSE" float
) | hemoglobin a1c < 8.5 % | SELECT * FROM table_train_215 WHERE hemoglobin_a1c_hba1c < 8.5 | criteria2sql |
CREATE TABLE table_34384 (
"Rank" real,
"Name" text,
"Nation" text,
"Points" real,
"Places" real
) | What was the average rank of Wolfgang Schwarz with greater than 13 places? | SELECT AVG("Rank") FROM table_34384 WHERE "Name" = 'wolfgang schwarz' AND "Places" > '13' | wikisql |
CREATE TABLE table_71074 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
) | what is the place for ireland? | SELECT "Place" FROM table_71074 WHERE "Country" = 'ireland' | wikisql |
CREATE TABLE table_14292 (
"Pick" real,
"Player" text,
"Country of origin*" text,
"PBA team" text,
"College" text
) | What is the country of origin for the player who plays on Tondena 65 Rhum? | SELECT "Country of origin*" FROM table_14292 WHERE "PBA team" = 'tondena 65 rhum' | wikisql |
CREATE TABLE table_21146729_6 (
series__number INTEGER,
original_airdate VARCHAR
) | What was the series# with the original airdate of october 23, 1967? | SELECT MAX(series__number) FROM table_21146729_6 WHERE original_airdate = "October 23, 1967" | sql_create_context |
CREATE TABLE table_60132 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Event" text,
"Time" text
) | What Competition has a Year smaller than 1983? | SELECT "Competition" FROM table_60132 WHERE "Year" < '1983' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | provide the number of patients whose admission type is newborn 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.admission_type = "NEWBORN" AND prescriptions.route = "NEB" | mimicsql_data |
CREATE TABLE table_204_749 (
id number,
"courthouse" text,
"city" text,
"street address" text,
"jurisdiction" text,
"dates of use" text,
"named for" number
) | where was the first court house built ? | SELECT "city" FROM table_204_749 ORDER BY "dates of use" LIMIT 1 | squall |
CREATE TABLE table_1074 (
"Nation" text,
"Winners" real,
"Runners-up" real,
"Third Place" real,
"Fourth Place" real
) | How many times did argentina win? | SELECT MAX("Winners") FROM table_1074 WHERE "Nation" = 'Argentina' | wikisql |
CREATE TABLE table_name_23 (
runner_s__up VARCHAR,
winner VARCHAR
) | Who was the runner(s)-Up to winner Sarah Brice? | SELECT runner_s__up FROM table_name_23 WHERE winner = "sarah brice" | sql_create_context |
CREATE TABLE table_203_697 (
id number,
"player" text,
"career" text,
"nickname" text,
"team inducted as" text
) | how long did cap anson play ? | SELECT "career" - "career" FROM table_203_697 WHERE "player" = 'cap anson' | squall |
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 the number of patients who were admitted via emergency room and had open liver biopsy procedure? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND procedures.short_title = "Open liver biopsy" | mimicsql_data |
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 inputevents_cv (
row_id number,
subject_id number,
... | until 2104, when did patient 86206 come to the hospital via the phys referral/normal deli for the first time? | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 86206 AND admissions.admission_location = 'phys referral/normal deli' AND STRFTIME('%y', admissions.admittime) <= '2104' ORDER BY admissions.admittime LIMIT 1 | mimic_iii |
CREATE TABLE table_37033 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real,
"Finish" text
) | Year(s) won of 1994 , 1997 has what average total? | SELECT AVG("Total") FROM table_37033 WHERE "Year(s) won" = '1994 , 1997' | wikisql |
CREATE TABLE table_name_44 (
date VARCHAR,
home_team VARCHAR
) | When was Southend United the home team? | SELECT date FROM table_name_44 WHERE home_team = "southend united" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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 te... | 哪些韩志明患者的检验报告单号对应的检验结果指标均异常和检验报告单号都是那个? | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '韩志明' AND NOT ... | css |
CREATE TABLE table_56435 (
"Tournament" text,
"1989" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text... | what 1989 has 2002 of 4r and 2005 of 4r? | SELECT "1989" FROM table_56435 WHERE "2002" = '4r' AND "2005" = '4r' | wikisql |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE instructor (
... | Which classes make up an EECS major 's Core ? | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%EECS%' AND program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id | advising |
CREATE TABLE gyb (
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... | 章浩然患者入院诊断疾病名称不包含癫痫在医院4333598的医疗就诊记录编号是什么号? | SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '章浩然' AND qtb.MED_SER_ORG_NO = '4333598' AND NOT qtb.IN_DIAG_DIS_NM LIKE '%癫痫%' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '章浩然' AND gyb.MED_SER_ORG_NO = '4333598' AND NOT gyb.IN_DIAG_DIS_NM LIKE '%癫痫%' UNION SELECT zyb.MED_CLINIC_ID FROM zyb WH... | css |
CREATE TABLE table_name_21 (
year INTEGER,
miss_fire__3rd_runner_up_ VARCHAR
) | What year was Caroline Medina Miss Fire (3rd Runner-up)? | SELECT AVG(year) FROM table_name_21 WHERE miss_fire__3rd_runner_up_ = "caroline medina" | sql_create_context |
CREATE TABLE has_amenity (
dormid number,
amenid number
)
CREATE TABLE dorm (
dormid number,
dorm_name text,
student_capacity number,
gender text
)
CREATE TABLE dorm_amenity (
amenid number,
amenity_name text
)
CREATE TABLE lives_in (
stuid number,
dormid number,
room_numb... | What is the first name and age of every student who lives in a dorm with a TV Lounge? | SELECT T1.fname, T1.age FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid WHERE NOT T2.dormid IN (SELECT T3.dormid FROM has_amenity AS T3 JOIN dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge') | spider |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 病患51529676买了多少次西药,在01年12月7日到06年4月8日这段时间里? | SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '51529676' AND t_kc22.STA_DATE BETWEEN '2001-12-07' AND '2006-04-08' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_ID = '5... | css |
CREATE TABLE table_name_5 (
crowd VARCHAR,
away_team VARCHAR
) | How many people were in the crowd with the away team being collingwood? | SELECT COUNT(crowd) FROM table_name_5 WHERE away_team = "collingwood" | sql_create_context |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 参保号码是60198732的人从2008年12月3日起到2010年1月6日为止单一药品购买的最大次数是多少? | 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 = '60198732' AND t_kc22.STA_DATE BETWEEN '2008-12-03' AND '2010-01-06' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC L... | css |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TA... | Questions with outstanding close votes by tag. | SELECT * FROM (SELECT Posts.Id AS "post_link", AVG(Posts.Score) AS "score", COUNT(*) AS "close_votes", MAX(Votes.CreationDate) AS "last_vote", MIN(Votes.CreationDate) AS "first_vote" FROM Posts JOIN Votes ON Posts.Id = Votes.PostId WHERE Votes.VoteTypeId = 6 AND Posts.ClosedDate IS NULL AND Posts.Tags LIKE '%<##Tag##>%... | sede |
CREATE TABLE table_20124413_1 (
original_title VARCHAR,
prod_code VARCHAR
) | When 1.12 is the production code what is the original title? | SELECT original_title FROM table_20124413_1 WHERE prod_code = "1.12" | sql_create_context |
CREATE TABLE table_1692 (
"Province" text,
"Provincial capital" text,
"Largest city" text,
"Area (km 2 )" real,
"Population (2013)" real
) | what is the number of provincial captial where the province is northern cape? | SELECT COUNT("Provincial capital") FROM table_1692 WHERE "Province" = 'Northern Cape' | wikisql |
CREATE TABLE table_8650 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Attendance" real,
"Record" text,
"Points" real
) | How many Points have a Date of march 19, 2009? | SELECT COUNT("Points") FROM table_8650 WHERE "Date" = 'march 19, 2009' | wikisql |
CREATE TABLE table_26137 (
"Series episode" real,
"Season episode" real,
"Title" text,
"U.S. viewers (millions)" text,
"Original U.S. airdate" text,
"Prod. code" real
) | What is the lowest series episode with a production code of 406? | SELECT MIN("Series episode") FROM table_26137 WHERE "Prod. code" = '406' | wikisql |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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,
... | 能告诉我病人97231052所有医疗记录中医疗费总额不低于9587.83元的入院诊断疾病名称是什么吗?疾病编码呢 | SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '97231052' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 9587.83) | css |
CREATE TABLE table_4910 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the home team score for the game with the away team Carlton? | SELECT "Home team score" FROM table_4910 WHERE "Away team" = 'carlton' | wikisql |
CREATE TABLE table_name_15 (
entrant VARCHAR,
points VARCHAR,
chassis VARCHAR,
engine VARCHAR,
year VARCHAR
) | Which entrant, with an Offenhauser L4 engine and a Kurtis Kraft KK500A chassis, scored 9 points before 1955? | SELECT entrant FROM table_name_15 WHERE engine = "offenhauser l4" AND year < 1955 AND chassis = "kurtis kraft kk500a" AND points = 9 | sql_create_context |
CREATE TABLE table_name_37 (
territory VARCHAR,
acquired VARCHAR,
capital VARCHAR
) | What is the territory that was acquired past 1899 and has a capital of saipan? | SELECT territory FROM table_name_37 WHERE acquired > 1899 AND capital = "saipan" | sql_create_context |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
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,
... | A bar chart shows the distribution of meter_600 and ID . | SELECT meter_600, ID FROM swimmer | nvbench |
CREATE TABLE table_name_90 (
winner VARCHAR,
location VARCHAR,
date VARCHAR
) | Who is the winner of the tournament in Georgia on Oct 3? | SELECT winner FROM table_name_90 WHERE location = "georgia" AND date = "oct 3" | sql_create_context |
CREATE TABLE table_name_5 (
bronze INTEGER,
total VARCHAR,
silver VARCHAR
) | What is the most Bronze medals won among the participants that won less than 22 medals overall and less than 5 silver medals? | SELECT MAX(bronze) FROM table_name_5 WHERE total < 22 AND silver < 5 | sql_create_context |
CREATE TABLE table_15194 (
"Name" text,
"Race" text,
"Current age" real,
"Age at offense" real,
"Years on death row" real,
"Location of offense" text
) | What is the prisoner's name that is currently 29 years old? | SELECT "Name" FROM table_15194 WHERE "Current age" = '29' | wikisql |
CREATE TABLE table_name_45 (
time VARCHAR,
event VARCHAR
) | What was the time of sportfight 10? | SELECT time FROM table_name_45 WHERE event = "sportfight 10" | sql_create_context |
CREATE TABLE table_45714 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | What is the Record for April 13? | SELECT "Record" FROM table_45714 WHERE "Date" = 'april 13' | 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 born before 2076 have been discharged to short term hospital? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND demographic.dob_year < "2076" | mimicsql_data |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
had... | what are the four most frequently occurring specimen tests? | SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 4 | mimic_iii |
CREATE TABLE countries (
country_id text,
country_name text,
region_id number
)
CREATE TABLE jobs (
job_id text,
job_title text,
min_salary number,
max_salary number
)
CREATE TABLE regions (
region_id number,
region_name text
)
CREATE TABLE locations (
location_id number,
... | List the full name (first and last name), and salary for those employees who earn below 6000. | SELECT first_name, last_name, salary FROM employees WHERE salary < 6000 | spider |
CREATE TABLE table_204_652 (
id number,
"title" text,
"year" number,
"director" text,
"country" text,
"genre" text,
"notes" text
) | what is the number of films in this category that came from france during this year ? | SELECT COUNT("title") FROM table_204_652 WHERE "country" = 'france' | squall |
CREATE TABLE table_58494 (
"Name" text,
"Years" text,
"Area" text,
"Authority" text,
"Decile" text,
"Roll" text
) | What is the roll number of Poroti school, which has a 6 decile? | SELECT "Roll" FROM table_58494 WHERE "Decile" = '6' AND "Name" = 'poroti school' | wikisql |
CREATE TABLE table_2668367_7 (
incumbent VARCHAR,
district VARCHAR
) | Who was the incumbent in the Kentucky 8 district? | SELECT incumbent FROM table_2668367_7 WHERE district = "Kentucky 8" | sql_create_context |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE restriction (
restriction_code text,
... | i would like information on ground transportation in ATLANTA from the airport to the city in the morning around 9am | SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = airport_service.city_code AND CITY_1.city_name = 'ATLANTA' AND ground_service.airp... | atis |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
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 o... | when was the last time patient 1902 was having greater than 64.0 heart rate today? | SELECT chartevents.charttime 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 = 1902)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rat... | mimic_iii |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | provide the number of patients whose admission type is elective and drug name is heparin (iabp)? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.drug = "Heparin (IABP)" | mimicsql_data |
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,... | 参保人98736904在2007.1.26到2015.8.6这段时间,曾开出的药品中,单一药品最大购买次数查一下 | 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 = '98736904' AND t_kc22.STA_DATE BETWEEN '2007-01-26' AND '2015-08-06' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC L... | css |
CREATE TABLE table_15479 (
"Date" text,
"Home captain" text,
"Away captain" text,
"Venue" text,
"Result" text
) | Who was the Home Captain at Sabina Park? | SELECT "Home captain" FROM table_15479 WHERE "Venue" = 'sabina park' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
... | what changes have been made to the wbc x 1000 values in patient 027-141930 second measured on the first hospital visit compared to the first value measured on the first hospital visit? | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-141930' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hosp... | eicu |
CREATE TABLE table_74113 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
) | how many teams had an appointment date of 11 april 2011 | SELECT COUNT("Team") FROM table_74113 WHERE "Date of appointment" = '11 April 2011' | wikisql |
CREATE TABLE table_14293 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | How many silver medals when the total was 2 and less than 1 bronze? | SELECT SUM("Silver") FROM table_14293 WHERE "Bronze" < '1' AND "Total" = '2' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE lab (
labid number,
pa... | count the number of patients who are diagnosed with coronary artery disease and do not come back to the hospital in the same month until 2104. | SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'coronary artery disease' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104') AS t1) - (SELECT COU... | eicu |
CREATE TABLE table_name_54 (
laps INTEGER,
points VARCHAR,
car__number VARCHAR,
make VARCHAR
) | What is the sum of laps that has a car number of larger than 1, is a ford, and has 155 points? | SELECT SUM(laps) FROM table_name_54 WHERE car__number > 1 AND make = "ford" AND points = 155 | sql_create_context |
CREATE TABLE table_name_77 (
surface VARCHAR,
date VARCHAR
) | What is the Surface of the match played on October 5, 1987? | SELECT surface FROM table_name_77 WHERE date = "october 5, 1987" | sql_create_context |
CREATE TABLE table_204_319 (
id number,
"mlb\nseason" number,
"team\nseason" number,
"league" text,
"division" text,
"finish" text,
"wins" number,
"losses" number,
"win %" number,
"gb" text,
"postseason" text,
"awards" text
) | how many losses did the team have in 1981 ? | SELECT SUM("losses") FROM table_204_319 WHERE "mlb\nseason" = 1981 | squall |
CREATE TABLE buildings (
id int,
name text,
City text,
Height int,
Stories int,
Status text
)
CREATE TABLE Office_locations (
building_id int,
company_id int,
move_in_year int
)
CREATE TABLE Companies (
id int,
name text,
Headquarters text,
Industry text,
Sales_... | List the number of each company whose office is in the building in a bar chart, list by the x-axis in asc. | SELECT T3.name, COUNT(T3.name) FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T3.name ORDER BY T3.name | nvbench |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER
)
CREATE TABLE Faculty_Participates_in (
FacID INTEGER... | How many faculty members does each building have? List the result with the name of the building Visualize by bar chart, order total number from low to high order. | SELECT Building, COUNT(*) FROM Faculty GROUP BY Building ORDER BY COUNT(*) | nvbench |
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 the number of patients whose diagnoses short title is cor ath unsp vsl ntv/gft and drug route is sl? | 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 = "Cor ath unsp vsl ntv/gft" AND prescriptions.route = "SL" | mimicsql_data |
CREATE TABLE table_name_90 (
gold INTEGER,
total INTEGER
) | What is the largest gold with a Total larger than 16? | SELECT MAX(gold) FROM table_name_90 WHERE total > 16 | sql_create_context |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
Par... | all tags related to Microsoft Office & related Questions. | SELECT t.TagName, t.Count, Body FROM Tags AS t LEFT OUTER JOIN Posts AS p ON t.ExcerptPostId = p.Id WHERE LOWER(Body) LIKE '%ms-word%' OR LOWER(Body) LIKE '%excel%' OR LOWER(Body) LIKE '%powerpoint%' OR LOWER(Body) LIKE '%outlook%' OR LOWER(Body) LIKE '%ms access%' OR LOWER(Body) LIKE '%microsoft access%' OR LOWER(Body... | sede |
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... | 18586184579的检验报告单上的报告日期是哪天呢? | SELECT zyjybgb.BGRQ FROM zyjybgb WHERE zyjybgb.BGDH = '18586184579' UNION SELECT mzjybgb.BGRQ FROM mzjybgb WHERE mzjybgb.BGDH = '18586184579' | css |
CREATE TABLE table_1342249_32 (
first_elected VARCHAR,
result VARCHAR
) | Name the first elected for lost renomination democratic loss | SELECT first_elected FROM table_1342249_32 WHERE result = "Lost renomination Democratic loss" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.