context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_59394 ( "Frequency" real, "Callsign" text, "Brand" text, "City of License" text, "Type" text )
What is City of License, when Frequency is greater than 1380?
SELECT "City of License" FROM table_59394 WHERE "Frequency" > '1380'
wikisql
CREATE TABLE table_name_26 ( away_team VARCHAR, home_team VARCHAR )
What was the away team score at Hawthorn?
SELECT away_team AS score FROM table_name_26 WHERE home_team = "hawthorn"
sql_create_context
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname var...
Between 429 and 311 , which course is harder ?
SELECT DISTINCT course.number FROM course, program_course WHERE (course.number = 429 OR course.number = 311) AND course.department = 'EECS' AND program_course.course_id = course.course_id ORDER BY program_course.workload DESC LIMIT 1
advising
CREATE TABLE Customer_Addresses ( customer_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME ) CREATE TABLE Department_Store_Chain ( dept_store_chain_id INTEGER, dept_store_chain_name VARCHAR(80) ) CREATE TABLE Customers ( customer_id INTEGER, payment_method_code VAR...
Return the names and ids of customers who have TN in their address by a bar chart.
SELECT customer_name, customer_id FROM Customers WHERE customer_address LIKE "%TN%"
nvbench
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense...
Top 10 Tags on SO by count.
SELECT TagName, Count FROM Tags ORDER BY Count DESC LIMIT 10
sede
CREATE TABLE table_name_93 ( platform VARCHAR, name VARCHAR, system VARCHAR, license VARCHAR )
What platform is nds4droid on for the nintendo ds with a license of gpl v2?
SELECT platform FROM table_name_93 WHERE system = "nintendo ds" AND license = "gpl v2" AND name = "nds4droid"
sql_create_context
CREATE TABLE table_65909 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the fewest gold medals won by Greece?
SELECT MIN("Gold") FROM table_65909 WHERE "Nation" = 'greece'
wikisql
CREATE TABLE table_name_21 ( raiders_first_downs VARCHAR, date VARCHAR, raiders_points VARCHAR )
What is the total number of Raiders First Downs, when Date is 'Nov. 2', and when Raiders Points is greater than 42?
SELECT COUNT(raiders_first_downs) FROM table_name_21 WHERE date = "nov. 2" AND raiders_points > 42
sql_create_context
CREATE TABLE table_204_940 ( id number, "year" number, "tournaments\nplayed" number, "cuts\nmade" number, "wins" number, "2nd" number, "3rd" number, "top 10s" number, "best\nfinish" text, "earnings\n(\u20ac)" number, "money\nlist rank" number, "scoring\naverage" number, ...
which year in this golfer 's career saw her have the most 2nd place finishes ?
SELECT "year" FROM table_204_940 ORDER BY "2nd" DESC LIMIT 1
squall
CREATE TABLE table_72277 ( "Name" text, "Location" text, "Light vehicle" text, "Heavy vehicle (2 axles)" text, "Heavy vehicle (3/4 axles)" text, "Heavy vehicle (5+ axles)" text )
What is the name of the plaza where the toll for heavy vehicles with 2 axles is r87.00?
SELECT "Name" FROM table_72277 WHERE "Heavy vehicle (2 axles)" = 'R87.00'
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 microlab ( microl...
count the number of patients who received a antiemetic - serotonin antagonist procedure within 2 months after they had received a stress ulcer prophylaxis - pantoprazole procedure until 2 years ago.
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'stress ulcer prophylaxis - pantoprazole' AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '...
eicu
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE m...
what was the prescription drug that was prescribed to patient 007-8693 within 2 days after the diagnosis of sedated?
SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-8693') AND diagnosis.diagnosi...
eicu
CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Student ( StuID INTEGER, LNa...
what is the average age for each dorm and what are the names of each dorm?
SELECT dorm_name, AVG(T1.Age) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid GROUP BY T3.dorm_name
nvbench
CREATE TABLE table_name_26 ( rank VARCHAR, laps VARCHAR, qual VARCHAR )
What is the rank when there are more than 107 laps and the qual is 137.825?
SELECT rank FROM table_name_26 WHERE laps > 107 AND qual = "137.825"
sql_create_context
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_40...
Show total number of id from each nationality, sort Nationality in desc order.
SELECT Nationality, SUM(ID) FROM swimmer GROUP BY Nationality ORDER BY Nationality DESC
nvbench
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) 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), ...
For those employees who was hired before 2002-06-21, find job_id and the sum of employee_id , and group by attribute job_id, and visualize them by a bar chart, could you order x-axis in desc order?
SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
CREATE TABLE table_42077 ( "Rank" real, "Location" text, "Total Passengers" real, "Annual change" text, "Capacity in use" text )
What is the Capacity in use with an Annual change that is 21.8%?
SELECT "Capacity in use" FROM table_42077 WHERE "Annual change" = '21.8%'
wikisql
CREATE TABLE table_18108 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text, "Candidates" text )
What is the lowest first elected?
SELECT MIN("First elected") FROM table_18108
wikisql
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 bdmzjzjlb ( HXPLC number, HZX...
二零一九年十二月十二日到二零年一月二十日,放射科门诊的就诊数量是多少
SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.JZKSMC = '放射科' AND wdmzjzjlb.JZKSRQ BETWEEN '2019-12-12' AND '2020-01-20' UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.JZKSMC = '放射科' AND bdmzjzjlb.JZKSRQ BETWEEN '2019-12-12' AND '2020-01-20'
css
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 ...
get me the dosage and code of drug taken by patient brian taylor.
SELECT prescriptions.formulary_drug_cd, prescriptions.drug_dose FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Brian Taylor"
mimicsql_data
CREATE TABLE table_1755 ( "Stage (Winner)" text, "General classification" text, "Points classification" text, "Mountains classification" text, "Young rider classification" text, "Team classification" text )
Who are all the stage winners where the team classification is Caisse D'epargne?
SELECT "Stage (Winner)" FROM table_1755 WHERE "Team classification" = 'Caisse d''Epargne'
wikisql
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnon...
Recent questions with specific word in the title (case insensitive).
SELECT Id AS "post_link", Title, OwnerUserId AS "user_link", Score, Tags, CreationDate FROM Posts WHERE (PostTypeId = 1) AND (Title LIKE '%##word?urgent##%' COLLATE Latin1_General_CI_AI) ORDER BY Id DESC LIMIT 100
sede
CREATE TABLE table_14778650_1 ( arranger VARCHAR, writer VARCHAR )
Who was the arranger for the track written by Nizar Francis ?
SELECT arranger FROM table_14778650_1 WHERE writer = "Nizar Francis"
sql_create_context
CREATE TABLE table_28723146_2 ( multi_lane INTEGER, category_wise VARCHAR )
What is the highest value for multi lane if category wise is major district roads?
SELECT MAX(multi_lane) FROM table_28723146_2 WHERE category_wise = "Major district roads"
sql_create_context
CREATE TABLE table_42897 ( "Year" real, "Award" text, "Category" text, "Recipient" text, "Result" text )
Who won the 2010 Kids' Choice Awards?
SELECT "Recipient" FROM table_42897 WHERE "Award" = '2010 kids'' choice awards' AND "Result" = 'won'
wikisql
CREATE TABLE table_12407546_1 ( shooting VARCHAR, athlete__noc_ VARCHAR )
What's Luis Siri's shooting score?
SELECT shooting FROM table_12407546_1 WHERE athlete__noc_ = "Luis Siri"
sql_create_context
CREATE TABLE table_19359427_6 ( date_of_appointment VARCHAR, position_in_table VARCHAR )
When was the new manager of the team on 21st position appointed?
SELECT date_of_appointment FROM table_19359427_6 WHERE position_in_table = "21st"
sql_create_context
CREATE TABLE table_name_40 ( type VARCHAR, formed_from VARCHAR )
Name the typed for formed from 6-pul trailer third in res unit
SELECT type FROM table_name_40 WHERE formed_from = "6-pul trailer third in res unit"
sql_create_context
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
when was the first time the respiratory rate of patient 3125 was measured today at greater than 14.0?
SELECT chartevents.charttime 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 = 3125)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'respirato...
mimic_iii
CREATE TABLE film_actor ( actor_id number, film_id number, last_update time ) CREATE TABLE film_category ( film_id number, category_id number, last_update time ) CREATE TABLE customer ( customer_id number, store_id number, first_name text, last_name text, email text, ad...
What is the phone number and postal code of the address 1031 Daugavpils Parkway?
SELECT phone, postal_code FROM address WHERE address = '1031 Daugavpils Parkway'
spider
CREATE TABLE table_29487895_2 ( title_in_country VARCHAR, country___region VARCHAR )
What country is in the region of France?
SELECT title_in_country FROM table_29487895_2 WHERE country___region = "France"
sql_create_context
CREATE TABLE table_54692 ( "State" text, "Interview" real, "Swimsuit" real, "Evening Gown" real, "Average" real )
What is the average of the swimsuit smaller than 9.545 , of Iowa, with an evening gown larger than 9.625?
SELECT AVG("Average") FROM table_54692 WHERE "Swimsuit" < '9.545' AND "State" = 'iowa' AND "Evening Gown" > '9.625'
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 trip ( id INTEGER, d...
A line chart for what are the number of the dates that have an average sea level pressure between 303 and 31?, and list by the X-axis in descending.
SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31 GROUP BY date ORDER BY date DESC
nvbench
CREATE TABLE performance ( HOST VARCHAR, Attendance VARCHAR )
List the hosts of performances in ascending order of attendance.
SELECT HOST FROM performance ORDER BY Attendance
sql_create_context
CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP_DOB datetime ) CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME...
How many courses for each course description? Show me a stacked bar chart. The x-axis is course description and group by instructor's first name.
SELECT CRS_DESCRIPTION, COUNT(CRS_DESCRIPTION) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY EMP_FNAME, CRS_DESCRIPTION
nvbench
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
I want to know the proportion of sum school id for each all home.
SELECT All_Home, SUM(School_ID) FROM basketball_match GROUP BY All_Home
nvbench
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...
Site Info: Score - Post Count.
SELECT Score, COUNT(Score) AS count FROM Posts GROUP BY Score ORDER BY Score
sede
CREATE TABLE table_name_99 ( date VARCHAR, location VARCHAR )
What date did the Boston Celtics play at Richfield Coliseum?
SELECT date FROM table_name_99 WHERE location = "richfield coliseum"
sql_create_context
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE hz_info ( KH text, KLX number...
检验汇报单57013725257的申请人工号还有他的是哪位?
SELECT SQRGH, SQRXM FROM jybgb WHERE BGDH = '57013725257'
css
CREATE TABLE table_204_39 ( id number, "number" number, "symbol" text, "name" text, "21st" number, "22nd" number, "23rd" number, "24th" number, "25th" number, "26th" number, "27th" number, "28th" number, "29th" number, "30th" number )
how many elements have data that is below the 25th ?
SELECT COUNT("name") FROM table_204_39 WHERE "number" > 25
squall
CREATE TABLE table_52066 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the Away Team Score of the Collingwood Home Team?
SELECT "Away team score" FROM table_52066 WHERE "Away team" = 'collingwood'
wikisql
CREATE TABLE Parts ( part_id INTEGER, part_name VARCHAR(255), chargeable_yn VARCHAR(1), chargeable_amount VARCHAR(20), other_part_details VARCHAR(255) ) CREATE TABLE Fault_Log_Parts ( fault_log_entry_id INTEGER, part_fault_id INTEGER, fault_status VARCHAR(10) ) CREATE TABLE Staff ( ...
List the number of enginners and group by last name in a bar chart, sort in asc by the bar.
SELECT last_name, COUNT(last_name) FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id = T2.engineer_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY last_name ORDER BY last_name
nvbench
CREATE TABLE table_33559 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the total number of the crowd at Glenferrie Oval?
SELECT COUNT("Crowd") FROM table_33559 WHERE "Venue" = 'glenferrie oval'
wikisql
CREATE TABLE table_64383 ( "Rank" real, "Lane" real, "Athlete" text, "Nationality" text, "Time" real, "React" real )
What is the highest lane with a rank larger than 2 in Guyana?
SELECT MAX("Lane") FROM table_64383 WHERE "Rank" > '2' AND "Nationality" = 'guyana'
wikisql
CREATE TABLE table_7135 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What's the average Week with the Result l 23 3?
SELECT AVG("Week") FROM table_7135 WHERE "Result" = 'l 23–3'
wikisql
CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE author ( authorid int, autho...
papers written by oren etzioni
SELECT DISTINCT writes.paperid FROM author, writes WHERE author.authorname = 'oren etzioni' AND writes.authorid = author.authorid
scholar
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 professor ( emp_num number, dep...
How many hours do the students spend studying in each department?
SELECT SUM(stu_hrs), dept_code FROM student GROUP BY dept_code
spider
CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT )
Return a histogram on how old is each gender, on average?, and could you show bars in asc order please?
SELECT gender, AVG(age) FROM Person GROUP BY gender ORDER BY gender
nvbench
CREATE TABLE table_name_29 ( overall VARCHAR, pick VARCHAR, position VARCHAR, name VARCHAR )
How many overalls have E as the position, buddy payne as the name, and a pick less than 5?
SELECT COUNT(overall) FROM table_name_29 WHERE position = "e" AND name = "buddy payne" AND pick < 5
sql_create_context
CREATE TABLE table_name_88 ( date VARCHAR, format VARCHAR, catalog VARCHAR )
On what date was the Ed Remaster CD and TOCT-24365 Catalog released?
SELECT date FROM table_name_88 WHERE format = "ed remaster cd" AND catalog = "toct-24365"
sql_create_context
CREATE TABLE table_1077 ( "Composition" text, "s Hindu" text, "s Muslim" text, "Christians" text, "s Sikh" text, "Buddhist" text, "s Jain" text, "Others" text )
What is the christian amount where work participation rate is the composition?
SELECT "Christians" FROM table_1077 WHERE "Composition" = 'Work Participation Rate'
wikisql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
哪些工号及姓名的医务人员在患者魏乐志就诊过程中为他检测指标977450的,时间是从一二年九月十七日到二一年五月十七日
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb 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_MZ...
css
CREATE TABLE table_name_64 ( regular_season VARCHAR, year VARCHAR )
What place did the Nashville Metros place in the 1994/95 Season?
SELECT regular_season FROM table_name_64 WHERE year = "1994/95"
sql_create_context
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PostTypes ( Id number, Name text ) C...
Writing SQL with SQL example INPUT..
SELECT 'SELECT CAST(''' + Badges.Name + '''AS VARCHAR(50)), COUNT(1) FROM BADGES WHERE BADGES.NAME = ''' + Badges.Name + ''' UNION ALL' FROM Badges GROUP BY Badges.Name
sede
CREATE TABLE table_name_89 ( record VARCHAR, date VARCHAR )
Name the record on june 22
SELECT record FROM table_name_89 WHERE date = "june 22"
sql_create_context
CREATE TABLE Statements ( Id VARCHAR )
How many statements do we have?
SELECT COUNT(*) FROM Statements
sql_create_context
CREATE TABLE table_name_97 ( quantity_made VARCHAR, class VARCHAR )
How many have a class of 330?
SELECT quantity_made FROM table_name_97 WHERE class = "330"
sql_create_context
CREATE TABLE table_name_23 ( bronze INTEGER, total VARCHAR, silver VARCHAR )
What is the average Bronze, when Total is 7, and when Silver is greater than 1?
SELECT AVG(bronze) FROM table_name_23 WHERE total = 7 AND silver > 1
sql_create_context
CREATE TABLE table_name_23 ( country VARCHAR, builder VARCHAR, ship VARCHAR )
What country was Brage, built by karljohansverns verft, from?
SELECT country FROM table_name_23 WHERE builder = "karljohansverns verft" AND ship = "brage"
sql_create_context
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
how much is the total hospital cost of patient 8245 in the last year?
SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8245) AND DATETIME(cost.chargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
mimic_iii
CREATE TABLE table_name_31 ( event VARCHAR, opponent VARCHAR )
What event did Soa Palelei fight against son hai suk?
SELECT event FROM table_name_31 WHERE opponent = "son hai suk"
sql_create_context
CREATE TABLE table_name_66 ( lost VARCHAR, points_for VARCHAR )
What is the loss with 319 points?
SELECT lost FROM table_name_66 WHERE points_for = "319"
sql_create_context
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
For those employees who was hired before 2002-06-21, give me the comparison about the sum of department_id over the job_id , and group by attribute job_id.
SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID
nvbench
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
负责医疗就诊41231928309的医疗机构科室的编码及医疗机构科室的名称都是什么?
SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.MED_ORG_DEPT_NM FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '41231928309'
css
CREATE TABLE customer_orders ( order_id number, customer_id number, order_status text, order_date time, order_details text ) CREATE TABLE customer_contact_channels ( customer_id number, channel_code text, active_from_date time, active_to_date time, contact_number text ) CREATE ...
What are the customer name and date of the orders whose status is 'Delivered'.
SELECT t1.customer_name, t2.order_date FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id WHERE order_status = "Delivered"
spider
CREATE TABLE table_67500 ( "No.1" text, "No.2" text, "No.3" text, "No.4" text, "No.5" text, "No.6" text, "No.7" text, "No.8" text, "FINAL" text )
What is the final result of the team that has Simara as No.5?
SELECT "FINAL" FROM table_67500 WHERE "No.5" = 'simara'
wikisql
CREATE TABLE table_20995 ( "Year" real, "Mens Open" text, "Womens Open" text, "Mixed Open" text, "Mens u20" text, "Womens u20" text, "Senior Mixed" text, "Mens 30" text, "Womens 30" text, "Mens 35" text, "Womens 35" text, "Mens 40" text, "Womens 40" text, "Mens 45...
What were the results for mens 40 when the mens u20 was Southern Suns def Gold Coast Sharks?
SELECT "Mens 40" FROM table_20995 WHERE "Mens u20" = 'Southern Suns def Gold Coast Sharks'
wikisql
CREATE TABLE table_name_72 ( bronze INTEGER, silver VARCHAR )
What is the lowest bronze total that has a silver total of 13 medals?
SELECT MIN(bronze) FROM table_name_72 WHERE silver = "13"
sql_create_context
CREATE TABLE table_20158 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (million)" text )
Name who wrote number 47
SELECT "Written by" FROM table_20158 WHERE "No. in series" = '47'
wikisql
CREATE TABLE table_name_78 ( position VARCHAR, competition VARCHAR, year VARCHAR )
Before 1979, what position was the European Indoor Championships?
SELECT position FROM table_name_78 WHERE competition = "european indoor championships" AND year < 1979
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
give the number of patients who had colonscopy.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Colonoscopy"
mimicsql_data
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, U...
Number of individual users who have asked questions.
SELECT COUNT(DISTINCT Id) FROM Users
sede
CREATE TABLE table_42519 ( "Year" text, "Title" text, "Genre" text, "Label" text, "Result" text )
Which label's year is 1993?
SELECT "Label" FROM table_42519 WHERE "Year" = '1993'
wikisql
CREATE TABLE table_61714 ( "Date" text, "Opponent#" text, "Rank #" text, "Site" text, "Result" text, "Attendance" text )
What was the attendance when they had a ranking of #4?
SELECT "Attendance" FROM table_61714 WHERE "Rank #" = '4'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
what is the admission type and discharge location of subject id 990?
SELECT demographic.admission_type, demographic.discharge_location FROM demographic WHERE demographic.subject_id = "990"
mimicsql_data
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 jybgb ( BBCJBW text, BBDM tex...
二零零八年七月二十七日到二零一二年七月十三日,编号为2152272的医院有多少科室在门诊就诊中开出了2张以内的检验报告单
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM txmzjzjlb JOIN jybgb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE txmzjzjlb.YLJGDM = '2152272' AND jybgb.BGRQ BETWEEN '2008-07-27' AND '2012-07-13' GROUP BY jybgb.KSBM HAVING COUNT(*) < 2 UNION SELECT jybgb.KSBM FROM ftxmzjzjlb J...
css
CREATE TABLE table_name_66 ( points INTEGER, games VARCHAR, losses VARCHAR, team_name VARCHAR )
What's the lowest number of points with fewer than 8 losses and fewer than 24 games for the vancouver burrards?
SELECT MIN(points) FROM table_name_66 WHERE losses < 8 AND team_name = "vancouver burrards" AND games < 24
sql_create_context
CREATE TABLE table_71181 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" text, "Roll" real )
Name the authority for te akau with roll less than 254 and decile of 8
SELECT "Authority" FROM table_71181 WHERE "Roll" < '254' AND "Decile" = '8' AND "Area" = 'te akau'
wikisql
CREATE TABLE table_name_47 ( result VARCHAR, original_title VARCHAR )
What is Result, when Original Title is 'Ti nm Ch f ng ( )'?
SELECT result FROM table_name_47 WHERE original_title = "tiānmǎ cháfáng (天馬茶房)"
sql_create_context
CREATE TABLE table_name_54 ( opponent VARCHAR, tournament VARCHAR )
Who was the opponent in the mallorca 2, spain tournament?
SELECT opponent FROM table_name_54 WHERE tournament = "mallorca 2, spain"
sql_create_context
CREATE TABLE table_53647 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the opponents score when Geelong played as home team?
SELECT "Away team score" FROM table_53647 WHERE "Home team" = 'geelong'
wikisql
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE code_description ( code varchar, description text ) CREATE...
i need a flight from SAN DIEGO to INDIANAPOLIS leaving in the afternoon on tuesday
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 = 'INDIANAPOLIS' AND date_day.day_number = 22 AND date_day.month_number = 3...
atis
CREATE TABLE table_78866 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
what is enfield's tie number?
SELECT "Tie no" FROM table_78866 WHERE "Home team" = 'enfield'
wikisql
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
Number of votes on answers in past 30 days.
SELECT COUNT(*) FROM Votes JOIN Posts ON Votes.PostId = Posts.Id WHERE Votes.VoteTypeId IN (2, 3) AND Votes.CreationDate >= DATEADD(DAY, -30, GETDATE()) AND Posts.PostTypeId IN (2)
sede
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...
张昊焱这位参保人年门诊医疗费总额有多少元
SELECT SUM(gwyjzb.MED_AMOUT) FROM gwyjzb WHERE gwyjzb.PERSON_NM = '张昊焱' AND gwyjzb.CLINIC_TYPE = '门诊' UNION SELECT SUM(fgwyjzb.MED_AMOUT) FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '张昊焱' AND fgwyjzb.CLINIC_TYPE = '门诊'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
give me the number of patients whose diagnoses short title is choledocholithiasis nos and lab test abnormal status is delta?
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.short_title = "Choledocholithiasis NOS" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE table_train_30 ( "id" int, "serum_potassium" float, "hyperkalemia" bool, "renal_disease" bool, "cardiopulmonary_resuscitation" bool, "receiving_vasopressor" bool, "age" float, "NOUSE" float )
cardiopulmonary resuscitation ( chest compression or defibrillation ) prior to enrollment;
SELECT * FROM table_train_30 WHERE cardiopulmonary_resuscitation = 1
criteria2sql
CREATE TABLE table_52541 ( "Year" text, "Population" text, "Romanians" text, "Hungarians" text, "Germans" text )
What is the population of the year featuring an 87.5% German population?
SELECT "Population" FROM table_52541 WHERE "Germans" = '87.5%'
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 demographic (...
count the number of patients whose gender is f and admission type is elective?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.admission_type = "ELECTIVE"
mimicsql_data
CREATE TABLE school_bus ( school_id number, driver_id number, years_working number, if_full_time others ) CREATE TABLE school ( school_id number, grade text, school text, location text, type text ) CREATE TABLE driver ( driver_id number, name text, party text, home_...
Show the types of schools that have two schools.
SELECT type FROM school GROUP BY type HAVING COUNT(*) = 2
spider
CREATE TABLE table_name_7 ( range VARCHAR, name VARCHAR, rank VARCHAR )
Which range includes Mount Fukushima, and is ranked 38?
SELECT range FROM table_name_7 WHERE name = "mount fukushima" AND rank = 38
sql_create_context
CREATE TABLE table_22879323_10 ( high_rebounds VARCHAR, date VARCHAR )
How many high rebounds were there on April 7?
SELECT COUNT(high_rebounds) FROM table_22879323_10 WHERE date = "April 7"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, a...
count the number of patients who were diagnosed with acute copd exacerbation in the same hospital encounter after they were diagnosed with anemia - anemia of chronic disease since 2105.
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute copd exacerbation' AND STRFTIME('%y', diagnosis.diagnosistime) >= '...
eicu
CREATE TABLE table_name_10 ( rank INTEGER, time VARCHAR )
What was the rank when then time was 7:52.53?
SELECT MIN(rank) FROM table_name_10 WHERE time = "7:52.53"
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 ...
这个被门诊诊断为脑梗死后遗症的病人朱文彬,查询他做的罗马指数(绝经前)的检测结果定量及单位
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = j...
css
CREATE TABLE table_name_98 ( average VARCHAR, evening_gown VARCHAR, preliminaries VARCHAR, interview VARCHAR )
How many average scores have preliminary scores over 9.25, interview scores more than 9.44, and evening gown scores of 9.77?
SELECT COUNT(average) FROM table_name_98 WHERE preliminaries > 9.25 AND interview > 9.44 AND evening_gown = 9.77
sql_create_context
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE code_description ( code varchar, description text ) CREATE...
flight from DENVER to PHILADELPHIA saturday afternoon
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 (((flight.departure_time BETWEEN 1200 AND 1800) AND date_day.day_number = 26 AND date_day.month_number = 7 AND date_day.year = 1991 AND days.day_...
atis
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...
Draw a scatterplot of school id vs acc_percent where school id is on the x-axis and points are colored by ACC_Road
SELECT School_ID, ACC_Percent FROM basketball_match GROUP BY ACC_Road
nvbench
CREATE TABLE conference ( cid int, homepage varchar, name varchar ) CREATE TABLE domain_author ( aid int, did int ) CREATE TABLE publication ( abstract varchar, cid int, citation_num int, jid int, pid int, reference_num int, title varchar, year int ) CREATE TABLE d...
return me the number of keywords .
SELECT COUNT(DISTINCT (keyword)) FROM keyword
academic
CREATE TABLE table_name_18 ( prominence__ft_ INTEGER, prominence__m_ INTEGER )
What is the highest prominence in ft of the peak with a prominence in m less than 103?
SELECT MAX(prominence__ft_) FROM table_name_18 WHERE prominence__m_ < 103
sql_create_context