context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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...
Give me a scatter chart that groups by all home, the x-axis is team id and the y-axis is school id.
SELECT Team_ID, School_ID FROM basketball_match GROUP BY All_Home
nvbench
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, ...
What upper level classes next semester will not have to meet on Fridays ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.friday = 'N' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'FA' ...
advising
CREATE TABLE table_65639 ( "Peak" text, "Country" text, "Elevation (m)" real, "Prominence (m)" real, "Col (m)" real )
Which Elevation (m) has a Prominence (m) of 2,876, and a Col (m) larger than 0?
SELECT SUM("Elevation (m)") FROM table_65639 WHERE "Prominence (m)" = '2,876' AND "Col (m)" > '0'
wikisql
CREATE TABLE table_name_38 ( length VARCHAR, numbers VARCHAR )
For numbers of 2600-2825 (223 buses), what is the length?
SELECT length FROM table_name_38 WHERE numbers = "2600-2825 (223 buses)"
sql_create_context
CREATE TABLE table_name_23 ( home VARCHAR, record VARCHAR )
Who was the home team when the record was 36 21 8?
SELECT home FROM table_name_23 WHERE record = "36–21–8"
sql_create_context
CREATE TABLE Video_games ( gtype VARCHAR )
Show all video game types and the number of video games in each type.
SELECT gtype, COUNT(*) FROM Video_games GROUP BY gtype
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
calculate the minimum age of divorcee patients who had posterior communicating aneurysm/sda as primary disease.
SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.diagnosis = "POSTERIOR COMMUNICATING ANEURYSM/SDA"
mimicsql_data
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, ...
列出37304370这名患者从零一年三月十一开始到二一年六月二十七这段时间在医院8586775被开的所有的药名还有药物的编码
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '37304370' AND t_kc21.MED_SER_ORG_NO = '8586775' AND t_kc21.IN_HOSP_DATE BETWEEN '2001-03-11' AND '2021-06-27')
css
CREATE TABLE gwyjzb ( 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, ...
查一下李沛文这位参保人从06.8.13起,至18.6.2止,总共在门诊开出了多少金额的手术费
SELECT SUM(t_kc22.AMOUNT) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '李沛文' AND gwyjzb.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2006-08-13' AND '2018-06-02' AND t_kc22.MED_INV_ITEM_TYPE = '手术费' UNION SELECT SUM(t_kc22.AMOUNT) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb...
css
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, ...
Cross-posts from Stack Overflow to Code Review.
SELECT * FROM sys.databases AS db
sede
CREATE TABLE table_1341586_14 ( result VARCHAR, incumbent VARCHAR )
How did the election end for Terry L. Bruce?
SELECT result FROM table_1341586_14 WHERE incumbent = "Terry L. Bruce"
sql_create_context
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time...
what is the drug that patient 66015 was prescribed with within the same hospital visit after the closed bronchial biopsy a month before?
SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 66015 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_proce...
mimic_iii
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TA...
when was the last test of patient 031-9128's microbiology other until 11/2105?
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-9128')) AND microlab.culturesite = 'other' AND STRFTIME('%y-%...
eicu
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
How many classes has Prof. Alan Gosman taken for 421 ?
SELECT COUNT(*) FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.number = 421 AND instructor.name LIKE '%Alan Gosman%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.offerin...
advising
CREATE TABLE table_train_82 ( "id" int, "mini_mental_state_examination_mmse" int, "systolic_blood_pressure_sbp" int, "diastolic_blood_pressure_dbp" int, "body_mass_index_bmi" float, "hypertension" bool, "age" float, "NOUSE" float )
uncontrolled hypertension ( systolic bp > 170 or diastolic bp > 100 ) .
SELECT * FROM table_train_82 WHERE hypertension = 1 OR (systolic_blood_pressure_sbp > 170 OR diastolic_blood_pressure_dbp > 100)
criteria2sql
CREATE TABLE table_73573 ( "No" real, "Player" text, "Height (m)" text, "Height (f)" text, "Position" text, "Year born" real, "Current Club" text )
Name the player that is 1.85 m
SELECT "Player" FROM table_73573 WHERE "Height (m)" = '1.85'
wikisql
CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
In next semester does Prof. Erkut Ozbay teach 445 ?
SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 445 AND instructor.name LIKE '%Erkut Ozbay%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_ins...
advising
CREATE TABLE table_26014 ( "Branding" text, "Callsign" text, "Ch. #" text, "Power kW" text, "Station Type" text, "Location (Transmitter site)" text )
When dxcc-tv is the call sign how many station types are there?
SELECT COUNT("Station Type") FROM table_26014 WHERE "Callsign" = 'DXCC-TV'
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, ...
Show me the number of patients suffering from hypertension but not coronary artery disease or cardiac catheterization as their primary disease who died on or before 2154.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "HYPERTENSION;RULE OUT CORONARY ARTERY DISEASE\CARDIAC CATH" AND demographic.dod_year <= "2154.0"
mimicsql_data
CREATE TABLE table_38418 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What team did the Montreal Canadiens visit when the record was 0-3?
SELECT "Home" FROM table_38418 WHERE "Visitor" = 'montreal canadiens' AND "Record" = '0-3'
wikisql
CREATE TABLE table_29505 ( "Period" text, "Live births per year" text, "Deaths per year" text, "Natural change per year" text, "CBR*" text, "CDR*" text, "NC*" text, "TFR*" text, "IMR*" real, "Life expectancy total" text, "Life expectancy males" text, "Life expectancy fema...
What is the life expectancy of men with an IMR of 64?
SELECT "Life expectancy males" FROM table_29505 WHERE "IMR*" = '64'
wikisql
CREATE TABLE table_name_61 ( record VARCHAR, game INTEGER )
Can you tell me the Record that has the Game smaller than 76?
SELECT record FROM table_name_61 WHERE game < 76
sql_create_context
CREATE TABLE table_name_13 ( year_left INTEGER, location VARCHAR )
How much Year Left has a Location of howe?
SELECT SUM(year_left) FROM table_name_13 WHERE location = "howe"
sql_create_context
CREATE TABLE table_43584 ( "Poll Source" text, "Dates administered" text, "Democrat: Mary Landrieu" text, "Republican: John Kennedy" text, "Lead Margin" real )
On what date was the poll showing John Kennedy with 45% and Mary Landrieu with 38%?
SELECT "Dates administered" FROM table_43584 WHERE "Republican: John Kennedy" = '45%' AND "Democrat: Mary Landrieu" = '38%'
wikisql
CREATE TABLE table_17327458_1 ( team VARCHAR, date_of_appointment VARCHAR )
What team appointed a manager on 12 June?
SELECT team FROM table_17327458_1 WHERE date_of_appointment = "12 June"
sql_create_context
CREATE TABLE table_name_38 ( date VARCHAR, time VARCHAR, set_4 VARCHAR )
What is the Date with a Time of 17:37, and the Set 4 is 25 15?
SELECT date FROM table_name_38 WHERE time = "17:37" AND set_4 = "25–15"
sql_create_context
CREATE TABLE table_203_185 ( id number, "season" text, "a\ntechnical" text, "b\nscientific" text, "c\nfine arts" text, "d\nimprovisational" text, "e\nstructural" text, "rising stars!\u00ae" text, "po\nprojectoutreach\u00ae" text, "university level" text )
which scientific challenge came two years before spinning a tale ?
SELECT "b\nscientific" FROM table_203_185 WHERE "season" = (SELECT "season" FROM table_203_185 WHERE "b\nscientific" = 'spinning a tale') - 2
squall
CREATE TABLE table_37686 ( "Venue" text, "Home" text, "Guest" text, "Score" text, "Attendance" real )
What venue was the match against the guest team, FK ibar, played at?
SELECT "Venue" FROM table_37686 WHERE "Guest" = 'fk ibar'
wikisql
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Po...
Tinkering with votes and posts.
SELECT v.Id, p.Id FROM Votes AS v, Posts AS p WHERE v.PostId = p.Id AND v.VoteTypeId = 1
sede
CREATE TABLE table_name_77 ( outcome VARCHAR, score VARCHAR, date VARCHAR )
On 27 July 2003 what was the outcome of the game that resulted in a score of 7 5, 6 3?
SELECT outcome FROM table_name_77 WHERE score = "7–5, 6–3" AND date = "27 july 2003"
sql_create_context
CREATE TABLE table_name_48 ( mountains_classification VARCHAR, points_classification VARCHAR )
Which Mountains classification has Points classification of not awarded?
SELECT mountains_classification FROM table_name_48 WHERE points_classification = "not awarded"
sql_create_context
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
92929768721的出院日期在医疗就诊里是几号?
SELECT OUT_HOSP_DATE FROM t_kc21 WHERE MED_CLINIC_ID = '92929768721'
css
CREATE TABLE table_name_69 ( bulletins_to_all_contacts VARCHAR, creator VARCHAR )
Were there Bulletins to all contacts of the license created by GG Network?
SELECT bulletins_to_all_contacts FROM table_name_69 WHERE creator = "gg network"
sql_create_context
CREATE TABLE table_1341586_39 ( incumbent VARCHAR, candidates VARCHAR )
who is the incumbent with candidates being bud shuster (r) unopposed
SELECT incumbent FROM table_1341586_39 WHERE candidates = "Bud Shuster (R) Unopposed"
sql_create_context
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime ...
calculate the number of patients who were tested for blood (toxo) microbiology in this year.
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT microbiologyevents.hadm_id FROM microbiologyevents WHERE microbiologyevents.spec_type_desc = 'blood (toxo)' AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year'))
mimic_iii
CREATE TABLE table_14136 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "TV Time" text, "Attendance" text )
Which opponent had a bye for the TV Time?
SELECT "Opponent" FROM table_14136 WHERE "TV Time" = 'bye'
wikisql
CREATE TABLE table_681 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text, "Candidates" text )
When was the incumbent Sherrod Brown first elected?
SELECT MAX("First elected") FROM table_681 WHERE "Incumbent" = 'Sherrod Brown'
wikisql
CREATE TABLE table_48373 ( "Season" real, "Team 1" text, "Score" text, "Team 2" text, "Venue" text )
What was the venue of the match where the score was 1:3 and team 2 was binh duong?
SELECT "Venue" FROM table_48373 WHERE "Score" = '1:3' AND "Team 2" = 'binh duong'
wikisql
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, give me the comparison about price over the name , and group by attribute headquarter by a bar chart, and order by the y axis in descending please.
SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Price DESC
nvbench
CREATE TABLE table_26966 ( "Name" text, "Position" text, "Period" text, "Appearances\u00b9" real, "Goals\u00b9" real, "Nationality\u00b2" text )
What is the nationality of the player who scored 13 goals
SELECT "Nationality\u00b2" FROM table_26966 WHERE "Goals\u00b9" = '13'
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, ...
Provide the number of patients whose primary disease is atrial septal defect/mitral valve replacement repair atrial-septal defect/sda and are aged below 59 years.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ATRIAL SEPTAL DEFECT\MITRAL VALVE REPLACEMENT;REPAIR ATRIAL-SEPTAL DEFECT/SDA" AND demographic.age < "59"
mimicsql_data
CREATE TABLE table_7600 ( "Mission name" text, "Lunar lander" text, "Lunar landing date" text, "Lunar blastoff date" text, "Lunar landing site" text, "Duration on lunar surface" text, "Crew" text, "Number of s EVA" real, "Total EVA Time (HH:MM)" text )
What is the average number of EVA for the Orion?
SELECT AVG("Number of s EVA") FROM table_7600 WHERE "Lunar lander" = 'orion'
wikisql
CREATE TABLE bdmzjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH number, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZD...
列出患者42321223入院科室名称包含与的有哪些住院就诊记录在医院7925513中?
SELECT * FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '42321223' AND hz_info.YLJGDM = '7925513' AND wdmzjzjlb.JZKSMC LIKE '%与%' UNION SELECT * FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjlb.YLJGDM AND hz_in...
css
CREATE TABLE ref_document_types ( document_type_code text, document_type_name text, document_type_description text ) CREATE TABLE employees ( employee_id number, role_code text, employee_name text, gender_mfu text, date_of_birth time, other_details text ) CREATE TABLE ref_locations...
Show the ids of all employees who don't destroy any document.
SELECT employee_id FROM employees EXCEPT SELECT destroyed_by_employee_id FROM documents_to_be_destroyed
spider
CREATE TABLE table_2160215_1 ( english___manga_uk__ VARCHAR, original_japanese VARCHAR )
Who was the cast on the English (Manga UK) version if K Nishimura acted on the original Japanese?
SELECT english___manga_uk__ FROM table_2160215_1 WHERE original_japanese = "Kō Nishimura"
sql_create_context
CREATE TABLE table_60649 ( "Date" text, "Opponent" text, "Score" text, "Decision" text, "Attendance" real, "Record" text )
WHAT IS THE DECISION FOR NOVEMBER 28?
SELECT "Decision" FROM table_60649 WHERE "Date" = 'november 28'
wikisql
CREATE TABLE table_name_61 ( attendance VARCHAR, result VARCHAR )
What was the attendance of the w 28-13 game?
SELECT attendance FROM table_name_61 WHERE result = "w 28-13"
sql_create_context
CREATE TABLE table_name_32 ( year INTEGER, cargo__tonnes_ VARCHAR )
What year had cargo tonnes of 13 585?
SELECT AVG(year) FROM table_name_32 WHERE cargo__tonnes_ = "13 585"
sql_create_context
CREATE TABLE Student ( Advisor VARCHAR )
Advisor 1121 has how many students?
SELECT COUNT(*) FROM Student WHERE Advisor = 1121
sql_create_context
CREATE TABLE table_name_67 ( earpads VARCHAR, construction VARCHAR, succeeded_by VARCHAR )
What earpads does the headphone with plastic contruction and was succeeded by igrado have?
SELECT earpads FROM table_name_67 WHERE construction = "plastic" AND succeeded_by = "igrado"
sql_create_context
CREATE TABLE table_name_81 ( time_retired VARCHAR, constructor VARCHAR, grid VARCHAR )
What is the time/retired for brm with a grid of 13?
SELECT time_retired FROM table_name_81 WHERE constructor = "brm" AND grid = 13
sql_create_context
CREATE TABLE table_18507 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What party's candidate was re-elected in the Louisiana 6 district?
SELECT "Party" FROM table_18507 WHERE "Result" = 'Re-elected' AND "District" = 'Louisiana 6'
wikisql
CREATE TABLE table_name_57 ( country VARCHAR, music VARCHAR, year VARCHAR )
What is the country that has a music writer of Angelo Francesco Lavagnino, written in 1969?
SELECT country FROM table_name_57 WHERE music = "angelo francesco lavagnino" AND year = 1969
sql_create_context
CREATE TABLE table_name_38 ( _number_of_bids INTEGER, win__percentage VARCHAR )
Tell me the lowest # of bids for win percent of .667
SELECT MIN(_number_of_bids) FROM table_name_38 WHERE win__percentage = ".667"
sql_create_context
CREATE TABLE table_name_61 ( leading_scorer VARCHAR, home VARCHAR )
What is the name of the Leading scorer when the Home was the Trail blazers?
SELECT leading_scorer FROM table_name_61 WHERE home = "trail blazers"
sql_create_context
CREATE TABLE table_28938 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
Name the district for matthew clay
SELECT "District" FROM table_28938 WHERE "Incumbent" = 'Matthew Clay'
wikisql
CREATE TABLE table_11570261_1 ( winning_score VARCHAR )
what's the 54 holes where winning score is 19 (67-66-67-69=269)
SELECT 54 AS _holes FROM table_11570261_1 WHERE winning_score = −19(67 - 66 - 67 - 69 = 269)
sql_create_context
CREATE TABLE table_name_90 ( discs VARCHAR, region_1_release VARCHAR )
What discs has a region 1 release date of January 22, 2008?
SELECT discs FROM table_name_90 WHERE region_1_release = "january 22, 2008"
sql_create_context
CREATE TABLE table_name_68 ( railway VARCHAR, build_date VARCHAR, loco_name VARCHAR )
Which railway had a loco name of Pyramus and a build date of 1911?
SELECT railway FROM table_name_68 WHERE build_date = 1911 AND loco_name = "pyramus"
sql_create_context
CREATE TABLE chip_model ( model_name text, launch_year number, ram_mib number, rom_mib number, slots text, wifi text, bluetooth text ) CREATE TABLE phone ( company_name text, hardware_model_name text, accreditation_type text, accreditation_level text, date text, chip...
List the name of the phone model launched in year 2002 and with the highest RAM size.
SELECT T2.hardware_model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.model_name = T2.chip_model WHERE T1.launch_year = 2002 ORDER BY T1.ram_mib DESC LIMIT 1
spider
CREATE TABLE table_29317 ( "Stage" real, "Stage winner" text, "General classification" text, "Points classification" text, "Mountains classification" text, "Asian rider classification" text, "Team classification" text )
Who is listed under general classification on stage 4?
SELECT "General classification" FROM table_29317 WHERE "Stage" = '4'
wikisql
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...
能提供出门诊就诊45399366381的日期是多少吗?
SELECT wdmzjzjlb.JZKSRQ FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '45399366381' UNION SELECT bdmzjzjlb.JZKSRQ FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '45399366381'
css
CREATE TABLE table_25287007_2 ( june_10_11 VARCHAR, november_3 VARCHAR )
How many solar eclipse on June 10-11, while November 3 is 153?
SELECT june_10_11 FROM table_25287007_2 WHERE november_3 = "153"
sql_create_context
CREATE TABLE accounts ( account_id number, customer_id number, account_name text, other_account_details text ) CREATE TABLE customers ( customer_id number, customer_first_name text, customer_last_name text, customer_address text, customer_phone text, customer_email text, oth...
What are the ids and first names of customers who do not hold a credit card?
SELECT customer_id, customer_first_name FROM customers EXCEPT SELECT T1.customer_id, T2.customer_first_name FROM customers_cards AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE card_type_code = "Credit"
spider
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) 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 varcha...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, draw a bar chart about the distribution of job_id and the average of department_id , and group by attribute job_id, and could you order in descending by the x-axis?
SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
Name the SAC classes that are offered in Summer term .
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'SAC' AND semester.semester = 'Summer'
advising
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location...
what is the top five most frequent microbiology tests that followed in the same month for patients who received packed cell transfusion during the previous year?
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR...
mimic_iii
CREATE TABLE table_157826_1 ( municipality VARCHAR, county VARCHAR, population VARCHAR )
Which municipalities located in the county of Finnmark have populations bigger than 6187.0?
SELECT municipality FROM table_157826_1 WHERE county = "Finnmark" AND population > 6187.0
sql_create_context
CREATE TABLE table_name_95 ( set_3 VARCHAR, total VARCHAR )
What is the set 3 when the total is 78 92?
SELECT set_3 FROM table_name_95 WHERE total = "78–92"
sql_create_context
CREATE TABLE table_8318 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
What was the Opponent before Week 11 with an Attendance of 63,571?
SELECT "Opponent" FROM table_8318 WHERE "Week" < '11' AND "Attendance" = '63,571'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
has there been a microbiology test held this month for patient 031-3355?
SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355')) AND DATETIME(microlab.culturetakentime, 'start of month') = DATETI...
eicu
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE T...
what ground transportation is available from the DENVER airport to downtown DENVER
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'DENVER' AND ground_service.city_code = city.city_code
atis
CREATE TABLE table_25100 ( "District" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date successor seated" text )
Name the successor for not filled this congress
SELECT "Successor" FROM table_25100 WHERE "Date successor seated" = 'Not filled this congress'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
give me the number of patients whose religion is jewish and diagnoses long title is other postoperative infection?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.religion = "JEWISH" AND diagnoses.long_title = "Other postoperative infection"
mimicsql_data
CREATE TABLE table_name_56 ( decision VARCHAR, visitor VARCHAR )
What was the decision of the Lightning game when the Canadiens were the away team?
SELECT decision FROM table_name_56 WHERE visitor = "canadiens"
sql_create_context
CREATE TABLE table_name_33 ( composition VARCHAR, weight VARCHAR )
What is the coin that weighs 3 g made of?
SELECT composition FROM table_name_33 WHERE weight = "3 g"
sql_create_context
CREATE TABLE table_51930 ( "Team" text, "Seasons" text, "Regular season" text, "Tournament" real, "Total" real )
What team has over 1 tournament title, 0 in the regular season, and 2 total?
SELECT "Team" FROM table_51930 WHERE "Tournament" > '1' AND "Regular season" = '0' AND "Total" = '2'
wikisql
CREATE TABLE table_name_34 ( constructor VARCHAR, race_name VARCHAR )
What is the constructor for the VII Race of Champions?
SELECT constructor FROM table_name_34 WHERE race_name = "vii race of champions"
sql_create_context
CREATE TABLE table_name_37 ( place INTEGER, national_final VARCHAR, points VARCHAR )
what is the highest place when the national final is 4th and the points is less than 139?
SELECT MAX(place) FROM table_name_37 WHERE national_final = "4th" AND points < 139
sql_create_context
CREATE TABLE table_name_33 ( pole_positions INTEGER, percentage VARCHAR )
What's the average pole position for the driver that has a percentage of 44.81%?
SELECT AVG(pole_positions) FROM table_name_33 WHERE percentage = "44.81%"
sql_create_context
CREATE TABLE table_71220 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
What is the highest round for College of Nebraska if the Overall is under 190?
SELECT MAX("Round") FROM table_71220 WHERE "College" = 'nebraska' AND "Overall" < '190'
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...
show me airlines with flights from PITTSBURGH to BOSTON please
SELECT DISTINCT airline.airline_code FROM airline, 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 = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.cit...
atis
CREATE TABLE people ( Height VARCHAR, People_ID VARCHAR ) CREATE TABLE perpetrator ( People_ID VARCHAR, Injured VARCHAR )
What are the heights of perpetrators in descending order of the number of people they injured?
SELECT T1.Height FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Injured DESC
sql_create_context
CREATE TABLE table_name_25 ( heat_ VARCHAR, _lane VARCHAR, name VARCHAR )
What heat and what lane is thi hue pham in?
SELECT heat_ & _lane FROM table_name_25 WHERE name = "thi hue pham"
sql_create_context
CREATE TABLE table_22944 ( "Country" text, "Total" real, "Champions" real, "Current" real, "First driver(s)" text, "Last/current driver(s)" text )
how many total where last/current driver(s) is narain karthikeyan ( 2010 )
SELECT COUNT("Total") FROM table_22944 WHERE "Last/current driver(s)" = 'Narain Karthikeyan ( 2010 )'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TA...
how many times has patient 022-163354 gone to the icu a year before?
SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-163354') AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
eicu
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE diagnoses_icd ( row_id number, subject_i...
what procedure did patient 83894 undergo for the first time until 2 years ago?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83894) AND DATETIME(procedures_icd.charttime) <= DATETIME(CURRENT_TI...
mimic_iii
CREATE TABLE table_1973842_1 ( type VARCHAR, nickname VARCHAR )
What's the type of the school whose students' name is spirits?
SELECT type FROM table_1973842_1 WHERE nickname = "Spirits"
sql_create_context
CREATE TABLE Customers_Cards ( card_id INTEGER, customer_id INTEGER, card_type_code VARCHAR(15), card_number VARCHAR(80), date_valid_from DATETIME, date_valid_to DATETIME, other_card_details VARCHAR(255) ) CREATE TABLE Financial_Transactions ( transaction_id INTEGER, previous_transa...
What is the relationship between customer id and account id? Show me a scatter chart.
SELECT account_id, customer_id FROM Accounts
nvbench
CREATE TABLE table_203_729 ( id number, "township" text, "fips" number, "population\ncenter" text, "population" number, "population\ndensity\n/km2 (/sq mi)" text, "land area\nkm2 (sq mi)" text, "water area\nkm2 (sq mi)" text, "water %" text, "geographic coordinates" text )
alphabetically , what is the last township in ellsworth county , kansas ?
SELECT MAX("township") FROM table_203_729
squall
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE...
has patient 69289 undergone a annuloplasty treatment in their first hospital visit?
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'annuloplasty') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 69289 AND NOT admissions.dischtime...
mimic_iii
CREATE TABLE table_203_697 ( id number, "player" text, "career" text, "nickname" text, "team inducted as" text )
tom terrific and the franchise are nicknames of this same player
SELECT "player" FROM table_203_697 WHERE "nickname" = '"tom terrific"' INTERSECT SELECT "player" FROM table_203_697 WHERE "nickname" = '"the franchise"'
squall
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
Which of the two are easier , EECS 503 , or EECS 489 ?
SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 503 OR course.number = 489) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ...
advising
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, ...
病号冯文轩做的颅部检查各项指标结果怎么样?
(SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN 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 = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGD...
css
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, ...
compared to second measured on the first hospital visit was the white blood cells value of patient 86786 greater than first measured on the first hospital visit?
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 86786 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label ...
mimic_iii
CREATE TABLE table_6690 ( "Average population (x 1000)" text, "Live births" text, "Deaths" text, "Natural change" text, "Crude birth rate (per 1000)" real, "Crude death rate (per 1000)" real, "Natural change (per 1000)" real )
Natural change (per 1000) smaller than -1, and a Crude birth rate (per 1000) smaller than 10.5, and a Deaths of 102 400 has what highest crude death rate per 1000?
SELECT MAX("Crude death rate (per 1000)") FROM table_6690 WHERE "Natural change (per 1000)" < '-1' AND "Crude birth rate (per 1000)" < '10.5' AND "Deaths" = '102 400'
wikisql
CREATE TABLE table_7521 ( "Heat" real, "Lane" real, "Name" text, "Country" text, "Mark" text )
What is the total lane number for the United States when the mark is 6.62 and the heat is greater than 8?
SELECT COUNT("Lane") FROM table_7521 WHERE "Country" = 'united states' AND "Mark" = '6.62' AND "Heat" > '8'
wikisql
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 demographic ( subject_id text, hadm_id t...
How many of the patients with guillain barre syndrome as their primary disease died in or before 2164?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "GUILLAIN BARRE SYNDROME" AND demographic.dod_year <= "2164.0"
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...
患有阿尔茨海默病的人检测指标273122的参考值范围下限与上限能达到多少?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE wdmzjzjlb.JZZDSM = '阿尔茨海默病' AND jyjgzbb.JCZBDM = '273122' UNION SELECT jyjgzbb.CKZFWXX...
css
CREATE TABLE table_name_93 ( withdrawn VARCHAR, number INTEGER )
How many items withdrawn had numbers over 5?
SELECT COUNT(withdrawn) FROM table_name_93 WHERE number > 5
sql_create_context