context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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 with admission location as phys refferal/normal deli were below the age of 48?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.age < "48"
mimicsql_data
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight te...
i need a flight from ONTARIO to LOS ANGELES on a THURSDAY
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, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LOS ANGELES' AND days.day_name = 'THURSDAY' AND flight.flight_days = days.days_code...
atis
CREATE TABLE table_24192031_2 ( geographical_regions VARCHAR, contestant VARCHAR )
What geographical region is contestant laura jim nez ynoa from?
SELECT geographical_regions FROM table_24192031_2 WHERE contestant = "Laura Jiménez Ynoa"
sql_create_context
CREATE TABLE table_10159 ( "Election" text, "D\u00e1il" text, "Share of votes" text, "Seats" real, "Total seats" real )
If the total number of seats is under 144, and the seats won is 32, which election is this?
SELECT "Election" FROM table_10159 WHERE "Total seats" < '144' AND "Seats" = '32'
wikisql
CREATE TABLE table_name_70 ( bush_number INTEGER, others_number VARCHAR, bush_percentage VARCHAR )
What is the average value of Bush# when the value for Others# is greater than 57, and the value for Bush% is 49.2%?
SELECT AVG(bush_number) FROM table_name_70 WHERE others_number > 57 AND bush_percentage = "49.2%"
sql_create_context
CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Ranking int ) CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price real ) CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stoc...
Plot the total number by grouped by carrier as a bar graph, and I want to list in asc by the names.
SELECT Carrier, COUNT(*) FROM phone GROUP BY Carrier ORDER BY Carrier
nvbench
CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE...
Visualize a bar chart about the distribution of Time and meter_100 , and show in ascending by the total number.
SELECT Time, meter_100 FROM swimmer ORDER BY meter_100
nvbench
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
provide the number of patients whose diagnosis long title is osteoporosis, unspecified and lab test abnormal status is abnormal.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Osteoporosis, unspecified" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_name_69 ( party VARCHAR, result VARCHAR, incumbent VARCHAR )
What party was re-elected as an incumbent of robert p. Kennedy?
SELECT party FROM table_name_69 WHERE result = "re-elected" AND incumbent = "robert p. kennedy"
sql_create_context
CREATE TABLE table_45655 ( "Class" text, "Team" text, "Driver" text, "Chassis \u2013 Engine" text, "Laps" real )
What Team has Bob Wollek as a Driver with 76 Laps in C1 Class?
SELECT "Team" FROM table_45655 WHERE "Class" = 'c1' AND "Laps" = '76' AND "Driver" = 'bob wollek'
wikisql
CREATE TABLE table_60013 ( "Provider" text, "Years" text, "Free or pay" text, "Transmission" text, "On demand" text )
Which On demandhas a Free or pay of free and a Provider of freesat?
SELECT "On demand" FROM table_60013 WHERE "Free or pay" = 'free' AND "Provider" = 'freesat'
wikisql
CREATE TABLE table_203_230 ( id number, "place" text, "player" text, "country" text, "score" text, "to par" number )
what score did tiger woods achieve in his third round ?
SELECT "score" FROM table_203_230 WHERE "player" = 'tiger woods'
squall
CREATE TABLE table_name_3 ( floors VARCHAR, rank VARCHAR, height VARCHAR, _m__ft_ VARCHAR )
How many floors were there with a building rank of less than 3 and a height of 300 / 985 m (ft)?
SELECT COUNT(floors) FROM table_name_3 WHERE height * _m__ft_ = "300 / 985" AND rank < 3
sql_create_context
CREATE TABLE table_name_49 ( lost INTEGER, tied INTEGER )
What is the average number of losses when there are more than 0 ties?
SELECT AVG(lost) FROM table_name_49 WHERE tied > 0
sql_create_context
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, sh...
what was the name of the drug, which patient 20801 had been prescribed two times until 09/2105?
SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20801) AND STRFTIME('%y-%m', prescriptions.startdate) <= '2105-09' GROUP BY prescriptions.drug) AS t1 WHERE t1.c...
mimic_iii
CREATE TABLE table_22196 ( "Year" real, "Date" text, "Type" text, "Species" text, "Author Species" text, "Value" text, "Afinsa" real, "Scott" text, "Mitchell" real, "Yvert" text, "Sta. & Gib." real, "Order" text, "Family" text )
What is every species when Afinsa is 639?
SELECT "Species" FROM table_22196 WHERE "Afinsa" = '639'
wikisql
CREATE TABLE table_50245 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
The match against Mark Hunt had what result?
SELECT "Res." FROM table_50245 WHERE "Opponent" = 'mark hunt'
wikisql
CREATE TABLE days ( days_code varchar, day_name varchar ) 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_days text ) CREATE TABLE equipment_sequence ( aircr...
is there a flight around 3pm from CHARLOTTE to MINNEAPOLIS
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 ((flight.departure_time <= 1530 AND flight.departure_time >= 1430) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MINNEAPOLIS' AND fl...
atis
CREATE TABLE table_38843 ( "Name" text, "Type" text, "Entered service" text, "Water depth" text, "Location" text )
Where is Transocean Richardson, a semi entered into service in 1988?
SELECT "Location" FROM table_38843 WHERE "Type" = 'semi' AND "Entered service" = '1988' AND "Name" = 'transocean richardson'
wikisql
CREATE TABLE table_43364 ( "Ballarat FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
For the teams that had more than 2 Byes, what was the highest number of Wins?
SELECT MAX("Wins") FROM table_43364 WHERE "Byes" > '2'
wikisql
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE ...
Which courses in Univ Chamber Choir will satisfy the ULCS requirement ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Univ Chamber Choir%' OR course.description LIKE '%Univ Chamber Choir%' OR course.name LIKE '%Uni...
advising
CREATE TABLE table_name_71 ( digital_analog_signal VARCHAR, available_interface VARCHAR, retail_name VARCHAR )
What is the Digital/analog signal with an Available interface with pci express, with Retail name with all-in-wonder x600 pro?
SELECT digital_analog_signal FROM table_name_71 WHERE available_interface = "pci express" AND retail_name = "all-in-wonder x600 pro"
sql_create_context
CREATE TABLE table_name_15 ( score VARCHAR, player VARCHAR )
What is Score, when Player is 'Ernie Els'?
SELECT score FROM table_name_15 WHERE player = "ernie els"
sql_create_context
CREATE TABLE table_name_48 ( agg VARCHAR, team_1 VARCHAR )
When Karaorman is Team 1, what is the Agg.?
SELECT agg FROM table_name_48 WHERE team_1 = "karaorman"
sql_create_context
CREATE TABLE table_54211 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the name of the venue when the home team is Richmond?
SELECT "Venue" FROM table_54211 WHERE "Home team" = 'richmond'
wikisql
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...
对于医疗费总额高于3099.06元的患者83701090的医疗记录,列出有哪些出院诊断疾病编码和名称?
SELECT qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '83701090' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 3099.06) UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '83701090' AND gyb.MED_CLINIC_ID IN (SELECT t...
css
CREATE TABLE table_name_10 ( grid INTEGER, constructor VARCHAR, time_retired VARCHAR )
What is the average grid number with a ferrari and a time or retired time of 1:32:35.101?
SELECT AVG(grid) FROM table_name_10 WHERE constructor = "ferrari" AND time_retired = "1:32:35.101"
sql_create_context
CREATE TABLE table_48917 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
Who was the home team when the away team was Telford United?
SELECT "Home team" FROM table_48917 WHERE "Away team" = 'telford united'
wikisql
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE weather ( date TEXT, ...
What is the total cloud cover rates of the dates (bin into year interval) that had the top 5 cloud cover rates? You can draw me a bar chart for this purpose, rank in descending by the Y-axis.
SELECT date, SUM(cloud_cover) FROM weather ORDER BY SUM(cloud_cover) DESC
nvbench
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...
how many patients are with white ethnicity and with oral drug route?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE" AND prescriptions.route = "ORAL"
mimicsql_data
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
count the number of patients whose admission location is emergency room admit and item id is 51375.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND lab.itemid = "51375"
mimicsql_data
CREATE TABLE country ( country_id number, country_name text, capital text, official_native_language text ) CREATE TABLE match_season ( season number, player text, position text, country number, team number, draft_pick_number number, draft_class text, college text ) CREA...
Which college have both players with position midfielder and players with position defender?
SELECT college FROM match_season WHERE position = "Midfielder" INTERSECT SELECT college FROM match_season WHERE position = "Defender"
spider
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time...
Titre des 10 derni res questions pos es et pseudo de l'auteur.
SELECT MONTH(10)
sede
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
My comments by score with post link.
SELECT PostId AS "post_link", Text, Score FROM Comments WHERE UserId = '##UserId##' ORDER BY Score DESC
sede
CREATE TABLE school ( Enrollment VARCHAR, Denomination VARCHAR )
What are the enrollments of schools whose denomination is not 'Catholic'?
SELECT Enrollment FROM school WHERE Denomination <> "Catholic"
sql_create_context
CREATE TABLE county ( county_id number, county_name text, population number, zip_code text ) CREATE TABLE party ( party_id number, year number, party text, governor text, lieutenant_governor text, comptroller text, attorney_general text, us_senate text ) CREATE TABLE el...
What are the distinct districts for elections?
SELECT DISTINCT district FROM election
spider
CREATE TABLE table_name_88 ( date VARCHAR, opponent VARCHAR )
Opponent of denver broncos happened on what date?
SELECT date FROM table_name_88 WHERE opponent = "denver broncos"
sql_create_context
CREATE TABLE book ( Book_ID int, Title text, Issues real, Writer text ) CREATE TABLE publication ( Publication_ID int, Book_ID int, Publisher text, Publication_Date text, Price real )
Bar chart x axis publication date y axis how many publication date, and show y-axis in ascending order.
SELECT Publication_Date, COUNT(Publication_Date) FROM publication GROUP BY Publication_Date ORDER BY COUNT(Publication_Date)
nvbench
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE food_service ( meal_code text, meal_nu...
show me all the flights from DENVER to BALTIMORE arriving 5 10
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, state WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND date_day.day_number = 10 AND date_day.month_number ...
atis
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...
编号88565849766的医疗就诊,退费结算该走的流程都走好了没
SELECT t_kc24.REF_SLT_FLG FROM t_kc24 JOIN t_kc21_t_kc24 JOIN t_kc21 ON t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID AND t_kc21_t_kc24.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '88565849766'
css
CREATE TABLE table_56468 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Record" text )
While the Hornets were visiting, what date was Deron Williams (29) the leading scorer?
SELECT "Date" FROM table_56468 WHERE "Leading scorer" = 'deron williams (29)' AND "Visitor" = 'hornets'
wikisql
CREATE TABLE table_55547 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Who did Footscray play against when they scored 14.12 (96)?
SELECT "Away team" FROM table_55547 WHERE "Home team score" = '14.12 (96)'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE vitalperiodic ( ...
how many times is hypotonic fluid administration - half-normal saline solution taken since 4 years ago?
SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'hypotonic fluid administration - half-normal saline solution' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-4 year')
eicu
CREATE TABLE table_70966 ( "Index" text, "Name" text, "Chinese Name" text, "Country" text, "Status" text )
What is the Chinese name of the player in Index F10?
SELECT "Chinese Name" FROM table_70966 WHERE "Index" = 'f10'
wikisql
CREATE TABLE table_25999087_2 ( mountains_classification VARCHAR, winner VARCHAR )
How many mountains classifications when Rui Costa is the winner?
SELECT COUNT(mountains_classification) FROM table_25999087_2 WHERE winner = "Rui Costa"
sql_create_context
CREATE TABLE table_22815568_6 ( county VARCHAR, unemployment_rate VARCHAR )
What county is the unemployment rate 4.8%?
SELECT county FROM table_22815568_6 WHERE unemployment_rate = "4.8%"
sql_create_context
CREATE TABLE table_25581 ( "Institution" text, "Nickname" text, "Location" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" real, "Left" real )
Name the nickname that was founded 1798
SELECT "Nickname" FROM table_25581 WHERE "Founded" = '1798'
wikisql
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttim...
list the top three most frequent prescriptions that patients were prescribed with within the same month after being prescribed sertraline since 6 years ago.
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 = 'sertraline' AND DATETIME(prescriptions.startdate) >= DATETIME(CUR...
mimic_iii
CREATE TABLE table_34970 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text )
Which Result has a District of pennsylvania 13?
SELECT "Result" FROM table_34970 WHERE "District" = 'pennsylvania 13'
wikisql
CREATE TABLE table_32003 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the rank of the Nation that has fewer than 24 total medals are more than 7 Gold medals?
SELECT AVG("Rank") FROM table_32003 WHERE "Total" < '24' AND "Gold" > '7'
wikisql
CREATE TABLE table_49046 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Record" text )
What was the highest game number when the opponent was the Miami Heat?
SELECT MAX("Game") FROM table_49046 WHERE "Opponent" = 'miami heat'
wikisql
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number ...
When will Sarah Mcdowell teach 763 next ?
SELECT DISTINCT semester.semester, semester.year FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.number = 763 AND course_offering.semester = semester.semester_id AND instructor.name LIKE '%Sarah Mcdowell%' AND offering_instructor.inst...
advising
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 procedures...
tell me the difference between the total amount of input and output for patient 2753.
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 = 2753))) - (SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icu...
mimic_iii
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 d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE chart...
is the creatine kinase (ck) value of patient 26612 last measured on the first hospital visit greater than the value of the patient second to last measured on the first hospital visit?
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26612 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label ...
mimic_iii
CREATE TABLE table_41792 ( "Rank" real, "Name" text, "Years" text, "Matches" real, "Goals" real )
Which Rank has a Years of 1998 present?
SELECT AVG("Rank") FROM table_41792 WHERE "Years" = '1998–present'
wikisql
CREATE TABLE table_22978 ( "Rank 2011" real, "Change since 2006" text, "Urban Area" text, "County" text, "Population 2011" real, "Increase since 2006" text )
How many places did the rank change since 22006 for County Leitrim?
SELECT COUNT("Change since 2006") FROM table_22978 WHERE "County" = 'County Leitrim'
wikisql
CREATE TABLE table_name_77 ( home_team VARCHAR, venue VARCHAR )
What home team plays at Windy Hill?
SELECT home_team FROM table_name_77 WHERE venue = "windy hill"
sql_create_context
CREATE TABLE table_2646656_3 ( incumbent VARCHAR, district VARCHAR )
Who was the incumbent in the Ohio 5 district?
SELECT incumbent FROM table_2646656_3 WHERE district = "Ohio 5"
sql_create_context
CREATE TABLE gyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
从05年12月30日到16年5月12这段时间内,患者86930913的住院次数为多少?
SELECT COUNT(*) FROM zyb WHERE zyb.PERSON_NM = '86930913' AND zyb.IN_HOSP_DAYS BETWEEN '2005-12-30' AND '2016-05-12'
css
CREATE TABLE body_builder ( Total INTEGER, People_ID VARCHAR ) CREATE TABLE people ( People_ID VARCHAR, Height INTEGER )
What is the average total score of body builders with height bigger than 200?
SELECT AVG(T1.Total) FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Height > 200
sql_create_context
CREATE TABLE student ( stu_num number, stu_lname text, stu_fname text, stu_init text, stu_dob time, stu_hrs number, stu_class text, stu_gpa number, stu_transfer number, dept_code text, stu_phone text, prof_num number ) CREATE TABLE enroll ( class_code text, stu_n...
What are the codes of all the courses that are located in room KLR209?
SELECT class_code FROM class WHERE class_room = 'KLR209'
spider
CREATE TABLE table_28068063_2 ( aggregate_score VARCHAR, winners VARCHAR )
What was the aggregate score for the match won by Viadana?
SELECT aggregate_score FROM table_28068063_2 WHERE winners = "Viadana"
sql_create_context
CREATE TABLE table_5272 ( "Order Year" text, "Manufacturer" text, "Model" text, "Fleet (Qty.)" text, "Propulsion" text, "Length (ft.)" real )
What is the Propulsion for the model offered in 2003-2004 by neoplan usa?
SELECT "Propulsion" FROM table_5272 WHERE "Order Year" = '2003-2004' AND "Manufacturer" = 'neoplan usa'
wikisql
CREATE TABLE table_67709 ( "Date" text, "Home captain" text, "Away captain" text, "Venue" text, "Result" text )
What was the venue for the matches played on the dates 3,4,5,6,7 June 1993?
SELECT "Venue" FROM table_67709 WHERE "Date" = '3,4,5,6,7 june 1993'
wikisql
CREATE TABLE table_name_99 ( frequency_mhz INTEGER, class VARCHAR )
What is the total of Frequency MHz with a Class of b1?
SELECT SUM(frequency_mhz) FROM table_name_99 WHERE class = "b1"
sql_create_context
CREATE TABLE table_name_67 ( bronze VARCHAR, sport VARCHAR )
Tell me the total number of Bronze for futsal
SELECT COUNT(bronze) FROM table_name_67 WHERE sport = "futsal"
sql_create_context
CREATE TABLE table_20367820_16 ( not_out VARCHAR, average VARCHAR )
How many no outs are there for an average of 43.70?
SELECT not_out FROM table_20367820_16 WHERE average = "43.70"
sql_create_context
CREATE TABLE table_name_15 ( crowd VARCHAR, away_team VARCHAR )
How many times is st kilda the away team?
SELECT COUNT(crowd) FROM table_name_15 WHERE away_team = "st kilda"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
which religious background does the patient with patient id 3343 belong to?
SELECT demographic.religion FROM demographic WHERE demographic.subject_id = "3343"
mimicsql_data
CREATE TABLE table_name_90 ( class VARCHAR, livery VARCHAR )
What is the Class when Wessex Trains Pink is the Livery?
SELECT class FROM table_name_90 WHERE livery = "wessex trains pink"
sql_create_context
CREATE TABLE table_33325 ( "Country" text, "Area (km\u00b2) 2010" text, "Population 2011" text, "GDP (PPP) ( Intl. $ ) 2011" text, "GDP (PPP) per capita ( Intl. $ ) 2011" text, "Income inequality 1994\u20132011 (latest available)" text, "HDI 2011" text, "FSI 2012" text, "CPI 2011" te...
What is the current income inequality for the country of Seychelles?
SELECT "Income inequality 1994\u20132011 (latest available)" FROM table_33325 WHERE "Country" = 'seychelles'
wikisql
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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), CO...
For those employees who did not have any job in the past, visualize a bar chart about the distribution of job_id and the average of manager_id , and group by attribute job_id, and could you list in descending by the Y?
SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY AVG(MANAGER_ID) DESC
nvbench
CREATE TABLE table_name_56 ( tie_no VARCHAR, home_team VARCHAR )
What was the tie resulting from Sheffield Wednesday's game?
SELECT tie_no FROM table_name_56 WHERE home_team = "sheffield wednesday"
sql_create_context
CREATE TABLE table_56253 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the largest crowd for an Away team of st kilda?
SELECT MAX("Crowd") FROM table_56253 WHERE "Away team" = 'st kilda'
wikisql
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...
把2002年11月30日到2010年6月8日期间患者96886355一共看过多少种疾病查看一下
SELECT COUNT(gwyjzb.IN_DIAG_DIS_CD) FROM gwyjzb WHERE gwyjzb.PERSON_ID = '96886355' AND gwyjzb.IN_HOSP_DATE BETWEEN '2002-11-30' AND '2010-06-08' UNION SELECT COUNT(fgwyjzb.IN_DIAG_DIS_CD) FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '96886355' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2002-11-30' AND '2010-06-08'
css
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
Was MUSED 371 ever offered in the Spring ?
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'MUSED' AND course.number = 371 AND semester.semester = 'Spring' AND semester.semester_id = course_offering.semester
advising
CREATE TABLE table_name_98 ( rank VARCHAR, attendance VARCHAR )
What is the Rank of the game with an Attendance of 93,039?
SELECT COUNT(rank) FROM table_name_98 WHERE attendance = 93 OFFSET 039
sql_create_context
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar...
Courses worth 11 credits ?
SELECT DISTINCT name, number FROM course WHERE credits = 11 AND department = 'EECS'
advising
CREATE TABLE table_23286112_7 ( high_points VARCHAR, location_attendance VARCHAR )
Who has high points when verizon center 17,152 is location attendance?
SELECT high_points FROM table_23286112_7 WHERE location_attendance = "Verizon Center 17,152"
sql_create_context
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propul...
where does CP fly to
SELECT DISTINCT airport.airport_code FROM airport, flight WHERE flight.airline_code = 'CP' AND flight.to_airport = airport.airport_code
atis
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,...
give me the number of patients whose primary disease is morbid obesity/sda and lab test fluid is ascites?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "MORBID OBESITY/SDA" AND lab.fluid = "Ascites"
mimicsql_data
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospit...
calculate the number of tracheostomy - performed during current admission for ventilatory support cases.
SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'tracheostomy - performed during current admission for ventilatory support'
eicu
CREATE TABLE table_name_60 ( week INTEGER, month VARCHAR, offensive VARCHAR )
What was the lowest week in the month of August against Andrew Combs?
SELECT MIN(week) FROM table_name_60 WHERE month = "august" AND offensive = "andrew combs"
sql_create_context
CREATE TABLE table_name_4 ( class VARCHAR, frequency_mhz VARCHAR, city_of_license VARCHAR )
What class has a MHZ frequency under 103.1 licensed in morro bay, california?
SELECT class FROM table_name_4 WHERE frequency_mhz < 103.1 AND city_of_license = "morro bay, california"
sql_create_context
CREATE TABLE orders ( order_id number, customer_id number, order_status text, date_order_placed time, order_details text ) CREATE TABLE shipment_items ( shipment_id number, order_item_id number ) CREATE TABLE products ( product_id number, product_name text, product_details text...
What are the distinct details of invoices created before 1989-09-03 or after 2007-12-25?
SELECT DISTINCT invoice_details FROM invoices WHERE invoice_date < "1989-09-03" OR invoice_date > "2007-12-25"
spider
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
DBA - Total Posts per Month.
SELECT CONCAT(YEAR(P.CreationDate), '-', MONTH(P.CreationDate)) AS YearMonth, COUNT(*) AS PostCount FROM Posts AS P GROUP BY YEAR(P.CreationDate), MONTH(P.CreationDate) ORDER BY YEAR(P.CreationDate) DESC, MONTH(P.CreationDate) DESC
sede
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 procedures ( ...
Give the number of patients that survived and had a lab test name of phosphate, urine.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.expire_flag = "0" AND lab.label = "Phosphate, Urine"
mimicsql_data
CREATE TABLE table_29218221_3 ( fri_3_june VARCHAR, thurs_2_june VARCHAR )
What was the Friday June 3 practice time of the rider who did 20' 50.45 108.623mph on Thursday, June 2?
SELECT fri_3_june FROM table_29218221_3 WHERE thurs_2_june = "20' 50.45 108.623mph"
sql_create_context
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, ...
timeline for linear algebra.
SELECT YEAR(p.LastActivityDate) AS "recent", p.Title, YEAR(p.CreationDate) AS "initial" FROM Posts AS p WHERE p.Tags LIKE '<linear-algebra>' AND p.Score > 0
sede
CREATE TABLE table_name_6 ( league_cup_goals INTEGER, club VARCHAR )
What is the highest number of League Cup goals that were scored by Hartlepool?
SELECT MAX(league_cup_goals) FROM table_name_6 WHERE club = "hartlepool"
sql_create_context
CREATE TABLE table_1789 ( "Country" text, "Population (2011)" real, "GDP (nominal) (2010, US$ millions)" real, "Military expenditures (2011, US$ millions)" real, "Military expenditures (2011, % of GDP)" text, "Defence expenditures, (2011, per capita)" real, "Deployable military (2011, thousa...
Name the population 2011 for luxembourg
SELECT "Population (2011)" FROM table_1789 WHERE "Country" = 'Luxembourg'
wikisql
CREATE TABLE table_27377 ( "Pick #" real, "NFL Team" text, "Player" text, "Position" text, "College" text )
What position was the draft pick that came from Langston?
SELECT "Position" FROM table_27377 WHERE "College" = 'Langston'
wikisql
CREATE TABLE table_57124 ( "Entrant" text, "Constructor" text, "Chassis" text, "Engine" text, "Tyre" text, "Driver" text, "Rounds" text )
Who is the constructor of the 196 chassis?
SELECT "Constructor" FROM table_57124 WHERE "Chassis" = '196'
wikisql
CREATE TABLE table_7562 ( "1st built" real, "1913 Class" text, "W.A." text, "No. Built" real, "Builder" text, "Date" text, "LNER Class" text )
What is the 1913 class of locomotive that has a 1st built value under 494 and WA of 4-4-0t?
SELECT "1913 Class" FROM table_7562 WHERE "1st built" < '494' AND "W.A." = '4-4-0t'
wikisql
CREATE TABLE table_204_722 ( id number, "season" text, "series" text, "team" text, "races" number, "wins" number, "poles" number, "f/lap" number, "podiums" number, "points" number, "position" text )
the two teams who raced in 2011 are carlin motorsport and what other team ?
SELECT "team" FROM table_204_722 WHERE "team" <> 'carlin motorsport' AND "season" = 2011
squall
CREATE TABLE table_23818 ( "County" text, "Obama%" text, "Obama#" real, "McCain%" text, "McCain#" real )
What are McCain's Percent when Obama has 36.47%?
SELECT "McCain%" FROM table_23818 WHERE "Obama%" = '36.47%'
wikisql
CREATE TABLE table_name_99 ( frequency VARCHAR, model_number VARCHAR )
What is the Frequency for Model Number c3 850?
SELECT frequency FROM table_name_99 WHERE model_number = "c3 850"
sql_create_context
CREATE TABLE Contacts ( contact_id INTEGER, customer_id INTEGER, gender VARCHAR(1), first_name VARCHAR(80), last_name VARCHAR(50), contact_phone VARCHAR(80) ) CREATE TABLE Addresses ( address_id INTEGER, line_1_number_building VARCHAR(80), city VARCHAR(50), zip_postcode VARCHAR(...
Show the number of customer address history in each day and group by date to with a line chart, and I want to list in ascending by the x axis.
SELECT date_to, COUNT(date_to) FROM Customer_Address_History AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id JOIN Addresses AS T3 ON T1.address_id = T3.address_id GROUP BY date_to ORDER BY date_to
nvbench
CREATE TABLE table_30215 ( "Draw" real, "Artist" text, "Song (English translation)" text, "Lyrics (l) / Music (m)" text, "Juries" real, "Viewers" real, "Total" real, "Place" real )
How many juries are there for Brolle?
SELECT MAX("Juries") FROM table_30215 WHERE "Artist" = 'Brolle'
wikisql
CREATE TABLE table_33890 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
What tournament was being played on August 11, 1984?
SELECT "Tournament" FROM table_33890 WHERE "Date" = 'august 11, 1984'
wikisql