context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_62 ( crowd VARCHAR, home_team VARCHAR )
What size was the crowd when Hawthorn was the home team?
SELECT COUNT(crowd) FROM table_name_62 WHERE home_team = "hawthorn"
sql_create_context
CREATE TABLE table_203_771 ( id number, "#" number, "artist" text, "featuring" text, "title" text, "version" text, "length" text )
what is the title of the first track on the best of benassi bros greatest hit album ?
SELECT "title" FROM table_203_771 ORDER BY "#" LIMIT 1
squall
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) 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, ...
what are the four most frequently prescribed drugs for patients who were also prescribed oxycodone-acetaminophen elixir previously during the same month until 2104?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'oxycodone-acetaminophen elixir' AND STRFTIME('%y', prescriptions....
mimic_iii
CREATE TABLE table_64556 ( "Year" real, "Champion" text, "Score" text, "Runner-up" text, "City" text, "Arena" text )
Who was the runner-up at the Broadmoor Arena before 2008?
SELECT "Runner-up" FROM table_64556 WHERE "Year" < '2008' AND "Arena" = 'broadmoor arena'
wikisql
CREATE TABLE table_name_43 ( home_team VARCHAR, away_team VARCHAR )
What was the home team score when the away team was Carlton?
SELECT home_team AS score FROM table_name_43 WHERE away_team = "carlton"
sql_create_context
CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Movie ( mID int, title text, year int, director text )
Show the title and score of the movie with a bar chart, and I want to show Y-axis in descending order.
SELECT title, stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID ORDER BY stars DESC
nvbench
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, ...
how many patients whose admission type is urgent and procedure short title is hemodialysis?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.short_title = "Hemodialysis"
mimicsql_data
CREATE TABLE table_27987623_1 ( us_viewers__in_million_ VARCHAR, written_by VARCHAR )
How many viewers saw the episode written by kevin biegel & bill lawrence?
SELECT us_viewers__in_million_ FROM table_27987623_1 WHERE written_by = "Kevin Biegel & Bill Lawrence"
sql_create_context
CREATE TABLE table_64195 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What's the bronze medal count for Rank 33 when the silver count was less than 2 and the total was more than 4?
SELECT MAX("Bronze") FROM table_64195 WHERE "Silver" < '2' AND "Total" > '4' AND "Rank" = '33'
wikisql
CREATE TABLE table_name_82 ( constellation VARCHAR, hd_designation VARCHAR )
What is Constellation, when HD Designation is 'HD197076'?
SELECT constellation FROM table_name_82 WHERE hd_designation = "hd197076"
sql_create_context
CREATE TABLE table_name_24 ( year VARCHAR, points VARCHAR )
How many years have 78 for points?
SELECT COUNT(year) FROM table_name_24 WHERE points = 78
sql_create_context
CREATE TABLE Addresses ( address_id INTEGER, line_1_number_building VARCHAR(80), city VARCHAR(50), zip_postcode VARCHAR(20), state_province_county VARCHAR(50), country VARCHAR(50) ) CREATE TABLE Products ( product_id INTEGER, product_type_code VARCHAR(15), product_name VARCHAR(80), ...
Show me a bar chart with the product name and their frequency.
SELECT product_name, COUNT(product_name) FROM Products GROUP BY product_name
nvbench
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and revenue , and group by attribute headquarter.
SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name
nvbench
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 ...
when was the last time that patient 1902 has the minimum bicarbonate since 47 months ago?
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1902) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bicarbonate') AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-47...
mimic_iii
CREATE TABLE table_name_62 ( city VARCHAR, aam_member VARCHAR, astc_member VARCHAR, state VARCHAR )
What is City, when ASTC Member is No, when State is California, and when AAM Member is Yes?
SELECT city FROM table_name_62 WHERE astc_member = "no" AND state = "california" AND aam_member = "yes"
sql_create_context
CREATE TABLE table_name_22 ( overall INTEGER, college VARCHAR, pick VARCHAR )
What is the sum of Overall, when College is 'Arkansas State', and when Pick is less than 17?
SELECT SUM(overall) FROM table_name_22 WHERE college = "arkansas state" AND pick < 17
sql_create_context
CREATE TABLE table_60168 ( "Model" text, "Screen size" text, "Bluetooth" text, "FM transmitter" text, "Flash" text )
Does the s35 model have bluetooth?
SELECT "Bluetooth" FROM table_60168 WHERE "Model" = 's35'
wikisql
CREATE TABLE table_204_103 ( id number, "medal" text, "name" text, "sport" text, "event" text )
how many silver medals did satheesha rai win according to the table ?
SELECT COUNT("medal") FROM table_204_103 WHERE "name" = 'satheesha rai'
squall
CREATE TABLE table_35703 ( "Molecular formula" text, "IUPAC name" text, "CAS registry number" text, "Common name" text, "Other names" text )
What is the IUPAC name for chloroform?
SELECT "IUPAC name" FROM table_35703 WHERE "Common name" = 'chloroform'
wikisql
CREATE TABLE table_name_17 ( date VARCHAR, score VARCHAR )
What date has 104-113 as the score?
SELECT date FROM table_name_17 WHERE score = "104-113"
sql_create_context
CREATE TABLE table_77287 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What location did the event kotc: mortal sins take place?
SELECT "Location" FROM table_77287 WHERE "Event" = 'kotc: mortal sins'
wikisql
CREATE TABLE table_name_65 ( date VARCHAR, away_team VARCHAR )
What date was the match against carlisle united?
SELECT date FROM table_name_65 WHERE away_team = "carlisle united"
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, ...
从08年7月20日到13年10月17日这段时间里,患者38917711所有检验结果指标记录中的检测方法都有什么啊?
SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND ...
css
CREATE TABLE college ( College_ID int, Name text, Leader_Name text, College_Location text ) CREATE TABLE round ( Round_ID int, Member_ID int, Decoration_Theme text, Rank_in_Round int ) CREATE TABLE member ( Member_ID int, Name text, Country text, College_ID int )
Plot the total number by grouped by country as a bar graph, and could you rank by the x-axis in desc?
SELECT Country, COUNT(*) FROM member GROUP BY Country ORDER BY Country DESC
nvbench
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE...
when was the first time patient 78221 was prescribed medicine via po route until 08/2101?
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 78221) AND prescriptions.route = 'po' AND STRFTIME('%y-%m', prescriptions.startdate) <= '2101-08' ORDER BY prescriptions.startdate LIMIT 1
mimic_iii
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
provide the number of patients whose language is port and days of hospital stay is greater than 3?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "PORT" AND demographic.days_stay > "3"
mimicsql_data
CREATE TABLE table_name_56 ( category VARCHAR, director_s_ VARCHAR )
what category is for tom shankland, director?
SELECT category FROM table_name_56 WHERE director_s_ = "tom shankland"
sql_create_context
CREATE TABLE table_name_49 ( Id VARCHAR )
Who held the same position in 2014 that Danielle Button held in 2013?
SELECT 2014 FROM table_name_49 WHERE 2013 = "danielle button"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
what was the last intake given to patient 013-28507 today.
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-28507')) AND intakeoutput.cellpath LIKE '%intake%' AND D...
eicu
CREATE TABLE table_name_75 ( week INTEGER, opponent VARCHAR )
What is the lowest week that has Minnesota Vikings as the opponent?
SELECT MIN(week) FROM table_name_75 WHERE opponent = "minnesota vikings"
sql_create_context
CREATE TABLE table_11900773_5 ( design VARCHAR, theme VARCHAR )
Who was responsible for the design of the Jasper National Park theme?
SELECT design FROM table_11900773_5 WHERE theme = "Jasper National Park"
sql_create_context
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 microbiologyevents ( row_id number, subject_id number...
give me the five most common output events since 2 years ago?
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT outputevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM outputevents WHERE DATETIME(outputevents.charttime) >= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY outputevents.itemid) AS t1 WHERE t1.c1 <= 5)
mimic_iii
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_...
how many people died after being diagnosed with ac stomach ulcer w hem within 2 months during this year?
SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_di...
mimic_iii
CREATE TABLE table_53982 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
How much did the home team Hawthorn score?
SELECT "Home team score" FROM table_53982 WHERE "Home team" = 'hawthorn'
wikisql
CREATE TABLE table_name_40 ( year_s__won VARCHAR, total VARCHAR, country VARCHAR )
What is Year(s) Won, when Total is '145', and when Country is 'United States'?
SELECT year_s__won FROM table_name_40 WHERE total = 145 AND country = "united states"
sql_create_context
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...
医院1900114中单价最高的患者21485538在被开出的药品编码和名称及其单价分别是?
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc21_t_kc22.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '21485538' AND t_kc21.MED_SER_ORG_NO = '1900114') ORDER BY t_kc22.UNIVALENT DESC LIMIT 1
css
CREATE TABLE gwyjzb ( 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, ...
从05年6月23日到19年12月27日,医疗机构7831592消耗的统筹金额是多少?
SELECT SUM(t_kc24.OVE_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '7831592' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2005-06-23' AND '2019-12-27' UNION SELECT SUM(t_kc24.OVE_PAY) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE fgwyj...
css
CREATE TABLE table_1676073_12 ( drawn VARCHAR, lost VARCHAR, points_for VARCHAR )
How many games drawn for the team that lost 11 and had 748 points?
SELECT drawn FROM table_1676073_12 WHERE lost = "11" AND points_for = "748"
sql_create_context
CREATE TABLE table_25261 ( "Week #" text, "Theme" text, "Song choice" text, "Original artist" text, "Order #" text, "Result" text )
If the song choice is Coba and the order number is 10, what is the result?
SELECT "Result" FROM table_25261 WHERE "Order #" = '10' AND "Song choice" = 'Coba'
wikisql
CREATE TABLE customer_orders ( order_id number, customer_id number, order_status text, order_date time, order_details text ) CREATE TABLE customers ( customer_id number, payment_method text, customer_name text, date_became_customer time, other_customer_details text ) CREATE TAB...
What are 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"
spider
CREATE TABLE table_name_60 ( date_of_appointment VARCHAR, outgoing_manager VARCHAR )
When is the appointment date for outgoing manager Petrik Sander?
SELECT date_of_appointment FROM table_name_60 WHERE outgoing_manager = "petrik sander"
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...
Show me minimal weight by sex in a histogram, order total number from high to low order.
SELECT Sex, MIN(Weight) FROM people GROUP BY Sex ORDER BY MIN(Weight) DESC
nvbench
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGD...
在二零二一年七月一号以前的住院就诊记录中有哪些是编号为22200311的患者对应的检验报告单?住院就诊的流水号能列出来吗?
SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '22200311' AND NOT zyjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ >= '2021-07-01')
css
CREATE TABLE table_8036 ( "Date" text, "H/A/N" text, "Opponent" text, "Score" text, "Record" text )
What was the score of the game played on December 17, with a H/A/N of H?
SELECT "Score" FROM table_8036 WHERE "H/A/N" = 'h' AND "Date" = 'december 17'
wikisql
CREATE TABLE table_32936 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which venue hosted South Melbourne?
SELECT "Venue" FROM table_32936 WHERE "Away team" = 'south melbourne'
wikisql
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, ...
被门诊诊断为R76.930这个病的蒋宏深,看看他的检测指标089733的结果定量及其单位
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_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 = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.J...
css
CREATE TABLE table_30571 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
how many parts does detroit red wings person urban nordin play
SELECT COUNT("Position") FROM table_30571 WHERE "NHL team" = 'Detroit Red Wings' AND "Player" = 'Urban Nordin'
wikisql
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
列出医疗就诊记录中医疗费总额与医疗就诊18542009470相同的的ID、人员ID、人员姓名、公民身份号码、人员性别、人员年龄都是什么啊?
SELECT t_kc21.MED_CLINIC_ID, t_kc21.PERSON_ID, t_kc21.PERSON_NM, t_kc21.IDENTITY_CARD, t_kc21.PERSON_SEX, t_kc21.PERSON_AGE FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc24.MED_AMOUT = (SELECT MED_AMOUT FROM t_kc24 WHERE MED_CLINIC_ID = '18542009470')
css
CREATE TABLE table_39573 ( "Score" text, "Opposition" text, "Venue" text, "City" text, "Year" real )
Which venue had a city of Manchester before 2003?
SELECT "Venue" FROM table_39573 WHERE "City" = 'manchester' AND "Year" < '2003'
wikisql
CREATE TABLE table_name_36 ( original_title VARCHAR, director VARCHAR )
What is the Original Title of the movie directed by Aigars Grauba?
SELECT original_title FROM table_name_36 WHERE director = "aigars grauba"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
what is procedure long title of subject id 29541?
SELECT procedures.long_title FROM procedures WHERE procedures.subject_id = "29541"
mimicsql_data
CREATE TABLE table_48438 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What is High Rebounds, when Game is greater than 33, and when Score is 'W 132-101'?
SELECT "High rebounds" FROM table_48438 WHERE "Game" > '33' AND "Score" = 'w 132-101'
wikisql
CREATE TABLE table_6465 ( "English name" text, "Bulgarian name" text, "Bulgarian name ( Transliteration )" text, "Old Bulgarian Names" text, "Old Bulgarian name (Transliteration)" text, "Old Bulgarian name - Meaning" text )
What's the old bulgarian word for ?
SELECT "Old Bulgarian name - Meaning" FROM table_6465 WHERE "Old Bulgarian Names" = 'тръвен'
wikisql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
从08年5月20到21年3月15的这几年里,共有多少患者在医疗机构7227046的转诊门诊看病
SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.YLJGDM = '7227046' AND wdmzjzjlb.JZKSRQ BETWEEN '2008-05-20' AND '2021-03-15' AND wdmzjzjlb.ZZBZ > 0 UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.YLJGDM = '7227046' AND bdmzjzjlb.JZKSRQ BETWEEN '2008-05-20' AND '2021-03-15' AND bdmzjzjlb.ZZBZ > 0
css
CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int ) CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real...
Show the average of artists' age by country, I want to rank Y in ascending order.
SELECT Country, AVG(Age) FROM artist GROUP BY Country ORDER BY AVG(Age)
nvbench
CREATE TABLE table_67968 ( "Position" real, "Club" text, "Played" real, "Points" text, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
How many losses has more than 59 goals against and more than 17 position?
SELECT MIN("Losses") FROM table_67968 WHERE "Goals against" > '59' AND "Position" > '17'
wikisql
CREATE TABLE table_name_63 ( black__both_hispanic_and_non_hispanic_ VARCHAR, municipality__2010_ VARCHAR, amerindian__both_hispanic_and_non_hispanic_ VARCHAR, white__both_hispanic_and_non_hispanic_ VARCHAR, n_asia__both_hispanic_and_non_hispanic_ VARCHAR )
What is the Black (Hispanic/Non-Hispanic) value having a white (Hispanic/Non-Hispanic) under 80.6, Asian (Hispanic/Non-Hispanic) of 0.1, Amerindian (Hispanic/Non-Hispanic) under 0.6000000000000001, and municipality of Vega Baja?
SELECT black__both_hispanic_and_non_hispanic_ FROM table_name_63 WHERE white__both_hispanic_and_non_hispanic_ < 80.6 AND n_asia__both_hispanic_and_non_hispanic_ = 0.1 AND amerindian__both_hispanic_and_non_hispanic_ < 0.6000000000000001 AND municipality__2010_ = "vega baja"
sql_create_context
CREATE TABLE table_26439 ( "No. by series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production number" real, "U.S. viewers (in millions)" text )
How many different writers have written the episode with series number 8?
SELECT COUNT("Written by") FROM table_26439 WHERE "No. by series" = '8'
wikisql
CREATE TABLE customers ( customer_id number, customer_address_id number, customer_status_code text, date_became_customer time, date_of_birth time, first_name text, last_name text, amount_outstanding number, email_address text, phone_number text, cell_mobile_phone_number text ...
List phone number and email address of customer with more than 2000 outstanding balance.
SELECT phone_number, email_address FROM customers WHERE amount_outstanding > 2000
spider
CREATE TABLE table_74891 ( "Year" real, "Location" text, "Gold" text, "Silver" text, "Bronze" text )
What's the Bronze with the Year of 1998?
SELECT "Bronze" FROM table_74891 WHERE "Year" = '1998'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
how many patients whose admission year is less than 2187 and drug route is tp?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2187" AND prescriptions.route = "TP"
mimicsql_data
CREATE TABLE table_58347 ( "Date and time ( UTC )" text, "Rocket" text, "Site" text, "Orbit" text, "Function" text, "Decay ( UTC )" text )
What site has an orbit of Leo, a decay (UTC) of still in orbit, and a magnetosphere research?
SELECT "Site" FROM table_58347 WHERE "Orbit" = 'leo' AND "Decay ( UTC )" = 'still in orbit' AND "Function" = 'magnetosphere research'
wikisql
CREATE TABLE table_23632 ( "Candidate" text, "Office" text, "Home state" text, "Popular vote" real, "States \u2013 first place" real, "States \u2013 second place" real, "States \u2013 third place" text )
How many states-first place are there for the office of Governor?
SELECT COUNT("States \u2013 first place") FROM table_23632 WHERE "Office" = 'Governor'
wikisql
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, ...
病人韦嘉泽有多少次医院是在03年3月16日到12年1月12日内去的?
SELECT (SELECT COUNT(*) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.person_info_XM = '韦嘉泽' AND mzjzjlb.JZKSRQ BETWEEN '2003-03-16' AND '2012-01-12') + (SELECT COUNT(*) FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AN...
css
CREATE TABLE table_name_32 ( club VARCHAR, number_of_seasons_in_liga_mx VARCHAR, number_of_seasons_in_top_division VARCHAR )
Which club has fewer than 40 seasons in Liga MX and 65 seasons in the top division?
SELECT club FROM table_name_32 WHERE number_of_seasons_in_liga_mx < 40 AND number_of_seasons_in_top_division = 65
sql_create_context
CREATE TABLE table_20294 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What was the record against Boston?
SELECT "Record" FROM table_20294 WHERE "Team" = 'Boston'
wikisql
CREATE TABLE table_40331 ( "Eliminated" text, "Wrestler" text, "Entered" real, "Eliminated by" text, "Time" text )
What is the number eliminated for the person with a time of 12:38?
SELECT "Eliminated by" FROM table_40331 WHERE "Time" = '12:38'
wikisql
CREATE TABLE table_51763 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Location" text )
Where is the location of a team with a 3-2 record?
SELECT "Location" FROM table_51763 WHERE "Record" = '3-2'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
how many patients had the diagnosis short title encephalopathy nos
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Encephalopathy NOS"
mimicsql_data
CREATE TABLE table_name_31 ( method VARCHAR, opponent VARCHAR )
What is the method of resolution for the fight against akihiro gono?
SELECT method FROM table_name_31 WHERE opponent = "akihiro gono"
sql_create_context
CREATE TABLE table_51648 ( "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Tell me the number of gold for albania with a silver of 1 and total less than 1
SELECT COUNT("Gold") FROM table_51648 WHERE "Silver" = '1' AND "Nation" = 'albania' AND "Total" < '1'
wikisql
CREATE TABLE table_1333 ( "Week #" text, "Theme" text, "Song choice" text, "Original artist" text, "Order #" text, "Result" text )
What is the order number for the theme of Mariah Carey?
SELECT "Order #" FROM table_1333 WHERE "Theme" = 'Mariah Carey'
wikisql
CREATE TABLE table_203_761 ( id number, "pos" number, "no" number, "driver" text, "team" text, "laps" number, "time/retired" text, "grid" number, "points" number )
what was the difference between the number of laps alex figge completed and the number of laps that will power completed ?
SELECT ABS((SELECT "laps" FROM table_203_761 WHERE "driver" = 'alex figge') - (SELECT "laps" FROM table_203_761 WHERE "driver" = 'will power'))
squall
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, ...
how many days have passed since first time on their current hospital visit patient 60136 stayed in the ward 14?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 60136 AND admissions.dischtime IS NULL)) AND transfers....
mimic_iii
CREATE TABLE table_name_69 ( year INTEGER, venue VARCHAR )
When is the earliest year the venue is in gothenburg, sweden?
SELECT MIN(year) FROM table_name_69 WHERE venue = "gothenburg, sweden"
sql_create_context
CREATE TABLE table_name_6 ( date VARCHAR, winning_driver VARCHAR, name VARCHAR )
On what date did Aymo Maggi win the Rome Grand Prix ?
SELECT date FROM table_name_6 WHERE winning_driver = "aymo maggi" AND name = "rome grand prix"
sql_create_context
CREATE TABLE table_67763 ( "Year" real, "Pick" text, "Player name" text, "College" text, "Position" text )
How many years have a Player name of ronnie bull?
SELECT SUM("Year") FROM table_67763 WHERE "Player name" = 'ronnie bull'
wikisql
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,...
For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of phone_number and manager_id .
SELECT PHONE_NUMBER, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE table_29717 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Table" text, "Incoming manager" text, "Date of appointment" text )
What is the outgoing manager when the date of vacancy is 10 october 2010?
SELECT "Outgoing manager" FROM table_29717 WHERE "Date of vacancy" = '10 October 2010'
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...
how many patients under the age of 58 had hemodialysis?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "58" AND procedures.long_title = "Hemodialysis"
mimicsql_data
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, ...
Top Total Score From Comments.
SELECT UserId AS "user_link", SUM(Score) AS "total_score", COUNT(*) AS "#comments" FROM Comments WHERE UserId IN ('##UserID##') GROUP BY UserId ORDER BY SUM(Score) DESC
sede
CREATE TABLE table_name_57 ( score VARCHAR, away VARCHAR )
What is the score of the match with deportes savio as the away team?
SELECT score FROM table_name_57 WHERE away = "deportes savio"
sql_create_context
CREATE TABLE table_34783 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
What was the outcome for the match at the leipzig tournament with a score w/o?
SELECT "Outcome" FROM table_34783 WHERE "Tournament" = 'leipzig' AND "Score" = 'w/o'
wikisql
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PostsWithDeleted ( Id number, PostTyp...
Shell looks for data in tables and joins some..
SELECT Posts.Id, Posts.Score, Posts.ParentId FROM Posts JOIN Comments ON Posts.Id = Comments.PostId
sede
CREATE TABLE technician ( technician_id real, Name text, Team text, Starting_Year real, Age int ) CREATE TABLE machine ( Machine_ID int, Making_Year int, Class text, Team text, Machine_series text, value_points real, quality_rank int ) CREATE TABLE repair ( repair_I...
Show different teams of technicians and the number of technicians in each team with a bar chart, and order Y in ascending order.
SELECT Team, COUNT(*) FROM technician GROUP BY Team ORDER BY COUNT(*)
nvbench
CREATE TABLE table_78157 ( "Year" text, "Competition" text, "Date" text, "Location" text, "Score" text, "Result" text )
what is the date for the game in prague for the world group, consolation round competition?
SELECT "Date" FROM table_78157 WHERE "Location" = 'prague' AND "Competition" = 'world group, consolation round'
wikisql
CREATE TABLE table_60537 ( "Country" text, "Date" text, "Label" text, "Format" text, "Catalogue number(s)" text )
Which Label has a Country of canada, and a Format of cd/digital download?
SELECT "Label" FROM table_60537 WHERE "Country" = 'canada' AND "Format" = 'cd/digital download'
wikisql
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, ...
when was patient 006-254182 prescribed thiamine 100 mg tab last in 05/last year?
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-254182')) AND medication.drugname = 'thiamine 100 mg tab' ...
eicu
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId nu...
User List: Top N - India - with false positive exclusions. List of Users in India.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE (LOWER(Location) LIKE '%india%' OR UPPER(Location) LIKE '%IND') AND LENGTH(Location) > 1 LIMIT 100
sede
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
For all employees who have the letters D or S in their first name, show me about the distribution of hire_date and the sum of department_id bin hire_date by time in a bar chart.
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
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, ...
自二零零六年十二月二十四日到二零一四年二月十日,医院7826174记录有医治过多少住院的患者
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '7826174' AND t_kc21.IN_HOSP_DATE BETWEEN '2006-12-24' AND '2014-02-10' AND t_kc21.CLINIC_TYPE = '住院'
css
CREATE TABLE table_8169 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Date" text, "Crowd" real )
What date was the Colonial Stadium?
SELECT "Date" FROM table_8169 WHERE "Ground" = 'colonial stadium'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREAT...
on the last intensive care unit visit', what was last systemicdiastolic value of patient 030-53416?
SELECT vitalperiodic.systemicdiastolic FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-53416') AND NOT patient.unitdischargetime IS ...
eicu
CREATE TABLE table_5696 ( "Model" text, "Engine" text, "Displacement" text, "Power" text, "Torque" text )
What was the displacement having a torque of n m (lb ft) @ 3000 rpm?
SELECT "Displacement" FROM table_5696 WHERE "Torque" = 'n·m (lb·ft) @ 3000 rpm'
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 prescriptions...
give me the number of patients whose insurance is medicare and primary disease is colangitis?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Medicare" AND demographic.diagnosis = "COLANGITIS"
mimicsql_data
CREATE TABLE table_name_31 ( weight VARCHAR, club VARCHAR, date_of_birth VARCHAR )
What is the Weight of the person born 1981-02-24 from the Uralochka Zlatoust club ?
SELECT weight FROM table_name_31 WHERE club = "uralochka zlatoust" AND date_of_birth = "1981-02-24"
sql_create_context
CREATE TABLE table_name_5 ( appearances VARCHAR, goals VARCHAR )
What is the amount of apperances of the person who had 36 goals?
SELECT appearances FROM table_name_5 WHERE goals = 36
sql_create_context
CREATE TABLE table_name_21 ( level VARCHAR, position VARCHAR, season VARCHAR, division VARCHAR )
What level for seasons after 2003, a Division of kakkonen (second division), and a Position of 12th?
SELECT level FROM table_name_21 WHERE season > 2003 AND division = "kakkonen (second division)" AND position = "12th"
sql_create_context
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, visualize the relationship between price and manufacturer , and group by attribute founder.
SELECT Price, Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder
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...
provide the number of patients whose insurance is medicaid and procedure icd9 code is 4432?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicaid" AND procedures.icd9_code = "4432"
mimicsql_data