context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_36 ( results VARCHAR, seed VARCHAR, year VARCHAR )
What Results has a Seed #12 and a Year that's smaller than 1996
SELECT results FROM table_name_36 WHERE seed = "#12" AND year < 1996
sql_create_context
CREATE TABLE table_204_311 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
how many countries total only received one bronze medal in the 1987 championship ?
SELECT COUNT("nation") FROM table_204_311 WHERE "bronze" = 1
squall
CREATE TABLE table_name_59 ( season_number VARCHAR )
Name the 2nd runner-up for season 7
SELECT 2 AS nd_runner_up FROM table_name_59 WHERE season_number = "season 7"
sql_create_context
CREATE TABLE table_15688 ( "Kanji" text, "Name" text, "Builder" text, "Laid down" text, "Launched" text, "Completed" text )
What is the launched date for the Harusame ship?
SELECT "Launched" FROM table_15688 WHERE "Name" = 'harusame'
wikisql
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
患者严光辉曾经接受过什么治疗
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '严光辉' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费'
css
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, ...
search for (possible) cat abuse.
SELECT Id, Title FROM Posts WHERE Body LIKE '%grep%'
sede
CREATE TABLE table_11180 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
How much was the score of the home team at windy hill?
SELECT "Home team score" FROM table_11180 WHERE "Venue" = 'windy hill'
wikisql
CREATE TABLE table_name_68 ( laps INTEGER, driver VARCHAR )
What are the lowest laps of Graham Hill?
SELECT MIN(laps) FROM table_name_68 WHERE driver = "graham hill"
sql_create_context
CREATE TABLE table_38028 ( "Series Ep." text, "Episode" real, "Netflix" text, "Segment A" text, "Segment B" text, "Segment C" text, "Segment D" text )
What series episode has stetson hats (part 1) under segment C?
SELECT "Series Ep." FROM table_38028 WHERE "Segment C" = 'stetson hats (part 1)'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
provide the number of patients whose death status is 0 and diagnoses long title is suicide and self-inflicted poisoning by analgesics, antipyretics, and antirheumatics?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.long_title = "Suicide and self-inflicted poisoning by analgesics, antipyretics, and antirheumatics"
mimicsql_data
CREATE TABLE table_name_28 ( attendance VARCHAR, date VARCHAR )
How many attended the game on april 14?
SELECT COUNT(attendance) FROM table_name_28 WHERE date = "april 14"
sql_create_context
CREATE TABLE table_name_99 ( ncbi_accession_number__mrna_protein_ VARCHAR, protein_identity VARCHAR )
What NCBI Accession Number (mRNA/Protein) has a Protein Identity of 69%?
SELECT ncbi_accession_number__mrna_protein_ FROM table_name_99 WHERE protein_identity = "69%"
sql_create_context
CREATE TABLE table_name_59 ( height VARCHAR, current_club VARCHAR )
What is the height of the player who currently plays for Alta Gesti n Fuenlabrada?
SELECT height FROM table_name_59 WHERE current_club = "alta gestión fuenlabrada"
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 many days is it since patient 40707's first d10w prescription in the current hospital visit?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40707 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'd10w' ORDER BY prescriptions.startdate LIMIT ...
mimic_iii
CREATE TABLE review ( a_id integer, u_id integer, i_id integer, rating integer, rank integer ) CREATE TABLE useracct ( u_id integer, name varchar(128) ) CREATE TABLE trust ( source_u_id integer, target_u_id integer, trust integer ) CREATE TABLE item ( i_id integer, tit...
Find each target user's name and average trust score Visualize by bar chart, I want to show by the x axis in ascending.
SELECT name, AVG(trust) FROM useracct AS T1 JOIN trust AS T2 ON T1.u_id = T2.target_u_id GROUP BY T2.target_u_id ORDER BY name
nvbench
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...
For BCS 232 what are the classes needed to be taken ?
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT...
advising
CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Description VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_...
Show me a scatter chart for how many documents correspond with each project id?
SELECT Project_ID, COUNT(*) FROM Documents GROUP BY Project_ID
nvbench
CREATE TABLE table_30793 ( "Player" text, "Matches" real, "Innings" real, "Wickets" real, "Average" text, "BBI" text, "BBM" text, "5wi" real, "10wi" real )
how many innings had bbi 4/26?
SELECT "Innings" FROM table_30793 WHERE "BBI" = '4/26'
wikisql
CREATE TABLE table_70131 ( "Stage" text, "Winner" text, "General classification" text, "Points classification" text, "Mountains classification" text, "Trofeo Fast Team" text )
Which winner has a points classification of Tony Rominger at stage 17?
SELECT "Winner" FROM table_70131 WHERE "Points classification" = 'tony rominger' AND "Stage" = '17'
wikisql
CREATE TABLE mzjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, 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, ...
知不知道申请检验报告单89851265565的科室名称是啥?编码呢
SELECT zyjybgb.SQKS, zyjybgb.SQKSMC FROM zyjybgb WHERE zyjybgb.BGDH = '89851265565' UNION SELECT mzjybgb.SQKS, mzjybgb.SQKSMC FROM mzjybgb WHERE mzjybgb.BGDH = '89851265565'
css
CREATE TABLE table_73749 ( "Character" text, "English version" text, "Laserdisc edition" text, "Buena Vista edition" text, "Special edition" text )
what is the special edition where the english version is nick stewart?
SELECT "Special edition" FROM table_73749 WHERE "English version" = 'Nick Stewart'
wikisql
CREATE TABLE table_204_160 ( id number, "rank" number, "name" text, "nationality" text, "time" text, "notes" text )
who had the slowest time in the race ?
SELECT "name" FROM table_204_160 ORDER BY "time" DESC LIMIT 1
squall
CREATE TABLE table_name_48 ( score VARCHAR, date VARCHAR )
Name the score for september 11
SELECT score FROM table_name_48 WHERE date = "september 11"
sql_create_context
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, ...
how many divorcee patients had a lab test for chloride?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "DIVORCED" AND lab.label = "Chloride"
mimicsql_data
CREATE TABLE table_45938 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the total number of Bronze, when Silver is greater than 0, when Gold is greater than 3, and when Rank is 1?
SELECT COUNT("Bronze") FROM table_45938 WHERE "Silver" > '0' AND "Gold" > '3' AND "Rank" = '1'
wikisql
CREATE TABLE table_50276 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Which High rebounds have High points of chris bosh (34)?
SELECT "High rebounds" FROM table_50276 WHERE "High points" = 'chris bosh (34)'
wikisql
CREATE TABLE manager_award_vote ( award_id TEXT, year INTEGER, league_id TEXT, player_id TEXT, points_won INTEGER, points_max INTEGER, votes_first INTEGER ) CREATE TABLE player_award_vote ( award_id TEXT, year INTEGER, league_id TEXT, player_id TEXT, points_won NUMERIC, ...
What is the number of wins the team Boston Red Stockings got in the postseasons each year in history Show the tendency, I want to list X in desc order.
SELECT year, COUNT(*) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' GROUP BY T1.year ORDER BY year DESC
nvbench
CREATE TABLE table_55302 ( "NGC number" real, "Object type" text, "Constellation" text, "Right ascension ( J2000 )" text, "Declination ( J2000 )" text, "Apparent magnitude" real )
I want the NGC number for right ascension of 08h11m13.6s
SELECT "NGC number" FROM table_55302 WHERE "Right ascension ( J2000 )" = '08h11m13.6s'
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 admission type is emergency and diagnoses long title is other drugs and medicinal substances causing adverse effects in therapeutic use?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Other drugs and medicinal substances causing adverse effects in therapeutic use"
mimicsql_data
CREATE TABLE table_1763 ( "Ending" text, "American" text, "British" text, "Australian" text, "Examples" text )
which examples are pronounced et in australian
SELECT "Examples" FROM table_1763 WHERE "Australian" = 'et'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE vitalperiodic ( ...
when did patient 012-37411 last have a sao2 measured on the current icu visit?
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-37411') AND patient.unitdischargetime IS NULL) ...
eicu
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, Ta...
Python gold badgers ordered by date.
SELECT ROW_NUMBER() OVER (ORDER BY b.Date DESC), b.UserId AS "user_link", b.Date AS got_gold_python, u.Reputation AS rep FROM Users AS u, Badges AS b WHERE b.Name = 'python' AND b.Class = 1 AND u.Id = b.UserId GROUP BY b.Date, b.UserId, u.Reputation
sede
CREATE TABLE table_51888 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which Date has an Away team score of 16.13 (109)?
SELECT "Date" FROM table_51888 WHERE "Away team score" = '16.13 (109)'
wikisql
CREATE TABLE table_name_1 ( game VARCHAR, date VARCHAR )
What game was played on May 29?
SELECT game FROM table_name_1 WHERE date = "may 29"
sql_create_context
CREATE TABLE table_name_33 ( category VARCHAR, year INTEGER )
What category has a year after 2004?
SELECT category FROM table_name_33 WHERE year > 2004
sql_create_context
CREATE TABLE table_name_43 ( tournament VARCHAR, score VARCHAR )
Which Tournament has a Score of 3 6 6 4 4 6?
SELECT tournament FROM table_name_43 WHERE score = "3–6 6–4 4–6"
sql_create_context
CREATE TABLE table_26387 ( "Branding" text, "Callsign" text, "Frequency" text, "Power kW" text, "Coverage" text )
What is the callsign when power kw is 25kw?
SELECT "Callsign" FROM table_26387 WHERE "Power kW" = '25kW'
wikisql
CREATE TABLE table_2439728_1 ( founded INTEGER, school VARCHAR )
when was lawrence academy at groton established?
SELECT MIN(founded) FROM table_2439728_1 WHERE school = "Lawrence Academy at Groton"
sql_create_context
CREATE TABLE table_name_33 ( winner VARCHAR, circuit VARCHAR )
What is Winner, when Circuit is June 8?
SELECT winner FROM table_name_33 WHERE circuit = "june 8"
sql_create_context
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, pr...
Which of the upper-level classes being offered are 11 credits ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 11 AND program_course.category LIKE 'ULCS'
advising
CREATE TABLE table_45699 ( "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
Who is the opponent on November 22, 2009, clay surface?
SELECT "Opponent" FROM table_45699 WHERE "Surface" = 'clay' AND "Date" = 'november 22, 2009'
wikisql
CREATE TABLE table_67723 ( "Year" real, "Designation" text, "% votes" real, "Seats" text, "% seats" real )
After 1993, what is the Seats with a % votes of 38.72?
SELECT "Seats" FROM table_67723 WHERE "Year" > '1993' AND "% votes" = '38.72'
wikisql
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 text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
calculate the maximum age of patients who are female and have private insurance.
SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.insurance = "Private"
mimicsql_data
CREATE TABLE table_237757_10 ( highest VARCHAR, average VARCHAR )
What was the entry for highest when average is 10295?
SELECT highest FROM table_237757_10 WHERE average = 10295
sql_create_context
CREATE TABLE table_3137 ( "Rank" real, "Team" text, "Round1" real, "Round2" real, "Round3" real, "Round4" real, "Total points" real )
How many points did the team who had 132 total points have in round 1?
SELECT MAX("Round1") FROM table_3137 WHERE "Total points" = '132'
wikisql
CREATE TABLE table_24571 ( "Train No." text, "Train Name" text, "Destination" text, "Category" text, "Frequency" text )
What is the category for trains numbered 16609/16610?
SELECT "Category" FROM table_24571 WHERE "Train No." = '16609/16610'
wikisql
CREATE TABLE table_28176 ( "Episode" real, "Reward" text, "Leader Battle" text, "Immunity" text, "Individual Immunity" text, "Eliminated" text, "Vote" text, "Finish" text )
Name the finish for 4-4
SELECT "Finish" FROM table_28176 WHERE "Vote" = '4-4'
wikisql
CREATE TABLE table_name_84 ( builder VARCHAR, completed VARCHAR, launched VARCHAR )
Which builder completed before 1890 and launched on 9 june 1888?
SELECT builder FROM table_name_84 WHERE completed < 1890 AND launched = "9 june 1888"
sql_create_context
CREATE TABLE table_name_41 ( notes VARCHAR, competition VARCHAR, year VARCHAR )
What were the notes of the All-Africa Games before 2007?
SELECT notes FROM table_name_41 WHERE competition = "all-africa games" AND year < 2007
sql_create_context
CREATE TABLE train ( Name VARCHAR, Railway_ID VARCHAR ) CREATE TABLE railway ( Location VARCHAR, Railway_ID VARCHAR )
Show the names of trains and locations of railways they are in.
SELECT T2.Name, T1.Location FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID
sql_create_context
CREATE TABLE table_name_83 ( method VARCHAR, opponent VARCHAR )
What was the method of resolution for the fight against dale hartt?
SELECT method FROM table_name_83 WHERE opponent = "dale hartt"
sql_create_context
CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE flight_fare ( flight_id in...
how far is the airport from SAN FRANCISCO
SELECT DISTINCT airport_service.miles_distant FROM airport_service, city WHERE city.city_code = airport_service.city_code AND city.city_name = 'SAN FRANCISCO'
atis
CREATE TABLE table_name_88 ( clubs INTEGER, place VARCHAR, all_around VARCHAR )
What are the lowest clubs that have a place greater than 5, with an all around greater than 9.7?
SELECT MIN(clubs) FROM table_name_88 WHERE place > 5 AND all_around > 9.7
sql_create_context
CREATE TABLE table_62054 ( "Round" real, "Race" text, "Circuit" text, "Date" text, "Event" text, "Winning driver" text )
What race was a round smaller than 8, on 6 july?
SELECT "Race" FROM table_62054 WHERE "Round" < '8' AND "Date" = '6 july'
wikisql
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, ...
was there a microbiological test that was done to patient 031-3355 during this month?
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 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 gsi ( course_offering_id int, student_id int ) CREATE TABLE semester ( ...
What CHEMBIO classes are needed for CS majors ?
SELECT DISTINCT course.department, course.name, course.number FROM program_course INNER JOIN course ON program_course.course_id = course.course_id WHERE course.department = 'CHEMBIO'
advising
CREATE TABLE table_14489821_1 ( average VARCHAR )
list the number of matches played by the teams that got an average of 1.079
SELECT 1986 AS _87 FROM table_14489821_1 WHERE average = "1.079"
sql_create_context
CREATE TABLE table_name_4 ( total INTEGER, silver VARCHAR, nation VARCHAR, bronze VARCHAR, rank VARCHAR )
For the United States, with greater than 2 bronze metals, greater than 3 silver medals, and a rank higher than 3, what is the highest total number of medals?
SELECT MAX(total) FROM table_name_4 WHERE bronze > 2 AND rank > 3 AND nation = "united states" AND silver > 3
sql_create_context
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) 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...
Has Christo Sevov ever taught MCDB 436 ?
SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'MCDB' AND course.number = 436 AND instructor.name LIKE '%Christo Sevov%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor....
advising
CREATE TABLE table_name_16 ( event VARCHAR, placed VARCHAR, year VARCHAR )
What event placed bronze earlier than 1987?
SELECT event FROM table_name_16 WHERE placed = "bronze" AND year < 1987
sql_create_context
CREATE TABLE table_23258 ( "Institution" text, "Location" text, "Nickname" text, "Founded" real, "Type" text, "Enrollment" real, "Primary Conference" text, "LEC Sport" text )
Where is the Westfield State University located?
SELECT "Location" FROM table_23258 WHERE "Institution" = 'Westfield State University'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code te...
what are the three most common diagnoses that patients were diagnosed within the same month after they were diagnosed with obstructive sleep apnea last year?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions...
mimic_iii
CREATE TABLE table_40302 ( "Tournament" text, "1996" text, "1997" text, "1998" text, "1999" text, "2000" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text...
What was in 2007 that has a 3r of 1999?
SELECT "2007" FROM table_40302 WHERE "1999" = '3r'
wikisql
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE...
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 hire_date and the sum of manager_id bin hire_date by weekday.
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
nvbench
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate tim...
Questions and Answers Score Distribution.
SELECT PostTypeId, Score, COUNT(Id) FROM (SELECT CASE WHEN Score < 0 THEN '0- < 0' WHEN Score BETWEEN 0 AND 100 THEN '1- 0-100' WHEN Score BETWEEN 101 AND 500 THEN '2- 101-500' WHEN Score BETWEEN 501 AND 1000 THEN '3- 501-1000' WHEN Score BETWEEN 1001 AND 2000 THEN '4- 1001-2000' WHEN Score BETWEEN 2001 AND 5000 THEN '...
sede
CREATE TABLE table_204_620 ( id number, "title" text, "year" number, "language" text, "role" text, "notes" text )
how many roles has this actor had ?
SELECT COUNT("role") FROM table_204_620
squall
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 ...
把王睿范住在医院2347656时的就诊记录里患者的入院科室名字有拔牙的记录列出来
SELECT * FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '王睿范' AND hz_info.YLJGDM = '2347656' AND wdmzjzjlb.JZKSMC LIKE '%拔牙%' UNION SELECT * FROM person_info JOIN h...
css
CREATE TABLE table_1949746_1 ( format VARCHAR, frequency VARCHAR )
When 790 am is the frequency what is the format?
SELECT format FROM table_1949746_1 WHERE frequency = "790 AM"
sql_create_context
CREATE TABLE table_name_14 ( record VARCHAR, high_points VARCHAR )
What is the record when Clippers have the high points?
SELECT record FROM table_name_14 WHERE high_points = "clippers"
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...
A bar chart shows the distribution of ACC_Regular_Season and All_Games_Percent , and rank by the Y-axis in descending.
SELECT ACC_Regular_Season, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent DESC
nvbench
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_tit...
what is the yearly maximum value of potassium in patient 8098?
SELECT MAX(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8098) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'potassium') GROUP BY STRFTIME('%y', labevents.charttime)
mimic_iii
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, ...
从2013年1月5日到2017年2月8日,患者35826599的住院次数总共多少次?
SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.PERSON_ID = '35826599' AND gwyjzb.IN_HOSP_DATE BETWEEN '2013-01-05' AND '2017-02-08' AND gwyjzb.CLINIC_TYPE = '住院' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '35826599' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2013-01-05' AND '2017-02-08' AND fgwyjzb.CLINIC_TYPE = '住院...
css
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
% of bad Minecraft questions. Check on how the sheeple are doing in corrupting the Minecraft tag. Intended to be used in Arqade
SELECT COUNT(Id) * 100. / (SELECT COUNT(Id) FROM Posts WHERE PostTypeId = 1 AND Tags LIKE '%minecraft%') AS Pct FROM Posts WHERE PostTypeId = 1 AND Tags LIKE '%minecraft%' AND (NOT ClosedDate IS NULL OR Score < 0)
sede
CREATE TABLE table_204_489 ( id number, "rank" number, "name" text, "height" text, "floors" number, "year" number, "notes" text )
how many floors does the tallest building have ?
SELECT "floors" FROM table_204_489 ORDER BY "floors" DESC LIMIT 1
squall
CREATE TABLE table_12740151_8 ( price___usd__ VARCHAR, l3 VARCHAR )
What's the price (in USD) of the model whose L3 is 18 mb?
SELECT price___usd__ FROM table_12740151_8 WHERE l3 = "18 MB"
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time...
how much is the maximum hospital cost involving inferior vena cava filter last year?
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'inferior vena cava filter')) AND DATETIME(co...
eicu
CREATE TABLE table_name_50 ( preliminary INTEGER, evening_gown VARCHAR, swimsuit VARCHAR, interview VARCHAR )
What is the smallest preliminary when swimsuit is less than 8.822, interview is more than 8.744 and gown is more than 9.333?
SELECT MIN(preliminary) FROM table_name_50 WHERE swimsuit < 8.822 AND interview > 8.744 AND evening_gown > 9.333
sql_create_context
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, return a bar chart about the distribution of headquarter and the sum of price , and group by attribute headquarter, could you order bars in descending order?
SELECT Headquarter, SUM(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter DESC
nvbench
CREATE TABLE table_19925114_1 ( directed_by VARCHAR, no_in_series VARCHAR )
How many episodes had the series number of 38?
SELECT COUNT(directed_by) FROM table_19925114_1 WHERE no_in_series = 38
sql_create_context
CREATE TABLE table_203_204 ( id number, "year" number, "film" text, "language" text, "actors" text, "music" text, "banner" text, "note" text )
who wrote the most music for c.v. sridhars movies ?
SELECT "music" FROM table_203_204 GROUP BY "music" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_name_54 ( first_uk_tour_cast VARCHAR, character VARCHAR )
What is the name of the person in the First UK Tour Cast for the Character of Sister Mary Robert?
SELECT first_uk_tour_cast FROM table_name_54 WHERE character = "sister mary robert"
sql_create_context
CREATE TABLE table_44542 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What place did Don Whitt finish?
SELECT "Place" FROM table_44542 WHERE "Player" = 'don whitt'
wikisql
CREATE TABLE table_name_18 ( masculine_an_stems VARCHAR, feminine_ō_stems VARCHAR, masculine_u_stems VARCHAR )
What is the an-stem for the word which has an -stems of siangar and an u-stem ending of syni?
SELECT masculine_an_stems FROM table_name_18 WHERE feminine_ō_stems = "siangar" AND masculine_u_stems = "syni"
sql_create_context
CREATE TABLE table_train_217 ( "id" int, "gender" string, "c_peptide_level" float, "hemoglobin_a1c_hba1c" float, "hematocrit_hct" float, "insulin_requirement" float, "serum_creatinine" float, "NOUSE" float )
hematocrit < 36 % ( female ) ; < 38 % ( male )
SELECT * FROM table_train_217 WHERE (hematocrit_hct < 36 AND gender = 'female') OR (hematocrit_hct < 38 AND gender = 'male')
criteria2sql
CREATE TABLE table_75880 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What was the date of the game with a score of 2 1?
SELECT "Date" FROM table_75880 WHERE "Score" = '2–1'
wikisql
CREATE TABLE table_16048129_5 ( number_of_families INTEGER, average_family_size VARCHAR )
What is the most number of families in regions where average family size is 2.7?
SELECT MAX(number_of_families) FROM table_16048129_5 WHERE average_family_size = "2.7"
sql_create_context
CREATE TABLE table_70653 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
Which Opponent has a lost of wells (6-2)?
SELECT "Opponent" FROM table_70653 WHERE "Loss" = 'wells (6-2)'
wikisql
CREATE TABLE table_name_36 ( bronze INTEGER, silver VARCHAR, gold VARCHAR, total VARCHAR )
Which Bronze has a Gold larger than 1, and a Total larger than 11, and a Silver larger than 5?
SELECT AVG(bronze) FROM table_name_36 WHERE gold > 1 AND total > 11 AND silver > 5
sql_create_context
CREATE TABLE Playlist ( PlaylistId integer, Name varchar(120) ) CREATE TABLE MediaType ( MediaTypeId integer, Name varchar(120) ) CREATE TABLE PlaylistTrack ( PlaylistId integer, TrackId integer ) CREATE TABLE Customer ( CustomerId integer, FirstName varchar(40), LastName varchar(...
What are the invoice dates for customers with the first name Astrid and the last name Gruber, and count them by a bar chart
SELECT InvoiceDate, COUNT(InvoiceDate) FROM Customer AS T1 JOIN Invoice AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.FirstName = "Astrid" AND LastName = "Gruber"
nvbench
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, ...
在01年2月23日到18年6月30日期间,医院7224356开出的检验报告单中,不同检测指标名称以及不同检测指标结果定量单位下,检测指标结果定量的平均值
SELECT JCZBMC, JCZBJGDW, AVG(JCZBJGDL) FROM jyjgzbb WHERE YLJGDM = '7224356' AND BGRQ BETWEEN '2001-02-23' AND '2018-06-30' GROUP BY JCZBMC, JCZBJGDW
css
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text ) 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...
编号为43827517的患者被门诊诊断为胃炎,看看检测指标983873的结果定量及其单位
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info ON 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.Y...
css
CREATE TABLE table_name_77 ( mpeg_1 VARCHAR, realvideo VARCHAR )
Tell me the MPEG-1 for real video of no
SELECT mpeg_1 FROM table_name_77 WHERE realvideo = "no"
sql_create_context
CREATE TABLE table_18473 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
How many results are listed for the election where Noah M. Mason was elected?
SELECT COUNT("Result") FROM table_18473 WHERE "Incumbent" = 'Noah M. Mason'
wikisql
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
医疗就诊68258054270与医疗就诊61652781791中开出了哪些药品名称相同?列出有哪些药品的名称?
SELECT t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21_t_kc22.MED_CLINIC_ID = '61652781791' INTERSECT SELECT t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON ...
css
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text...
Last Access Date by Age.
WITH AccessedLastWeek AS (SELECT Age, COUNT(1) AS Count FROM Users WHERE Age <= 75 AND LastAccessDate >= DATEADD(day, -7, GETDATE()) GROUP BY Age), AccessedLastMonth AS (SELECT Age, COUNT(1) AS Count FROM Users WHERE Age <= 75 AND LastAccessDate >= DATEADD(day, -30, GETDATE()) GROUP BY Age), AllUsers AS (SELECT Age, CO...
sede
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 Votes ( Id number, PostId number, VoteTypeId nu...
Bounties: on own questions vs. others' questions.
SELECT SUM(CASE v.UserId WHEN p.OwnerUserId THEN 1 ELSE 0 END) AS "Own", 100 * SUM(CASE v.UserId WHEN p.OwnerUserId THEN 1 ELSE 0 END) / COUNT(*) AS "%", SUM(CASE v.UserId WHEN p.OwnerUserId THEN 0 ELSE 1 END) AS "Other", 100 * SUM(CASE v.UserId WHEN p.OwnerUserId THEN 0 ELSE 1 END) / COUNT(*) AS "%" FROM Votes AS v IN...
sede
CREATE TABLE table_203_864 ( id number, "place" text, "player" text, "country" text, "score" text, "to par" number, "money ($)" number )
which two players tied for first place ?
SELECT "player" FROM table_203_864 WHERE "place" = 1
squall
CREATE TABLE table_72048 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
Which score has an Attendance larger than 16,571, and a Loss of mcdowell (0-1)?
SELECT "Score" FROM table_72048 WHERE "Attendance" > '16,571' AND "Loss" = 'mcdowell (0-1)'
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
what is the number of patients whose diagnoses long title is other alteration of consciousness and lab test fluid is blood?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Other alteration of consciousness" AND lab.fluid = "Blood"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
在55601265065住院就诊中,入住的哪个病区?编码是什么?床位号呢
SELECT zyjzjlb.RZBQDM, zyjzjlb.RZBQMC, zyjzjlb.RYCWH FROM zyjzjlb WHERE zyjzjlb.JZLSH = '55601265065'
css