context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Movie ( mID int, title text, year int, director text )
Visualize the average smallest rating of different movie title using a bar chart, and order by the total number in desc.
SELECT T2.title, AVG(MIN(T1.stars)) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.title ORDER BY AVG(MIN(T1.stars)) DESC
nvbench
CREATE TABLE table_28980706_4 ( rank__timeslot_ VARCHAR, share__18_49_ VARCHAR )
When 13 is the share (18-49) what is the rank (timeslot)?
SELECT rank__timeslot_ FROM table_28980706_4 WHERE share__18_49_ = 13
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
how many of the patients with left heart cardiac cath have unspecified death status?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.short_title = "Left heart cardiac cath"
mimicsql_data
CREATE TABLE table_name_51 ( week VARCHAR, date VARCHAR, attendance VARCHAR )
On what week were there 26,243 in attendance on September 21, 1969?
SELECT COUNT(week) FROM table_name_51 WHERE date = "september 21, 1969" AND attendance < 26 OFFSET 243
sql_create_context
CREATE TABLE region ( Region_ID int, Region_name text, Date text, Label text, Format text, Catalogue text ) CREATE TABLE party_events ( Event_ID int, Event_Name text, Party_ID int, Member_in_charge_ID int ) CREATE TABLE party ( Party_ID int, Minister text, Took_offi...
Stacked bar chart of the number of left office for with each Minister in each left office, could you display in asc by the y-axis?
SELECT Left_office, COUNT(Left_office) FROM party GROUP BY Minister ORDER BY COUNT(Left_office)
nvbench
CREATE TABLE table_15943 ( "Season" real, "Timeslot ( ET )" text, "Season premiere" text, "Season finale" text, "TV season" text, "Rank" text, "Viewers (millions)" text )
What is the year of the season that was 12?
SELECT "TV season" FROM table_15943 WHERE "Season" = '12'
wikisql
CREATE TABLE table_name_68 ( report VARCHAR, winning_team VARCHAR, pole_position VARCHAR )
What is the Report of Winning Team Penske Racing, and what was Rick Mears' Pole position?
SELECT report FROM table_name_68 WHERE winning_team = "penske racing" AND pole_position = "rick mears"
sql_create_context
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID...
For those employees who did not have any job in the past, return a bar chart about the distribution of hire_date and the sum of manager_id bin hire_date by time, order from low to high by the Y-axis please.
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(MANAGER_ID)
nvbench
CREATE TABLE table_46501 ( "Name" text, "Club" text, "Position" text, "Years" text, "Current status" text )
What is the Club during the Years 1995 1996?
SELECT "Club" FROM table_46501 WHERE "Years" = '1995–1996'
wikisql
CREATE TABLE table_23619492_3 ( paula_radcliffe___gbr__ VARCHAR, world_record VARCHAR )
Name the total number of african record
SELECT COUNT(paula_radcliffe___gbr__) FROM table_23619492_3 WHERE world_record = "African record"
sql_create_context
CREATE TABLE table_58524 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
Tell me the sum of Grid for giancarlo fisichella
SELECT SUM("Grid") FROM table_58524 WHERE "Driver" = 'giancarlo fisichella'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
cost of levothyroxine sodium 50 mcg po tabs and how much does it cost.
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'levothyroxine sodium 50 mcg po tabs')
eicu
CREATE TABLE table_25800134_1 ( writer_s_ VARCHAR, series__number VARCHAR )
Who wrote the episode with series number 56?
SELECT writer_s_ FROM table_25800134_1 WHERE series__number = 56
sql_create_context
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
22021171患者被门诊诊断为混合性焦虑障碍,查看他的检测指标074536的结果定量及其单位
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '混合性焦虑障碍' AND hz_info.RYB...
css
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE restriction ( restriction_code text, advance_purc...
what flights does AA fly from PHILADELPHIA to DALLAS
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 = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILAD...
atis
CREATE TABLE table_name_22 ( place VARCHAR, to_par VARCHAR, score VARCHAR )
What is the Place of the Player with a To par of +2 and a Score of 70-72-73=215?
SELECT place FROM table_name_22 WHERE to_par = "+2" AND score = 70 - 72 - 73 = 215
sql_create_context
CREATE TABLE table_name_82 ( tournament VARCHAR, date VARCHAR )
What is Tournament, when Date is '6 October 2008'?
SELECT tournament FROM table_name_82 WHERE date = "6 october 2008"
sql_create_context
CREATE TABLE table_203_51 ( id number, "channel" text, "definition" text, "organisation" text, "ownership" text, "notes" text )
what is the definition of the last channel ?
SELECT "definition" FROM table_203_51 ORDER BY id DESC LIMIT 1
squall
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
provide me the number of black/haitian patients who were admitted before the year 2124.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/HAITIAN" AND demographic.admityear < "2124"
mimicsql_data
CREATE TABLE Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CREATE TABLE Ref_Transaction_Types ( transaction_type_code VARCHAR(10), transaction_type_description VARCHAR(80) ) CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE T...
For the transaction dates if share count is smaller than 10, bin the dates into the year interval, and count them using a line chart, could you sort X from high to low order?
SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE share_count < 10 ORDER BY date_of_transaction DESC
nvbench
CREATE TABLE table_name_1 ( term_of_office VARCHAR, member VARCHAR )
What was the term of office for noel beaton?
SELECT term_of_office FROM table_name_1 WHERE member = "noel beaton"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
how many patients were admitted before the year 2175 with aspergillosis as the diagnosis long title?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2175" AND diagnoses.long_title = "Aspergillosis"
mimicsql_data
CREATE TABLE table_name_94 ( constituency_number VARCHAR, reserved_for___sc___st__none_ VARCHAR, district VARCHAR )
What's the constituency number of the Seoni district and has none reserved?
SELECT constituency_number FROM table_name_94 WHERE reserved_for___sc___st__none_ = "none" AND district = "seoni"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH te...
请提供检验结果指标记录38098966311的参考值范围以及范围下限和上限的详细信息
SELECT jyjgzbb.CKZFWDX, jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '38098966311'
css
CREATE TABLE domain_author ( aid int, did int ) CREATE TABLE keyword ( keyword varchar, kid int ) CREATE TABLE publication ( abstract varchar, cid int, citation_num int, jid int, pid int, reference_num int, title varchar, year int ) CREATE TABLE author ( aid int, ...
return me the keywords in PVLDB .
SELECT keyword.keyword FROM journal, keyword, publication, publication_keyword WHERE journal.name = 'PVLDB' AND publication_keyword.kid = keyword.kid AND publication.jid = journal.jid AND publication.pid = publication_keyword.pid
academic
CREATE TABLE table_28902 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
who are the candidates for district new york 10?
SELECT "Candidates" FROM table_28902 WHERE "District" = 'New York 10'
wikisql
CREATE TABLE table_1749567_2 ( name VARCHAR, number VARCHAR )
What was the name of race #28?
SELECT name FROM table_1749567_2 WHERE number = 28
sql_create_context
CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type text ) CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working...
Find the average age of journalists working on different role type, show the result with a bar chart, sort y axis in ascending order.
SELECT Work_Type, AVG(t1.Age) FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_ID = t2.journalist_ID GROUP BY t2.Work_Type ORDER BY AVG(t1.Age)
nvbench
CREATE TABLE table_name_59 ( copa_libertadores_1992 VARCHAR, supercopa_sudamericana_1992 VARCHAR, team VARCHAR )
Which Copa Libertadores 1992 has a Supercopa Sudamericana 1992 of round of 16, and a Team of gr mio?
SELECT copa_libertadores_1992 FROM table_name_59 WHERE supercopa_sudamericana_1992 = "round of 16" AND team = "grêmio"
sql_create_context
CREATE TABLE table_6037 ( "City" text, "State" text, "School" text, "Colony Name" text, "Date Founded" text )
Which City has a Colony Name of northeastern crescent colony?
SELECT "City" FROM table_6037 WHERE "Colony Name" = 'northeastern crescent colony'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
provide the number of patients whose gender is f and primary disease is bradycardia?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "BRADYCARDIA"
mimicsql_data
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Hidden gems: Lowest viewed questions with score 5 or higher.
SELECT Posts.Id AS "post_link", Posts.OwnerUserId AS "user_link", Score, ViewCount, Score * 1000 / ViewCount AS "Score per Thousand Views" FROM Posts WHERE Score >= 5 AND PostTypeId = 1 ORDER BY ViewCount LIMIT 1000
sede
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id num...
Average score of answers per month.
SELECT LAST_DATE_OF_MONTH(p.CreationDate), AVG(CAST(p.Score AS FLOAT)) FROM Posts AS p WHERE (p.PostTypeId = 2) AND (p.CreationDate >= '##Date1?2010-01-01##') AND (p.CreationDate <= '##Date2?2021-01-01##') GROUP BY LAST_DATE_OF_MONTH(p.CreationDate) ORDER BY LAST_DATE_OF_MONTH(p.CreationDate)
sede
CREATE TABLE table_name_99 ( venue VARCHAR, date VARCHAR )
what is the venue when the date is 16 january 1996?
SELECT venue FROM table_name_99 WHERE date = "16 january 1996"
sql_create_context
CREATE TABLE table_73871 ( "Locale" text, "Skip" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real, "Shot Pct." real )
If the skip is Kelly Scott, what is the PF total number?
SELECT COUNT("PF") FROM table_73871 WHERE "Skip" = 'Kelly Scott'
wikisql
CREATE TABLE table_train_85 ( "id" int, "mini_mental_state_examination_mmse" int, "elevated_serum_phenylalanine" int, "elevated_creatinine" float, "renal_disease" bool, "geriatric_depression_scale_gds" int, "NOUSE" float )
mini mental status exam ( mmse ) between 15 _ 26 ;
SELECT * FROM table_train_85 WHERE mini_mental_state_examination_mmse >= 15 AND mini_mental_state_examination_mmse <= 26
criteria2sql
CREATE TABLE table_name_18 ( score VARCHAR, result VARCHAR, style VARCHAR )
Which Score has a Result of third place, and a Style of cha-cha-cha?
SELECT score FROM table_name_18 WHERE result = "third place" AND style = "cha-cha-cha"
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id numbe...
how much was the total hospital bill for patient 30733's stay in a year before?
SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30733) AND DATETIME(cost.chargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
mimic_iii
CREATE TABLE table_72726 ( "Series #" real, "Season #" real, "Title" text, "Directed by:" text, "Written by:" text, "Original air date" text )
Which Season originally aired on September 17, 1955
SELECT "Season #" FROM table_72726 WHERE "Original air date" = 'September 17, 1955'
wikisql
CREATE TABLE table_73694 ( "Player" text, "Starts" real, "Cuts made" real, "Best finish" text, "Money list rank" real, "Earnings ($)" real )
What is the minimum money list rank for the players having a best finish of T9?
SELECT MIN("Money list rank") FROM table_73694 WHERE "Best finish" = 'T9'
wikisql
CREATE TABLE table_18788823_5 ( position_in_table VARCHAR, date_of_vacancy VARCHAR )
Which vacancy happened on 4 November 2008?
SELECT position_in_table FROM table_18788823_5 WHERE date_of_vacancy = "4 November 2008"
sql_create_context
CREATE TABLE table_name_98 ( nationality VARCHAR, time VARCHAR )
What Nationality's time is 2:07.64?
SELECT nationality FROM table_name_98 WHERE time = "2:07.64"
sql_create_context
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswer...
Open questions with the Possible Duplicate bit.
SELECT Score, Id AS "post_link", ViewCount, OwnerUserId AS "user_link", CreationDate FROM Posts WHERE PostTypeId = 1 AND ClosedDate IS NULL AND (Body LIKE '%<strong>Possible Duplicate:</strong>%' OR Body LIKE '%<strong>Possible Duplicates:</strong>%') ORDER BY CreationDate
sede
CREATE TABLE table_name_27 ( qual_2 VARCHAR, best VARCHAR )
What is Qual 2, when Best is 1:27.642?
SELECT qual_2 FROM table_name_27 WHERE best = "1:27.642"
sql_create_context
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, U...
Drupal 8: Most popular answers 2015.
SELECT Answers.Id AS "post_link", Questions.Tags, Answers.Score FROM Posts AS Answers, Posts AS Questions, PostTags, Tags WHERE Answers.ParentId = Questions.Id AND Questions.Id = PostTags.PostId AND PostTags.TagId = Tags.Id AND Tags.TagName = '8' AND YEAR(Answers.CreationDate) >= 2015 ORDER BY Answers.Score DESC LIMIT ...
sede
CREATE TABLE table_30674 ( "Couple" text, "Style" text, "Music" text, "Trine Dehli Cleve" real, "Tor Fl\u00f8ysvik" real, "Karianne Gulliksen" real, "Christer Tornell" real, "Total" real )
What is the largest number for trine dehli cleve?
SELECT MAX("Trine Dehli Cleve") FROM table_30674
wikisql
CREATE TABLE table_name_58 ( original_air_date VARCHAR, no_in_series INTEGER )
What the air dates for the episodes are episode 3 in the series?
SELECT original_air_date FROM table_name_58 WHERE no_in_series > 3
sql_create_context
CREATE TABLE table_name_35 ( winner VARCHAR, result VARCHAR )
What team was the winner when the result was 90 86?
SELECT winner FROM table_name_35 WHERE result = "90–86"
sql_create_context
CREATE TABLE table_name_83 ( winners VARCHAR, team VARCHAR )
How many winners did Halcones uv xalapa have?
SELECT winners FROM table_name_83 WHERE team = "halcones uv xalapa"
sql_create_context
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 (...
what number of patients with procedure icd9 code 8872 had death status as 0?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.icd9_code = "8872"
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 prescription...
how many patients have medicaid insurance and diagnosed with st elevated myocardial infarction\cardiac cath?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Medicaid" AND demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH"
mimicsql_data
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
count the number of patients whose primary disease is bradycardia and year of death is less than or equal to 2131?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "BRADYCARDIA" AND demographic.dod_year <= "2131.0"
mimicsql_data
CREATE TABLE table_61654 ( "Game Title" text, "Year Released" real, "Platform" text, "GameRankings" text, "Metacritic" text )
What game was released before 2010 with a Metacritic of 85/100?
SELECT "Game Title" FROM table_61654 WHERE "Metacritic" = '85/100' AND "Year Released" < '2010'
wikisql
CREATE TABLE table_79579 ( "Pick" real, "Team" text, "Player" text, "Position" text, "College" text )
What is the highest pick for the position of defensive end?
SELECT MAX("Pick") FROM table_79579 WHERE "Position" = 'defensive end'
wikisql
CREATE TABLE table_71423 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
In 1961, what was the Chassis when the points were lower than 6?
SELECT "Chassis" FROM table_71423 WHERE "Points" < '6' AND "Year" = '1961'
wikisql
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_airline text, departure_flight_number int, stop_time int ) CREATE TABLE dual_carrier...
what 's the lowest round trip fare from DALLAS to BALTIMORE
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_...
atis
CREATE TABLE table_27668 ( "GB" text, "ISO \u2116" text, "Province" text, "Chinese Name" text, "Capital" text, "Population\u00b9" real, "Density\u00b2" text, "Area\u00b3" real, "Abbreviation/Symbol" text )
How many gb's have an iso number of cn-65?
SELECT COUNT("GB") FROM table_27668 WHERE "ISO \u2116" = 'CN-65'
wikisql
CREATE TABLE table_77969 ( "Race" text, "Circuit" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Constructor" text, "Tyre" text, "Report" text )
What is the tyre for the circuit of Prince George, which had Jim Clark as the fastest lap?
SELECT "Tyre" FROM table_77969 WHERE "Fastest lap" = 'jim clark' AND "Circuit" = 'prince george'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
how many hours have elapsed since the last time patient 006-195316 was given a -lymphs lab test during their current hospital visit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', lab.labresulttime)) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-195316' AND patient.hos...
eicu
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additio...
In the Spring-Summer 2007 in the afternoon is 351 offered ?
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time >= '12:00:00' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 351 AND semester.semester = 'Spring-Summer' AND semester.semester_id = course_offering.semester AND semester.year ...
advising
CREATE TABLE table_203_37 ( id number, "#" number, "title" text, "producer(s)" text, "performer(s)" text, "length" text )
what is the title of the next track after kreditz ?
SELECT "title" FROM table_203_37 WHERE "#" = (SELECT "#" FROM table_203_37 WHERE "title" = '"kreditz"') + 1
squall
CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Movie ( mID int, title text, year int, director text )
For each reviewer id, show their corresponding rating for the movie in a scatter chart.
SELECT rID, stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID
nvbench
CREATE TABLE table_54730 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which Home team score has an Away team of st kilda?
SELECT "Home team score" FROM table_54730 WHERE "Away team" = 'st kilda'
wikisql
CREATE TABLE table_22391 ( "Episode" text, "Garfield Episode 1" text, "U.S. Acres Episode" text, "Garfield Episode 2" text, "Original Airdate" text )
what is the 2nd garfield episode for garfield episode 1 twice told tale
SELECT "Garfield Episode 2" FROM table_22391 WHERE "Garfield Episode 1" = 'Twice Told Tale'
wikisql
CREATE TABLE table_76234 ( "Season" text, "Appearance" real, "Tries" real, "Goals" real, "Points" real )
what is the lowest appearance when goals is more than 0?
SELECT MIN("Appearance") FROM table_76234 WHERE "Goals" > '0'
wikisql
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE cost ( costid num...
what's the top three most common output events in 2102?
SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%output%' AND STRFTIME('%y', intakeoutput.intakeoutputtime) = '2102' GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 3
eicu
CREATE TABLE table_name_13 ( elector VARCHAR, title VARCHAR )
What Elector has the Title of Titulus S. Cecilia?
SELECT elector FROM table_name_13 WHERE title = "titulus s. cecilia"
sql_create_context
CREATE TABLE table_204_95 ( id number, "name" text, "title" text, "first year\nin this position" number, "years at nebraska" text, "alma mater" text )
how many consecutive years did w. harold browne coach
SELECT "years at nebraska" - "years at nebraska" FROM table_204_95 WHERE "name" = 'w. harold browne'
squall
CREATE TABLE table_70374 ( "Language" text, "Number" text, "percentage (%)" text, "males" text, "females" text )
Name the number which has language of other
SELECT "Number" FROM table_70374 WHERE "Language" = 'other'
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...
How many jehovah's witness patients have lab test item id 51514?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "JEHOVAH'S WITNESS" AND lab.itemid = "51514"
mimicsql_data
CREATE TABLE table_203_152 ( id number, "province" text, "capital" text, "area (km2)" number, "population" number, "density" number )
what is the difference between the population of san juan and sanchez ramirez ?
SELECT (SELECT "population" FROM table_203_152 WHERE "province" = 'san juan') - (SELECT "population" FROM table_203_152 WHERE "province" = 'sanchez ramirez')
squall
CREATE TABLE table_41727 ( "Name" text, "Position" text, "Number" real, "School/Club Team" text, "Season" text, "Acquisition via" text )
How many total players came from the school/club team of De La Salle?
SELECT COUNT("Number") FROM table_41727 WHERE "School/Club Team" = 'de la salle'
wikisql
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...
Return a pie chart about the proportion of ACC_Regular_Season and Team_ID.
SELECT ACC_Regular_Season, Team_ID FROM basketball_match
nvbench
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE ftxmzjzjlb ( HXPLC number, HZ...
自2017.9.16日起,至2018.5.10日止,把患者郑和璧这段时间被开出的所有检验报告单中的标本采集部位给一一列出来
SELECT jybgb.BBCJBW FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = ...
css
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number...
until 10/26/2103, when was the first time that patient 017-70504 had a drainage total output?
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-70504')) AND intakeoutput.cellpath LIKE '%output%...
eicu
CREATE TABLE table_name_59 ( character VARCHAR, category VARCHAR, award VARCHAR )
Which character was in the sexiest female category of the British Soap Awards?
SELECT character FROM table_name_59 WHERE category = "sexiest female" AND award = "british soap awards"
sql_create_context
CREATE TABLE table_9882 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text )
Who's the partner that played against Alicia Molik Mara Santangelo on clay?
SELECT "Partner" FROM table_9882 WHERE "Surface" = 'clay' AND "Opponents in the final" = 'alicia molik mara santangelo'
wikisql
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAno...
Most viewed questions that were not in the HNQ.
SELECT q.Id AS "post_link", ViewCount, Score, AnswerCount FROM Posts AS q WHERE (q.CreationDate >= '##Date1?2019-03-01##') AND (q.CreationDate <= '##Date2?2021-01-01##') AND q.Id NOT IN (SELECT PostId FROM PostHistory WHERE PostHistoryTypeId = 52) ORDER BY ViewCount DESC LIMIT 500
sede
CREATE TABLE table_48072 ( "State" text, "Abbreviation" text, "Capital" text, "Area (km\u00b2)" real, "Population (2005)" real, "Density (2005)" real, "GDP (% total) (2004)" text, "GDP per capita (US$) (2004)" real, "HDI (2005)" real, "Literacy (2003)" text, "Infant Mortality...
Which Density (2005) has an Area (km ) of 340086.7, and a Population (2005) smaller than 5926300?
SELECT SUM("Density (2005)") FROM table_48072 WHERE "Area (km\u00b2)" = '340086.7' AND "Population (2005)" < '5926300'
wikisql
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 text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
药品编码976046在医疗就诊56397946981中的剂型和规格是什么?
SELECT t_kc22.DOSE_FORM, t_kc22.SPEC FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '56397946981' AND t_kc22.SOC_SRT_DIRE_CD = '976046'
css
CREATE TABLE Properties ( property_id INTEGER, property_type_code CHAR(15), property_address VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Residents ( resident_id INTEGER, property_id INTEGER, date_moved_in DATETIME, date_moved_out DATETIME, other_details VARCHAR(255) ) C...
Give me a bar chart that the X-axis is the date_moved_in and the Y-axis is Count them, could you show by the bar in ascending please?
SELECT date_moved_in, COUNT(date_moved_in) FROM Customer_Events GROUP BY date_moved_in ORDER BY date_moved_in
nvbench
CREATE TABLE county ( County_name VARCHAR, Population VARCHAR )
Show the county name and population of all counties.
SELECT County_name, Population FROM county
sql_create_context
CREATE TABLE table_31598 ( "Schemas" text, "Flexible" text, "Semantic verification" text, "Dictionary" text, "Information Model" text, "Synonyms and homonyms" text, "Dialecting" text, "Web standard" text, "Transformations" text, "Lightweight" text, "Human readable" text )
What is the lightweight value with no information model and the flexible value is unknown?
SELECT "Lightweight" FROM table_31598 WHERE "Information Model" = 'no' AND "Flexible" = 'unknown'
wikisql
CREATE TABLE table_72104 ( "Season" text, "Competition" text, "Round" text, "Opponents" text, "1st leg" text, "2nd leg" text, "Aggregate" text )
what's the competition where 1st leg is 4-1 (h)
SELECT "Competition" FROM table_72104 WHERE "1st leg" = '4-1 (h)'
wikisql
CREATE TABLE table_47634 ( "Opponent" text, "Res." text, "Class" text, "Score" text, "Date" text, "Competition" text, "Notes" text )
WHAT SCORE WAS ON 1999-05-31?
SELECT "Score" FROM table_47634 WHERE "Date" = '1999-05-31'
wikisql
CREATE TABLE table_name_35 ( tries_against VARCHAR, club VARCHAR )
What was the tries again llanishen rfc?
SELECT tries_against FROM table_name_35 WHERE club = "llanishen rfc"
sql_create_context
CREATE TABLE table_27631756_2 ( team VARCHAR, head_coach VARCHAR )
How many teams have a head coach named mahdi ali?
SELECT COUNT(team) FROM table_27631756_2 WHERE head_coach = "Mahdi Ali"
sql_create_context
CREATE TABLE table_name_33 ( date VARCHAR, region VARCHAR, catalog VARCHAR )
What Date has the Region Europe and a Catalog of 74321 45851 2?
SELECT date FROM table_name_33 WHERE region = "europe" AND catalog = "74321 45851 2"
sql_create_context
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE course ( course_id int, name varchar, department...
What hardware courses in the Winter or Fall of 2002 are offered ?
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE area.area LIKE '%hardw...
advising
CREATE TABLE table_25276 ( "Constituency" text, "Winner" text, "Party" text, "Margin" real, "Runner-up a" text, "Party a" text )
Name the party a for m. s. k. sathiyendran runner up
SELECT "Party a" FROM table_25276 WHERE "Runner-up a" = 'M. S. K. Sathiyendran'
wikisql
CREATE TABLE table_46629 ( "Nominative" text, "Ergative" text, "Dative" text, "Genitive" text, "Instrumental" text, "Adverbial" text )
What is the genitive for the ergative shen?
SELECT "Genitive" FROM table_46629 WHERE "Ergative" = 'shen'
wikisql
CREATE TABLE table_name_6 ( order_and_title VARCHAR, nationality VARCHAR, elector VARCHAR )
What is the Order and Title with a Nationality with roman, and an Elector with matteo orsini rosso?
SELECT order_and_title FROM table_name_6 WHERE nationality = "roman" AND elector = "matteo orsini rosso"
sql_create_context
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
患者华红英在二0一七年十月十五日到二0二0年十一月二十九日期间,在医疗机构3113128总共被检查过多少次
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '华红英' AND t_kc22.STA_DATE BETWEEN '2017-10-15' AND '2020-11-29' AND t_kc21.MED_SER_ORG_NO = '3113128' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_name_77 ( points INTEGER, chassis VARCHAR, year VARCHAR )
How many total points were earned with ferrari 125 Chassis after 1952?
SELECT SUM(points) FROM table_name_77 WHERE chassis = "ferrari 125" AND year > 1952
sql_create_context
CREATE TABLE table_13710464_1 ( winning_pitcher VARCHAR, losing_pitcher VARCHAR )
Who was the wenning witcher when ezequiel astacio was the losing pitcher?
SELECT winning_pitcher FROM table_13710464_1 WHERE losing_pitcher = "Ezequiel Astacio"
sql_create_context
CREATE TABLE table_16392 ( "Round" real, "Choice" real, "Player name" text, "Position" text, "Height" text, "Weight" real, "College" text )
What is the height of the person that weighs 320 pounds?
SELECT "Height" FROM table_16392 WHERE "Weight" = '320'
wikisql
CREATE TABLE table_31666 ( "Year" text, "Competition" text, "Opponent" text, "Score" text, "Venue" text )
What was the score when Richmond was the opponent?
SELECT "Score" FROM table_31666 WHERE "Opponent" = 'richmond'
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...
tell me the number of patients who had c4 lab test and were hospitalized for more than 9 days.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "9" AND lab.label = "C4"
mimicsql_data
CREATE TABLE table_48338 ( "Year" real, "MLB Club" text, "Record" text, "Finish" text, "Manager" text )
what is the record when the year is after 1992, manager is tom kotchman and finish is 2nd?
SELECT "Record" FROM table_48338 WHERE "Year" > '1992' AND "Manager" = 'tom kotchman' AND "Finish" = '2nd'
wikisql
CREATE TABLE table_204_430 ( id number, "model" text, "origin" text, "type" text, "version" text, "in service" text, "notes" text )
what country uses the mitsubishi l200 by their military ?
SELECT "origin" FROM table_204_430 WHERE "model" = 'mitsubishi l200'
squall