context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_204_79 ( id number, "season" text, "tier" number, "division" text, "place" text )
in what year did atletico artexico finish on top of their division ?
SELECT "season" FROM table_204_79 WHERE "place" = 1
squall
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom te...
what the last height of patient 31325 in 06/last year.
SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31325)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit ht'...
mimic_iii
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...
Sample, simple question query by tag.
SELECT q.Id AS "post_link", q.LastActivityDate, q.Tags FROM Posts AS q INNER JOIN PostTags AS pt ON q.Id = pt.PostId INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE q.PostTypeId = 1 AND t.TagName IN ('inflation') ORDER BY q.LastActivityDate DESC
sede
CREATE TABLE table_50365 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
What CFL team does Jeff brown play for?
SELECT "CFL Team" FROM table_50365 WHERE "Player" = 'jeff brown'
wikisql
CREATE TABLE table_204_448 ( id number, "team" text, "winners" number, "runners-up" number, "years won" text, "years runner-up" text )
what team has won twice but has been runner up 5 times ?
SELECT "team" FROM table_204_448 WHERE "winners" = 2 AND "runners-up" = 5
squall
CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_...
what is the earliest flight that has no stops from WASHINGTON to SAN FRANCISCO 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 = 'SAN FRANCISCO' AND date_day.day_number = 25 AND date_day.month_number =...
atis
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 whose marital status is widowed and procedure short title is nasal sinus dx proc nec?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "WIDOWED" AND procedures.short_title = "Nasal sinus dx proc NEC"
mimicsql_data
CREATE TABLE bank ( branch_ID int, bname varchar(20), no_of_customers int, city varchar(10), state varchar(20) ) CREATE TABLE customer ( cust_ID varchar(3), cust_name varchar(20), acc_type char(1), acc_bal int, no_of_loans int, credit_score int, branch_ID int, state ...
Find the name and credit score of the customers who have some loans, list in descending by the y axis.
SELECT cust_name, credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_ID = T2.cust_ID ORDER BY credit_score DESC
nvbench
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, ins...
I want to fulfill the MDE requirement , what is the easiest class I can take for this ?
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_cou...
advising
CREATE TABLE table_22977424_8 ( name VARCHAR, promoted_from_league VARCHAR )
Name the number of names for exeter chiefs
SELECT COUNT(name) FROM table_22977424_8 WHERE promoted_from_league = "Exeter Chiefs"
sql_create_context
CREATE TABLE table_12791809_1 ( number_of_truck_loads_north INTEGER )
What is the most number of truck loads north?
SELECT MAX(number_of_truck_loads_north) FROM table_12791809_1
sql_create_context
CREATE TABLE table_name_14 ( russian VARCHAR, us_customary VARCHAR )
What is the Russian word for wine glass that contains 4.16 fl. oz.?
SELECT russian FROM table_name_14 WHERE us_customary = "4.16 fl. oz."
sql_create_context
CREATE TABLE table_28568 ( "Name / Name of Act" text, "Age(s)" text, "Genre" text, "Act" text, "Hometown" text, "Semifinal (Week)" real, "Position Reached" text )
what are all the hometown where the average age is 16
SELECT "Hometown" FROM table_28568 WHERE "Age(s)" = '16'
wikisql
CREATE TABLE Product_Characteristics ( product_id INTEGER, characteristic_id INTEGER, product_characteristic_value VARCHAR(50) ) CREATE TABLE Characteristics ( characteristic_id INTEGER, characteristic_type_code VARCHAR(15), characteristic_data_type VARCHAR(10), characteristic_name VARCHAR(...
Find the category descriptions of the products whose descriptions include letter 't', and count them by a pie chart
SELECT product_category_description, COUNT(product_category_description) FROM Ref_Product_Categories AS T1 JOIN Products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' GROUP BY product_category_description
nvbench
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 did patient 031-15417 get the last microbiological test until 11/2105?
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-15417')) AND STRFTIME('%y-%m', microlab.culturetakentime) <= ...
eicu
CREATE TABLE table_44533 ( "Position" real, "Name" text, "Played" real, "Drawn" real, "Lost" real, "Points" real )
what is the average points when drawn is 0, lost is 5 and played is more than 10?
SELECT AVG("Points") FROM table_44533 WHERE "Drawn" = '0' AND "Lost" = '5' AND "Played" > '10'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, ...
count the number of mechanical ventilation - tidal volume 6-10 ml/kg procedures performed since 2 years ago.
SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'mechanical ventilation - tidal volume 6-10 ml/kg' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-2 year')
eicu
CREATE TABLE train ( train_id number, name text, time text, service text ) CREATE TABLE train_station ( train_id number, station_id number ) CREATE TABLE station ( station_id number, name text, annual_entry_exit number, annual_interchanges number, total_passengers number, ...
Show all locations with only 1 station.
SELECT location FROM station GROUP BY location HAVING COUNT(*) = 1
spider
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number...
count the number of patients who had received a microbiological test of the blood, venipuncture in a year before.
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT microlab.patientunitstayid FROM microlab WHERE microlab.culturesite = 'blood, venipuncture' AND DATETIME(microlab.culturetakentime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year'))
eicu
CREATE TABLE table_name_20 ( week INTEGER, result VARCHAR )
Which Week has a Result of w 20-13?
SELECT AVG(week) FROM table_name_20 WHERE result = "w 20-13"
sql_create_context
CREATE TABLE employment ( Company_ID int, People_ID int, Year_working int ) CREATE TABLE company ( Company_ID real, Name text, Headquarters text, Industry text, Sales_in_Billion real, Profits_in_Billion real, Assets_in_Billion real, Market_Value_in_Billion real ) CREATE TAB...
What is the number of companies for each headquarter? Visualize by bar chart, sort by the total number in desc.
SELECT Headquarters, COUNT(Headquarters) FROM company GROUP BY Headquarters ORDER BY COUNT(Headquarters) DESC
nvbench
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
看一下门诊86971332521就诊的科室编码及名称分别是什么
SELECT wdmzjzjlb.JZKSBM, wdmzjzjlb.JZKSMC FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '86971332521' UNION SELECT bdmzjzjlb.JZKSBM, bdmzjzjlb.JZKSMC FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '86971332521'
css
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
what is the minimum age of patients with private insurance and year of death before 2183?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.insurance = "Private" AND demographic.dod_year < "2183.0"
mimicsql_data
CREATE TABLE table_name_68 ( target_version VARCHAR, license VARCHAR )
What is Target Version, when License is LGPL or MPL?
SELECT target_version FROM table_name_68 WHERE license = "lgpl or mpl"
sql_create_context
CREATE TABLE wdmzjzjlb ( 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 * 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.JZLSH_MZJZJLB AND jybgb.YLJGDM = jy...
css
CREATE TABLE table_name_35 ( crowd INTEGER, away_team VARCHAR )
What is the largest crowd for a Melbourne away team?
SELECT MAX(crowd) FROM table_name_35 WHERE away_team = "melbourne"
sql_create_context
CREATE TABLE table_70824 ( "Player" text, "AFL debut" text, "Games" text, "Goals" text, "Behinds" text, "Kicks" text, "Handballs" text, "Disposals" text, "Marks" text, "Tackles" text )
What is the number of disposals when marks is 134?
SELECT "Disposals" FROM table_70824 WHERE "Marks" = '134'
wikisql
CREATE TABLE table_name_97 ( date VARCHAR, crowd INTEGER )
What date was there a crowd larger than 30,343?
SELECT date FROM table_name_97 WHERE crowd > 30 OFFSET 343
sql_create_context
CREATE TABLE table_149330_1 ( seats_won VARCHAR, _percentage_of_votes VARCHAR )
What was the total number of seats won where the % of votes is equal to 20.29?
SELECT COUNT(seats_won) FROM table_149330_1 WHERE _percentage_of_votes = "20.29"
sql_create_context
CREATE TABLE table_35903 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
What was the Winning Score on May 29, 1977?
SELECT "Winning score" FROM table_35903 WHERE "Date" = 'may 29, 1977'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number,...
查出哪些检验指标记录在检测指标名称、检测指标结果定量单位、检测指标结果定量上和记录40791389430相同
SELECT * FROM jyjgzbb WHERE JCZBMC = (SELECT JCZBMC FROM jyjgzbb WHERE JYZBLSH = '40791389430') AND JCZBJGDW = (SELECT JCZBJGDW FROM jyjgzbb WHERE JYZBLSH = '40791389430') AND JCZBJGDL = (SELECT JCZBJGDL FROM jyjgzbb WHERE JYZBLSH = '40791389430')
css
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airlin...
okay how about a flight on sunday from TAMPA to CHARLOTTE
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 = 'CHARLOTTE' AND date_day.day_number = 27 AND date_day.month_number = 8 AND...
atis
CREATE TABLE table_39158 ( "Game" real, "November" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
How many points have November of 15?
SELECT SUM("Points") FROM table_39158 WHERE "November" = '15'
wikisql
CREATE TABLE table_692 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Status" text, "Opponent" text )
how many status with first elected being 1968
SELECT COUNT("Status") FROM table_692 WHERE "First elected" = '1968'
wikisql
CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ) CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255) ) CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARCHAR(25...
Bar chart x axis document name y axis the number of document name, and could you show in desc by the Y-axis please?
SELECT Document_Name, COUNT(Document_Name) FROM Documents GROUP BY Document_Name ORDER BY COUNT(Document_Name) DESC
nvbench
CREATE TABLE table_name_69 ( laps VARCHAR, start VARCHAR )
How many laps were there when the start was 12?
SELECT COUNT(laps) FROM table_name_69 WHERE start = "12"
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...
在11-12-13到19-01-19期间内,患者凤飞尘被开出的所有检验报告单中的标本采集部位需要列出来
SELECT jybgb.BBCJBW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '凤飞尘' AND jy...
css
CREATE TABLE table_train_123 ( "id" int, "bleeding" int, "systolic_blood_pressure_sbp" int, "anticoagulation" bool, "lumbar_puncture" bool, "blood_pressure_problem" bool, "stroke" bool, "substance_dependence" bool, "schizophrenia" bool, "major_mental_illness" bool, "multiple_...
subject has a systolic blood pressure ( sitting ) of greater than 160 mmhg, a diastolic ( sitting ) greater than 95 mmhg, a pulse ( sitting or supine ) less than 50 or greater than 85 .
SELECT * FROM table_train_123 WHERE systolic_blood_pressure_sbp > 160 OR diastolic_blood_pressure_dbp > 95 OR (pulse_rate < 50 OR pulse_rate > 85)
criteria2sql
CREATE TABLE table_203_584 ( id number, "date" text, "race name" text, "d(f)" number, "course" text, "prize (\u00a3)" number, "odds" text, "runners" number, "place" number, "margin" number, "winner/runner-up" text, "time" text, "jockey" text )
how many races did bend or complete in 1881 ?
SELECT COUNT("race name") FROM table_203_584 WHERE "date" = 1881
squall
CREATE TABLE table_name_58 ( psip_short_name VARCHAR, network VARCHAR )
What is ion life network's PSIP Short Name?
SELECT psip_short_name FROM table_name_58 WHERE network = "ion life"
sql_create_context
CREATE TABLE table_204_543 ( id number, "national team" text, "title(s)\nrepresented" text, "first\nworn" number, "number\nof stars" number, "notes" text )
what team was the first of win the world cup ?
SELECT "national team" FROM table_204_543 WHERE "title(s)\nrepresented" = 'world cup' ORDER BY "first\nworn" LIMIT 1
squall
CREATE TABLE table_203_247 ( id number, "district" text, "counties represented" text, "delegate" text, "party" text, "first elected" number, "committee" text )
how many total different committes are listed ?
SELECT COUNT(DISTINCT "committee") FROM table_203_247
squall
CREATE TABLE table_23628 ( "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 different popular vote counts were there for the candidate Rick Perry?
SELECT COUNT("Popular vote") FROM table_23628 WHERE "Candidate" = 'Rick Perry'
wikisql
CREATE TABLE business ( bid int, business_id varchar, name varchar, full_address varchar, city varchar, latitude varchar, longitude varchar, review_count bigint, is_open tinyint, rating float, state varchar ) CREATE TABLE user ( uid int, user_id varchar, name var...
Find all restaurant reviewed by Patrick in ' Los Angeles
SELECT business.name FROM business, category, review, user WHERE business.city = 'Los Angeles' AND category.business_id = business.business_id AND category.category_name = 'restaurant' AND review.business_id = business.business_id AND user.name = 'Patrick' AND user.user_id = review.user_id
yelp
CREATE TABLE table_191323_2 ( alt_name VARCHAR, notes VARCHAR )
What are the alternative names of those satellites where the notes are: mission failed. guidance system failed. no orbit.
SELECT alt_name FROM table_191323_2 WHERE notes = "Mission failed. Guidance system failed. No orbit."
sql_create_context
CREATE TABLE table_name_55 ( status VARCHAR, vehicle_types VARCHAR )
what status is the vehicle types of dmbs+tcl+dmcl?
SELECT status FROM table_name_55 WHERE vehicle_types = "dmbs+tcl+dmcl"
sql_create_context
CREATE TABLE table_60685 ( "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
What date was the match against leonardo tavares with a score of 6 4, 6 4?
SELECT "Date" FROM table_60685 WHERE "Score" = '6–4, 6–4' AND "Opponent" = 'leonardo tavares'
wikisql
CREATE TABLE table_name_75 ( draw VARCHAR, artist VARCHAR, place VARCHAR )
What is the draw number of the Artist Dav Mcnamara and a place bigger than 4?
SELECT COUNT(draw) FROM table_name_75 WHERE artist = "dav mcnamara" AND place > 4
sql_create_context
CREATE TABLE table_name_61 ( player VARCHAR, team VARCHAR )
Which player played for the Boston Patriots?
SELECT player FROM table_name_61 WHERE team = "boston patriots"
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 who died in or before the year 2126.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dod_year <= "2126.0"
mimicsql_data
CREATE TABLE table_name_71 ( date VARCHAR, opponent VARCHAR )
On what Date is the Minnesota Vikings the Opponent?
SELECT date FROM table_name_71 WHERE opponent = "minnesota vikings"
sql_create_context
CREATE TABLE table_name_36 ( opponent_in_the_final VARCHAR, year VARCHAR )
Name the opponent in the final for year of 1888
SELECT opponent_in_the_final FROM table_name_36 WHERE year = 1888
sql_create_context
CREATE TABLE table_name_12 ( score VARCHAR, loss VARCHAR )
Which score has a Loss of hiller (22 15 1)?
SELECT score FROM table_name_12 WHERE loss = "hiller (22–15–1)"
sql_create_context
CREATE TABLE table_name_23 ( governments VARCHAR, party VARCHAR )
What is the Government the has the Kadima Party?
SELECT governments FROM table_name_23 WHERE party = "kadima"
sql_create_context
CREATE TABLE table_25333 ( "County" text, "Population" real, "Unemployment Rate" text, "Market Income Per Capita" text, "Poverty Rate" text, "Status" text )
Name the status for unemployment rate being 6.7%
SELECT "Status" FROM table_25333 WHERE "Unemployment Rate" = '6.7%'
wikisql
CREATE TABLE festival_detail ( festival_id number, festival_name text, chair_name text, location text, year number, num_of_audience number ) CREATE TABLE nomination ( artwork_id number, festival_id number, result text ) CREATE TABLE artwork ( artwork_id number, type text, ...
What is the average number of audience for festivals?
SELECT AVG(num_of_audience) FROM festival_detail
spider
CREATE TABLE member ( Member_ID int, Name text, Country text, College_ID int ) CREATE TABLE round ( Round_ID int, Member_ID int, Decoration_Theme text, Rank_in_Round int ) CREATE TABLE college ( College_ID int, Name text, Leader_Name text, College_Location text )
A bar chart showing the number of members in each country, and rank by the names in desc.
SELECT Country, COUNT(Country) FROM member GROUP BY Country ORDER BY Country DESC
nvbench
CREATE TABLE table_name_33 ( wickets INTEGER, best_bowling VARCHAR, matches VARCHAR )
what is the highest wickets when the best bowling is 2/32 and matches is less than 5?
SELECT MAX(wickets) FROM table_name_33 WHERE best_bowling = "2/32" AND matches < 5
sql_create_context
CREATE TABLE table_name_82 ( away_team VARCHAR, date VARCHAR, tie_no VARCHAR )
Who was the away team on 10 January 1979 who had a tie no of 17?
SELECT away_team FROM table_name_82 WHERE date = "10 january 1979" AND tie_no = "17"
sql_create_context
CREATE TABLE table_name_24 ( visitor VARCHAR, date VARCHAR )
What is Visitor, when Date is 'April 24'?
SELECT visitor FROM table_name_24 WHERE date = "april 24"
sql_create_context
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE restriction ( restriction_c...
give me the flights with the fares from INDIANAPOLIS to ORLANDO on 12 27
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 AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AN...
atis
CREATE TABLE table_24448 ( "Class" text, "Weapon" text, "Caliber" text, "Type" text, "Weight (g)" text, "Range (m)" text, "Velocity (m/s)" text, "Impact Energy" text, "Shots" real )
What range does type FJ/PB/SCP work at?
SELECT "Range (m)" FROM table_24448 WHERE "Type" = 'FJ/PB/SCP'
wikisql
CREATE TABLE table_name_44 ( replaced_by VARCHAR, team VARCHAR )
Who replaced the manager of team arminia bielefeld?
SELECT replaced_by FROM table_name_44 WHERE team = "arminia bielefeld"
sql_create_context
CREATE TABLE table_name_43 ( years_in_orlando VARCHAR, nationality VARCHAR, player VARCHAR )
Which Years in Orlando has a Nationality of united states, and a Player of doug overton?
SELECT years_in_orlando FROM table_name_43 WHERE nationality = "united states" AND player = "doug overton"
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 the number of patients whose age is less than 68 and lab test fluid is blood?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "68" AND lab.fluid = "Blood"
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, ...
把患者章清懿在医院0923275住院就诊的所有记录中,出院时科室名字里有眼睛的住院就诊记录列出
SELECT * 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.person_info_XM = '章清懿' AND hz_info.YLJGDM = '0923275' AND zyjzjlb.CYKSMC LIKE '%眼睛%'
css
CREATE TABLE table_79742 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
What is Davis Love III's total?
SELECT "Total" FROM table_79742 WHERE "Player" = 'davis love iii'
wikisql
CREATE TABLE competition_result ( Competition_ID int, Club_ID_1 int, Club_ID_2 int, Score text ) CREATE TABLE competition ( Competition_ID int, Year real, Competition_type text, Country text ) CREATE TABLE club ( Club_ID int, name text, Region text, Start_year text ) C...
List the types of competition and the number of competitions of each type in a bar chart, display by the x-axis in descending please.
SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type ORDER BY Competition_type DESC
nvbench
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text, person_info_CSD text, person_info_CSRQ time, person_info_GJDM text, person_info_GJMC text, person_info_JGDM text, person_info_JGMC text, person_info_MZDM text, person_info_MZMC text, person_info_XBDM ...
病人奚子平的检验结果指标中哪些单号的检验报告单全部正常?
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.person_info_XM = '奚子平' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgz...
css
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, ...
what is the number of patients whose procedure long title is other open incisional hernia repair with graft or prosthesis and lab test fluid is blood?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Other open incisional hernia repair with graft or prosthesis" AND lab.fluid = "Blood"
mimicsql_data
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...
患者43770039被开出的药品在哪几次医疗记录中均不超过9882.0元?分别列出医疗就诊编号为?
SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '43770039' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 9882.0)
css
CREATE TABLE table_203_262 ( id number, "year" number, "team" text, "co-drivers" text, "car" text, "class" text, "laps" number, "pos." text, "class\npos." text )
who was casper elgaard 's co driver the most often for the 24 hours of le mans ?
SELECT "co-drivers" FROM table_203_262 GROUP BY "co-drivers" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE manufacturers ( code number, name text, headquarter text, founder text, revenue number ) CREATE TABLE products ( code number, name text, price number, manufacturer number )
How many manufacturers have headquarters in either Tokyo or Beijing?
SELECT COUNT(*) FROM manufacturers WHERE headquarter = 'Tokyo' OR headquarter = 'Beijing'
spider
CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE Dorm_amenity ( amenid ...
Find the number of students who are not in the largest major and group by students' first name in a bar chart, and could you list by the x axis in asc?
SELECT Fname, COUNT(Fname) FROM Student WHERE Major <> (SELECT Major FROM Student) GROUP BY Fname ORDER BY Fname
nvbench
CREATE TABLE table_22141 ( "Year [e ] (Ceremony)" text, "Film title used in nomination" text, "Original title" text, "Director" text, "Main Language(s)" text, "Result" text )
how many times was 27 missing kisses used in nomination
SELECT COUNT("Year [e ] (Ceremony)") FROM table_22141 WHERE "Film title used in nomination" = '27 Missing Kisses'
wikisql
CREATE TABLE table_name_92 ( tie_no VARCHAR, date VARCHAR )
What tie no has Watford as the date?
SELECT tie_no FROM table_name_92 WHERE date = "watford"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, pati...
list the top three most frequent lab tests that were given to patients in the same month after they were diagnosed with post cartoid endarterectomy this year.
SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'post cartoid endarterectomy' AND DATETIME(diagnosis....
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
How many of the patients admitted before the year 2198 were treated with valganciclovir?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2198" AND prescriptions.drug = "ValGANCIclovir"
mimicsql_data
CREATE TABLE table_35639 ( "State" text, "1990\u201395" real, "1996-00" real, "2001\u201305" real, "2006\u201310" real )
Which 1990 95 is the average one that has a 2001 05 larger than 0.55?
SELECT AVG("1990\u201395") FROM table_35639 WHERE "2001\u201305" > '0.55'
wikisql
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ...
Users who visited in the last day.
SELECT COUNT(*) AS "Num of Recent Visitors" FROM Users WHERE LastAccessDate > CURRENT_TIMESTAMP() - 34
sede
CREATE TABLE table_203_161 ( id number, "pos." text, "div." number, "no." number, "team" text, "drivers" text, "car" text, "laps" number, "qual.\npos." number )
how many teams are in the top five positions ?
SELECT COUNT(DISTINCT "team") FROM table_203_161 WHERE "pos." <= 5
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...
Visualize a bar chart about the distribution of ACC_Road and the average of School_ID , and group by attribute ACC_Road, could you order in ascending by the names?
SELECT ACC_Road, AVG(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road
nvbench
CREATE TABLE table_78582 ( "Season" text, "Division North" text, "Division South" text, "Division East" text, "Division West" text, "Division Southwest" text )
Who won Division Southwest when Mad ari Solidarnost won Division North?
SELECT "Division Southwest" FROM table_78582 WHERE "Division North" = 'madžari solidarnost'
wikisql
CREATE TABLE table_10981 ( "Rider" text, "Bike" text, "Laps" real, "Time" text, "Grid" real )
What is the average number of laps for max biaggi
SELECT AVG("Laps") FROM table_10981 WHERE "Rider" = 'max biaggi'
wikisql
CREATE TABLE table_26761 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "U.S. viewers (million)" text, "Original air date" text, "Production code" text )
Who directed episode 53 in the series?
SELECT "Directed by" FROM table_26761 WHERE "No. in series" = '53'
wikisql
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD ...
在病人27439695的医疗记录中,给他开出的药品金额小于8781.25元的医疗就诊有哪几次?编号是什么
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '27439695' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 8781.25)
css
CREATE TABLE table_10333757_1 ( market_rank VARCHAR, calls VARCHAR )
Which Market/Rank is associated with WCRN calls?
SELECT market_rank FROM table_10333757_1 WHERE calls = "WCRN"
sql_create_context
CREATE TABLE table_204_834 ( id number, "rank" number, "name" text, "nationality" text, "time" text )
who finished with the top time ?
SELECT "name" FROM table_204_834 ORDER BY "time" LIMIT 1
squall
CREATE TABLE table_18077713_1 ( earnings_per_share__¢_ VARCHAR, net_profit__us_$m_ VARCHAR )
What is the earnings per share when the net profit is 16.2 million dollars?
SELECT earnings_per_share__¢_ FROM table_18077713_1 WHERE net_profit__us_$m_ = "16.2"
sql_create_context
CREATE TABLE table_485 ( "Season #" real, "Series #" real, "Title" text, "Canadian airdate" text, "U.S. airdate" text, "Production code" real )
What is the total number of title with a u.s. air date of April 17, 2009
SELECT COUNT("Title") FROM table_485 WHERE "U.S. airdate" = 'April 17, 2009'
wikisql
CREATE TABLE table_name_74 ( pali VARCHAR, english VARCHAR )
Which Pali has an English of meditative concentration?
SELECT pali FROM table_name_74 WHERE english = "meditative concentration"
sql_create_context
CREATE TABLE table_30139175_3 ( uk_total_viewers VARCHAR, episode_no VARCHAR )
How many viewers in the UK did episode 50 have?
SELECT uk_total_viewers FROM table_30139175_3 WHERE episode_no = 50
sql_create_context
CREATE TABLE table_4974 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
Name the sum of pick # for round less than 1
SELECT SUM("Pick #") FROM table_4974 WHERE "Round" < '1'
wikisql
CREATE TABLE table_10581768_2 ( founded INTEGER, type VARCHAR, location VARCHAR )
How many institutions are located in wilmore, kentucky and private
SELECT MAX(founded) FROM table_10581768_2 WHERE type = "Private" AND location = "Wilmore, Kentucky"
sql_create_context
CREATE TABLE table_name_40 ( place_of_birth VARCHAR, elector VARCHAR )
What is listed as the Place of Birth for the Elector of Pandolfo?
SELECT place_of_birth FROM table_name_40 WHERE elector = "pandolfo"
sql_create_context
CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(50), building_phone VARCHAR(80) ) CREATE TABLE Guests ( guest_id INTEGER, ...
Show the number of apartment bookings for each year and bin booking start date by year interval in a bar chart, and show y-axis from low to high order.
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id ORDER BY COUNT(booking_start_date)
nvbench
CREATE TABLE Catalogs ( date_of_latest_revision VARCHAR )
Find the dates on which more than one revisions were made.
SELECT date_of_latest_revision FROM Catalogs GROUP BY date_of_latest_revision HAVING COUNT(*) > 1
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
find out the short title of procedure and primary disease of patient with patient id 17570.
SELECT demographic.diagnosis, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "17570"
mimicsql_data
CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1...
Show all the faculty ranks and the number of students advised by each rank with a pie chart.
SELECT Rank, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.Advisor GROUP BY T1.Rank
nvbench
CREATE TABLE technician ( technician_id number, name text, team text, starting_year number, age number ) CREATE TABLE repair ( repair_id number, name text, launch_date text, notes text ) CREATE TABLE machine ( machine_id number, making_year number, class text, team ...
What are the teams with the most technicians?
SELECT team FROM technician GROUP BY team ORDER BY COUNT(*) DESC LIMIT 1
spider