context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE Student ( Fname VARCHAR, Lname VARCHAR )
Show first name and last name for all students.
SELECT Fname, Lname FROM Student
sql_create_context
CREATE TABLE table_11658094_3 ( left INTEGER, institution VARCHAR )
What year did longwood university leave the conference?
SELECT MIN(left) FROM table_11658094_3 WHERE institution = "Longwood University"
sql_create_context
CREATE TABLE debate_people ( debate_id number, affirmative number, negative number, if_affirmative_win others ) CREATE TABLE debate ( debate_id number, date text, venue text, num_of_audience number ) CREATE TABLE people ( people_id number, district text, name text, part...
Show the names of people aged either 35 or 36.
SELECT name FROM people WHERE age = 35 OR age = 36
spider
CREATE TABLE table_47225 ( "Player" text, "Nationality" text, "Jersey Number(s)" text, "Position" text, "Years" text, "From" text )
Where is the position of sG from?
SELECT "From" FROM table_47225 WHERE "Position" = 'sg'
wikisql
CREATE TABLE table_23670057_4 ( no VARCHAR, position VARCHAR )
Display the serial numbers for the players who play at the center.
SELECT no FROM table_23670057_4 WHERE position = "Center"
sql_create_context
CREATE TABLE table_17115950_2 ( replaced_by VARCHAR, team VARCHAR )
Who replaced the manager on Team Cfr Cluj?
SELECT replaced_by FROM table_17115950_2 WHERE team = "CFR Cluj"
sql_create_context
CREATE TABLE table_19523142_5 ( group_7 VARCHAR, group_11 VARCHAR )
When persikos sorong city played in group 11, who played in group 7?
SELECT group_7 FROM table_19523142_5 WHERE group_11 = "Persikos Sorong City"
sql_create_context
CREATE TABLE table_25551880_2 ( mountains_classification VARCHAR, winner VARCHAR )
Who was awarded mountains classifications when Mikel Nieve was the winner?
SELECT mountains_classification FROM table_25551880_2 WHERE winner = "Mikel Nieve"
sql_create_context
CREATE TABLE table_name_81 ( time VARCHAR, opponent VARCHAR, record VARCHAR )
At what time was the game when they played the White Sox and had a record of 63-70?
SELECT time FROM table_name_81 WHERE opponent = "white sox" AND record = "63-70"
sql_create_context
CREATE TABLE Customers_Cards ( card_id INTEGER, customer_id INTEGER, card_type_code VARCHAR(15), card_number VARCHAR(80), date_valid_from DATETIME, date_valid_to DATETIME, other_card_details VARCHAR(255) ) CREATE TABLE Financial_Transactions ( transaction_id INTEGER, previous_transa...
Show the card type codes and the number of transactions Visualize by bar chart, I want to rank by the x-axis in ascending please.
SELECT card_type_code, COUNT(*) FROM Financial_Transactions AS T1 JOIN Customers_Cards AS T2 ON T1.card_id = T2.card_id GROUP BY T2.card_type_code ORDER BY card_type_code
nvbench
CREATE TABLE table_name_16 ( result VARCHAR, partner VARCHAR )
What was the result when the partner was magdalena maleeva?
SELECT result FROM table_name_16 WHERE partner = "magdalena maleeva"
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
count the number of patients whose admission year is less than 2166 and procedure long title is exteriorization of small intestine?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2166" AND procedures.long_title = "Exteriorization of small intestine"
mimicsql_data
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, ...
tell me the number of patients diagnosed with subarachnoid hemorrhage who have iv bolus route of drug administration.
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 = "Subarachnoid hemorrhage" AND prescriptions.route = "IV BOLUS"
mimicsql_data
CREATE TABLE table_27154 ( "Player" text, "Minutes" real, "Field Goals" real, "Rebounds" real, "Assists" real, "Steals" real, "Blocks" real, "Points" real )
How many blocks did tye'sha fluker have?
SELECT MIN("Blocks") FROM table_27154 WHERE "Player" = 'Tye''sha Fluker'
wikisql
CREATE TABLE table_203_675 ( id number, "match" number, "date" text, "round" text, "home/away" text, "opponent team" text, "score" text, "scorers" text )
how many consecutive times was the opponent team shakhtar donetsk ?
SELECT COUNT(*) FROM table_203_675 WHERE "opponent team" = 'shakhtar donetsk'
squall
CREATE TABLE table_202_250 ( id number, "year" text, "name" text, "source" text, "definition" text )
which is the most recent source for the name ?
SELECT "source" FROM table_202_250 ORDER BY "year" DESC LIMIT 1
squall
CREATE TABLE school ( School_ID int, School text, Location text, Enrollment real, Founded real, Denomination text, Boys_or_Girls text, Day_or_Boarding text, Year_Entered_Competition real, School_Colors text ) CREATE TABLE player ( Player_ID int, Player text, Team tex...
Create a bar chart showing the total number across denomination, I want to sort by the Denomination from high to low.
SELECT Denomination, COUNT(*) FROM school GROUP BY Denomination ORDER BY Denomination DESC
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...
那个医院9209968有哪些在08年9月8日到10年1月16日期间非异地结算的医疗就诊记录?
(SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '9209968' AND IN_HOSP_DATE BETWEEN '2008-09-08' AND '2010-01-16') EXCEPT (SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '9209968' AND IN_HOSP_DATE BETWEEN '2008-09-08' AND '2010-01-16' AND (REMOTE_SETTLE_FLG = '异地1' OR REMOTE_SETTLE_FLG = '异地2'))
css
CREATE TABLE table_51231 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What away team has a home team score of 10.13 (73)?
SELECT "Away team" FROM table_51231 WHERE "Home team score" = '10.13 (73)'
wikisql
CREATE TABLE table_name_19 ( region VARCHAR, catalog VARCHAR )
Which Region has a Catalog of magik muzik 806-5?
SELECT region FROM table_name_19 WHERE catalog = "magik muzik 806-5"
sql_create_context
CREATE TABLE table_5387 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
what was the score on november 3?
SELECT "Score" FROM table_5387 WHERE "Date" = 'november 3'
wikisql
CREATE TABLE table_name_94 ( assists VARCHAR, name VARCHAR, games VARCHAR )
What is the total number of Assists, when Name is 'Pablo Prigioni', and when Games is greater than 21?
SELECT COUNT(assists) FROM table_name_94 WHERE name = "pablo prigioni" AND games > 21
sql_create_context
CREATE TABLE table_name_69 ( chassis VARCHAR, year VARCHAR, engine VARCHAR )
What company built the chassis for a year later than 1959 and a climax l4 engine?
SELECT chassis FROM table_name_69 WHERE year > 1959 AND engine = "climax l4"
sql_create_context
CREATE TABLE table_18821196_1 ( status VARCHAR, weekly_schedule VARCHAR )
What is every status with a weekly schedule of Monday to Thursday @ 11:00 pm?
SELECT status FROM table_18821196_1 WHERE weekly_schedule = "Monday to Thursday @ 11:00 pm"
sql_create_context
CREATE TABLE table_name_88 ( nationality VARCHAR, name VARCHAR )
Swimmer Aurore Mongel has what nationality?
SELECT nationality FROM table_name_88 WHERE name = "aurore mongel"
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 the number of patients whose primary disease is morbid obesity/sda and year of death is less than or equal to 2174?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "MORBID OBESITY/SDA" AND demographic.dod_year <= "2174.0"
mimicsql_data
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_co...
indicate the daily minimum sao2 of patient 14054 last month.
SELECT MIN(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 = 14054)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'sao2...
mimic_iii
CREATE TABLE table_name_28 ( traditional VARCHAR, area VARCHAR )
What is the Traditional for area 35?
SELECT traditional FROM table_name_28 WHERE area = "35"
sql_create_context
CREATE TABLE mzb ( 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...
病患82923898在7620449号这个医院入院是其诊断的疾病名字没有震颤麻痹这几个字的医疗就诊记录编码有啥?
SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '82923898' AND qtb.MED_SER_ORG_NO = '7620449' AND NOT qtb.IN_DIAG_DIS_NM LIKE '%震颤麻痹%' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '82923898' AND gyb.MED_SER_ORG_NO = '7620449' AND NOT gyb.IN_DIAG_DIS_NM LIKE '%震颤麻痹%' UNION SELECT zyb.MED_CLINIC_...
css
CREATE TABLE table_name_52 ( name VARCHAR, province_or_country_of_birth VARCHAR )
Which supercentenarians were born in Manitoba?
SELECT name FROM table_name_52 WHERE province_or_country_of_birth = "manitoba"
sql_create_context
CREATE TABLE table_name_58 ( votes INTEGER, draw VARCHAR, place VARCHAR, producer VARCHAR )
How many average votes did producer carlos coelho have in a higher place than 6 and with a draw larger than 5?
SELECT AVG(votes) FROM table_name_58 WHERE place < 6 AND producer = "carlos coelho" AND draw > 5
sql_create_context
CREATE TABLE bdmzjzjlb ( 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...
患有慢性根尖周炎的那些人确诊时同型半胱氨酸的参考值范畴下限和上限是多少?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE wdmzjzjlb.JZZDSM = '慢性根尖周炎' AND jyjgzbb.JCZBMC = '同型半胱氨酸' UNION SELECT jyjgzbb.CKZFWXX...
css
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_procedures ( row_id number, ...
tell me the cost of a cancer antigen 27.29 lab test.
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'cancer antigen 27.29'))
mimic_iii
CREATE TABLE table_57105 ( "Rd #" real, "Pick #" real, "Player" text, "Team (League)" text, "Reg GP" real, "Pl GP" real )
What is the reg gp of the player with a round number less than 2?
SELECT SUM("Reg GP") FROM table_57105 WHERE "Rd #" < '2'
wikisql
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 Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), ...
How many students live in each city.
SELECT city_code, COUNT(*) FROM Student GROUP BY city_code
nvbench
CREATE TABLE table_26308 ( "No." real, "Episode" text, "Rating" text, "Share" real, "Rating/share (18-49)" text, "Viewers (millions)" text, "Rank (timeslot)" real, "Rank (night)" real )
What was the share for the 'Lisa Kudrow' episode?
SELECT MIN("Share") FROM table_26308 WHERE "Episode" = 'Lisa Kudrow'
wikisql
CREATE TABLE table_name_13 ( week INTEGER, attendance VARCHAR )
What is the maximum week that 69,372 people attended the game?
SELECT MAX(week) FROM table_name_13 WHERE attendance = "69,372"
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
give me the number of patients whose death status is 1 and primary disease is morbid obesity/sda?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.diagnosis = "MORBID OBESITY/SDA"
mimicsql_data
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, d...
what were the four most frequent microbiology tests ordered for patients who received kidney stone procedure - with removal of ureteral calculus earlier within 2 months until 3 years ago?
SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'kidney stone procedure - with removal of ure...
eicu
CREATE TABLE table_name_53 ( score VARCHAR, date VARCHAR )
What was the score of the game that took place on october 22, 1976?
SELECT score FROM table_name_53 WHERE date = "october 22, 1976"
sql_create_context
CREATE TABLE table_3918 ( "Episode #" real, "Series #" real, "Title" text, "Director" text, "Writer" text, "Original airdate" text, "Viewers (millions)" text )
What episode in the series had 5.24 million viewers?
SELECT "Series #" FROM table_3918 WHERE "Viewers (millions)" = '5.24'
wikisql
CREATE TABLE table_71105 ( "Date" text, "Time" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text, "Report" text )
Which Set 1 has a Set 3 of 16 25?
SELECT "Set 1" FROM table_71105 WHERE "Set 3" = '16–25'
wikisql
CREATE TABLE team_half ( year INTEGER, league_id TEXT, team_id TEXT, half INTEGER, div_id TEXT, div_win TEXT, rank INTEGER, g INTEGER, w INTEGER, l INTEGER ) CREATE TABLE team_franchise ( franchise_id TEXT, franchise_name TEXT, active TEXT, na_assoc TEXT ) CREAT...
Show me the frequency of those years (bin year into year interval) that the team Boston Red Stockings won in the postseasons with a bar chart, and rank from low to high by the year.
SELECT year, COUNT(year) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' ORDER BY year
nvbench
CREATE TABLE table_name_52 ( rank INTEGER, bronze VARCHAR, silver VARCHAR )
What is the average rank when the bronze is larger than 1, and silver is less than 0?
SELECT AVG(rank) FROM table_name_52 WHERE bronze > 1 AND silver < 0
sql_create_context
CREATE TABLE table_name_10 ( doctorate INTEGER, masters VARCHAR, specialist VARCHAR, college VARCHAR )
What is the highest number of doctorates the college of informatics and systems, which has 0 specialists and less than 2 master's degrees, have?
SELECT MAX(doctorate) FROM table_name_10 WHERE specialist = 0 AND college = "informatics and systems" AND masters < 2
sql_create_context
CREATE TABLE qtb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
列出按平均住院时长升序排序各科室在医院3701034的名称、编码以及平均住院时长都是什么?
SELECT qtb.MED_ORG_DEPT_CD, qtb.MED_ORG_DEPT_NM, AVG(qtb.IN_HOSP_DAYS) FROM qtb WHERE qtb.MED_SER_ORG_NO = '3701034' GROUP BY qtb.MED_ORG_DEPT_CD ORDER BY AVG(qtb.IN_HOSP_DAYS) UNION SELECT gyb.MED_ORG_DEPT_CD, gyb.MED_ORG_DEPT_NM, AVG(gyb.IN_HOSP_DAYS) FROM gyb WHERE gyb.MED_SER_ORG_NO = '3701034' GROUP BY gyb.MED_ORG...
css
CREATE TABLE table_name_33 ( opponents VARCHAR, round VARCHAR )
Which opponent made it to the final round?
SELECT opponents FROM table_name_33 WHERE round = "final"
sql_create_context
CREATE TABLE member ( Member_ID int, Name text, Membership_card text, Age int, Time_of_purchase int, Level_of_membership int, Address text ) CREATE TABLE shop ( Shop_ID int, Address text, Num_of_staff text, Score real, Open_Year text ) CREATE TABLE happy_hour ( HH_I...
Find the address and staff number of the shops that do not have any happy hour Visualize by bar chart, list in asc by the X please.
SELECT Address, Num_of_staff FROM shop WHERE NOT Shop_ID IN (SELECT Shop_ID FROM happy_hour) ORDER BY Address
nvbench
CREATE TABLE table_name_54 ( country VARCHAR, player VARCHAR )
What country is Curtis Strange from?
SELECT country FROM table_name_54 WHERE player = "curtis strange"
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 whose diagnosis icd9 code is 43411 and the drug type is additive?
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.icd9_code = "43411" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
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...
let me know the type of admission and short title of diagnoses for the patient with patient id 2560.
SELECT demographic.admission_type, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_69203 ( "2003/ 04" text, "2004/ 05" text, "2007/ 08" text, "2009/ 10" text, "2010/ 11" text, "2011/ 12" text, "2012/ 13" text )
What was held in 2009/10 with Former Ranking Tournaments in 2003/04?
SELECT "2009/ 10" FROM table_69203 WHERE "2003/ 04" = 'former ranking tournaments'
wikisql
CREATE TABLE bdmzjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH number, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZD...
列出患者49963274的检验报告单中结果指标均正常的检验报告单号
SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '49963274' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WH...
css
CREATE TABLE fires ( fire_year number, discovery_date number, discovery_doy number, discovery_time text, stat_cause_code number, stat_cause_descr text, cont_date text, cont_doy text, cont_time text, fire_size number, fire_size_class text, latitude number, longitude nu...
Which state has the largest wildfire?
SELECT state FROM fires ORDER BY fire_size DESC LIMIT 1
uswildfires
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 ...
能列举出患者编号87435774在2013年5月27日到2018年10月29日内所有检验报告单中的标本搜集部位吗?
SELECT jybgb.BBCJBW FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '87435774' AND jybgb.BGRQ BETWEEN '2013-05-27' AND '2018-10-29' UNI...
css
CREATE TABLE table_name_75 ( date VARCHAR, race_winner VARCHAR, track VARCHAR )
Steve Wallace was a Race Winner at the Kentucky Speedway on what date?
SELECT date FROM table_name_75 WHERE race_winner = "steve wallace" AND track = "kentucky speedway"
sql_create_context
CREATE TABLE table_8002 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text )
Which High rebounds have a Game larger than 4, and a Date of may 27?
SELECT "High rebounds" FROM table_8002 WHERE "Game" > '4' AND "Date" = 'may 27'
wikisql
CREATE TABLE pitstops ( driverid VARCHAR, STOP VARCHAR, duration INTEGER, raceid VARCHAR )
Find the distinct driver id of all drivers that have a longer stop duration than some drivers in the race whose id is 841?
SELECT DISTINCT driverid, STOP FROM pitstops WHERE duration > (SELECT MIN(duration) FROM pitstops WHERE raceid = 841)
sql_create_context
CREATE TABLE table_63855 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" real, "Water (sqmi)" real, "Latitude" real, "Longitude" real, "GEO ID" real, "ANSI code" real )
What is the population in 2010 for the longitude of -97.578927?
SELECT COUNT("Pop. (2010)") FROM table_63855 WHERE "Longitude" = '-97.578927'
wikisql
CREATE TABLE Catalog_Structure ( catalog_level_number INTEGER, catalog_id INTEGER, catalog_level_name VARCHAR(50) ) CREATE TABLE Catalogs ( catalog_id INTEGER, catalog_name VARCHAR(50), catalog_publisher VARCHAR(80), date_of_publication DATETIME, date_of_latest_revision DATETIME ) CREA...
Display a bar chart for which catalog contents has price above 700 dollars? Show their catalog entry names and capacities.
SELECT catalog_entry_name, capacity FROM Catalog_Contents WHERE price_in_dollars > 700
nvbench
CREATE TABLE table_name_21 ( power VARCHAR, name VARCHAR )
Which Power has a Name of 9 nc?
SELECT power FROM table_name_21 WHERE name = "9 nc"
sql_create_context
CREATE TABLE table_name_74 ( label VARCHAR, year VARCHAR )
Which label's year was 1990?
SELECT label FROM table_name_74 WHERE year = "1990"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
列出在医院2926207中患者45461281门诊诊断名称不包含硅肺有哪些门诊就诊记录?
SELECT * FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE hz_info.RYBH = '45461281' AND hz_info.YLJGDM = '2926207' AND NOT zzmzjzjlb.JZZDSM LIKE '%硅肺%' UNION SELECT * FROM hz_info JOIN fzzmzjzjlb ON hz_info.YLJGDM = fzzmzjzjlb.YLJGDM AN...
css
CREATE TABLE table_46780 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Record" text )
Can you tell me the Record that has the Score of 100-105?
SELECT "Record" FROM table_46780 WHERE "Score" = '100-105'
wikisql
CREATE TABLE table_60597 ( "Title" text, "Lyricist(s)" text, "Composer(s)" text, "Arranger(s)" text, "Time" text )
What is the title of the track with lyricist ROZ and arranger Yongmin Lee?
SELECT "Title" FROM table_60597 WHERE "Lyricist(s)" = 'roz' AND "Arranger(s)" = 'yongmin lee'
wikisql
CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT )
Whare the friends, and ages of all people who are older than the average age of a person? Visualize the result by a pie chart.
SELECT friend, age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age > (SELECT AVG(age) FROM Person)
nvbench
CREATE TABLE enzyme ( id int, name text, Location text, Product text, Chromosome text, OMIM int, Porphyria text ) CREATE TABLE medicine ( id int, name text, Trade_Name text, FDA_approved text ) CREATE TABLE medicine_enzyme_interaction ( enzyme_id int, medicine_id in...
what is the id and trade name of the medicines can interact with at least 3 enzymes?, and could you order in ascending by the Y-axis?
SELECT Trade_Name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id ORDER BY id
nvbench
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE allergy ( allergy...
when was the first time in which patient 030-52327 had the maximum heartrate during yesterday?
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-52327')) AND NOT vitalperiodic.heartrate IS NUL...
eicu
CREATE TABLE table_204_882 ( id number, "number" number, "builder" text, "entered service" text, "withdrawn" text, "notes" text )
how many number were in service in 1910 ?
SELECT COUNT("number") FROM table_204_882 WHERE "entered service" <= 1910
squall
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...
看一下编号为16021187507的医疗就诊的出院日期
SELECT gwyjzb.OUT_HOSP_DATE FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '16021187507' UNION SELECT fgwyjzb.OUT_HOSP_DATE FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '16021187507'
css
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 ) ...
what is days of hospital stay of subject id 18112?
SELECT demographic.days_stay FROM demographic WHERE demographic.subject_id = "18112"
mimicsql_data
CREATE TABLE film_market_estimation ( estimation_id number, low_estimate number, high_estimate number, film_id number, type text, market_id number, year number ) CREATE TABLE film ( film_id number, title text, studio text, director text, gross_in_dollar number ) CREATE ...
Give the average number of cities within markets that had a low market estimation larger than 10000?
SELECT AVG(T2.number_cities) FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.market_id = T2.market_id WHERE T1.low_estimate > 10000
spider
CREATE TABLE table_64787 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What was the average rank for the team that had more than 5 medals and more than 6 gold medals?
SELECT AVG("Rank") FROM table_64787 WHERE "Total" > '5' AND "Gold" > '6'
wikisql
CREATE TABLE table_16278825_1 ( area__km²_ INTEGER, name_of_county VARCHAR )
Name the least area for vas
SELECT MIN(area__km²_) FROM table_16278825_1 WHERE name_of_county = "Vas"
sql_create_context
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 Plays_Games ( StuID INTEGER, GameID INTEGER, Hours_Played INTEGER ) CREATE TABLE Video_Games ( Ga...
What are the number of the last names for all scholarship students?, and could you order by the y axis from high to low?
SELECT LName, COUNT(LName) FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.OnScholarship = 'Y' GROUP BY LName ORDER BY COUNT(LName) DESC
nvbench
CREATE TABLE table_59774 ( "Episode" text, "Broadcast date" text, "Run time" text, "Viewers (in millions)" text, "Archive" text )
What episode has a run time of 25:12?
SELECT "Episode" FROM table_59774 WHERE "Run time" = '25:12'
wikisql
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, ...
Can you name courses that would prepare me for taking PHARMACY 562 ?
SELECT DISTINCT advisory_requirement FROM course WHERE department = 'PHARMACY' AND number = 562
advising
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeou...
what are the three most common procedures among the patients of age 40s in this year?
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT...
eicu
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,...
provide the number of patients whose year of death is less than or equal to 2186 and drug code is mom30l?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2186.0" AND prescriptions.formulary_drug_cd = "MOM30L"
mimicsql_data
CREATE TABLE table_64602 ( "Name" text, "La Liga" real, "Copa del Rey" real, "UEFA Champions League" real, "FIFA Club World Championship" real, "Total" real )
Which Copa del Rey has a La Liga smaller than 0?
SELECT SUM("Copa del Rey") FROM table_64602 WHERE "La Liga" < '0'
wikisql
CREATE TABLE table_name_75 ( owner VARCHAR, year VARCHAR, winner VARCHAR )
Who owned winner Blueeyesintherein after 2009?
SELECT owner FROM table_name_75 WHERE year > 2009 AND winner = "blueeyesintherein"
sql_create_context
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description...
Monthly growth of given tag.
SELECT TIME_TO_STR(Posts.CreationDate, '%Y'), TIME_TO_STR(Posts.CreationDate, '%m'), COUNT(Tags.TagName) FROM Posts INNER JOIN PostTags ON PostTags.PostId = Posts.Id INNER JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName = @tag GROUP BY TIME_TO_STR(Posts.CreationDate, '%m'), TIME_TO_STR(Posts.CreationDate, '%Y'...
sede
CREATE TABLE table_1526 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Points difference" text, "Points" text )
What is the total points when the point difference is +119?
SELECT "Points" FROM table_1526 WHERE "Points difference" = '+119'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text,...
what is the total amount of pe 24 fs po delivered until 907 days ago to patient 32168?
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 = 32168)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab...
mimic_iii
CREATE TABLE table_57554 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
Which week has the lowest attendance of 48,102?
SELECT MIN("Week") FROM table_57554 WHERE "Attendance" = '48,102'
wikisql
CREATE TABLE table_73648 ( "WEEK" real, "Sydney" real, "Melbourne" real, "Brisbane" real, "Adelaide" real, "Perth" real, "TOTAL" real, "WEEKLY RANK" real )
What is the highest number of Brisbane viewers?
SELECT MAX("Brisbane") FROM table_73648
wikisql
CREATE TABLE table_65716 ( "Player" text, "Round" real, "Pick" real, "Position" text, "NFL Club" text )
What is jamar martin's highest pick?
SELECT MAX("Pick") FROM table_65716 WHERE "Player" = 'jamar martin'
wikisql
CREATE TABLE table_51808 ( "Name" text, "Built" text, "Wheels" text, "Fuel/ Trans" text, "Status" text, "Colour" text )
What is the status of the Cub/John locomotive?
SELECT "Status" FROM table_51808 WHERE "Name" = 'the cub/john'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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...
患者00569182肘部的各项指标检验结果的数据怎么样?
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '...
css
CREATE TABLE table_49434 ( "Player" text, "Qual." text, "Baku" text, "Sochi" text, "Elista" text, "Nalchik" text, "Jermuk" text, "Astrakhan" text, "Played" real )
What is the elista with 1 played and 153 baku?
SELECT "Elista" FROM table_49434 WHERE "Played" = '1' AND "Baku" = '153⅓'
wikisql
CREATE TABLE sampledata15 ( sample_pk number, state text, year text, month text, day text, site text, commod text, source_id text, variety text, origin text, country text, disttype text, commtype text, claim text, quantity number, growst text, packst t...
How many number of units are there in sample 9628?
SELECT quantity FROM sampledata15 WHERE sample_pk = 9628
pesticide
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...
provide the number of patients whose year of death is less than or equal to 2155 and drug name is cyanocobalamin?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2155.0" AND prescriptions.drug = "Cyanocobalamin"
mimicsql_data
CREATE TABLE table_75011 ( "Vol. #" real, "Title" text, "Material collected" text, "Publication date" text, "ISBN" text )
What's the Material collected for the 978-1401209674 ISBN?
SELECT "Material collected" FROM table_75011 WHERE "ISBN" = '978-1401209674'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_DIRE_CD text, MED_DIRE_NM text,...
医疗就诊00409069439中,被用到的所有药品中,把超限价自付金额高于355.93元的给列出来
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_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 = '00409069439' AND t_kc22.OVE_SELF_AMO > 355.93
css
CREATE TABLE table_name_16 ( total_apps VARCHAR, league_apps VARCHAR, total_goals VARCHAR )
What are the total apps that have 41 as the League apps, with total goals greater than 1?
SELECT total_apps FROM table_name_16 WHERE league_apps = "41" AND total_goals > 1
sql_create_context
CREATE TABLE table_27312918_5 ( high_points VARCHAR, game VARCHAR )
Who got the most points in game number 5?
SELECT high_points FROM table_27312918_5 WHERE game = 5
sql_create_context
CREATE TABLE table_11948 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the attendance when St Kilda played as the away team?
SELECT AVG("Crowd") FROM table_11948 WHERE "Away team" = 'st kilda'
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, ...
specify icd9 code for patient antonio mccarthy
SELECT procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Antonio Mccarthy"
mimicsql_data
CREATE TABLE addresses ( address_content VARCHAR, city VARCHAR, state_province_county VARCHAR )
Find all the addresses in East Julianaside, Texas or in Gleasonmouth, Arizona.
SELECT address_content FROM addresses WHERE city = "East Julianaside" AND state_province_county = "Texas" UNION SELECT address_content FROM addresses WHERE city = "Gleasonmouth" AND state_province_county = "Arizona"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREA...
count the number of people who were discharged since 2105 from the hospital.
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND STRFTIME('%y', patient.hospitaldischargetime) >= '2105'
eicu