instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid nu...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ...
mimic_iii
CREATE TABLE table_27722408_10 ( record VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of record for 61
SELECT COUNT(record) FROM table_27722408_10 WHERE game = 61
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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "BLACK/HAITIAN" AND procedures.short_title = "Bone marrow biopsy"
mimicsql_data
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.long_title = "Angiocardiography of right heart structures"
mimicsql_data
CREATE TABLE table_1341423_40 ( candidates VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who are the candidates when the incumbent is lindsey graham?
SELECT candidates FROM table_1341423_40 WHERE incumbent = "Lindsey Graham"
sql_create_context
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, star...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Spanish for the Professions%' OR course.description LIKE '%Spanish for the Professions%' OR cour...
advising
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 = '1165324' AND IN_HOSP_DATE BETWEEN '2002-04-26' AND '2008-06-23' AND INSU_TYPE = '儿童'
css
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CRE...
SELECT * FROM Users
sede
CREATE TABLE table_63383 ( "TIME" text, "ATHLETE" text, "SCHOOL" text, "CITY" text, "DATE" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Date of the Athlete from Ferris High School?
SELECT "DATE" FROM table_63383 WHERE "SCHOOL" = 'ferris high school'
wikisql
CREATE TABLE artist ( artist_id number, name text, country text, year_join number, age number ) CREATE TABLE exhibition ( exhibition_id number, year number, theme text, artist_id number, ticket_price number ) CREATE TABLE exhibition_record ( exhibition_id number, date t...
SELECT T2.name, COUNT(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id GROUP BY T1.artist_id
spider
CREATE TABLE table_40451 ( "Constituency" text, "Michael D. Higgins" text, "Se\u00e1n Gallagher" text, "Martin McGuinness" text, "Gay Mitchell" text, "David Norris" text, "Dana Rosemary Scallon" text, "Mary Davis" text ) -- Using valid SQLite, answer the following questions for the tab...
SELECT "Martin McGuinness" FROM table_40451 WHERE "Se\u00e1n Gallagher" = '29.6%'
wikisql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, va...
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 = 'protein') AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-6 year'))
mimic_iii
CREATE TABLE member ( Name VARCHAR, Member_ID VARCHAR ) CREATE TABLE round ( Decoration_Theme VARCHAR, Member_ID VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the names of members and the decoration themes they have.
SELECT T1.Name, T2.Decoration_Theme FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID
sql_create_context
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2123" AND lab."CATEGORY" = "Chemistry"
mimicsql_data
CREATE TABLE table_name_91 ( maximum_seating_capacity VARCHAR, arena_venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the maximum capacity of the San Agustin Gym?
SELECT maximum_seating_capacity FROM table_name_91 WHERE arena_venue = "san agustin gym"
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 intakeoutput ( in...
SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-79017' AND patient.hospitaldischargetime IS NULL))
eicu
CREATE TABLE table_58615 ( "Rank 2014" real, "Rank 2013" real, "Mvmt" text, "Club" text, "Country" text, "2009\u201310" real, "2010\u201311" real, "2011\u201312" real, "2012\u201313" real, "2013\u201314" real, "Coeff." real ) -- Using valid SQLite, answer the following ques...
SELECT AVG("2011\u201312") FROM table_58615 WHERE "2010\u201311" < '26.016' AND "Rank 2013" > '20' AND "Club" = 'rubin kazan'
wikisql
CREATE TABLE volume ( Volume_ID int, Volume_Issue text, Issue_Date text, Weeks_on_Top real, Song text, Artist_ID int ) CREATE TABLE music_festival ( ID int, Music_Festival text, Date_of_ceremony text, Category text, Volume int, Result text ) CREATE TABLE artist ( Ar...
SELECT Category, COUNT(Category) FROM music_festival WHERE Result = "Awarded" GROUP BY Category ORDER BY COUNT(Category)
nvbench
CREATE TABLE reservations ( code number, room text, checkin text, checkout text, rate number, lastname text, firstname text, adults number, kids number ) CREATE TABLE rooms ( roomid text, roomname text, beds number, bedtype text, maxoccupancy number, basepric...
SELECT SUM(beds) FROM rooms WHERE bedtype = 'King'
spider
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, Di...
SELECT Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Dandong%' ORDER BY Reputation DESC LIMIT 500
sede
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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...
SELECT jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.JZLSH = '97962620644'
css
CREATE TABLE table_1656555_1 ( ordained_priest VARCHAR, vacated_throne VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the archbishop who vacated the throne on August 18, 1885 ordained as a priest?
SELECT ordained_priest FROM table_1656555_1 WHERE vacated_throne = "August 18, 1885"
sql_create_context
CREATE TABLE table_name_49 ( game VARCHAR, home_team VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the game when Houston was the home team and the result is 106-104?
SELECT game FROM table_name_49 WHERE home_team = "houston" AND result = "106-104"
sql_create_context
CREATE TABLE table_34452 ( "Position" real, "Club (City/Town)" text, "Games Played" real, "W-L-D" text, "Goals For/Against" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the goals for/against of the club with 17 points?
SELECT "Goals For/Against" FROM table_34452 WHERE "Points" = '17'
wikisql
CREATE TABLE table_55292 ( "Entrant" text, "Constructor" text, "Chassis" text, "Engine" text, "Tyres" text, "Driver" text, "Rounds" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Constructor has Rounds, All and Driver, Bruno Giacomelli...
SELECT "Constructor" FROM table_55292 WHERE "Rounds" = 'all' AND "Driver" = 'bruno giacomelli'
wikisql
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 School_ID, All_Games_Percent FROM basketball_match GROUP BY ACC_Home
nvbench
CREATE TABLE technician ( technician_id real, Name text, Team text, Starting_Year real, Age int ) CREATE TABLE repair_assignment ( technician_id int, repair_ID int, Machine_ID int ) CREATE TABLE repair ( repair_ID int, name text, Launch_Date text, Notes text ) CREATE T...
SELECT Name, COUNT(Name) FROM technician WHERE Team <> "NYY" GROUP BY Name ORDER BY COUNT(Name) DESC
nvbench
CREATE TABLE table_name_53 ( gold INTEGER, total VARCHAR, silver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the gold medal count for the country with a total greater than 32 and more than 128 silvers?
SELECT AVG(gold) FROM table_name_53 WHERE total > 32 AND silver > 128
sql_create_context
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 EMPLOYEE_ID, MANAGER_ID FROM employees WHERE HIRE_DATE < '2002-06-21'
nvbench
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 prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "80126" AND prescriptions.route = "INHALATION"
mimicsql_data
CREATE TABLE table_28547332_4 ( highest_score INTEGER, average VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest score in those games where the average is 9.88?
SELECT MIN(highest_score) FROM table_28547332_4 WHERE average = "9.88"
sql_create_context
CREATE TABLE table_76268 ( "Governorate" text, "Capital City" text, "Area km\u00b2" real, "Pop (2004)" real, "Map Key" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Pop (2004) has a Governorate of al mahwit?
SELECT SUM("Pop (2004)") FROM table_76268 WHERE "Governorate" = 'al mahwit'
wikisql
CREATE TABLE table_36287 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Opponent has a Surface of hard on 28 august 1993?
SELECT "Opponent" FROM table_36287 WHERE "Surface" = 'hard' AND "Date" = '28 august 1993'
wikisql
CREATE TABLE time_slot ( time_slot_id text, day text, start_hr number, start_min number, end_hr number, end_min number ) CREATE TABLE student ( id text, name text, dept_name text, tot_cred number ) CREATE TABLE advisor ( s_id text, i_id text ) CREATE TABLE instructor (...
SELECT T1.title, T3.name FROM course AS T1 JOIN teaches AS T2 ON T1.course_id = T2.course_id JOIN instructor AS T3 ON T2.id = T3.id WHERE year = 2008 ORDER BY T1.title
spider
CREATE TABLE table_13391 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which High as...
SELECT "High assists" FROM table_13391 WHERE "Game" > '21' AND "Record" = '18-6'
wikisql
CREATE TABLE table_204_324 ( id number, "team 1" text, "agg." text, "team 2" text, "1st leg" text, "2nd leg" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total number of countries in this preliminary qualifying round
SELECT COUNT("team 1") + COUNT("team 2") FROM table_204_324
squall
CREATE TABLE table_203_661 ( id number, "year" number, "single" text, "peak chart positions\nus mod" number, "peak chart positions\nuk" number, "album" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which year has the most singles ?
SELECT "year" FROM table_203_661 GROUP BY "year" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_name_75 ( points VARCHAR, engine VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of points for the KV Racing Technology team when they use a chevrolet engine?
SELECT COUNT(points) FROM table_name_75 WHERE engine = "chevrolet" AND team = "kv racing technology"
sql_create_context
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE diagnoses_icd ( row_id numbe...
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR...
mimic_iii
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name
nvbench
CREATE TABLE table_26032940_2 ( main_cast VARCHAR, airdate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the cast on the 3/23/1963 episode?
SELECT main_cast FROM table_26032940_2 WHERE airdate = "3/23/1963"
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 WHERE demographic.age < "70" AND demographic.admityear < "2203"
mimicsql_data
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "6" AND procedures.long_title = "Procedure on single vessel"
mimicsql_data
CREATE TABLE table_43717 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the to par for Tom Weiskopf?
SELECT AVG("To par") FROM table_43717 WHERE "Player" = 'tom weiskopf'
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Enterococcus group d" AND lab.label = "Bands"
mimicsql_data
CREATE TABLE table_78209 ( "Date(s) conducted" text, "Polling organisation/client" text, "Cons" text, "Plaid Cymru" text, "Lib Dem" text, "Others" text, "Lead" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the dates conducted for pl...
SELECT "Date(s) conducted" FROM table_78209 WHERE "Plaid Cymru" = '19%'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_icd_diag...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'phosphate') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8116 AND admission...
mimic_iii
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 * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '...
css
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 All_Home, School_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY School_ID
nvbench
CREATE TABLE table_2673 ( "Year" real, "Network" text, "Race caller" text, "s Host" text, "s Analyst" text, "Reporters" text, "Trophy presentation" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the latest year with reporters Lesley ...
SELECT MAX("Year") FROM table_2673 WHERE "Reporters" = 'Lesley Visser and Robin Roberts'
wikisql
CREATE TABLE farm ( Farm_ID int, Year int, Total_Horses real, Working_Horses real, Total_Cattle real, Oxen real, Bulls real, Cows real, Pigs real, Sheep_and_Goats real ) CREATE TABLE farm_competition ( Competition_ID int, Year int, Theme text, Host_city_ID int, ...
SELECT Status, AVG(Population) FROM city GROUP BY Status ORDER BY AVG(Population) DESC
nvbench
CREATE TABLE table_name_24 ( tries_against VARCHAR, points_against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Having 429 points against, what is the Tries Against?
SELECT tries_against FROM table_name_24 WHERE points_against = "429"
sql_create_context
CREATE TABLE table_25794532_1 ( series VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the series for 68
SELECT series FROM table_25794532_1 WHERE points = "68"
sql_create_context
CREATE TABLE table_29198 ( "Rank" real, "Rider" text, "Sat 21 Aug" text, "Mon 23 Aug" text, "Tues 24 Aug" text, "Wed 25 Aug" text, "Thurs 26 Aug" text, "Fri 27 Aug" text, "Sat 28 Aug" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wh...
SELECT "Rider" FROM table_29198 WHERE "Tues 24 Aug" = '22'' 09.44 93.840mph'
wikisql
CREATE TABLE table_18422 ( "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. -- What district is incumbent frank chelf from?
SELECT "District" FROM table_18422 WHERE "Incumbent" = 'Frank Chelf'
wikisql
CREATE TABLE table_55244 ( "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. -- Name the venue for collingwood home team
SELECT "Venue" FROM table_55244 WHERE "Home team" = 'collingwood'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Personal history of malignant neoplasm of gastrointestinal tract, unspecified"
mimicsql_data
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 COUNT(*) FROM mzjzjlb WHERE mzjzjlb.YLJGDM = '3982250' AND mzjzjlb.JZKSRQ BETWEEN '2005-02-09' AND '2017-11-19' AND mzjzjlb.WDBZ > 0
css
CREATE TABLE table_name_31 ( dec___j2000__ VARCHAR, redshift__km__s__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Dec. (J2000) has a Redshift (km/ s) of 1331 3?
SELECT dec___j2000__ FROM table_name_31 WHERE redshift__km__s__ = "1331 ± 3"
sql_create_context
CREATE TABLE table_14070062_3 ( tries_for VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many tries for does Pontardawe RFC have?
SELECT tries_for FROM table_14070062_3 WHERE club = "Pontardawe RFC"
sql_create_context
CREATE TABLE table_name_99 ( record VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the Record that has the Score of 100-105?
SELECT record FROM table_name_99 WHERE score = "100-105"
sql_create_context
CREATE TABLE table_name_33 ( opponent_in_the_final VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Opponent In The Final, when Year is '1942'?
SELECT opponent_in_the_final FROM table_name_33 WHERE year = 1942
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "F" AND procedures.long_title = "Replacement of tube or enterostomy device of small intestine"
mimicsql_data
CREATE TABLE table_name_64 ( rank INTEGER, rider VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest rank for Peter Symes?
SELECT MAX(rank) FROM table_name_64 WHERE rider = "peter symes"
sql_create_context
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE Posts ( Id number, PostTypeId number, Accepted...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE Reputation BETWEEN '##MinRep##' AND '##MaxRep##' AND Age BETWEEN 16 AND 16 ORDER BY Reputation DESC
sede
CREATE TABLE table_55985 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average attendance on October 9, 1983?
SELECT AVG("Attendance") FROM table_55985 WHERE "Date" = 'october 9, 1983'
wikisql
CREATE TABLE table_39843 ( "District" text, "Incumbent" text, "Party" text, "Elected" real, "Status" text, "2008 Candidates" text, "Results" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the Incumbent with Results of 68% 32%?
SELECT "Incumbent" FROM table_39843 WHERE "Results" = '68% 32%'
wikisql
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '88686860' AND t_kc22.STA_DATE BETWEEN '2015-07-07' AND '2018-02-18' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE table_11304 ( "Player" text, "Position" text, "Tries" real, "Goals" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of Tries with less than 28 Points for Mike Forshaw?
SELECT AVG("Tries") FROM table_11304 WHERE "Player" = 'mike forshaw' AND "Points" < '28'
wikisql
CREATE TABLE table_name_86 ( visitor VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the visiting team when the record was 28 14 6 2?
SELECT visitor FROM table_name_86 WHERE record = "28–14–6–2"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'treatment of hypercalcemia - bisphosphonates') AS t1 JOIN (SELECT patient.uniquepid, medication.drugstarttim...
eicu
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, u...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT intakeoutput.patientunitstayid FROM intakeoutput WHERE intakeoutput.celllabel = 'volume given (ml)' AND intakeoutput.cellpath LIKE '%input%' AND DATETIME(intakeoutput.intakeoutputtime) >= DATETIME(CURRENT_TIME(), '-4 year')...
eicu
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2112.0" AND prescriptions.formulary_drug_cd = "INSULIN"
mimicsql_data
CREATE TABLE table_name_62 ( total VARCHAR, gold VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many totals have a Gold larger than 0, and a Bronze smaller than 0?
SELECT COUNT(total) FROM table_name_62 WHERE gold > 0 AND bronze < 0
sql_create_context
CREATE TABLE ship ( ship_id number, name text, type text, built_year number, class text, flag text ) CREATE TABLE captain ( captain_id number, name text, ship_id number, age text, class text, rank text ) -- Using valid SQLite, answer the following questions for the tab...
SELECT name, flag FROM ship WHERE NOT ship_id IN (SELECT ship_id FROM captain WHERE rank = 'Midshipman')
spider
CREATE TABLE table_name_50 ( playoffs VARCHAR, points VARCHAR, head_coach VARCHAR, finish VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the playoff status when the head coach was Brent Sutter, the finish was 4th central, and the points were...
SELECT playoffs FROM table_name_50 WHERE head_coach = "brent sutter" AND finish = "4th central" AND points = "82"
sql_create_context
CREATE TABLE mzjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, ...
SELECT zyjybgb.JYKSBM, zyjybgb.JYKSMC FROM zyjybgb WHERE zyjybgb.BGDH = '00456578648' UNION SELECT mzjybgb.JYKSBM, mzjybgb.JYKSMC FROM mzjybgb WHERE mzjybgb.BGDH = '00456578648'
css
CREATE TABLE table_31670 ( "Year" text, "Broadcast date" text, "BBC One total viewing" text, "BBC One Rank" text, "BBC Two total viewing" text, "BBC Two Rank" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much is the total BBC 2 viewing in ...
SELECT "BBC Two total viewing" FROM table_31670 WHERE "Year" = '1999'
wikisql
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 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 = '0652199' AND OUT_DIAG_DIS_CD = 'H88.444')
css
CREATE TABLE table_17449 ( "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's Dave Fortier's pick number?
SELECT COUNT("Pick #") FROM table_17449 WHERE "Player" = 'Dave Fortier'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND procedures.icd9_code = "3892"
mimicsql_data
CREATE TABLE table_21266 ( "Athlete" text, "Event" text, "Swim (1.5km)" text, "Trans 1" text, "Bike (40km)" text, "Trans 2" text, "Run (10km)" text, "Total Time" text, "Rank" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the...
SELECT "Athlete" FROM table_21266 WHERE "Bike (40km)" = '58:52'
wikisql
CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER ) CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, baseP...
SELECT decor, AVG(basePrice) FROM Rooms GROUP BY decor
nvbench
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city v...
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%ENDODONT%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id
advising
CREATE TABLE table_778 ( "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. -- Who was the incumbent when henry e. barbour ran?
SELECT "Candidates" FROM table_778 WHERE "Incumbent" = 'Henry E. Barbour'
wikisql
CREATE TABLE table_66075 ( "Period" text, "Internet Explorer" text, "Firefox" text, "Chrome" text, "Safari" text, "Opera" text, "Other Mozilla" text, "Mobile" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What percentage of users were u...
SELECT "Internet Explorer" FROM table_66075 WHERE "Mobile" = '2.1%'
wikisql
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD...
SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '80665777' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2001-06-23' AND '2021-06-24' AND t_kc22.MED_INV_ITEM_TYPE = '手术费'
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 AVG(demographic.age) FROM demographic WHERE demographic.diagnosis = "COMPLETE HEART BLOCK" AND demographic.days_stay = "27"
mimicsql_data
CREATE TABLE table_name_82 ( surface VARCHAR, partner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Surface has a Partner of oliver marach?
SELECT surface FROM table_name_82 WHERE partner = "oliver marach"
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 hz_info ( KH text, KLX number...
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzb...
css
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE ta ( campus_job_id int,...
SELECT COUNT(instructor.name), instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'ORALHEAL' AND course.number = 990 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id ...
advising
CREATE TABLE table_11961582_4 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the game played on December 8?
SELECT score FROM table_11961582_4 WHERE date = "December 8"
sql_create_context
CREATE TABLE table_24638867_6 ( surface VARCHAR, partner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the surface for nathalie tauziat
SELECT surface FROM table_24638867_6 WHERE partner = "Nathalie Tauziat"
sql_create_context
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 Score, COALESCE(ViewCount, 0) AS ViewCount, COUNT(*) AS numResps FROM Posts WHERE PostTypeId = 1 GROUP BY Score, COALESCE(ViewCount, 0)
sede
CREATE TABLE table_name_67 ( game__number INTEGER, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What game number was played on March 4?
SELECT AVG(game__number) FROM table_name_67 WHERE date = "march 4"
sql_create_context
CREATE TABLE table_13983 ( "Draw" real, "Language" text, "Artist" text, "Song" text, "English translation" text, "Place" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is Croatian spoken?
SELECT "Place" FROM table_13983 WHERE "Language" = 'croatian'
wikisql
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 patient ( ...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'chronic kidney ...
eicu
CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, ...
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 = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN...
atis
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 SUM(t_kc22.AMOUNT) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '姜舒方' AND gwyjzb.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2005-02-06' AND '2017-08-25' AND t_kc22.MED_INV_ITEM_TYPE = '手术费' UNION SELECT SUM(t_kc22.AMOUNT) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb...
css
CREATE TABLE table_26321719_1 ( population_density VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every population density if name is Beaubassin East?
SELECT population_density FROM table_26321719_1 WHERE name = "Beaubassin East"
sql_create_context