instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate...
SELECT p.CreationDate, p.Id AS "post_link", p.AnswerCount, p.Tags FROM Posts AS p INNER JOIN Users AS u ON p.OwnerUserId = u.Id WHERE u.Reputation >= '##MinReputation##' AND p.PostTypeId = 1 AND p.Score >= 0 AND ClosedDate IS NULL ORDER BY p.CreationDate DESC LIMIT 500
sede
CREATE TABLE table_64196 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many silver for rank 22 when gold count was more than 0 and Bronze count was less than 5...
SELECT SUM("Silver") FROM table_64196 WHERE "Bronze" < '5' AND "Gold" > '0' AND "Rank" = '22'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.long_title = "Other closed [endoscopic] biopsy of biliary duct or sphincter of Oddi"
mimicsql_data
CREATE TABLE table_22815568_3 ( status VARCHAR, county VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many statuses are listed for Wayne county?
SELECT COUNT(status) FROM table_22815568_3 WHERE county = "Wayne"
sql_create_context
CREATE TABLE table_10741 ( "Player" text, "Team" text, "Date" text, "Opposition" text, "Game" text, "D\u00e9but" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the game whose team is Waterford and debuted later than 1995?
SELECT "Game" FROM table_10741 WHERE "Team" = 'waterford' AND "D\u00e9but" > '1995'
wikisql
CREATE TABLE table_name_83 ( player VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player has 14 wins?
SELECT player FROM table_name_83 WHERE wins = 14
sql_create_context
CREATE TABLE files ( f_id number, artist_name text, file_size text, duration text, formats text ) CREATE TABLE genre ( g_name text, rating text, most_popular_in text ) CREATE TABLE song ( song_name text, artist_name text, country text, f_id number, genre_is text, ...
SELECT song_name FROM song WHERE rating < (SELECT MIN(rating) FROM song WHERE languages = 'english')
spider
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Transitional Epithelial Cells"
mimicsql_data
CREATE TABLE table_1630 ( "Rank" real, "Administrative Division" text, "Area (km\u00b2)" real, "Area (sq mi)" real, "National Share (%)" text, "Comparable Country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the national share of the ...
SELECT "National Share (%)" FROM table_1630 WHERE "Area (km\u00b2)" = '148064'
wikisql
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_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...
css
CREATE TABLE table_name_46 ( nationality VARCHAR, round INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the nationality of the player with round more than 4
SELECT nationality FROM table_name_46 WHERE round > 4
sql_create_context
CREATE TABLE table_name_39 ( year VARCHAR, laps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year resulted in 54 laps?
SELECT year FROM table_name_39 WHERE laps = 54
sql_create_context
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...
SELECT Team_ID, ACC_Percent FROM basketball_match GROUP BY ACC_Regular_Season
nvbench
CREATE TABLE table_68827 ( "Date" text, "Location" text, "Nature of incident" text, "Circumstances" text, "Casualties" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the nature of the incident that's a bomb attack?
SELECT "Nature of incident" FROM table_68827 WHERE "Circumstances" = 'bomb attack'
wikisql
CREATE TABLE table_name_31 ( province VARCHAR, region VARCHAR, area VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What province has a v valpara so region and an area of 927.2?
SELECT province FROM table_name_31 WHERE region = "v valparaíso" AND area = 927.2
sql_create_context
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardi...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'coronar arteriogr-2 cath') AND DATETIME(procedures_i...
mimic_iii
CREATE TABLE table_name_59 ( score VARCHAR, set_1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score for Set 1 at 19:21?
SELECT score FROM table_name_59 WHERE set_1 = "19:21"
sql_create_context
CREATE TABLE table_name_88 ( mark VARCHAR, lane VARCHAR, react VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Mark, when Lane is less than 5, and when React is 0.217?
SELECT mark FROM table_name_88 WHERE lane < 5 AND react = 0.217
sql_create_context
CREATE TABLE table_name_89 ( voltage_input_ VARCHAR, v_a VARCHAR, model VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the voltage iinput [V/A] of the whr-g54s model?
SELECT voltage_input_ AS "v_a" FROM table_name_89 WHERE model = "whr-g54s"
sql_create_context
CREATE TABLE table_name_33 ( time VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the time of the bout against Dave Menne?
SELECT time FROM table_name_33 WHERE opponent = "dave menne"
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 ...
SELECT AVG(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13528 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartevent...
mimic_iii
CREATE TABLE table_203_648 ( id number, "date" text, "opposition" text, "result" text, "score" text, "brazil scorers" text, "competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- total number of wins
SELECT COUNT(*) FROM table_203_648 WHERE "result" = 'w'
squall
CREATE TABLE table_36119 ( "Album#" text, "English title" text, "Chinese title" text, "Released" text, "Label" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Album # of 3rd is what chinese title?
SELECT "Chinese title" FROM table_36119 WHERE "Album#" = '3rd'
wikisql
CREATE TABLE table_70458 ( "Episode No." real, "Airdate" text, "Total Viewers" real, "Share" text, "BBC One Weekly Ranking" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date did the episode with a weekly ranking of 14 air?
SELECT "Airdate" FROM table_70458 WHERE "BBC One Weekly Ranking" = '14'
wikisql
CREATE TABLE APPELLATIONS ( County VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many appelations are in Napa Country?
SELECT COUNT(*) FROM APPELLATIONS WHERE County = "Napa"
sql_create_context
CREATE TABLE table_name_58 ( artist VARCHAR, draw INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which artist has a draw greater than 15?
SELECT artist FROM table_name_58 WHERE draw > 15
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 ) -- Using valid SQLite, answer the following questions for the...
SELECT Founder, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder
nvbench
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...
SELECT All_Road, All_Games_Percent FROM basketball_match ORDER BY All_Road
nvbench
CREATE TABLE table_27927185_1 ( viewers__millions_ VARCHAR, episode__number INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many million viewers watched episodes prior to episode 2.0?
SELECT viewers__millions_ FROM table_27927185_1 WHERE episode__number < 2.0
sql_create_context
CREATE TABLE table_5133 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the Final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Score of 4 6, 6 4, 6 4 included which tournament?
SELECT "Tournament" FROM table_5133 WHERE "Score" = '4–6, 6–4, 6–4'
wikisql
CREATE TABLE table_50435 ( "Date" text, "Home" text, "Score" text, "Away" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the attendance was 3188 what was the score?
SELECT "Score" FROM table_50435 WHERE "Attendance" = '3188'
wikisql
CREATE TABLE table_name_63 ( name VARCHAR, west_or_south_terminus VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the name when the west or south terminus is ne 112 west of blue springs?
SELECT name FROM table_name_63 WHERE west_or_south_terminus = "ne 112 west of blue springs"
sql_create_context
CREATE TABLE table_name_11 ( record VARCHAR, location VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was their record on Wed. Dec. 5, when they played in Boston Garden?
SELECT record FROM table_name_11 WHERE location = "boston garden" AND date = "wed. dec. 5"
sql_create_context
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
SELECT COUNT(Ids) AS Questioners, SUM(PostCount) AS Questions, (SUM(PostCount) / 1.0) / (COUNT(Ids) / 1.0) AS QsPerPoster FROM (SELECT p.OwnerUserId AS Ids, COUNT(p.Id) AS PostCount FROM Posts AS p INNER JOIN Users AS u ON p.OwnerUserId = u.Id WHERE p.PostTypeId = 1 GROUP BY p.OwnerUserId) AS q
sede
CREATE TABLE table_76590 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What i...
SELECT "Date" FROM table_76590 WHERE "Location Attendance" = 'td banknorth garden 18,624'
wikisql
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDat...
SELECT CreationDate, Text, PostHistoryTypeId, UserId AS "user10926745", PostId AS "post_link" FROM PostHistory WHERE PostHistoryTypeId IN (3, 6, 9) AND Text LIKE '%<drupal>%' ORDER BY CreationDate
sede
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE VoteTypes ( Id number, Name text...
SELECT COUNT(*) FROM SuggestedEditVotes WHERE CreationDate > DATEADD(year, -1, GETDATE()) AND UserId > -1
sede
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREAT...
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 lab.patientunitstayid FROM lab WHERE lab.labname = 'pressure control')) AND STRFTIME('%y', cost.chargetime) <= '2102' GR...
eicu
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId ...
SELECT q.Id, a.Id, a.Score, q.Tags, u.DisplayName FROM Posts AS q JOIN Posts AS a ON q.AcceptedAnswerId = a.Id JOIN Users AS u ON a.OwnerUserId = u.Id WHERE 0 = 0 AND q.Tags LIKE '%api%' AND q.PostTypeId = 1 AND a.PostTypeId = 2 ORDER BY a.Score DESC LIMIT 100
sede
CREATE TABLE table_name_38 ( position VARCHAR, school VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position does the winner from Ohio State with 412 points play?
SELECT position FROM table_name_38 WHERE school = "ohio state" AND points = "412"
sql_create_context
CREATE TABLE table_name_88 ( aggregate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the 2nd leg score having an aggregate score of 4-2?
SELECT 2 AS nd_leg FROM table_name_88 WHERE aggregate = "4-2"
sql_create_context
CREATE TABLE election ( Election_ID int, Counties_Represented text, District int, Delegate text, Party int, First_Elected real, Committee text ) CREATE TABLE party ( Party_ID int, Year real, Party text, Governor text, Lieutenant_Governor text, Comptroller text, A...
SELECT Governor, COUNT(Governor) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 GROUP BY Governor
nvbench
CREATE TABLE Department_Stores ( dept_store_id INTEGER, dept_store_chain_id INTEGER, store_name VARCHAR(80), store_address VARCHAR(255), store_phone VARCHAR(80), store_email VARCHAR(80) ) CREATE TABLE Customer_Addresses ( customer_id INTEGER, address_id INTEGER, date_from DATETIME, ...
SELECT customer_name, customer_id FROM Customers WHERE customer_address LIKE "%TN%" ORDER BY customer_name DESC
nvbench
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI" AND procedures.short_title = "Cardiac rhythm conv NEC"
mimicsql_data
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 COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '0036548' AND t_kc22.SOC_SRT_DIRE_CD = '6599-i'
css
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT LAST_NAME, EMPLOYEE_ID FROM employees ORDER BY EMPLOYEE_ID DESC
nvbench
CREATE TABLE table_name_62 ( intake INTEGER, dcsf_number VARCHAR, type VARCHAR, ofsted_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average primary intake with an Ofsted number of 117433 and a DCSF number greater than 3335?
SELECT AVG(intake) FROM table_name_62 WHERE type = "primary" AND ofsted_number = 117433 AND dcsf_number > 3335
sql_create_context
CREATE TABLE table_3695 ( "District" text, "Counties Represented" text, "Delegate" text, "Party" text, "First Elected" real, "Committee" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What committees do the district 46 members serve on?
SELECT "Committee" FROM table_3695 WHERE "District" = '46'
wikisql
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) 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...
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 = 17667 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'magnesium sulfate' ORDER BY prescriptions.sta...
mimic_iii
CREATE TABLE storm ( storm_id number, name text, dates_active text, max_speed number, damage_millions_usd number, number_deaths number ) CREATE TABLE affected_region ( region_id number, storm_id number, number_city_affected number ) CREATE TABLE region ( region_id number, r...
SELECT name FROM storm WHERE NOT storm_id IN (SELECT storm_id FROM affected_region)
spider
CREATE TABLE table_name_22 ( bronze INTEGER, silver INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the most bronze a team with more than 2 silvers has?
SELECT MAX(bronze) FROM table_name_22 WHERE silver > 2
sql_create_context
CREATE TABLE table_name_48 ( lost VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the team that lost but had 10 points?
SELECT lost FROM table_name_48 WHERE points = "10"
sql_create_context
CREATE TABLE table_name_99 ( to_par VARCHAR, year_s__won VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is To Par, when Year(s) Won is '1968 , 1971'?
SELECT to_par FROM table_name_99 WHERE year_s__won = "1968 , 1971"
sql_create_context
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...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, fare, fare_basis, flight, flight_fare, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_nam...
atis
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 ...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'PIBS' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Summer...
advising
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 * FROM gwyjzb WHERE gwyjzb.PERSON_NM = '凤乐和' AND gwyjzb.MED_SER_ORG_NO = '2365508' AND gwyjzb.MED_ORG_DEPT_NM LIKE '%科学%' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '凤乐和' AND fgwyjzb.MED_SER_ORG_NO = '2365508' AND fgwyjzb.MED_ORG_DEPT_NM LIKE '%科学%'
css
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, v...
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1918) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemi...
mimic_iii
CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) ) CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password VARCHAR(10), personal_name VARCHAR(40), middle_name VARCHAR(40), fam...
SELECT personal_name, author_tutor_ATB FROM Course_Authors_and_Tutors ORDER BY personal_name
nvbench
CREATE TABLE table_name_60 ( employees__world_ VARCHAR, revenue__mil€_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is hte nuumber of employees that has a revenue of 104.000?
SELECT employees__world_ FROM table_name_60 WHERE revenue__mil€_ = "104.000"
sql_create_context
CREATE TABLE table_name_75 ( finish VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the finish in 1953?
SELECT finish FROM table_name_75 WHERE year = "1953"
sql_create_context
CREATE TABLE table_204_394 ( id number, "year" number, "album" text, "label" text, "peak chart\npositions\nus" number, "peak chart\npositions\nus r&b" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what year was clayton 's first album ?
SELECT MIN("year") FROM table_204_394
squall
CREATE TABLE table_57621 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the pick number when mark hayes was drafted?
SELECT "Pick" FROM table_57621 WHERE "Player" = 'mark hayes'
wikisql
CREATE TABLE table_name_8 ( date VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What day was the opponent Austria?
SELECT date FROM table_name_8 WHERE opponent = "austria"
sql_create_context
CREATE TABLE table_30722 ( "Athens XI" text, "PIFA Colaba FC u-17" text, "Tata Power" text, "Dadar XI \u2018B\u2019" text, "IDBI" text, "World Network Services" text, "United FC" text, "Good Shepherd" text ) -- Using valid SQLite, answer the following questions for the tables provided ...
SELECT "Dadar XI \u2018B\u2019" FROM table_30722 WHERE "Good Shepherd" = 'Sea Liner FC'
wikisql
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 ) -- Using valid SQLite, answer the following questions for the...
SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T2.Headquarter DESC
nvbench
CREATE TABLE table_59176 ( "Week 1" text, "Week 2" text, "Week 3" text, "Week 4" text, "Week 5" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When Star Zemba was featured in Week 3, who was the cyber girl for Week 2?
SELECT "Week 2" FROM table_59176 WHERE "Week 3" = 'star zemba'
wikisql
CREATE TABLE table_name_29 ( college VARCHAR, cfl_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which college did the Calgary Stampeders recruit from?
SELECT college FROM table_name_29 WHERE cfl_team = "calgary stampeders"
sql_create_context
CREATE TABLE table_name_10 ( attendance INTEGER, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the least attendance when the time was 3:15?
SELECT MIN(attendance) FROM table_name_10 WHERE time = "3:15"
sql_create_context
CREATE TABLE table_203_465 ( id number, "name" text, "population (2002 census)" number, "population (2007 estimation)" number, "population (2011 census)" number, "area (km2)" number, "density (pop/km2)" number ) -- Using valid SQLite, answer the following questions for the tables provided ...
SELECT "population (2011 census)" FROM table_203_465 WHERE "name" = 'predeal'
squall
CREATE TABLE table_name_76 ( drawn INTEGER, lost VARCHAR, position VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many draws did clitheroe have when their position was less than 12 and they lost less than 4 times?
SELECT SUM(drawn) FROM table_name_76 WHERE position < 12 AND team = "clitheroe" AND lost > 4
sql_create_context
CREATE TABLE table_16423070_4 ( track_ VARCHAR, _field VARCHAR, swimming VARCHAR, volleyball VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which country won swimming track & field when lexington won swimming and madison won volleyball
SELECT track_ & _field FROM table_16423070_4 WHERE swimming = "Lexington" AND volleyball = "Madison"
sql_create_context
CREATE TABLE table_11547 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many bronzes for the nation with 2 golds and ranked below 2?
SELECT SUM("Bronze") FROM table_11547 WHERE "Gold" = '2' AND "Rank" > '2'
wikisql
CREATE TABLE table_203_451 ( id number, "year" number, "film" text, "role" text, "language" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what other movies was aggarwal in the same year as her role in veera ?
SELECT "film" FROM table_203_451 WHERE "film" <> 'veera' AND "year" = (SELECT "year" FROM table_203_451 WHERE "film" = 'veera')
squall
CREATE TABLE table_204_585 ( id number, "year" text, "player" text, "high school" text, "college" text, "nba/aba draft" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who won the last one ?
SELECT "player" FROM table_204_585 ORDER BY "year" DESC LIMIT 1
squall
CREATE TABLE table_21420 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text, "Position in table" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was ...
SELECT "Position in table" FROM table_21420 WHERE "Replaced by" = 'Lucas Alcaraz'
wikisql
CREATE TABLE table_52142 ( "Year" real, "Single" text, "U.S. Country" text, "U.S." text, "U.S. AC" text, "Album" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What US Country released an album of singles only in 1967?
SELECT "U.S. Country" FROM table_52142 WHERE "Album" = 'singles only' AND "Year" = '1967'
wikisql
CREATE TABLE table_name_73 ( name VARCHAR, laid_down VARCHAR, commissioned VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the name for commissioned of 30 august 1941 and laid down of 22 september 1939
SELECT name FROM table_name_73 WHERE laid_down = "22 september 1939" AND commissioned = "30 august 1941"
sql_create_context
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, ...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 94229 AND admissions.dischtime IS NULL) AND transfers.careunit = 'tsicu' ORDER BY transfers.intime LIMIT 1
mimic_iii
CREATE TABLE table_56961 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people attended the game where the home...
SELECT MAX("Crowd") FROM table_56961 WHERE "Home team score" = '8.10 (58)'
wikisql
CREATE TABLE table_name_58 ( bronze INTEGER, nation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many total bronze medals did Canada receive?
SELECT MAX(bronze) FROM table_name_58 WHERE nation = "canada"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom te...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'rbc, ascites') AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '-1 year'))
mimic_iii
CREATE TABLE table_16677738_1 ( year INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest overall year?
SELECT MIN(year) FROM table_16677738_1
sql_create_context
CREATE TABLE table_75027 ( "Call sign" text, "Analog channel" text, "Digital channel" text, "Virtual channel" text, "Network" text, "Station Ownership" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Station Ownership of eicb tv, and a Call sign ...
SELECT "Virtual channel" FROM table_75027 WHERE "Station Ownership" = 'eicb tv' AND "Call sign" = 'ktcj-ld'
wikisql
CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Give me a histogram for how...
SELECT gender, AVG(age) FROM Person GROUP BY gender ORDER BY gender
nvbench
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
SELECT * 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 = '24372784' AND hz_info.YLJGDM = '8690714' AND zyjzjlb.JZKSMC LIKE '%职业病%'
css
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT gwyjzb.OUT_DIAG_DOC_CD, gwyjzb.OUT_DIAG_DOC_NM FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '12315818260' UNION SELECT fgwyjzb.OUT_DIAG_DOC_CD, fgwyjzb.OUT_DIAG_DOC_NM FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '12315818260'
css
CREATE TABLE table_name_56 ( score VARCHAR, tie_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score for the game with a tie no of 1?
SELECT score FROM table_name_56 WHERE tie_no = "1"
sql_create_context
CREATE TABLE route ( station_id VARCHAR, train_id VARCHAR ) CREATE TABLE train ( name VARCHAR, time VARCHAR, id VARCHAR ) CREATE TABLE station ( id VARCHAR, local_authority VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find names and t...
SELECT t3.name, t3.time FROM station AS t1 JOIN route AS t2 ON t1.id = t2.station_id JOIN train AS t3 ON t2.train_id = t3.id WHERE t1.local_authority = "Chiltern"
sql_create_context
CREATE TABLE table_name_43 ( nomination VARCHAR, year INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the nomination in a year earlier than 2009?
SELECT nomination FROM table_name_43 WHERE year < 2009
sql_create_context
CREATE TABLE table_52144 ( "Result" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result of the fight that had a tko (low kicks)?
SELECT "Result" FROM table_52144 WHERE "Method" = 'tko (low kicks)'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( medicationid n...
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-16737')) AND intakeoutput.cellpath LIKE '%output%' AND S...
eicu
CREATE TABLE table_13833770_3 ( district VARCHAR, party VARCHAR, elected VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the district with party being republican and elected being 1998
SELECT district FROM table_13833770_3 WHERE party = "Republican" AND elected = 1998
sql_create_context
CREATE TABLE table_name_14 ( finalist VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the May 7 finalist?
SELECT finalist FROM table_name_14 WHERE week = "may 7"
sql_create_context
CREATE TABLE table_75124 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text ) -- Using valid SQLite, answer the following questions f...
SELECT "Try bonus" FROM table_75124 WHERE "Points for" = '423'
wikisql
CREATE TABLE Catalogs ( catalog_id INTEGER, catalog_name VARCHAR(50), catalog_publisher VARCHAR(80), date_of_publication DATETIME, date_of_latest_revision DATETIME ) CREATE TABLE Catalog_Contents_Additional_Attributes ( catalog_entry_id INTEGER, catalog_level_number INTEGER, attribute_i...
SELECT catalog_entry_name, capacity FROM Catalog_Contents WHERE price_in_dollars > 700
nvbench
CREATE TABLE table_name_23 ( mascot VARCHAR, enrollment INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Mascot has an Enrollment greater than 2,464?
SELECT mascot FROM table_name_23 WHERE enrollment > 2 OFFSET 464
sql_create_context
CREATE TABLE table_33403 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many silver medals were won with a total medal of 3 and a rank above 9?
SELECT AVG("Silver") FROM table_33403 WHERE "Total" < '3' AND "Rank" > '9'
wikisql
CREATE TABLE table_name_41 ( loan_club VARCHAR, start_source VARCHAR, ended VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the loan club with bbc sport as the start source and ended in 3 February?
SELECT loan_club FROM table_name_41 WHERE start_source = "bbc sport" AND ended = "3 february"
sql_create_context
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
SELECT Sex, COUNT(Sex) FROM people GROUP BY Sex
nvbench
CREATE TABLE table_50482 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the venue of the team race that was after 2008?
SELECT "Venue" FROM table_50482 WHERE "Year" > '2008' AND "Notes" = 'team'
wikisql