context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text ) CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text )
Return a bar chart on what are the different ship flags, and how many ships have each?, order from high to low by the X.
SELECT Flag, COUNT(*) FROM Ship GROUP BY Flag ORDER BY Flag DESC
nvbench
CREATE TABLE table_name_74 ( winner VARCHAR, time VARCHAR, jockey VARCHAR )
Who is the Winner with a Time of 1:12.00 and Melvin A. Holland as the Jockey?
SELECT winner FROM table_name_74 WHERE time = "1:12.00" AND jockey = "melvin a. holland"
sql_create_context
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
在09年3月14日到2019年9月13日内患者周才英花了多少医保金额?
SELECT SUM(t_kc24.PER_ACC_PAY) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.PERSON_NM = '周才英' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2009-03-14' AND '2019-09-13'
css
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_labitems ( row_id number, itemid...
have patient 9983 been prescribed vial, ondansetron or insulin?
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9983) AND prescriptions.drug IN ('ondansetron', 'insulin', 'vial')
mimic_iii
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
就诊的病患33852265号其检验报告单上对应的检查结果指标均不正常的单号是多少?
SELECT jybgb.BGDH FROM hz_info JOIN zzmzjzjlb JOIN jybgb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '33852265' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FRO...
css
CREATE TABLE table_49003 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text )
What is the highest Game, when Team is 'Celtics', and when High Assists is 'Hedo T rko lu (4)'?
SELECT MAX("Game") FROM table_49003 WHERE "Team" = 'celtics' AND "High assists" = 'hedo türkoğlu (4)'
wikisql
CREATE TABLE table_name_7 ( opponent VARCHAR, result VARCHAR )
Who is iv n navarro's opponent?
SELECT opponent FROM table_name_7 WHERE result = "iván navarro"
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...
What is the number of patients who are prescribed main drug type and are diagnosed with intestinal perforation?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Perforation of intestine" AND prescriptions.drug_type = "MAIN"
mimicsql_data
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 flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE compartmen...
please list the flight times from BOSTON to PITTSBURGH
SELECT DISTINCT flight.arrival_time, flight.departure_time 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND C...
atis
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 is the primary disease and lab test fluid of Wilbur Braatz?
SELECT demographic.diagnosis, lab.fluid FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Wilbur Braatz"
mimicsql_data
CREATE TABLE Customers ( Customer_ID INTEGER, Customer_name VARCHAR(40) ) CREATE TABLE Claims ( Claim_ID INTEGER, FNOL_ID INTEGER, Effective_Date DATE ) CREATE TABLE Services ( Service_ID INTEGER, Service_name VARCHAR(40) ) CREATE TABLE Settlements ( Settlement_ID INTEGER, Claim_I...
Retrieve the close dates of all the policies associated with the customer whose name contains 'Diana', bin the close dates into the day of week interval and count them for a bar chart.
SELECT Date_Closed, COUNT(Date_Closed) FROM Customers AS t1 JOIN Customers_Policies AS t2 ON t1.Customer_ID = t2.Customer_ID WHERE t1.Customer_name LIKE "%Diana%"
nvbench
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight ( aircraft_code_sequence...
what flights from PITTSBURGH to NEWARK after 2220
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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEWARK' AND flight.departure_time > 2220 AND flight.to_airport = AIRPORT_SERVICE_1.airpor...
atis
CREATE TABLE table_148535_2 ( hand VARCHAR )
Name the least 2 credits for straight hand
SELECT MIN(2 AS _credits) FROM table_148535_2 WHERE hand = "Straight"
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 ...
在二零二一年七月一号以前的住院就诊记录中有哪些是编号为22200311的患者对应的检验报告单?住院就诊的流水号能列出来吗?
SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '22200311' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2021-07-01')
css
CREATE TABLE table_name_14 ( visitor VARCHAR, record VARCHAR, home VARCHAR, time VARCHAR )
Who was the visitor at the pittsburgh penguins at 7:00 pm that had a record of 0-2-2?
SELECT visitor FROM table_name_14 WHERE home = "pittsburgh penguins" AND time = "7:00 pm" AND record = "0-2-2"
sql_create_context
CREATE TABLE Payments ( Payment_ID INTEGER, Settlement_ID INTEGER, Payment_Method_Code VARCHAR(255), Date_Payment_Made DATE, Amount_Payment INTEGER ) CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE Settlements ( Settlement_ID INTEGER, Clai...
Please use a bar chart to show the total amount of payment by each payment method code, rank total number in ascending order.
SELECT Payment_Method_Code, SUM(Amount_Payment) FROM Payments GROUP BY Payment_Method_Code ORDER BY SUM(Amount_Payment)
nvbench
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, ...
列出医院3002384中不同疾病的平均患者有多大年龄,根据出院诊断疾病名称?
SELECT t_kc21.OUT_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '3002384' GROUP BY t_kc21.OUT_DIAG_DIS_NM
css
CREATE TABLE table_name_90 ( Lieutenant VARCHAR, left_office VARCHAR )
Who was lieutenant governor to the governor that left office on October 16, 2000?
SELECT Lieutenant AS governor FROM table_name_90 WHERE left_office = "october 16, 2000"
sql_create_context
CREATE TABLE table_name_35 ( years VARCHAR, name VARCHAR )
What year was the name mount roskill grammar school?
SELECT years FROM table_name_35 WHERE name = "mount roskill grammar school"
sql_create_context
CREATE TABLE table_11033 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Where the home team score is 15.19 (109), what did the away team Footscray score?
SELECT "Away team score" FROM table_11033 WHERE "Home team score" = '15.19 (109)' AND "Away team" = 'footscray'
wikisql
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTME...
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a line chart about the change of salary over hire_date , and show in desc by the x axis.
SELECT HIRE_DATE, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE DESC
nvbench
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
count the number of patients with lab test item id 50970.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "50970"
mimicsql_data
CREATE TABLE table_name_8 ( rank INTEGER, country VARCHAR )
What is the highest rank of a player from Ethiopia?
SELECT MAX(rank) FROM table_name_8 WHERE country = "ethiopia"
sql_create_context
CREATE TABLE table_71566 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
What was the score when the opponent was the Orioles and the loss shows morehead (5 4)?
SELECT "Score" FROM table_71566 WHERE "Opponent" = 'orioles' AND "Loss" = 'morehead (5–4)'
wikisql
CREATE TABLE table_77983 ( "Player" text, "Position" text, "Round" real, "Pick" real, "NFL Club" text )
During which round was a Hawkeyes player selected for the defensive back position?
SELECT "Round" FROM table_77983 WHERE "Position" = 'defensive back'
wikisql
CREATE TABLE member_of_club ( stuid number, clubid number, position text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE club ( clubid number, clubname text, clubdes...
Find the description of the club 'Pen and Paper Gaming'.
SELECT clubdesc FROM club WHERE clubname = "Pen and Paper Gaming"
spider
CREATE TABLE table_name_75 ( played VARCHAR, drawn VARCHAR, lost VARCHAR, points VARCHAR )
How many goes played fot hteam that lost less than 12 games, drew 5, and had over 37 points?
SELECT played FROM table_name_75 WHERE lost < 12 AND points > 37 AND drawn = 5
sql_create_context
CREATE TABLE table_203_543 ( id number, "year" text, "show" text, "role" text, "channel" text, "extra" text )
what is the number of shows on the list ?
SELECT COUNT("show") FROM table_203_543
squall
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE T...
show me flights from DENVER to PHILADELPHIA
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADE...
atis
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE code_des...
find flight from HOUSTON to MEMPHIS on friday
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MEMPHIS' AND date_day.day_number = 25 AND date_day.month_number = 6 AND d...
atis
CREATE TABLE editor ( Name VARCHAR, Age VARCHAR )
Show the names of editors of age either 24 or 25.
SELECT Name FROM editor WHERE Age = 24 OR Age = 25
sql_create_context
CREATE TABLE table_23973 ( "Model Type" text, "Model Designation" text, "Engine" text, "Wheelbase (mm/inch)" text, "GVW (kg/ton)" text, "Axle Ratio" text )
What's the axle ratio of the model with model designation 97G00?
SELECT "Axle Ratio" FROM table_23973 WHERE "Model Designation" = '97G00'
wikisql
CREATE TABLE table_name_96 ( year INTEGER, director VARCHAR, title VARCHAR )
What year was The Horn Blows at Midnight, directed by Raoul Walsh?
SELECT AVG(year) FROM table_name_96 WHERE director = "raoul walsh" AND title = "the horn blows at midnight"
sql_create_context
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE T...
For those employees who did not have any job in the past, draw a scatter chart about the correlation between manager_id and department_id .
SELECT MANAGER_ID, DEPARTMENT_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
nvbench
CREATE TABLE table_34705 ( "Date" text, "Tournament" text, "Location" text, "Winner" text, "Score" text, "1st prize ( $ )" real )
What is the lowest first prize of the Mercedes Championships tournament in California?
SELECT MIN("1st prize ( $ )") FROM table_34705 WHERE "Location" = 'california' AND "Tournament" = 'mercedes championships'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id num...
what are patient 92846's new drugs today compared to those yesterday?
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 92846) AND DATETIME(prescriptions.startdate, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT prescriptions.drug FROM prescriptions WHERE...
mimic_iii
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...
All questions from the last n days.
SELECT * FROM Posts AS p WHERE p.PostTypeId = 1 AND p.AnswerCount > 0 AND p.CreationDate >= DATEADD(day, -5, GETDATE())
sede
CREATE TABLE table_72730 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
On what date was the attendance at Continental Airlines Arena 13,755?
SELECT "Date" FROM table_72730 WHERE "Location Attendance" = 'Continental Airlines Arena 13,755'
wikisql
CREATE TABLE table_3986 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real )
Who is the director when the title is listed as 'all guts, no glory'?
SELECT "Directed by" FROM table_3986 WHERE "Title" = 'All Guts, No Glory'
wikisql
CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, available_yn BIT ) CREATE TABLE Guests ( guest_id INTEGER, gender_code CHAR(1), guest_first_name VARCHAR(80), guest_last_name VARCHAR(80), date_of_birth DATETIME ) CREATE TABLE Apartment_F...
Give me a pie to show the total number from different booking status code.
SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code
nvbench
CREATE TABLE table_66784 ( "Place" text, "Name" text, "Country" text, "Score" text, "To par" text )
What is the To par of Willie MacFarlane from the country of Scotland?
SELECT "To par" FROM table_66784 WHERE "Country" = 'scotland' AND "Name" = 'willie macfarlane'
wikisql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
For all employees who have the letters D or S in their first name, return a bar chart about the distribution of job_id and the sum of salary , and group by attribute job_id, and display by the Y-axis in desc please.
SELECT JOB_ID, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(SALARY) DESC
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 txmzjzjlb ( HXPLC number, HZX...
在17年10月30日到18年12月8日期间,列出金宏茂患者所有检验结果指标记录中用的什么检测方法?
SELECT jyjgzbb.JCFF 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_MZJZJLB AND jybgb....
css
CREATE TABLE table_20309 ( "Week #" text, "Theme" text, "Song choice" text, "Original artist" text, "Order #" text, "Result" text )
What was the theme when the original artist was The Beatles?
SELECT "Theme" FROM table_20309 WHERE "Original artist" = 'The Beatles'
wikisql
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
列出患者孔古兰出院科室名称包含病的住院就诊在医院3510402中有什么记录?
SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '孔古兰' AND hz_info.YLJGDM = '3510402' AND zyjzjlb.CYKSMC LIKE '%病%'
css
CREATE TABLE takes ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), grade varchar(2) ) CREATE TABLE course ( course_id varchar(8), title varchar(50), dept_name varchar(20), credits numeric(2,0) ) CREATE TABLE section ( course...
Find the number of courses offered by Psychology department in each year with a line chart, could you sort by the year in asc?
SELECT year, COUNT(year) FROM course AS T1 JOIN section AS T2 ON T1.course_id = T2.course_id WHERE T1.dept_name = 'Psychology' GROUP BY year ORDER BY year
nvbench
CREATE TABLE table_name_55 ( transfer_window VARCHAR, status VARCHAR )
What is the transfer window for the player whose status was loan ended?
SELECT transfer_window FROM table_name_55 WHERE status = "loan ended"
sql_create_context
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction 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, admi...
What requirements would HJCS 296 meet other than a general elective ?
SELECT DISTINCT program_course.category FROM course, program_course WHERE course.department = 'HJCS' AND course.number = 296 AND program_course.course_id = course.course_id
advising
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
在2007-10-12到2017-03-18内患者范华池曾在医院有多少次就诊?
SELECT (SELECT COUNT(*) FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '范华池' AND mzjzjlb.JZKSRQ BETWEEN '2007-10-12' AND '2017-03-18') + (SELECT COUNT(*) FROM person_info J...
css
CREATE TABLE professor ( emp_num number, dept_code text, prof_office text, prof_extension text, prof_high_degree text ) CREATE TABLE enroll ( class_code text, stu_num number, enroll_grade text ) CREATE TABLE course ( crs_code text, dept_code text, crs_description text, ...
What are the first names and date of birth of professors teaching course ACCT-211?
SELECT DISTINCT T1.emp_fname, T1.emp_dob FROM employee AS T1 JOIN class AS T2 ON T1.emp_num = T2.prof_num WHERE crs_code = "ACCT-211"
spider
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
what are the three most frequently performed procedures among the patients 20s the last year?
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 20 AND 29) AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT...
eicu
CREATE TABLE table_name_9 ( location_attendance VARCHAR, record VARCHAR )
What shows for the location and attendance when the record is 41 36?
SELECT location_attendance FROM table_name_9 WHERE record = "41–36"
sql_create_context
CREATE TABLE table_23394920_1 ( power_kw VARCHAR, callsign VARCHAR )
When dxrt-tv is the callsign what is the power kw?
SELECT power_kw FROM table_23394920_1 WHERE callsign = "DXRT-TV"
sql_create_context
CREATE TABLE table_204_907 ( id number, "lift name" text, "type" text, "top\nelevation\n(ft)" number, "bottom\nelevation" number, "vertical\nrise" number, "length\n(ft)" number, "slope\n(%)" text, "capacity\n(rides/hr)" number, "speed\n(ft/min)" number, "lift\nmanufacturer" t...
which lifts have a vertical rise of more than 1,000 ?
SELECT "lift name" FROM table_204_907 WHERE "vertical\nrise" > 1000
squall
CREATE TABLE table_70570 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What's the highest bronze with a less than 1 Rank?
SELECT MAX("Bronze") FROM table_70570 WHERE "Rank" < '1'
wikisql
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id numb...
TOP C++ users in New York.
WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id =...
sede
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program ( program_id int, name v...
Which classes will Dr. Juan Hallak be teaching next semester ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Juan Hallak%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offer...
advising
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, ...
calculate the number of patients who had received the opn/oth rep aortic valve procedure two or more times this year.
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'opn/oth rep aortic va...
mimic_iii
CREATE TABLE table_204_553 ( id number, "outcome" text, "no." number, "date" text, "tournament" text, "surface" text, "partner" text, "opponents in the final" text, "score in the final" text )
what was the outcome after the october 8 game in phoenix ?
SELECT "outcome" FROM table_204_553 WHERE "date" = 10 AND "date" = 8 AND "tournament" = 'phoenix'
squall
CREATE TABLE table_name_54 ( ordered VARCHAR, name VARCHAR )
Sfax has a total ordered number of?
SELECT COUNT(ordered) FROM table_name_54 WHERE name = "sfax"
sql_create_context
CREATE TABLE table_201_19 ( id number, "rank" number, "title" text, "studio" text, "director" text, "actors" text, "gross" text )
which 1965 film starred actors elizabeth taylor and richard burton ?
SELECT "title" FROM table_201_19 WHERE "actors" = 'elizabeth taylor' INTERSECT SELECT "title" FROM table_201_19 WHERE "actors" = 'richard burton'
squall
CREATE TABLE table_29720 ( "Year" real, "Exhibitors (domestic)" real, "Exhibitors (foreign)" real, "Exhibitors (total)" real, "Visitors (total)" real, "Visitors (foreign in %)" text )
what is the most time where exhibitions is 1701
SELECT MAX("Year") FROM table_29720 WHERE "Exhibitors (total)" = '1701'
wikisql
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
有多少人在医疗机构7283097住院天数超过6天?
SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE wdmzjzjlb.YLJGDM = '7283097' AND DATEDIFF(wdmzjzjlb.CYSJ, wdmzjzjlb.RYSJ) > 6 UNION SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = b...
css
CREATE TABLE table_52679 ( "Division" text, "League Apps (Sub)" real, "League Goals" real, "FA Cup Apps (Sub)" text, "FA Cup Goals" real, "FL Cup Apps (Sub)" real, "FL Cup Goals" real, "Other Apps" real, "Other Goals" real, "Total Apps (Sub)" text, "Total Goals" real )
What division has the highest FA Cup Goals, but a Total Goal score less than 5, and a Total Apps of 52?
SELECT MAX("FA Cup Goals") FROM table_52679 WHERE "Total Apps (Sub)" = '52' AND "Total Goals" < '5'
wikisql
CREATE TABLE table_29776 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
How many entries are shown for high rebounds for the philips arena 20,024 game?
SELECT COUNT("High rebounds") FROM table_29776 WHERE "Location Attendance" = 'Philips Arena 20,024'
wikisql
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
对于医疗费总额高于9559.88元的患者83111468的医疗记录,列出有什么入院诊断疾病编码和名称?
SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_ID = '83111468' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT > 9559.88)
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 prescription...
count the number of patients whose primary disease is sigmoid diverticulitis, colovestical fistula/sda and year of birth is less than 2073?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SIGMOID DIVERTICULITIS, COLOVESTICAL FISTULA/SDA" AND demographic.dob_year < "2073"
mimicsql_data
CREATE TABLE table_name_22 ( author VARCHAR, company VARCHAR )
Which author has a company of the Semeio Theatre?
SELECT author FROM table_name_22 WHERE company = "semeio theatre"
sql_create_context
CREATE TABLE table_72700 ( "Date" text, "Cover model" text, "Centerfold model" text, "Interview subject" text, "20 Questions" text, "Pictorials" text )
Who was the centerfold model when the issue's pictorial was kimberly bell , bunnies of the new playboy club?
SELECT "Centerfold model" FROM table_72700 WHERE "Pictorials" = 'Kimberly Bell , Bunnies of the New Playboy Club'
wikisql
CREATE TABLE table_12161822_5 ( pole_position VARCHAR, grand_prix VARCHAR )
who is the the pole position with grand prix being italian grand prix
SELECT pole_position FROM table_12161822_5 WHERE grand_prix = "Italian grand_prix"
sql_create_context
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...
负责医疗就诊55063958449的医疗机构科室的编码及名称给提供一下
SELECT qtb.MED_ORG_DEPT_CD, qtb.MED_ORG_DEPT_NM FROM qtb WHERE qtb.MED_CLINIC_ID = '55063958449' UNION SELECT gyb.MED_ORG_DEPT_CD, gyb.MED_ORG_DEPT_NM FROM gyb WHERE gyb.MED_CLINIC_ID = '55063958449' UNION SELECT zyb.MED_ORG_DEPT_CD, zyb.MED_ORG_DEPT_NM FROM zyb WHERE zyb.MED_CLINIC_ID = '55063958449' UNION SELECT mzb....
css
CREATE TABLE table_204_426 ( id number, "year" text, "division" number, "league" text, "regular season" text, "playoffs" text, "open cup" text )
in what year only did they compete in division 5
SELECT "year" FROM table_204_426 WHERE "division" = 5
squall
CREATE TABLE table_204_257 ( id number, "ethnicity" text, "1926 census" text, "1939 census" text, "1959 census" text, "1970 census" text, "1979 census" text, "1989 census" text, "2007 estimate" text )
who is previous of the russians based on the list ?
SELECT "ethnicity" FROM table_204_257 WHERE id = (SELECT id FROM table_204_257 WHERE "ethnicity" = 'russians') - 1
squall
CREATE TABLE table_name_12 ( start VARCHAR, rank VARCHAR, year VARCHAR )
What was the start with a rank of 3 in 1936?
SELECT start FROM table_name_12 WHERE rank = "3" AND year = "1936"
sql_create_context
CREATE TABLE table_name_12 ( format VARCHAR, catalog VARCHAR )
What is the Format for the alca-487 catalog?
SELECT format FROM table_name_12 WHERE catalog = "alca-487"
sql_create_context
CREATE TABLE table_name_15 ( rank INTEGER, city VARCHAR )
What is Busan's rank?
SELECT SUM(rank) FROM table_name_15 WHERE city = "busan"
sql_create_context
CREATE TABLE table_name_4 ( coach VARCHAR, details VARCHAR )
Who is the coach of the 2012 Gold Coast Titans season?
SELECT coach FROM table_name_4 WHERE details = "2012 gold coast titans season"
sql_create_context
CREATE TABLE table_15637071_1 ( fleet_size VARCHAR, iata VARCHAR )
How large is the fleet size of the airline with the IATA code of 5j?
SELECT COUNT(fleet_size) FROM table_15637071_1 WHERE iata = "5J"
sql_create_context
CREATE TABLE table_name_43 ( points INTEGER, driver VARCHAR, grid VARCHAR )
HOW MANY POINTS DOES ALEX SPERAFICO HAVE WITH A GRID LARGER THAN 17?
SELECT MIN(points) FROM table_name_43 WHERE driver = "alex sperafico" AND grid > 17
sql_create_context
CREATE TABLE table_61946 ( "English name" text, "Thai name" text, "Transcription" text, "Color" text, "Sanskrit word" text, "Planet" text )
WHich Thai name has a Transcription of wan phruehatsabodi?
SELECT "Thai name" FROM table_61946 WHERE "Transcription" = 'wan phruehatsabodi'
wikisql
CREATE TABLE table_38008 ( "Unit" text, "Russian" text, "Ratio" text, "Metric value" text, "Avoirdupois value" text )
What Ratio has a Unit of zolotnik?
SELECT "Ratio" FROM table_38008 WHERE "Unit" = 'zolotnik'
wikisql
CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) ) CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password VARCHAR(40), personal_name VARCHAR(80), middle_name VARCHAR(80), family_name VARCHAR(80),...
Draw a bar chart about the distribution of password and author_id .
SELECT password, author_id FROM Course_Authors_and_Tutors ORDER BY personal_name
nvbench
CREATE TABLE table_name_13 ( year INTEGER, loser VARCHAR )
In which year is Nerida Gregory listed as the loser?
SELECT AVG(year) FROM table_name_13 WHERE loser = "nerida gregory"
sql_create_context
CREATE TABLE table_28132970_5 ( breadth VARCHAR, vessel VARCHAR )
How many breadth entries are there when the vessel is marianarray?
SELECT COUNT(breadth) FROM table_28132970_5 WHERE vessel = "Marianarray"
sql_create_context
CREATE TABLE table_name_97 ( date VARCHAR, catalog VARCHAR )
What is Date, when Catalog is EPC 81436?
SELECT date FROM table_name_97 WHERE catalog = "epc 81436"
sql_create_context
CREATE TABLE table_1341930_40 ( candidates VARCHAR, incumbent VARCHAR )
Name the candidates for l. mendel rivers
SELECT COUNT(candidates) FROM table_1341930_40 WHERE incumbent = "L. Mendel Rivers"
sql_create_context
CREATE TABLE table_31186 ( "No." real, "Title" text, "Directed by" text, "Written by" text, "Featured character(s)" text, "U.S. viewers (millions)" text, "Original air date" text )
How many million U.S. viewers was written by Matt Pelfrey?
SELECT "U.S. viewers (millions)" FROM table_31186 WHERE "Written by" = 'Matt Pelfrey'
wikisql
CREATE TABLE table_20362 ( "Residence Hall" text, "Sex" text, "Established" real, "Rector" text, "Campus" text, "Capacity" real, "Colors" text, "Mascot" text )
Who is the rector of the residence hall who's mascot is the phoxes?
SELECT "Rector" FROM table_20362 WHERE "Mascot" = 'Phoxes'
wikisql
CREATE TABLE table_name_63 ( year VARCHAR, league VARCHAR )
What years did the Nashville Metros have Usisl Indoor League?
SELECT year FROM table_name_63 WHERE league = "usisl indoor"
sql_create_context
CREATE TABLE table_29135051_3 ( episode INTEGER, guest_s_ VARCHAR )
which episode did sarah millican and grayson perry appear in
SELECT MIN(episode) FROM table_29135051_3 WHERE guest_s_ = "Sarah Millican and Grayson Perry"
sql_create_context
CREATE TABLE table_name_1 ( partial_thromboplastin_time VARCHAR, condition VARCHAR, prothrombin_time VARCHAR, bleeding_time VARCHAR )
Which Partial thromboplastin time has a Prothrombin time of prolonged, and a Bleeding time of unaffected, and a Condition of vitamin k deficiency or warfarin? Question 6
SELECT partial_thromboplastin_time FROM table_name_1 WHERE prothrombin_time = "prolonged" AND bleeding_time = "unaffected" AND condition = "vitamin k deficiency or warfarin"
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 prescriptions ( subject_id text, hadm_id...
give me the number of patients whose diagnoses short title is hx tia/stroke w/o resid and drug route is iv bolus?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Hx TIA/stroke w/o resid" AND prescriptions.route = "IV BOLUS"
mimicsql_data
CREATE TABLE table_54293 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What date did the away team score 14.8 (92)?
SELECT "Date" FROM table_54293 WHERE "Away team score" = '14.8 (92)'
wikisql
CREATE TABLE table_name_48 ( date VARCHAR, away_team VARCHAR )
what is the date when the away team is melbourne?
SELECT date FROM table_name_48 WHERE away_team = "melbourne"
sql_create_context
CREATE TABLE table_name_29 ( right_ascension___j2000__ VARCHAR, apparent_magnitude INTEGER )
For an apparent magnitude greater than 11.8 what Right ascension value is assigned?
SELECT right_ascension___j2000__ FROM table_name_29 WHERE apparent_magnitude > 11.8
sql_create_context
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 bar chart about the distribution of Team_Name and All_Games_Percent , and order y-axis from low to high order.
SELECT Team_Name, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent
nvbench
CREATE TABLE table_32751 ( "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 when the away team score is 8.17 (65)?
SELECT "Away team" FROM table_32751 WHERE "Away team score" = '8.17 (65)'
wikisql
CREATE TABLE buildings ( id number, name text, city text, height number, stories number, status text ) CREATE TABLE companies ( id number, name text, headquarters text, industry text, sales_billion number, profits_billion number, assets_billion number, market_val...
Count the number of companies.
SELECT COUNT(*) FROM companies
spider
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 mzjzjlb ( HXPLC number, HZXM ...
哪些门诊就诊记录是患者31549527的对应的检验报告单的报告日期均在2006年4月16日之后?门诊就诊流水号是什么?
SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '31549527' AND NOT mzjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ <= '2006-04-16' UNION SELECT mzjybgb.JZLSH FROM mzjybgb WHERE mzjybgb...
css
CREATE TABLE table_name_16 ( laps INTEGER, points VARCHAR, grid VARCHAR )
Who has the lowest laps with 29 points on 1 grid?
SELECT MIN(laps) FROM table_name_16 WHERE points = 29 AND grid < 1
sql_create_context