instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_10485 ( "Retail name" text, "Chipset based on" text, "Digital/analog signal" text, "AVIVO" text, "Available interface" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Digital/analog signal with a Chipset based on with r...
SELECT "Digital/analog signal" FROM table_10485 WHERE "Chipset based on" = 'radeon 8500'
wikisql
CREATE TABLE table_name_39 ( original_artist VARCHAR, week__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Original artist when the week number is top 9?
SELECT original_artist FROM table_name_39 WHERE week__number = "top 9"
sql_create_context
CREATE TABLE table_34904 ( "Driver" text, "Points" real, "Season" text, "Races" real, "Percentage of possible points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the average Points of the season driver Fernando Alonso had a percentage of...
SELECT AVG("Points") FROM table_34904 WHERE "Driver" = 'fernando alonso' AND "Percentage of possible points" = '53.05%'
wikisql
CREATE TABLE device ( device_id number, device text, carrier text, package_version text, applications text, software_platform text ) CREATE TABLE stock ( shop_id number, device_id number, quantity number ) CREATE TABLE shop ( shop_id number, shop_name text, location tex...
SELECT software_platform, COUNT(*) FROM device GROUP BY software_platform
spider
CREATE TABLE table_60289 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position does Barry Richter play?
SELECT "Position" FROM table_60289 WHERE "Player" = 'barry richter'
wikisql
CREATE TABLE table_name_66 ( year INTEGER, points VARCHAR, wins VARCHAR, class VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the mean year number where there are more than 0 wins, the class is 250cc, and the points are 95?
SELECT AVG(year) FROM table_name_66 WHERE wins > 0 AND class = "250cc" AND points = 95
sql_create_context
CREATE TABLE member ( Member_ID text, Name text, Nationality text, Role text ) CREATE TABLE performance ( Performance_ID real, Date text, Host text, Location text, Attendance int ) CREATE TABLE member_attendance ( Member_ID int, Performance_ID int, Num_of_Pieces int ) ...
SELECT Location, COUNT(Location) FROM performance GROUP BY Location ORDER BY COUNT(Location) DESC
nvbench
CREATE TABLE table_name_7 ( date VARCHAR, delta VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what Date is Delta 0:40?
SELECT date FROM table_name_7 WHERE delta = "0:40"
sql_create_context
CREATE TABLE table_name_58 ( home_team VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team has an Away team of carlton?
SELECT home_team FROM table_name_58 WHERE away_team = "carlton"
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb....
css
CREATE TABLE table_9163 ( "Rank" real, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total rank where the total is less than 5, and bronze is less than 0?
SELECT COUNT("Rank") FROM table_9163 WHERE "Total" < '5' AND "Bronze" < '0'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.formulary_drug_cd = "MIDO25"
mimicsql_data
CREATE TABLE table_name_90 ( award VARCHAR, year VARCHAR, category VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was awarded after 1947 in the category of, the best actor in a leading role?
SELECT award FROM table_name_90 WHERE year > 1947 AND category = "best actor in a leading role"
sql_create_context
CREATE TABLE table_name_11 ( pick INTEGER, position VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE HIGHEST PICK WITH A TE POSITION, AND ROUND SMALLER THAN 2?
SELECT MAX(pick) FROM table_name_11 WHERE position = "te" AND round < 2
sql_create_context
CREATE TABLE table_1341472_20 ( district VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many districts was Robert Livingston incumbent in?
SELECT COUNT(district) FROM table_1341472_20 WHERE incumbent = "Robert Livingston"
sql_create_context
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, ...
SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'third spacing' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-4 year')) AS t1) ...
eicu
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) 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, ...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Ryan Kellogg%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offe...
advising
CREATE TABLE table_40458 ( "Election" real, "First member" text, "First party" text, "Second member" text, "Second party" text, "Third member" text, "Third party" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the highest election w...
SELECT MAX("Election") FROM table_40458 WHERE "Third member" = 'sir robert price, bt' AND "First party" = 'conservative'
wikisql
CREATE TABLE apartment_bookings ( apt_booking_id number, apt_id number, guest_id number, booking_status_code text, booking_start_date time, booking_end_date time ) CREATE TABLE apartments ( apt_id number, building_id number, apt_type_code text, apt_number text, bathroom_coun...
SELECT T2.apt_number, T1.booking_start_date, T1.booking_start_date FROM apartment_bookings AS T1 JOIN apartments AS T2 ON T1.apt_id = T2.apt_id
spider
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT MIN(MED_AMOUT), MAX(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE MED_SER_ORG_NO = '5848543' AND IN_DIAG_DIS_CD = 'A46.X63')
css
CREATE TABLE table_27914606_1 ( written_by VARCHAR, us_viewers__millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who were the writers of the episode that had 5.56 millions of north american viewers?
SELECT written_by FROM table_27914606_1 WHERE us_viewers__millions_ = "5.56"
sql_create_context
CREATE TABLE table_27547 ( "Authority" text, "Rate or precept" text, "Budget limit (\u00a3m)" text, "Budget plans (\u00a3m)" text, "Rate limit (p)" text, "Rate change (%)" text, "Desired rate (p)" text, "Desired rate change (%)" text ) -- Using valid SQLite, answer the following questi...
SELECT "Desired rate (p)" FROM table_27547 WHERE "Rate limit (p)" = '50.33'
wikisql
CREATE TABLE table_24165 ( "Member countries" text, "Population" real, "Area (km\u00b2)" real, "GDP (billion US$)" text, "GDP per capita (US$)" real, "Languages" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the languages for estonia
SELECT "Languages" FROM table_24165 WHERE "Member countries" = 'Estonia'
wikisql
CREATE TABLE table_47487 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Event, when Round is '1', when Location is 'Osaka , Japan', ...
SELECT "Event" FROM table_47487 WHERE "Round" = '1' AND "Location" = 'osaka , japan' AND "Method" = 'tko (corner stoppage)'
wikisql
CREATE TABLE table_28930 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the incumbent for candidates Joseph Hiester (dr) 83.2% Roswell Well...
SELECT "Incumbent" FROM table_28930 WHERE "Candidates" = 'Joseph Hiester (DR) 83.2% Roswell Wells (F) 16.8%'
wikisql
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ...
WITH p AS (SELECT Id FROM Posts WHERE PostTypeId = 2), a AS (SELECT p.Id, SUM(CASE WHEN v.VoteTypeId = 2 THEN 1 ELSE 0 END) AS upvotes, SUM(CASE WHEN v.VoteTypeId = 3 THEN 1 ELSE 0 END) AS downvotes FROM p JOIN Votes AS v ON p.Id = v.PostId GROUP BY p.Id), m AS (SELECT upvotes, downvotes, COUNT(Id) AS cnt FROM a GROUP ...
sede
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CRE...
SELECT COUNT(DISTINCT AccountId) FROM Users
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 Badges ( Id number, UserId number, Name text, ...
SELECT V.PostId, P.OwnerUserId AS "user_link", P.Title, P.Body FROM Votes AS V, Posts AS P WHERE V.VoteTypeId = 10 AND DATEDIFF(month, V.CreationDate, GETDATE()) < 1 AND P.Id = V.PostId AND NOT P.FavoriteCount IS NULL AND (SELECT COUNT(V2.PostId) FROM Votes AS V2 WHERE V.VoteTypeId = 10 AND V2.PostId = P.Id) = 4 GROUP ...
sede
CREATE TABLE table_21475 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which championship had the final ...
SELECT "Championship" FROM table_21475 WHERE "Opponents in the final" = 'Nathalie Dechy Andy Ram'
wikisql
CREATE TABLE table_75019 ( "Version" text, "Length" text, "Album" text, "Remixed by" text, "Year" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the version shown for the Length of 4:58?
SELECT "Version" FROM table_75019 WHERE "Length" = '4:58'
wikisql
CREATE TABLE table_12037 ( "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. -- Which home team scored 9.13 (67)?
SELECT "Home team" FROM table_12037 WHERE "Home team score" = '9.13 (67)'
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 prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicaid" AND procedures.long_title = "Endoscopic excision or destruction of lesion or tissue of stomach"
mimicsql_data
CREATE TABLE table_name_50 ( election INTEGER, province VARCHAR, established VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average election result for the province of Grosseto from 1766 and prior?
SELECT AVG(election) FROM table_name_50 WHERE province = "grosseto" AND established < 1766
sql_create_context
CREATE TABLE table_name_56 ( school VARCHAR, county VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What school is in 41 Johnson county?
SELECT school FROM table_name_56 WHERE county = "41 johnson"
sql_create_context
CREATE TABLE table_name_93 ( score VARCHAR, high_points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the game in which P. Pierce (31) scored the most points, what was the final score?
SELECT score FROM table_name_93 WHERE high_points = "p. pierce (31)"
sql_create_context
CREATE TABLE field ( fieldid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename...
SELECT DISTINCT cite.citingpaperid FROM cite, paper WHERE paper.paperid = cite.citedpaperid GROUP BY cite.citingpaperid HAVING COUNT(DISTINCT cite.citedpaperid) >= 5
scholar
CREATE TABLE table_name_30 ( wins INTEGER, seasons VARCHAR, points VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the least amount of wins for Germany in the 1999 season having 0 points?
SELECT MIN(wins) FROM table_name_30 WHERE points = "0" AND country = "germany" AND seasons = "1999"
sql_create_context
CREATE TABLE table_59189 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( \u00a3 )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country has t6 as the place, with seve ballesteros as the player?
SELECT "Country" FROM table_59189 WHERE "Place" = 't6' AND "Player" = 'seve ballesteros'
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 * FROM qtb WHERE qtb.MED_SER_ORG_NO = '8417883' AND qtb.IN_HOSP_DATE BETWEEN '2014-10-07' AND '2015-04-15' AND qtb.PERSON_NM LIKE '郑%' UNION SELECT * FROM gyb WHERE gyb.MED_SER_ORG_NO = '8417883' AND gyb.IN_HOSP_DATE BETWEEN '2014-10-07' AND '2015-04-15' AND gyb.PERSON_NM LIKE '郑%' UNION SELECT * FROM zyb WHERE ...
css
CREATE TABLE table_14342480_6 ( points VARCHAR, field_goals VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of points for field goals being 1
SELECT COUNT(points) FROM table_14342480_6 WHERE field_goals = 1
sql_create_context
CREATE TABLE table_204_987 ( id number, "city/municipality" text, "no. of\nbarangays" number, "area\n(km2)" number, "population\n(2010 census)" number, "pop. density\n(per km2)" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many cities ha...
SELECT COUNT("city/municipality") FROM table_204_987 WHERE "no. of\nbarangays" >= 10
squall
CREATE TABLE table_2899987_2 ( region VARCHAR, owner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which regions are owned by estado de tabasco?
SELECT region FROM table_2899987_2 WHERE owner = "Estado de Tabasco"
sql_create_context
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE Comments ( Id number, PostId num...
SELECT CAST(Posts.CreationDate AS DATE) AS PostDate, COUNT(DISTINCT Users.Id) AS UserCount FROM Users LEFT JOIN Posts ON Users.Id = Posts.OwnerUserId WHERE Users.Reputation >= 1e4 AND Users.LastAccessDate >= DATEADD(year, -1, GETDATE()) AND Posts.CreationDate >= DATEADD(year, -1, GETDATE()) AND Posts.PostTypeId = 2 AND...
sede
CREATE TABLE table_22879323_9 ( location_attendance VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the location attendance for l 83 106 (ot)
SELECT location_attendance FROM table_22879323_9 WHERE score = "L 83–106 (OT)"
sql_create_context
CREATE TABLE Fault_Log_Parts ( fault_log_entry_id INTEGER, part_fault_id INTEGER, fault_status VARCHAR(10) ) CREATE TABLE Engineer_Skills ( engineer_id INTEGER, skill_id INTEGER ) CREATE TABLE Third_Party_Companies ( company_id INTEGER, company_type VARCHAR(5), company_name VARCHAR(255...
SELECT asset_make, COUNT(asset_make) FROM Assets GROUP BY asset_make ORDER BY COUNT(asset_make)
nvbench
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM ...
SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb 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 = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE person_i...
css
CREATE TABLE table_32548 ( "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the highest points for less than 78 laps and on grid 5?
SELECT MAX("Points") FROM table_32548 WHERE "Grid" = '5' AND "Laps" < '78'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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 te...
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '2121304' AND jybgb.BGRQ BETWEEN '2004-12-03' AND '2010-02-06' GROUP BY jybgb.KSBM HAVING COUNT(*) > 21) AS T
css
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
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 = "Diabetes with ketoacidosis, type I [juvenile type], not stated as uncontrolled" AND lab."CATEGORY" = "Chemistry...
mimicsql_data
CREATE TABLE table_38160 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the ICAO when the IATA shows mfm?
SELECT "ICAO" FROM table_38160 WHERE "IATA" = 'mfm'
wikisql
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, Creati...
SELECT p.Id AS "post_link", p.Score, p.CreationDate FROM Posts AS p WHERE STR_POSITION(p.Body, 'stack.imgur') > 0 ORDER BY p.CreationDate
sede
CREATE TABLE table_41973 ( "Animal" text, "Proto-Austronesian" text, "Proto-Malayo-Polynesian" text, "Proto-Oceanic" text, "Proto-Polynesian" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What proto-oceanic has louse as the animal?
SELECT "Proto-Oceanic" FROM table_41973 WHERE "Animal" = 'louse'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, ...
SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1372) AND NOT transfers.wardid IS NULL AND DATETIME(transfers.intime) <= DATETIME(CURRENT_TIME(), '-1 year') ORDER BY transfers.intime LIMIT 1
mimic_iii
CREATE TABLE table_24051050_1 ( episode VARCHAR, contest VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what episode did heat 1 take place?
SELECT episode FROM table_24051050_1 WHERE contest = "Heat 1"
sql_create_context
CREATE TABLE table_name_91 ( date VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was the game that had a score of 7 0?
SELECT date FROM table_name_91 WHERE score = "7–0"
sql_create_context
CREATE TABLE table_69992 ( "Year" real, "Name" text, "Genre" text, "Status" text, "Post" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what year has a Post of designer?
SELECT SUM("Year") FROM table_69992 WHERE "Post" = 'designer'
wikisql
CREATE TABLE film ( film_id number, title text, description text, release_year time, language_id number, original_language_id number, rental_duration number, rental_rate number, length number, replacement_cost number, rating text, special_features text, last_update ti...
SELECT T2.country FROM city AS T1 JOIN country AS T2 ON T1.country_id = T2.country_id GROUP BY T2.country_id HAVING COUNT(*) >= 3
spider
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT COUNT(DISTINCT Id) AS NewUsers, AVG(Reputation) AS AvgRep FROM Users WHERE CreationDate BETWEEN '2012-10-19' AND '2012-11-09'
sede
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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), CO...
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(EMPLOYEE_ID) DESC
nvbench
CREATE TABLE table_name_98 ( venue VARCHAR, result VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was there a result of 4-5 and a score of 1-1?
SELECT venue FROM table_name_98 WHERE result = "4-5" AND score = "1-1"
sql_create_context
CREATE TABLE table_1908877_2 ( top_division_titles VARCHAR, position_in_2012_13 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many clubs achieved the 5th position in 2012-13?
SELECT COUNT(top_division_titles) FROM table_1908877_2 WHERE position_in_2012_13 = "5th"
sql_create_context
CREATE TABLE table_75687 ( "Year" real, "Winner" text, "Jockey" text, "Trainer" text, "Owner" text, "Distance (Miles)" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What horse won with a trainer of 'no race'?
SELECT "Winner" FROM table_75687 WHERE "Trainer" = 'no race'
wikisql
CREATE TABLE table_name_69 ( laps INTEGER, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the lowest laps of grid 17?
SELECT MIN(laps) FROM table_name_69 WHERE grid = 17
sql_create_context
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...
SELECT * FROM hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.zyjzjlb...
css
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 person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN mzjzjlb 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 person_info_hz_info.KH = hz_info.KH AND ...
css
CREATE TABLE table_78929 ( "Elector" text, "Place of birth" text, "Cardinalatial title" text, "Elevated" text, "Elevator" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Elevator of the Elected Elevated on September 21, 1179?
SELECT "Elevator" FROM table_78929 WHERE "Elevated" = 'september 21, 1179'
wikisql
CREATE TABLE table_65391 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score for place 4?
SELECT "Score" FROM table_65391 WHERE "Place" = '4'
wikisql
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 text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT prescriptions.drug, prescriptions.formulary_drug_cd FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Frank Gregory"
mimicsql_data
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, ic...
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 = '006-80884')) AND intakeoutput.cellpath LIKE '%output%' ORDER...
eicu
CREATE TABLE table_17818 ( "Club" text, "Played" text, "Won" 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 follo...
SELECT "Played" FROM table_17818 WHERE "Points for" = '438'
wikisql
CREATE TABLE table_name_10 ( score VARCHAR, visitor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the scory when calgary was visiting?
SELECT score FROM table_name_10 WHERE visitor = "calgary"
sql_create_context
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text )...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHING...
atis
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(gwyjzb.PERSON_ID) FROM gwyjzb WHERE gwyjzb.IN_DIAG_DIS_CD = 'L35.977' UNION SELECT COUNT(fgwyjzb.PERSON_ID) FROM fgwyjzb WHERE fgwyjzb.IN_DIAG_DIS_CD = 'L35.977'
css
CREATE TABLE table_64162 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the match that resulted in a win in 4:16 ...
SELECT "Location" FROM table_64162 WHERE "Res." = 'win' AND "Time" = '4:16'
wikisql
CREATE TABLE table_name_29 ( rank VARCHAR, nationality VARCHAR, react VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank of the player from Ukraine with react less than 0.26?
SELECT COUNT(rank) FROM table_name_29 WHERE nationality = "ukraine" AND react < 0.26
sql_create_context
CREATE TABLE table_18732 ( "School" text, "Location" text, "Founded" real, "Affiliation" text, "Mascot" text, "Division" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many teams have an eagles mascot?
SELECT COUNT("Affiliation") FROM table_18732 WHERE "Mascot" = 'Eagles'
wikisql
CREATE TABLE qtb ( CLINIC_ID 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, INSU_TYPE text, IN...
SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '89232453' AND t_kc22.STA_DATE BETWEEN '2013-04-26' AND '2016-08-03' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_I...
css
CREATE TABLE table_29709 ( "Conference" text, "Old membership total" real, "New membership total" real, "Net change" text, "Members added" real, "Members lost" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest number of members l...
SELECT MIN("Members lost") FROM table_29709 WHERE "Net change" = '−1'
wikisql
CREATE TABLE wdmzjzjlb ( 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...
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE person_info.XM = '张秀媛' AND NOT ...
css
CREATE TABLE table_41119 ( "Issue" text, "Date" text, "Title" text, "Story" text, "Color" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What story title was included in Issue #8?
SELECT "Story" FROM table_41119 WHERE "Issue" = '#8'
wikisql
CREATE TABLE table_name_24 ( backed_with VARCHAR, record_label VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the Backed after 2008 with a label of Wild World?
SELECT backed_with FROM table_name_24 WHERE record_label = "wild world" AND date > 2008
sql_create_context
CREATE TABLE table_70699 ( "Race" text, "Position" text, "Time (HH:MM:SS)" text, "Speed (Mph)" text, "Replica" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Replica has a race of supersport race 1?
SELECT "Replica" FROM table_70699 WHERE "Race" = 'supersport race 1'
wikisql
CREATE TABLE table_name_52 ( record VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the record for april 22
SELECT record FROM table_name_52 WHERE date = "april 22"
sql_create_context
CREATE TABLE submission ( Submission_ID int, Scores real, Author text, College text ) CREATE TABLE workshop ( Workshop_ID int, Date text, Venue text, Name text ) CREATE TABLE Acceptance ( Submission_ID int, Workshop_ID int, Result text ) -- Using valid SQLite, answer the ...
SELECT Author, COUNT(DISTINCT T1.Workshop_ID) FROM Acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID
nvbench
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT PRESCRIPTION_CODE, PRESCRIPTION_ID FROM t_kc22 WHERE MED_EXP_DET_ID = '18978368931'
css
CREATE TABLE table_name_27 ( dates VARCHAR, lifetime_achievement VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what dates did Jim Jarmusch win the Lifetime Achievement?
SELECT dates FROM table_name_27 WHERE lifetime_achievement = "jim jarmusch"
sql_create_context
CREATE TABLE table_name_72 ( score VARCHAR, visitor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Score has a Visitor of atlanta?
SELECT score FROM table_name_72 WHERE visitor = "atlanta"
sql_create_context
CREATE TABLE table_14623167_1 ( virtual VARCHAR, network VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the virtual for Fox
SELECT COUNT(virtual) FROM table_14623167_1 WHERE network = "Fox"
sql_create_context
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 WHERE demographic.diagnosis = "GUILLAIN BARRE SYNDROME" AND demographic.dob_year < "2076"
mimicsql_data
CREATE TABLE table_name_42 ( high_points VARCHAR, location_attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the high points at the United Center 20,389?
SELECT high_points FROM table_name_42 WHERE location_attendance = "united center 20,389"
sql_create_context
CREATE TABLE table_25459168_2 ( circuit VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What circuit was used on August 21?
SELECT circuit FROM table_25459168_2 WHERE date = "August 21"
sql_create_context
CREATE TABLE txmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM txmzjzjlb JOIN jybgb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE txmzjzjlb.YLJGDM = '1746368' AND jybgb.BGRQ BETWEEN '2007-03-29' AND '2008-04-25' GROUP BY jybgb.KSBM HAVING COUNT(*) > 28 UNION SELECT jybgb.KSBM FROM ftxmzjzjlb ...
css
CREATE TABLE debate ( Date VARCHAR, Num_of_Audience INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the dates of debates with number of audience bigger than 150
SELECT Date FROM debate WHERE Num_of_Audience > 150
sql_create_context
CREATE TABLE table_44911 ( "Team" text, "Manager" text, "Home city" text, "Stadium" text, "Capacity" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the capacity when the home city is zagreb and the manager is zlatko kranj ar?
SELECT AVG("Capacity") FROM table_44911 WHERE "Home city" = 'zagreb' AND "Manager" = 'zlatko kranjčar'
wikisql
CREATE TABLE table_73141 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the result for first elected being 1992
SELECT "Result" FROM table_73141 WHERE "First elected" = '1992'
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...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.religion = "PROTESTANT QUAKER" AND demographic.dob_year < "2023"
mimicsql_data
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE Tags ( Id num...
SELECT T.Month, (T.QuestionCount - T.UnansweredCount) / CAST(T.QuestionCount AS FLOAT) AS AnswerRate FROM (SELECT CAST(CAST(TIME_TO_STR(CreationDate, '%YEAR') AS TEXT) + '-' + CAST(TIME_TO_STR(CreationDate, '%-mONT%-H') AS TEXT) + '-01' AS DATETIME) AS "Month", SUM(CAST(CASE WHEN AnswerCount = 0 THEN 1 ELSE 0 END AS IN...
sede
CREATE TABLE table_43479 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game Site" text, "Record" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the game against San Francisco 49ers bef...
SELECT "Result" FROM table_43479 WHERE "Week" < '16' AND "Opponent" = 'san francisco 49ers'
wikisql
CREATE TABLE table_2941848_2 ( pregame_analysts VARCHAR, trophy_presentation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every pregame analyst with Chris Rose as trophy presenter?
SELECT pregame_analysts FROM table_2941848_2 WHERE trophy_presentation = "Chris Rose"
sql_create_context
CREATE TABLE table_50423 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many tim...
SELECT "Drawn" FROM table_50423 WHERE "Lost" < '12' AND "Goal Difference" = '+20'
wikisql