context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufac...
i would like a flight from SAN FRANCISCO to PITTSBURGH on friday morning after 1000 o'clock
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 (((date_day.day_number = 25 AND date_day.month_number = 6 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_tim...
atis
CREATE TABLE table_26454128_4 ( athlete VARCHAR, height VARCHAR, country VARCHAR )
Which athlete has a height of 1.87 and is from Sweden?
SELECT athlete FROM table_26454128_4 WHERE height = "1.87" AND country = "Sweden"
sql_create_context
CREATE TABLE table_17798093_20 ( ending VARCHAR, examples VARCHAR )
what are the endings of examples achilles, appendices, f ces
SELECT ending FROM table_17798093_20 WHERE examples = "Achilles, appendices, fæces"
sql_create_context
CREATE TABLE table_1480455_1 ( area__km_2__ VARCHAR, population_density___km_2__ VARCHAR )
What is the area (km 2) where the population density (/mk2) is 84.3?
SELECT area__km_2__ FROM table_1480455_1 WHERE population_density___km_2__ = "84.3"
sql_create_context
CREATE TABLE table_38154 ( "Date" text, "Venue" text, "Result" text, "Goals" real, "Competition" text )
On what date was a friendly match held at Auckland?
SELECT "Date" FROM table_38154 WHERE "Competition" = 'friendly match' AND "Venue" = 'auckland'
wikisql
CREATE TABLE table_74568 ( "Area" text, "Advertisement date" text, "Block" text, "Winning applicant" text, "Ensemble name" text )
What is Oxfordshire Area's Ensemble Name?
SELECT "Ensemble name" FROM table_74568 WHERE "Area" = 'oxfordshire'
wikisql
CREATE TABLE table_20477 ( "Headphone Model" text, "Headphone Class" text, "Driver-matched dB" text, "Construction" text, "Earpads" text, "Termination" text, "US MSRP" text )
Which terminations correspond with headphone model SR80I?
SELECT "Termination" FROM table_20477 WHERE "Headphone Model" = 'SR80i'
wikisql
CREATE TABLE table_3764 ( "Artist" text, "Country" text, "Number-one single(s)" text, "Year" real, "Weeks at #1" real, "Straight to #1 ?" text )
Name the number one singles for desvarieux, jacob
SELECT "Number-one single(s)" FROM table_3764 WHERE "Artist" = 'Desvarieux, Jacob'
wikisql
CREATE TABLE table_name_80 ( original_us_air_date VARCHAR, original_canadian_air_date VARCHAR )
What is the Original U.S. air-date for the Original Canadian air-date of december 9, 2007?
SELECT original_us_air_date FROM table_name_80 WHERE original_canadian_air_date = "december 9, 2007"
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, ...
门诊给韦天心这个病人诊断为躁狂型分裂情感性障碍,看看编号为246107的这个检测指标的结果定量及单位
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = j...
css
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufac...
i need to make reservations from DENVER to BOSTON
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON'...
atis
CREATE TABLE table_name_28 ( points INTEGER, winnings VARCHAR )
Which driver has the highest point total after winning $133,386?
SELECT MAX(points) FROM table_name_28 WHERE winnings = "$133,386"
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE cost ( row_id...
what was the name of the output which patient 10855 had for the first time on this month/25?
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT outputevents.itemid FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10855)) AND DATETIME(outputevents.charttim...
mimic_iii
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE admissions...
when was the last time until 38 months ago that patient 88558 had the minimum red blood cells value?
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 88558) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'red blood cells') AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(),...
mimic_iii
CREATE TABLE table_14850099_18 ( planet VARCHAR, cardinal_direction VARCHAR )
What is the planet associated with the direction of south?
SELECT planet FROM table_14850099_18 WHERE cardinal_direction = "South"
sql_create_context
CREATE TABLE table_34775 ( "Nation" text, "Skip" text, "Third" text, "Second" text, "Lead" text, "Alternate" text )
Who is the lead for the team with Nkeiruka Ezekh as second?
SELECT "Lead" FROM table_34775 WHERE "Second" = 'nkeiruka ezekh'
wikisql
CREATE TABLE table_33186 ( "Positional or Automatic" text, "Opponents" text, "Suits" text, "Material or Non-material" text, "Count Rectified" text )
Which suits have no material or non-material, either opponent, and are positional?
SELECT "Suits" FROM table_33186 WHERE "Material or Non-material" = 'no' AND "Opponents" = 'either' AND "Positional or Automatic" = 'positional'
wikisql
CREATE TABLE table_name_66 ( school_colors VARCHAR, main_campus_location VARCHAR )
What are the school colors for the college whose main campus is overland park?
SELECT school_colors FROM table_name_66 WHERE main_campus_location = "overland park"
sql_create_context
CREATE TABLE table_45903 ( "Name" text, "Platform" text, "Supported databases" text, "Tracking Method" text, "Latest stable release" text, "License" text )
Which tracking method has a latest stable release of 6.0?
SELECT "Tracking Method" FROM table_45903 WHERE "Latest stable release" = '6.0'
wikisql
CREATE TABLE table_name_73 ( guest_host VARCHAR, episode_number VARCHAR )
What is the name of the Guest Host for Episode Number of 5?
SELECT guest_host FROM table_name_73 WHERE episode_number = 5
sql_create_context
CREATE TABLE table_21907770_4 ( country VARCHAR, versus VARCHAR )
How many times was the opponent country India?
SELECT COUNT(country) FROM table_21907770_4 WHERE versus = "India"
sql_create_context
CREATE TABLE diagnoses ( 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 ) C...
what is admission time and procedure short title of subject id 2560?
SELECT demographic.admittime, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
provide the number of patients whose discharge location is long term care hospital?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "LONG TERM CARE HOSPITAL"
mimicsql_data
CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP...
Give me a histogram for what are the total number of credits offered by each department?
SELECT DEPT_CODE, SUM(T1.CRS_CREDIT) FROM COURSE AS T1 JOIN CLASS AS T2 ON T1.CRS_CODE = T2.CRS_CODE GROUP BY T1.DEPT_CODE
nvbench
CREATE TABLE table_27615445_1 ( audition_city VARCHAR, episode_air_date VARCHAR )
How many audition city's are there with an episode air date of June 24, 2010?
SELECT COUNT(audition_city) FROM table_27615445_1 WHERE episode_air_date = "June 24, 2010"
sql_create_context
CREATE TABLE table_18348 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
Name the incumbent for district texas 12
SELECT "Incumbent" FROM table_18348 WHERE "District" = 'Texas 12'
wikisql
CREATE TABLE table_203_763 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text )
in what years did ramon gonzalez come in first place ?
SELECT "year" FROM table_203_763 WHERE "position" = 1
squall
CREATE TABLE table_59509 ( "School" text, "Suburb/Town" text, "Years" text, "Founded" real, "Website" text )
What is the year Airds High School was founded?
SELECT "Founded" FROM table_59509 WHERE "School" = 'airds high school'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
what is maximum age of patients whose days of hospital stay is 11 and year of death is less than 2154?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.days_stay = "11" AND demographic.dod_year < "2154.0"
mimicsql_data
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, ...
从2014-03-30到2020-03-19,哪个工号什么名字的医务人员在患者奚信瑞就诊时为其检测罗马指数(绝经前)的
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.J...
css
CREATE TABLE table_69894 ( "Rank" real, "Player" text, "County" text, "Tally" text, "Total" real, "Opposition" text )
With a Tally of 0-14, what is the Rank in Kilkenny County?
SELECT COUNT("Rank") FROM table_69894 WHERE "County" = 'kilkenny' AND "Tally" = '0-14'
wikisql
CREATE TABLE table_204_735 ( id number, "rank" number, "team" text, "names" text, "time" text, "qualification" text )
how many consecutive rankings are listed ?
SELECT COUNT("rank") FROM table_204_735
squall
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE patients ( row_id number, subject_id number, ...
give me the difference between the total input of patient 10431 and the output of the patient until 12/00/2105.
SELECT (SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10431)) AND STRFTIME('%y-%m-%d', inputevents_cv.charttime) <= '2105-12-00') - (SEL...
mimic_iii
CREATE TABLE table_27987623_4 ( rank_timeslot_ VARCHAR, airdate VARCHAR )
what is the total rank on airdate march 30, 2011?
SELECT COUNT(rank_timeslot_) FROM table_27987623_4 WHERE airdate = "March 30, 2011"
sql_create_context
CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int,...
what flights stop in ATLANTA before 1200
SELECT DISTINCT flight.flight_id FROM airport_service, city, flight, flight_stop WHERE city.city_code = airport_service.city_code AND city.city_name = 'ATLANTA' AND flight_stop.arrival_time < 1200 AND flight_stop.stop_airport = airport_service.airport_code AND flight.flight_id = flight_stop.flight_id
atis
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...
A bar chart shows the distribution of Name and Weight .
SELECT Name, Weight FROM people
nvbench
CREATE TABLE table_38237 ( "Games" real, "Drawn" real, "Lost" real, "Points difference" text, "Points" real )
What is the highest number of draws with 14 points and less than 7 games?
SELECT MAX("Drawn") FROM table_38237 WHERE "Points" = '14' AND "Games" < '7'
wikisql
CREATE TABLE table_name_38 ( military_deaths VARCHAR, total_casualties VARCHAR )
How many members of the military died in the conflict that had a total of 531 casualties?
SELECT military_deaths FROM table_name_38 WHERE total_casualties = "531"
sql_create_context
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
What courses on Advanced Al Techniques have 4 credits ?
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Advanced Al Techniques%' OR name LIKE '%Advanced Al Techniques%') AND credits = 4
advising
CREATE TABLE table_51905 ( "Player" text, "Car." real, "Yards" real, "Avg." real, "TD's" real, "Long" real )
Name the total number of TD's for long more than 6 and cars less than 4
SELECT COUNT("TD's") FROM table_51905 WHERE "Long" > '6' AND "Car." < '4'
wikisql
CREATE TABLE table_1341453_15 ( results VARCHAR, district VARCHAR )
What was the result in Illinois 7?
SELECT results FROM table_1341453_15 WHERE district = "Illinois 7"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( ...
what were the number of definity prescriptions that were made since 4 years ago?
SELECT COUNT(*) FROM medication WHERE medication.drugname = 'definity' AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-4 year')
eicu
CREATE TABLE table_22654 ( "Date Released" text, "Polling institute" text, "Social Democratic" text, "Socialist" text, "Green-Communist" text, "Democratic and Social Centre" text, "Lead" text )
How many socialist have a lead of 12.6%?
SELECT COUNT("Socialist") FROM table_22654 WHERE "Lead" = '12.6%'
wikisql
CREATE TABLE table_name_81 ( score VARCHAR, result VARCHAR )
Which Score has a Result of 0 2?
SELECT score FROM table_name_81 WHERE result = "0 – 2"
sql_create_context
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
For those employees who did not have any job in the past, visualize a bar chart about the distribution of job_id and the sum of manager_id , and group by attribute job_id, and rank by the y-axis in asc.
SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(MANAGER_ID)
nvbench
CREATE TABLE table_17325580_6 ( high_points VARCHAR, team VARCHAR )
What is every high point when the team is Washington?
SELECT high_points FROM table_17325580_6 WHERE team = "Washington"
sql_create_context
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...
从2007年11月6日开始,截止到2012年5月8日,请把47198797的这位病人总共被开出的检验报告单的审核日期时间给列出来
SELECT jybgb.SHSJ FROM hz_info JOIN wdmzjzjlb JOIN jybgb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '47198797' AND jybgb.BGRQ BETWEEN '2007-11-06' AND '2012-...
css
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Visualize a bar chart about the distribution of All_Home and Team_ID , and group by attribute ACC_Road, I want to order in descending by the Y please.
SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY Team_ID DESC
nvbench
CREATE TABLE table_11677760_1 ( player VARCHAR, year VARCHAR, college VARCHAR, school VARCHAR )
what is the player who's college is listed as direct to nba, school is st. vincent st. mary high school and the year is 2001-2002?
SELECT player FROM table_11677760_1 WHERE college = "Direct to NBA" AND school = "St. Vincent – St. Mary High school" AND year = "2001-2002"
sql_create_context
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardi...
since 3 years ago, what is the top four most frequent diagnosis that patients were diagnosed with within 2 months after receiving total splenectomy?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissi...
mimic_iii
CREATE TABLE wrestler ( Wrestler_ID int, Name text, Reign text, Days_held text, Location text, Event text ) CREATE TABLE Elimination ( Elimination_ID text, Wrestler_ID text, Team text, Eliminated_By text, Elimination_Move text, Time text )
What is the number of locations of the wrestlers? Visualize by a bar chart, and sort by the x-axis from high to low.
SELECT Location, COUNT(Location) FROM wrestler GROUP BY Location ORDER BY Location DESC
nvbench
CREATE TABLE table_29673 ( "Week #" text, "Theme" text, "Song Choice" text, "Original Artist" text, "Order #" text, "Result" text )
How many different weeks are there in order number 4 that were judge's choice?
SELECT COUNT("Week #") FROM table_29673 WHERE "Theme" = 'Judge''s Choice' AND "Order #" = '4'
wikisql
CREATE TABLE table_204_268 ( id number, "album/single" text, "performer" text, "year" number, "variant" text, "notes" text )
who appeared on more albums , maccoll or kornog ?
SELECT "performer" FROM table_204_268 WHERE "performer" IN ('ewan maccoll', 'kornog') GROUP BY "performer" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_30326 ( "Year Location" text, "Mens Singles" text, "Womens Singles" text, "Mens Doubles" text, "Womens Doubles" text )
Name the number of womens singles for 1999 rio de janeiro
SELECT COUNT("Womens Singles") FROM table_30326 WHERE "Year Location" = '1999 Rio de Janeiro'
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...
find the number of emergency hospital admitted patients who had neb route of drug administration.
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.route = "NEB"
mimicsql_data
CREATE TABLE table_36999 ( "Rank" real, "First quarter" text, "Second quarter" text, "Third quarter" text, "Fourth quarter" text )
When the third quarter is China Mobile 195,680.4, what is the rank?
SELECT "Rank" FROM table_36999 WHERE "Third quarter" = 'china mobile 195,680.4'
wikisql
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
how much is the cost of the atrophic vaginitis diagnosing?
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'atrophic vaginitis'))
mimic_iii
CREATE TABLE table_55800 ( "Name" text, "Date of birth" text, "Date of death" text, "Reign" text, "Relationship with predecessor" text )
What was the Date of Death of the person whose Date of Birth was 28 May 1371?
SELECT "Date of death" FROM table_55800 WHERE "Date of birth" = '28 may 1371'
wikisql
CREATE TABLE table_59892 ( "Date" text, "Opponent" text, "Score" text, "Result" text, "Competition" text )
What is the result of the UEFA Cup, against Palermo?
SELECT "Result" FROM table_59892 WHERE "Competition" = 'uefa cup' AND "Opponent" = 'palermo'
wikisql
CREATE TABLE table_36602 ( "Date" text, "Home Team" text, "Score" text, "Visiting Team" text, "Stadium" text )
What was the score at CN Centre on April 5, 2008?
SELECT "Score" FROM table_36602 WHERE "Stadium" = 'cn centre' AND "Date" = 'april 5, 2008'
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_CLINIC_ID text, MED_DIRE_CD tex...
在41121954222的医疗就诊中,是哪个医疗机构的科室负责这次医疗就诊的,想知道编码和名称
SELECT gwyjzb.MED_ORG_DEPT_CD, gwyjzb.MED_ORG_DEPT_NM FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '41121954222' UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, fgwyjzb.MED_ORG_DEPT_NM FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '41121954222'
css
CREATE TABLE table_18818 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
How many leading scorers were there in the game against Utah?
SELECT COUNT("High points") FROM table_18818 WHERE "Team" = 'Utah'
wikisql
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE fare ( fare...
what about a RENTAL CAR in DENVER
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'DENVER' AND ground_service.city_code = city.city_code AND ground_service.transport_type = 'RENTAL CAR'
atis
CREATE TABLE table_14875671_1 ( date VARCHAR, attendance VARCHAR )
What was the date when the attendance was 63995
SELECT date FROM table_14875671_1 WHERE attendance = 63995
sql_create_context
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_da...
i'm requesting flight information on a flight from SAN FRANCISCO to PITTSBURGH on friday
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 (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND date_day.day_number = 25 AND date_day.month_number = 6 AN...
atis
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,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varcha...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, visualize a bar chart about the distribution of job_id and the sum of department_id , and group by attribute job_id, and could you list by the X in descending please?
SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
CREATE TABLE table_name_56 ( record VARCHAR, games VARCHAR )
What is the Record of the 1991 Port of Spain Games?
SELECT record FROM table_name_56 WHERE games = "1991 port of spain"
sql_create_context
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, ...
calculate the number of male patients whose hospital stay was for more than 2 days.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.days_stay > "2"
mimicsql_data
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of founder and the sum of manufacturer , and group by attribute founder, and I want to sort X-axis in asc order.
SELECT Founder, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder
nvbench
CREATE TABLE table_11951237_3 ( original_air_date VARCHAR, directed_by VARCHAR )
What is theoriginal air date of the episode directed by timothy van patten?
SELECT original_air_date FROM table_11951237_3 WHERE directed_by = "Timothy Van Patten"
sql_create_context
CREATE TABLE table_name_51 ( congress VARCHAR, _number_of_cosponsors VARCHAR )
Which Congress has a # of cosponsors of 19?
SELECT congress FROM table_name_51 WHERE _number_of_cosponsors = 19
sql_create_context
CREATE TABLE table_29290 ( "Season" text, "Coach" text, "Conf. Record" text, "Overall" text, "Standings" text, "Postseason" text )
What was the conference record for the Pandas when they were first in the standings in the 2003-04 season?
SELECT "Conf. Record" FROM table_29290 WHERE "Standings" = 'First' AND "Season" = '2003-04'
wikisql
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 those employees who was hired before 2002-06-21, draw a bar chart about the distribution of hire_date and the average of department_id bin hire_date by time.
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21'
nvbench
CREATE TABLE neighborhood ( id int, business_id varchar, neighborhood_name varchar ) CREATE TABLE user ( uid int, user_id varchar, name varchar ) CREATE TABLE business ( bid int, business_id varchar, name varchar, full_address varchar, city varchar, latitude varchar, ...
Find all restaurant in ' Los Angeles ' with more than 100 reviews
SELECT business.name FROM business, category WHERE business.city = 'Los Angeles' AND business.review_count > 100 AND category.business_id = business.business_id AND category.category_name = 'restaurant'
yelp
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...
从03年5月25日到14年6月18日,医院2484766一共有多少门诊医疗记录
SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '2484766' AND gwyjzb.IN_HOSP_DATE BETWEEN '2003-05-25' AND '2014-06-18' AND gwyjzb.CLINIC_TYPE = '门诊' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '2484766' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2003-05-25' AND '2014-06-18' AND fgwyjzb.CLINIC_TY...
css
CREATE TABLE csu_fees ( campus number, year number, campusfee number ) CREATE TABLE degrees ( year number, campus number, degrees number ) CREATE TABLE discipline_enrollments ( campus number, discipline number, year number, undergraduate number, graduate number ) CREATE TA...
What campuses are located in Chico?
SELECT campus FROM campuses WHERE location = "Chico"
spider
CREATE TABLE table_204_805 ( id number, "name" text, "club" text, "date of departure" text, "replacement" text, "date of appointment" text )
what is the number of managerial changes that ttm samut sakhon made in 2009 ?
SELECT COUNT(*) FROM table_204_805 WHERE "club" = 'ttm samut sakhon'
squall
CREATE TABLE table_46430 ( "Finished" real, "Time/ Behind" text, "Post" real, "Horse" text, "Jockey" text, "Trainer" text, "Owner" text )
What is Jockey, when Horse is 'Eight Belles'?
SELECT "Jockey" FROM table_46430 WHERE "Horse" = 'eight belles'
wikisql
CREATE TABLE table_29215 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
What college did the player who played DE go to?
SELECT "College" FROM table_29215 WHERE "Position" = 'DE'
wikisql
CREATE TABLE table_203_238 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text )
when was his last competition ?
SELECT "year" FROM table_203_238 ORDER BY "year" DESC LIMIT 1
squall
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...
For the attribute Team_Name and ACC_Percent, show their proportion by a pie chart.
SELECT Team_Name, ACC_Percent FROM basketball_match
nvbench
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...
韦浩岚这个病人被门诊诊断为混合性焦虑障碍,他做的三碘甲状腺原氨酸的结果定量及其单位分别是啥
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZ...
css
CREATE TABLE table_5592 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text )
On what date was their record 46-39?
SELECT "Date" FROM table_5592 WHERE "Record" = '46-39'
wikisql
CREATE TABLE table_14903627_1 ( year VARCHAR, mens_doubles VARCHAR )
HOW MANY YEARS DID MENS DOUBLES PLAYER HEIKI SORGE MEELIS MAISTE PLAY?
SELECT COUNT(year) FROM table_14903627_1 WHERE mens_doubles = "Heiki Sorge Meelis Maiste"
sql_create_context
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH ...
病人许乐心在门诊诊断为慢性胃溃疡的茶碱的结果定量还有单位分别为什么?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB ...
css
CREATE TABLE table_16318 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
What's the team of the player from St. Francis Xavier College?
SELECT "CFL Team" FROM table_16318 WHERE "College" = 'St. Francis Xavier'
wikisql
CREATE TABLE table_2855 ( "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 score for the game when the record was 37-27?
SELECT "Score" FROM table_2855 WHERE "Record" = '37-27'
wikisql
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, ...
那个叫做朱秀兰的病患在04年4月24日到2021年1月7日内医保的统筹基金支出共有多少钱?
SELECT SUM(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.PERSON_NM = '朱秀兰' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-04-24' AND '2021-01-07'
css
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 ReviewTaskResults ( Id number, Review...
Top users by the number of times they earned 200/day. This query finds the top users by the number of times they've earned 200/day, and gives indication about the progress towards Epic and Legendary badges. Think of it as the number of times Mortarboard badge could have been earned
SELECT Id AS "user_link", (SELECT COUNT(TotalRep) FROM (SELECT SUM(CASE Votes.VoteTypeId WHEN 1 THEN 15 WHEN 2 THEN 10 WHEN 9 THEN BountyAmount END) AS TotalRep, Votes.CreationDate AS CreationDate FROM Posts INNER JOIN Votes ON Votes.PostId = Posts.Id WHERE Posts.OwnerUserId = U.Id AND Posts.CommunityOwnedDate IS NULL ...
sede
CREATE TABLE table_29399 ( "Model Number" text, "Frequency" text, "L2 Cache" text, "HT" text, "Mult. 1" text, "V Core" text, "TDP" text, "Socket" text, "Release Date" text, "Part Number(s)" text )
Name the number of v core for model number mobile athlon 64 3000+
SELECT COUNT("V Core") FROM table_29399 WHERE "Model Number" = 'Mobile Athlon 64 3000+'
wikisql
CREATE TABLE table_75070 ( "Rank" real, "Country/Territory" text, "Nuestra Belleza Latina" real, "1st runner-up" real, "2nd runner-up" real, "3rd runner-up" real, "4th runner-up" real, "5th runner-up" real, "6th runner-up" real, "7th runner-up" real, "8th runner-up" real, ...
What is the 7th runner-up of the country with a 10th runner-up greater than 0, a 9th runner-up greater than 0, and an 8th runner-up greater than 1?
SELECT SUM("7th runner-up") FROM table_75070 WHERE "10th runner-up" > '0' AND "9th runner-up" > '0' AND "8th runner-up" > '1'
wikisql
CREATE TABLE diagnoses ( 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 ) C...
count the number of patients whose insurance is private and year of birth is less than 1887?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Private" AND demographic.dob_year < "1887"
mimicsql_data
CREATE TABLE table_name_59 ( country VARCHAR, city VARCHAR )
Where is the City of Douala?
SELECT country FROM table_name_59 WHERE city = "douala"
sql_create_context
CREATE TABLE table_4612 ( "Rank" real, "Heat (Lane)" text, "Name" text, "Nationality" text, "Time" text )
Which heat and lane was in rank of 22?
SELECT "Heat (Lane)" FROM table_4612 WHERE "Rank" = '22'
wikisql
CREATE TABLE table_5482 ( "# 100" real, "Season" text, "Playing For" text, "Against" text, "Score" text )
Which sum of # 100 has a Season of 1990, and an Against of warwickshire?
SELECT SUM("# 100") FROM table_5482 WHERE "Season" = '1990' AND "Against" = 'warwickshire'
wikisql
CREATE TABLE table_49190 ( "Event" text, "Time" text, "Name" text, "Nation" text, "Games" text, "Date" text )
On what date was the record set with a time of 1:07.18?
SELECT "Date" FROM table_49190 WHERE "Time" = '1:07.18'
wikisql
CREATE TABLE table_17335602_1 ( date VARCHAR, tournament VARCHAR )
When was the mcdonald's lpga championship?
SELECT date FROM table_17335602_1 WHERE tournament = "McDonald's LPGA Championship"
sql_create_context
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Descr...
popular db access programming languages.
SELECT COUNT(DISTINCT P.Id) AS num_questions, t_dbname.TagName FROM Posts AS P INNER JOIN PostTags AS pt ON pt.PostId = P.Id INNER JOIN Tags AS t_lang ON t_lang.Id = pt.TagId INNER JOIN PostTags AS pt_db ON pt_db.PostId = P.Id INNER JOIN Tags AS t_dbname ON t_dbname.Id = pt_db.TagId WHERE t_lang.TagName IN ('c++', 'jav...
sede
CREATE TABLE table_9522 ( "Name" text, "Nationality" text, "Position [F ]" text, "Date from [G ]" text, "Date to [H ]" text, "Appearances" real, "Goals" real, "Club source [I ]" text )
What is Appearances, when Postion [F ] is 'Defender', and when Date to [H ] is '1938'?
SELECT "Appearances" FROM table_9522 WHERE "Position [F ]" = 'defender' AND "Date to [H ]" = '1938'
wikisql
CREATE TABLE table_name_51 ( meg_whitman__r_ VARCHAR, date_s__administered VARCHAR )
What percent of the vote went to Meg Whitman in the poll taken on October 21, 2010.
SELECT meg_whitman__r_ FROM table_name_51 WHERE date_s__administered = "october 21, 2010"
sql_create_context