instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type text ) CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working...
SELECT Work_Type, AVG(Years_working) FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_ID = t2.journalist_ID GROUP BY t2.Work_Type ORDER BY AVG(Years_working)
nvbench
CREATE TABLE table_name_87 ( round INTEGER, name VARCHAR, pick VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many rounds have john o'day as the name, and a pick less than 3?
SELECT SUM(round) FROM table_name_87 WHERE name = "john o'day" AND pick < 3
sql_create_context
CREATE TABLE table_name_98 ( ended VARCHAR, loan_club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- when was the loan ended when the loan club is spartak moscow?
SELECT ended FROM table_name_98 WHERE loan_club = "spartak moscow"
sql_create_context
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2146" AND diagnoses.long_title = "Nephritis and nephropathy, not specified as acute or chronic, with unspecified pathological lesion in kidney"
mimicsql_data
CREATE TABLE table_name_16 ( place VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What place has Wales as a country?
SELECT place FROM table_name_16 WHERE country = "wales"
sql_create_context
CREATE TABLE table_54021 ( "Rank" real, "Name" text, "Film" text, "Year" text, "Date of Birth" text, "Date of Award" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What film was made in 1999?
SELECT "Film" FROM table_54021 WHERE "Year" = '1999'
wikisql
CREATE TABLE table_20255 ( "English country name" text, "Arabic romanised country name" text, "Arabic country name" text, "English capital name" text, "Arabic romanised capital name" text, "Arabic capital name" text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT "Arabic capital name" FROM table_20255 WHERE "English capital name" = 'Manama'
wikisql
CREATE TABLE table_name_1 ( venue VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the venue for 27th position
SELECT venue FROM table_name_1 WHERE position = "27th"
sql_create_context
CREATE TABLE table_55103 ( "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. -- When South Melbourne was the home team, who was ...
SELECT "Away team" FROM table_55103 WHERE "Home team" = 'south melbourne'
wikisql
CREATE TABLE table_14337 ( "Club" text, "Visa 1" text, "Visa 2" text, "Visa 3" text, "Visa 4" text, "Visa 5" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Visa 3 has a Visa 4 of youssouf hersi?
SELECT "Visa 3" FROM table_14337 WHERE "Visa 4" = 'youssouf hersi'
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, ...
SELECT DISTINCT PostHistory.PostId AS "post_link", url = 'site://posts/' + CAST(PostHistory.PostId AS TEXT) + '/revisions', Posts.OwnerUserId AS "user_link", Posts.CreationDate, Posts.LastActivityDate, Posts.Tags FROM PostHistory INNER JOIN Posts ON PostHistory.PostId = Posts.Id WHERE PostHistoryTypeId IN (3, 6, 9) AND...
sede
CREATE TABLE table_204_381 ( id number, "sum" number, "mongolian" number, "population\n(2005)" number, "population\n(2008)" number, "population\n(2009)" number, "area\nkm2" number, "density\n/km2" number, "sum centre\npopulation" number ) -- Using valid SQLite, answer the following...
SELECT COUNT("sum") FROM table_204_381 WHERE "population\n(2009)" > 10000
squall
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ...
SELECT * FROM Posts WHERE PostTypeId = 1 AND NOT ClosedDate IS NULL AND Score >= 250 OR ViewCount >= 150000 AND CreationDate BETWEEN '2008-01-01' AND '2009-01-01' LIMIT 100
sede
CREATE TABLE table_60165 ( "Year" real, "Championship" text, "Partnering" text, "Opponents in Final" text, "Score in Final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What championship tournament did Ronald Vink play in with maikel scheffers as ...
SELECT "Championship" FROM table_60165 WHERE "Partnering" = 'maikel scheffers' AND "Year" > '2007' AND "Opponents in Final" = 'stephane houdet nicolas peiffer'
wikisql
CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
SELECT DISTINCT name, number FROM course WHERE credits = 15 AND department = 'EECS'
advising
CREATE TABLE PostHistoryTypes ( Id number, Name text ) 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 T...
SELECT TIME_TO_STR(p.CreationDate, '%Y') AS "year", COUNT(*) AS "# questions" FROM Posts AS p JOIN Users AS u ON u.Id = p.OwnerUserId WHERE p.Body LIKE '%##SpecifiedText##%' AND p.PostTypeId = 1 GROUP BY TIME_TO_STR(p.CreationDate, '%Y') ORDER BY year DESC
sede
CREATE TABLE table_name_53 ( unit VARCHAR, location VARCHAR, authors VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What unit is located in China and has Zhou Zhang as an author?
SELECT unit FROM table_name_53 WHERE location = "china" AND authors = "zhou zhang"
sql_create_context
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY ...
SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID
nvbench
CREATE TABLE table_6801 ( "County" text, "Obama%" text, "Obama#" real, "McCain%" text, "McCain#" real, "Others%" text, "Others#" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number of votes for McCain in a county that v...
SELECT MAX("McCain#") FROM table_6801 WHERE "Others%" = '1.6%' AND "McCain%" = '40.5%' AND "Obama#" < '256,299'
wikisql
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
SELECT Id, DisplayName, Reputation, Location, WebsiteUrl, REPLACE(REPLACE(AboutMe, CHAR(13), ''), CHAR(10), '') AS AboutMe FROM Users WHERE AboutMe IS NULL ORDER BY Reputation DESC LIMIT 10
sede
CREATE TABLE furniture_manufacte ( Manufacturer_ID int, Furniture_ID int, Price_in_Dollar real ) CREATE TABLE furniture ( Furniture_ID int, Name text, Num_of_Component int, Market_Rate real ) CREATE TABLE manufacturer ( Manufacturer_ID int, Open_Year real, Name text, Num_of...
SELECT Name, Price_in_Dollar FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID
nvbench
CREATE TABLE table_204_294 ( id number, "date" text, "time" text, "opponent#" text, "rank#" text, "site" text, "tv" text, "result" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which game was higher scoring by n...
SELECT "date" FROM table_204_294 WHERE "date" IN ('september 1', 'september 8') ORDER BY "result" DESC LIMIT 1
squall
CREATE TABLE table_64550 ( "Country" text, "Tourist arrivals (2011) (Millions)" real, "Tourism receipts (2011) (Millions of US$)" real, "Tourism receipts (2011) (US$ per arrival)" real, "Tourism receipts (2011) (US$ per capita)" real, "Tourism receipts (2003) (as % of GDP)" text, "Tourism re...
SELECT MAX("Tourism receipts (2011) (US$ per capita)") FROM table_64550 WHERE "Tourism receipts (2003) (as % of GDP)" = '19.4' AND "Tourism receipts (2011) (US$ per arrival)" < '655'
wikisql
CREATE TABLE table_name_77 ( events INTEGER, top_10 VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest number of events a tournament with more than 1 top-10 and more than 0 wins has?
SELECT MIN(events) FROM table_name_77 WHERE top_10 > 1 AND wins > 0
sql_create_context
CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIGH_DEGREE varchar(5) ) CREATE TABLE DEPARTME...
SELECT DEPT_CODE, SUM(CRS_CREDIT) FROM COURSE GROUP BY DEPT_CODE
nvbench
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( la...
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-127262')) AND medication.routeadmin = 'sub-q' AND DATETIME(medi...
eicu
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.MED_ORG_DEPT_NM, gwyjzb.OUT_DIAG_DIS_CD, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '1383573' GROUP BY gwyjzb.MED_ORG_DEPT_NM, gwyjzb.OUT_DIAG_DIS_CD UNION SELECT fgwyjzb.MED_ORG_DEPT_NM, fgwyjzb.OUT_DIAG_DIS_CD, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '13...
css
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 COUNT(DISTINCT MED_SER_ORG_NO) FROM t_kc21 WHERE PERSON_ID = '35830097' AND IN_HOSP_DATE BETWEEN '2010-05-05' AND '2011-01-04'
css
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
SELECT DISTINCT course_offering.start_time FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'LHC' AND course.num...
advising
CREATE TABLE medicine ( FDA_approved VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many distinct FDA approval statuses are there for the medicines?
SELECT COUNT(DISTINCT FDA_approved) FROM medicine
sql_create_context
CREATE TABLE zyb ( 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 = '86828604' AND t_kc22.STA_DATE BETWEEN '2019-04-10' AND '2019-04-22' AND t_kc22.SOC_SRT_DIRE_NM = '盐酸帕罗西汀片' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_ID = ...
css
CREATE TABLE election ( Votes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the votes of elections in descending order.
SELECT Votes FROM election ORDER BY Votes DESC
sql_create_context
CREATE TABLE table_name_14 ( director VARCHAR, year VARCHAR, role VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What director directed the role of shelby barret wyatt in 1935?
SELECT director FROM table_name_14 WHERE year = 1935 AND role = "shelby barret wyatt"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number,...
SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '韦文心' AND NOT mzjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ <= '2006-05-29')
css
CREATE TABLE table_name_88 ( part_1 VARCHAR, part_4 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When is Part 1, when Part 4 is on February 10, 2008?
SELECT part_1 FROM table_name_88 WHERE part_4 = "february 10, 2008"
sql_create_context
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE patient ( uniquep...
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-38131')) AND medication.drugname = 'dextrose 50% 25 gram/50 ml syr' AN...
eicu
CREATE TABLE table_78107 ( "Date" text, "Winning Team" text, "Losing Team" text, "Score" text, "Venue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the score on june 29 when the devil rays los?
SELECT "Score" FROM table_78107 WHERE "Losing Team" = 'devil rays' AND "Date" = 'june 29'
wikisql
CREATE TABLE table_name_84 ( tv_time VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the tv time for attendance of 69,551
SELECT tv_time FROM table_name_84 WHERE attendance = "69,551"
sql_create_context
CREATE TABLE table_47570 ( "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 IATA when the ICAO is wipp?
SELECT "IATA" FROM table_47570 WHERE "ICAO" = 'wipp'
wikisql
CREATE TABLE table_name_27 ( erp__analog__digital_ VARCHAR, region_served VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the ERP for the Rockhampton region?
SELECT erp__analog__digital_ FROM table_name_27 WHERE region_served = "rockhampton"
sql_create_context
CREATE TABLE Procedures ( Code INTEGER, Name VARCHAR(30), Cost REAL ) CREATE TABLE Appointment ( AppointmentID INTEGER, Patient INTEGER, PrepNurse INTEGER, Physician INTEGER, Start DATETIME, End DATETIME, ExaminationRoom TEXT ) CREATE TABLE Prescribes ( Physician INTEGER, ...
SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Physician AS T2 ON T1.Physician = T2.EmployeeID GROUP BY Name
nvbench
CREATE TABLE submission ( Scores INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average score of submissions?
SELECT AVG(Scores) FROM submission
sql_create_context
CREATE TABLE table_name_6 ( total_tenure_rank VARCHAR, uninterrupted_time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total tenure rank of the person with an uninterrupted time of 49 years, 349 days?
SELECT total_tenure_rank FROM table_name_6 WHERE uninterrupted_time = "49 years, 349 days"
sql_create_context
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 COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '0244651' AND IN_HOSP_DATE BETWEEN '2002-05-16' AND '2016-06-25' AND IN_DIAG_DIS_CD <> OUT_DIAG_DIS_CD
css
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "86" AND diagnoses.icd9_code = "11284"
mimicsql_data
CREATE TABLE table_name_16 ( club VARCHAR, try_bonus VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What club has a Try Bonus of 8?
SELECT club FROM table_name_16 WHERE try_bonus = "8"
sql_create_context
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...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.dob_year > "2090"
mimicsql_data
CREATE TABLE table_name_44 ( pick INTEGER, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the highest drafted player that attended college at Virginia?
SELECT MAX(pick) FROM table_name_44 WHERE college = "virginia"
sql_create_context
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 t1.treatmentname FROM (SELECT treatment.treatmentname, COUNT(treatment.treatmenttime) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ...
eicu
CREATE TABLE race ( CLASS VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the race class with at least two races.
SELECT CLASS FROM race GROUP BY CLASS HAVING COUNT(*) >= 2
sql_create_context
CREATE TABLE table_33835 ( "Ship" text, "Built As" text, "Reclassified As" text, "Class" text, "Commissioned\u2013 Decommissioned" text, "NVR link" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where the built as is DLG-23, what is the class?
SELECT "Class" FROM table_33835 WHERE "Built As" = 'dlg-23'
wikisql
CREATE TABLE table_name_5 ( position VARCHAR, round VARCHAR, pick__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position has 7 as the round, with a pick # less than 214?
SELECT position FROM table_name_5 WHERE round = 7 AND pick__number < 214
sql_create_context
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, Revision...
SELECT a.OwnerUserId AS "user_link", a.OwnerDisplayName, SUM(a.Score) AS "total_score", COUNT(a.Id) AS "num_answers" FROM Posts AS a JOIN Posts AS q ON a.ParentId = q.Id WHERE a.PostTypeId = 2 AND q.Tags LIKE '%<##tagName##>%' AND a.CommunityOwnedDate IS NULL GROUP BY a.OwnerUserId, a.OwnerDisplayName ORDER BY SUM(a.Sc...
sede
CREATE TABLE table_35028 ( "Round" text, "Pick" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which pick's round was 5 when Kellen Davis was a player?
SELECT "Pick" FROM table_35028 WHERE "Round" = '5' AND "Player" = 'kellen davis'
wikisql
CREATE TABLE table_2091 ( "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. -- Name the college/junior club team for jimmy jones
SELECT "College/junior/club team" FROM table_2091 WHERE "Player" = 'Jimmy Jones'
wikisql
CREATE TABLE gyb ( 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_NM = '花和豫' AND t_kc22.STA_DATE BETWEEN '2009-01-20' AND '2018-02-07' AND t_kc22.SOC_SRT_DIRE_CD = '904255' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_NM = '花和豫' ...
css
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...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.days_stay = "30"
mimicsql_data
CREATE TABLE table_75622 ( "Source" text, "Date" text, "Goldberg" text, "Murray" text, "Silbert" text, "Undecided" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the poll with Goldberg at 26%?
SELECT "Date" FROM table_75622 WHERE "Goldberg" = '26%'
wikisql
CREATE TABLE table_name_12 ( became_acharya_on VARCHAR, name_of_acharya VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did acharya shree koshalendraprasadji maharaj become acharya?
SELECT became_acharya_on FROM table_name_12 WHERE name_of_acharya = "acharya shree koshalendraprasadji maharaj"
sql_create_context
CREATE TABLE table_name_3 ( week VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What week of the season was December 13?
SELECT week FROM table_name_3 WHERE date = "december 13"
sql_create_context
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...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.drug_type = "MAIN" AND lab.label = "Calculated TBG"
mimicsql_data
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, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dob_year < "2058"
mimicsql_data
CREATE TABLE Apartments ( bathroom_count INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the minimum and maximum number of bathrooms of all the apartments?
SELECT MIN(bathroom_count), MAX(bathroom_count) FROM Apartments
sql_create_context
CREATE TABLE table_name_83 ( left_office VARCHAR, minister VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the left office for enrico la loggia
SELECT left_office FROM table_name_83 WHERE minister = "enrico la loggia"
sql_create_context
CREATE TABLE table_name_81 ( event VARCHAR, games VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What event was in the 2008 Beijing games?
SELECT event FROM table_name_81 WHERE games = "2008 beijing"
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...
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid...
eicu
CREATE TABLE table_name_73 ( place VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What place is Spain in?
SELECT place FROM table_name_73 WHERE country = "spain"
sql_create_context
CREATE TABLE table_29411 ( "Athlete" text, "Event" text, "Round of 32" text, "Round of 16" text, "Quarterfinals" text, "Semifinals" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many semifinals did ferhat pehlivan attend?
SELECT COUNT("Semifinals") FROM table_29411 WHERE "Athlete" = 'Ferhat Pehlivan'
wikisql
CREATE TABLE table_250309_1 ( production__latest_figures_ VARCHAR, parent_company VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the production where the parent company is ariel?
SELECT production__latest_figures_ FROM table_250309_1 WHERE parent_company = "Ariel"
sql_create_context
CREATE TABLE table_65174 ( "Eliminated" text, "Tag Team" text, "Entered" real, "Eliminated by" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Tag Team with a Time of 03:34?
SELECT "Tag Team" FROM table_65174 WHERE "Time" = '03:34'
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.admityear < "2108"
mimicsql_data
CREATE TABLE table_name_75 ( recnet VARCHAR, class VARCHAR, power VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the RECNet belonging to Class A with a Power of 3,000 watts?
SELECT recnet FROM table_name_75 WHERE class = "a" AND power = "3,000 watts"
sql_create_context
CREATE TABLE table_name_61 ( pick INTEGER, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest pick when the college is saginaw valley state?
SELECT MAX(pick) FROM table_name_61 WHERE college = "saginaw valley state"
sql_create_context
CREATE TABLE table_60555 ( "Election" text, "1st Member" text, "1st Party" text, "2nd Member" text, "2nd Party" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What 2nd Member has an Election of 1833 by-election?
SELECT "2nd Member" FROM table_60555 WHERE "Election" = '1833 by-election'
wikisql
CREATE TABLE table_57947 ( "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. -- What was the name of the away team had a score o...
SELECT "Away team" FROM table_57947 WHERE "Away team score" = '17.15 (117)'
wikisql
CREATE TABLE table_name_97 ( results¹ VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the game against Luxembourg?
SELECT results¹ FROM table_name_97 WHERE opponent = "luxembourg"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.days_stay > "6"
mimicsql_data
CREATE TABLE table_18821196_1 ( country VARCHAR, tv_network_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every country with a TV network of AXN India?
SELECT country FROM table_18821196_1 WHERE tv_network_s_ = "AXN India"
sql_create_context
CREATE TABLE table_46832 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Rockets score" real, "Opponents" real, "Record" text, "Streak" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Opponent has a Rockets score larger...
SELECT "Opponent" FROM table_46832 WHERE "Rockets score" > '86' AND "Streak" = 'won 1' AND "Opponents" < '101'
wikisql
CREATE TABLE table_1137695_3 ( fastest_lap VARCHAR, grand_prix VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the fastest lap at the brazilian grand prix?
SELECT fastest_lap FROM table_1137695_3 WHERE grand_prix = "Brazilian grand_prix"
sql_create_context
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 MAIN_COND_DES FROM t_kc21 WHERE MED_CLINIC_ID = '99383862652'
css
CREATE TABLE table_56504 ( "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 in total have attended games at ...
SELECT SUM("Crowd") FROM table_56504 WHERE "Venue" = 'kardinia park'
wikisql
CREATE TABLE table_63053 ( "Rank" real, "Lane" real, "Athlete" text, "Country" text, "Time" real, "React" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest of the athlete from sri lanka who has a lane greater than 8?
SELECT MIN("React") FROM table_63053 WHERE "Country" = 'sri lanka' AND "Lane" > '8'
wikisql
CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, basePrice INTEGER, decor TEXT ) CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adul...
SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType ORDER BY COUNT(*)
nvbench
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_ID = '06203278' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '蜜炼川贝枇杷膏')
css
CREATE TABLE ship ( ship_id number, name text, type text, nationality text, tonnage number ) CREATE TABLE mission ( mission_id number, ship_id number, code text, launched_year number, location text, speed_knots number, fate text ) -- Using valid SQLite, answer the foll...
SELECT name FROM ship WHERE nationality = "United States" OR nationality = "United Kingdom"
spider
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, H...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc21_t_kc22.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '52950661' AND t_kc21.MED_SER_ORG_NO = '7572010' AND t_kc21.IN_HOSP_DATE BETWEEN '2004-10-25' AND '2018-02-18')
css
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 COUNT(*) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19175)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'lipids 20%' ...
mimic_iii
CREATE TABLE table_name_53 ( year_ceremony VARCHAR, english_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was Kelin nominated?
SELECT year_ceremony FROM table_name_53 WHERE english_title = "kelin"
sql_create_context
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25...
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE basketball_match ( team_id number, school_id number, team_name text, acc_regular_season text, acc_percent text, acc_home text, acc_road text, all_games text, all_games_percent number, all_home text, all_road text, all_neutral text ) CREATE TABLE university (...
SELECT acc_percent FROM basketball_match ORDER BY acc_percent DESC LIMIT 1
spider
CREATE TABLE table_name_88 ( player VARCHAR, goals_against_average VARCHAR, games_played VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who played 44 games who averaged over 2.07 goals against?
SELECT player FROM table_name_88 WHERE goals_against_average > 2.07 AND games_played = 44
sql_create_context
CREATE TABLE table_35565 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the game with a loss of Mercedes (0-1)?
SELECT "Score" FROM table_35565 WHERE "Loss" = 'mercedes (0-1)'
wikisql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDBM = 'F51.X21' AND jyjgzbb.JCZBMC = '血清铁'
css
CREATE TABLE table_name_75 ( competition VARCHAR, venue VARCHAR, notes VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Prior to 2004, what was the name of the competition that took place in Johannesburg, South Africa and had the 400 m hu...
SELECT competition FROM table_name_75 WHERE notes = "400 m hurdles" AND year < 2004 AND venue = "johannesburg, south africa"
sql_create_context
CREATE TABLE table_name_35 ( pole_position VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the pole position for 8 september
SELECT pole_position FROM table_name_35 WHERE date = "8 september"
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 demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Medicare" AND lab.label = "Amylase, Body Fluid"
mimicsql_data
CREATE TABLE table_47706 ( "Date" text, "Flight" text, "Aircraft" text, "Registration" text, "Location" text, "Fatalities" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the registration of tc-jes?
SELECT "Date" FROM table_47706 WHERE "Registration" = 'tc-jes'
wikisql
CREATE TABLE table_35436 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Last match" text, "Replaced by" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the last match that had a sa...
SELECT "Last match" FROM table_35436 WHERE "Manner of departure" = 'sacked' AND "Outgoing manager" = 'geninho'
wikisql
CREATE TABLE table_204_430 ( id number, "model" text, "origin" text, "type" text, "version" text, "in service" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what two models are only from the philippines ?
SELECT "model" FROM table_204_430 WHERE "origin" = 'philippines'
squall