instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime t...
SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 3369 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'alcohol...
mimic_iii
CREATE TABLE table_76531 ( "Date" text, "Opponent" text, "Score" text, "Result" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Opponent of the game with a Score of 74-66?
SELECT "Opponent" FROM table_76531 WHERE "Score" = '74-66'
wikisql
CREATE TABLE Students ( student_id INTEGER, address_id INTEGER, first_name VARCHAR(80), middle_name VARCHAR(40), last_name VARCHAR(40), cell_mobile_number VARCHAR(40), email_address VARCHAR(40), date_first_rental DATETIME, date_left_university DATETIME, other_student_details VARC...
SELECT date_address_to, SUM(monthly_rental) FROM Student_Addresses GROUP BY date_address_to ORDER BY monthly_rental DESC
nvbench
CREATE TABLE table_10706961_2 ( rd VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Rd took place at the Indianapolis 500?
SELECT rd FROM table_10706961_2 WHERE name = "Indianapolis 500"
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.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb...
css
CREATE TABLE Student_Addresses ( student_id INTEGER, address_id INTEGER, date_address_from DATETIME, date_address_to DATETIME, monthly_rental DECIMAL(19,4), other_details VARCHAR(255) ) CREATE TABLE Students ( student_id INTEGER, address_id INTEGER, first_name VARCHAR(80), middl...
SELECT other_details, SUM(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC
nvbench
CREATE TABLE table_2285 ( "Type" text, "Beam height (mm)" real, "Flange width (mm)" real, "Web thickness (mm)" text, "Flange thickness (mm)" text, "Weight (kg/m)" text, "Cross-section area (cm 2 )" text, "Moment of inertia in torsion (J) (cm 4 )" text ) -- Using valid SQLite, answer th...
SELECT "Weight (kg/m)" FROM table_2285 WHERE "Cross-section area (cm 2 )" = '25.3'
wikisql
CREATE TABLE table_name_36 ( home_team VARCHAR, road_team VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the home team on April 20 against Boston?
SELECT home_team FROM table_name_36 WHERE road_team = "boston" AND date = "april 20"
sql_create_context
CREATE TABLE table_57093 ( "car plates (since 1937)" text, "Voivodeship Separate city" text, "Capital" text, "Area in 1000km\u00b2 (1930)" text, "Population in 1000 (1931)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the capital with the ...
SELECT "Capital" FROM table_57093 WHERE "Voivodeship Separate city" = 'białostockie'
wikisql
CREATE TABLE table_9574 ( "Year" real, "Character" text, "Title" text, "Author" text, "Artist" text, "Imprint" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the character when the artist is take and the year is before 2006?
SELECT "Character" FROM table_9574 WHERE "Artist" = 'take' AND "Year" < '2006'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT demographic.discharge_location, demographic.dischtime FROM demographic WHERE demographic.name = "Melinda Miers"
mimicsql_data
CREATE TABLE table_12406 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the player with a 68-67-75=210 score?
SELECT "Player" FROM table_12406 WHERE "Score" = '68-67-75=210'
wikisql
CREATE TABLE table_204_28 ( id number, "election" text, "name of the party/alliance" text, "number of votes" number, "percentage" text, "seats in the parliament" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which party/alliance has more than...
SELECT "name of the party/alliance" FROM table_204_28 WHERE "number of votes" > 300000
squall
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.admission_type = "URGENT" AND diagnoses.short_title = "Hemochromatos-rbc trans"
mimicsql_data
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 SUM(t_kc24.MED_AMOUT), SUM(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '2412028' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-01-31' AND '2009-06-09'
css
CREATE TABLE table_name_52 ( city_of_license VARCHAR, frequency_mhz VARCHAR, call_sign VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What city of license has a Frequency under 107.7, and a call sign of w247aq?
SELECT city_of_license FROM table_name_52 WHERE frequency_mhz < 107.7 AND call_sign = "w247aq"
sql_create_context
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id...
SELECT Id AS "post_link", CreationDate, Score, ViewCount FROM Posts WHERE PostTypeId = 1 AND AnswerCount = 0 AND CommentCount = 0 AND ClosedDate IS NULL ORDER BY ViewCount
sede
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 zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '李红旭' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2006-03-20')
css
CREATE TABLE table_59153 ( "Aircraft" text, "1990" real, "destroyed" real, "damaged" real, "to Iran" real, "survived" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the average destroyed with a 1990 over 12, more than 1 damaged, 6 survivo...
SELECT AVG("destroyed") FROM table_59153 WHERE "1990" > '12' AND "damaged" > '1' AND "to Iran" < '4' AND "survived" = '6'
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 SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '52953159' AND MED_SER_ORG_NO = '3607978' AND IN_HOSP_DATE BETWEEN '2015-08-12' AND '2015-10-01')
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 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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2109" AND lab.itemid = "50902"
mimicsql_data
CREATE TABLE table_name_45 ( team__number1 VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is team 1 in group h?
SELECT team__number1 FROM table_name_45 WHERE round = "group h"
sql_create_context
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostFeedback ( Id number, PostId numb...
WITH Rankings AS (SELECT Id, DisplayName, Reputation, Ranking = ROW_NUMBER() OVER (ORDER BY Reputation DESC) FROM Users), Counts AS (SELECT Count = COUNT(*) FROM Users WHERE Reputation > 100) SELECT Id, DisplayName, Reputation, CAST(Ranking AS FLOAT(20, 5)) / (SELECT Count FROM Counts) AS Percentile FROM Rankings
sede
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-87465' AND patient.hospitaldischargetime IS NULL)) ORDER B...
eicu
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 diagnosis ( diagn...
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-11182')) ORDER BY medication.drugstarttime LIMIT 1
eicu
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) 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 nu...
SELECT jybgb.KSBM, jybgb.KSMC 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 = '陈...
css
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "81" AND prescriptions.formulary_drug_cd = "PRISMAB32K25000"
mimicsql_data
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, ...
SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-37499')) AND medication.drugname = 'sodium chloride 0.9 % iv solp'
eicu
CREATE TABLE table_40972 ( "Player" text, "Nationality" text, "Position" text, "Years in Orlando" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the Player for School/Club Team Illinois?
SELECT "Player" FROM table_40972 WHERE "School/Club Team" = 'illinois'
wikisql
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABL...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND C...
atis
CREATE TABLE table_name_35 ( finish INTEGER, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Jeff's finish in 2011?
SELECT SUM(finish) FROM table_name_35 WHERE year = 2011
sql_create_context
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 text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '5878641' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2008-10-14' AND '2015-11-15' GROUP B...
css
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2190" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_name_23 ( lost INTEGER, games INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the total Lost with Games that's less than 4?
SELECT SUM(lost) FROM table_name_23 WHERE games < 4
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost numbe...
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 30 AND 39) AND STRFTIME('%y', diagnosis.diagnosistime) >= '2100' GROUP BY diagnosis....
eicu
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABL...
SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime, t1.hadm_id FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FRO...
mimic_iii
CREATE TABLE table_24938621_3 ( production_code VARCHAR, written_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the production code of the episode written by Cathryn Humphris?
SELECT production_code FROM table_24938621_3 WHERE written_by = "Cathryn Humphris"
sql_create_context
CREATE TABLE table_5674 ( "Game" real, "December" real, "Opponent" text, "Score" text, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points have @ new york islanders as the opponent, with a game greater than 35?...
SELECT COUNT("Points") FROM table_5674 WHERE "Opponent" = '@ new york islanders' AND "Game" > '35'
wikisql
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 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_info.XM = '苏幼安'...
css
CREATE TABLE table_name_71 ( part_number_s_ VARCHAR, l3_cache VARCHAR, sspec_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Part number(s) has a L3 cache of 8 mb and a sSpec number of sr0pl(e1)?
SELECT part_number_s_ FROM table_name_71 WHERE l3_cache = "8 mb" AND sspec_number = "sr0pl(e1)"
sql_create_context
CREATE TABLE table_22368 ( "Voting order" real, "Country" text, "Spokespersons" text, "Commentator" text, "Broadcaster" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was the commentator when spokesperson was claude darget
SELECT "Commentator" FROM table_22368 WHERE "Spokespersons" = 'Claude Darget'
wikisql
CREATE TABLE table_204_32 ( id number, "season" number, "division" text, "w-l" text, "finish" text, "home" text, "road" text, "gf" number, "ga" number, "coach" text, "playoffs" text, "avg attendance" number ) -- Using valid SQLite, answer the following questions for the...
SELECT COUNT("season") FROM table_204_32 WHERE "w-l" > "w-l"
squall
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.gender = "M" AND demographic.age < "74"
mimicsql_data
CREATE TABLE table_204_696 ( id number, "issue" number, "volume" number, "title" text, "main feature story" text, "first/early appearance story/stories" text, "release date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what other publicati...
SELECT "title" FROM table_204_696 WHERE "title" <> 'jean grey' AND "release date" = (SELECT "release date" FROM table_204_696 WHERE "title" = 'jean grey')
squall
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "SQUAMOUS CELL CARCINOMA ORAL TONGUE/SDA"
mimicsql_data
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE ground...
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, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND date_day.day_number = 24 AND date_day.month_number = 5 AND d...
atis
CREATE TABLE table_21713 ( "Class" text, "Part 1" text, "Part 2" text, "Part 3" text, "Part 4" text, "Verb meaning" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 3rd participle of the verb whose 2nd participle is band?
SELECT "Part 3" FROM table_21713 WHERE "Part 2" = 'band'
wikisql
CREATE TABLE table_28393 ( "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment" real, "Nickname" text, "Joined" text, "Primary Conference" text, "Colors" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What i...
SELECT "Enrollment" FROM table_28393 WHERE "Colors" = 'Green & Black'
wikisql
CREATE TABLE table_806 ( "Rank by average" real, "Competition finish" real, "Couple" text, "Total" real, "Number of dances" real, "Average" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The minimum average number of dancers is 34.1 how many tim...
SELECT MIN("Number of dances") FROM table_806 WHERE "Average" = '34.1'
wikisql
CREATE TABLE table_48337 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player(s) is from South Africa?
SELECT "Player" FROM table_48337 WHERE "Country" = 'south africa'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "41" AND lab.fluid = "Urine"
mimicsql_data
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END...
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(EMPLOYEE_ID)
nvbench
CREATE TABLE table_33806 ( "Year" real, "Name" text, "Nationality" text, "Time" text, "Age category" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In which Age Category is Marco Manenti?
SELECT "Age category" FROM table_33806 WHERE "Name" = 'marco manenti'
wikisql
CREATE TABLE table_name_98 ( result VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result of the game with 68,436 attending?
SELECT result FROM table_name_98 WHERE attendance = "68,436"
sql_create_context
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, User...
SELECT t.TagName, SUM(a.Score) AS "total_score", COUNT(a.Id) AS "answer_count" FROM Posts AS a INNER JOIN Posts AS q ON q.Id = a.ParentId INNER JOIN PostTags AS pt ON q.Id = pt.PostId INNER JOIN Tags AS t ON pt.TagId = t.Id WHERE (a.OwnerUserId = '##userid##') AND (a.CommunityOwnedDate IS NULL) GROUP BY t.TagName ORDER...
sede
CREATE TABLE table_64883 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" real, "Water (sqmi)" real, "Latitude" real, "Longitude" real, "GEO ID" real, "ANSI code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wh...
SELECT "GEO ID" FROM table_64883 WHERE "Longitude" = '-102.693028'
wikisql
CREATE TABLE table_name_64 ( attendance INTEGER, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the highest attendance of games that resulted in L 23-20?
SELECT MAX(attendance) FROM table_name_64 WHERE result = "l 23-20"
sql_create_context
CREATE TABLE table_name_99 ( nominated_by_the_taoiseach INTEGER, total VARCHAR, cultural_and_educational_panel VARCHAR, industrial_and_commercial_panel VARCHAR, administrative_panel VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the avera...
SELECT AVG(nominated_by_the_taoiseach) FROM table_name_99 WHERE industrial_and_commercial_panel < 9 AND administrative_panel > 0 AND cultural_and_educational_panel > 2 AND total < 29
sql_create_context
CREATE TABLE table_name_61 ( total_matches INTEGER, year VARCHAR, points_won VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Total matches have a Year of career, and a Points won larger than 25?
SELECT SUM(total_matches) FROM table_name_61 WHERE year = "career" AND points_won > 25
sql_create_context
CREATE TABLE table_25363 ( "R" real, "Player" text, "Scottish Premier League" real, "Scottish Cup" real, "Scottish League Cup" real, "Champions League (qualifying)" real, "Europa League" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided ...
SELECT "Scottish Premier League" FROM table_25363 WHERE "Player" = 'Georgios Samaras'
wikisql
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 ReviewTaskResults ( Id number, ReviewTaskId number,...
SELECT Body FROM Posts WHERE Posts.Body LIKE '%sql%' AND Posts.Body LIKE '%php%' AND Posts.Body LIKE '%<code>%' AND (Posts.Body LIKE '%sql injectable%' OR Posts.Body LIKE '%inject%' OR Posts.Body LIKE '%injectable%') LIMIT 100
sede
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE instructor ( ...
SELECT DISTINCT num_enrolled FROM course WHERE department = 'EECS' AND number = 579
advising
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod 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_labitems ( row_id number...
SELECT AVG(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22245)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admi...
mimic_iii
CREATE TABLE table_23195_5 ( present_share VARCHAR, producing_nation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the present share for australia
SELECT present_share FROM table_23195_5 WHERE producing_nation = "Australia"
sql_create_context
CREATE TABLE table_name_79 ( year VARCHAR, make_ VARCHAR, _model VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year has a make & model of mci d4000n?
SELECT year FROM table_name_79 WHERE make_ & _model = "mci d4000n"
sql_create_context
CREATE TABLE table_train_7 ( "id" int, "bleeding" int, "hypotension" bool, "burn_injury" int, "hypoperfusion" bool, "hypertension" bool, "age" float, "lactate" int, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- intracranial...
SELECT * FROM table_train_7 WHERE bleeding = 1 OR hypertension = 1
criteria2sql
CREATE TABLE table_8484 ( "School" text, "Locality" text, "Ages" text, "Capacity" real, "Ofsted" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Capacity has a School of windlehurst school, and an Ofsted smaller than 131889?
SELECT SUM("Capacity") FROM table_8484 WHERE "School" = 'windlehurst school' AND "Ofsted" < '131889'
wikisql
CREATE TABLE table_name_63 ( moving_from VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What moving has fra as the country?
SELECT moving_from FROM table_name_63 WHERE country = "fra"
sql_create_context
CREATE TABLE table_1470 ( "C/W 15+" real, "Oblast\\Age" text, "15 to 17" real, "18 to 19" real, "20 to 24" real, "25 to 29" real, "30 to 34" real, "35 to 39" real, "40 to 44" real, "45 to 49" real, "50 to 54" real, "55 to 59" real, "60 to 64" real, "65 to 69" real...
SELECT MIN("40 to 44") FROM table_1470
wikisql
CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password VARCHAR(40), personal_name VARCHAR(80), middle_name VARCHAR(80), family_name VARCHAR(80), gender_mf VARCHAR(1), address_line_1 VARCHAR(80) ) CREATE TABLE Courses...
SELECT password, gender_mf FROM Course_Authors_and_Tutors ORDER BY personal_name
nvbench
CREATE TABLE table_name_6 ( time VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is shintaro ishiwatari's time?
SELECT time FROM table_name_6 WHERE opponent = "shintaro ishiwatari"
sql_create_context
CREATE TABLE table_name_83 ( week INTEGER, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the latest week with a result of l 14-3?
SELECT MAX(week) FROM table_name_83 WHERE result = "l 14-3"
sql_create_context
CREATE TABLE table_name_86 ( population_estimate_2005 VARCHAR, capital VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many population estimate 2005 are for majene?
SELECT COUNT(population_estimate_2005) FROM table_name_86 WHERE capital = "majene"
sql_create_context
CREATE TABLE table_22822559_4 ( date VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date did the Pistons play @ toronto?
SELECT date FROM table_22822559_4 WHERE team = "@ Toronto"
sql_create_context
CREATE TABLE table_69970 ( "Match" real, "Date" text, "Competition or tour" text, "Ground" text, "Opponent" text, "Score1" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was match 8 played?
SELECT "Ground" FROM table_69970 WHERE "Match" = '8'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "HYPERGLYCEMIA;HYPONATREMIA" AND demographic.age < "62"
mimicsql_data
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Chronic pulmonary heart disease, unspecified"
mimicsql_data
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 T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T1.Code
nvbench
CREATE TABLE table_name_71 ( champion VARCHAR, year VARCHAR, finalist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Champion, when Year is greater than 2007, and when Finalist is 'Asvel'?
SELECT champion FROM table_name_71 WHERE year > 2007 AND finalist = "asvel"
sql_create_context
CREATE TABLE table_9054 ( "Outcome" text, "Date" real, "Championship" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the surface tye during the match with the opponent of richard fromberg?
SELECT "Surface" FROM table_9054 WHERE "Opponent" = 'richard fromberg'
wikisql
CREATE TABLE table_73953 ( "Name" text, "Turbines" text, "Capacity (MW)" text, "Power (MW\u00b7hr/yr)" text, "Location (county)" text, "Year Operational" real, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What all capacities have ...
SELECT "Capacity (MW)" FROM table_73953 WHERE "Turbines" = '50-60'
wikisql
CREATE TABLE table_name_62 ( date VARCHAR, margin_of_victory VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the tournament with 5 strokes as the margin of victory?
SELECT date FROM table_name_62 WHERE margin_of_victory = "5 strokes"
sql_create_context
CREATE TABLE table_name_64 ( to_par VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the to par for score of 74-74-74-71=293
SELECT to_par FROM table_name_64 WHERE score = 74 - 74 - 74 - 71 = 293
sql_create_context
CREATE TABLE table_77857 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did tav rez lose?
SELECT "Date" FROM table_77857 WHERE "Loss" = 'tavárez'
wikisql
CREATE TABLE table_71189 ( "Event" text, "Time" text, "Venue" text, "Date" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the notes for the time 45.74?
SELECT "Notes" FROM table_71189 WHERE "Time" = '45.74'
wikisql
CREATE TABLE table_26407 ( "Season" text, "Name" text, "Teams" real, "Relegated to league" text, "Promoted to league" text, "Promoted from league" text, "Relegated from league" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many seasons ...
SELECT COUNT("Season") FROM table_26407 WHERE "Relegated from league" = 'Barking Birmingham & Solihull Stourbridge'
wikisql
CREATE TABLE table_5896 ( "Game" real, "February" real, "Opponent" text, "Score" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Opponent has a February larger than 7 and Record of 37-16-4?
SELECT "Opponent" FROM table_5896 WHERE "February" > '7' AND "Record" = '37-16-4'
wikisql
CREATE TABLE table_78543 ( "Tujunga" text, "La Crescenta- Montrose" text, "Glendale" text, "La Ca\u00f1ada Flintridge" text, "Pasadena" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the percentage of La Canada Flintridge when Tujunga is 7%?...
SELECT "La Ca\u00f1ada Flintridge" FROM table_78543 WHERE "Tujunga" = '7%'
wikisql
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_typ...
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 61527) AND prescriptions.drug IN ('docusate sodium', 'potassium chloride', 'spironolactone') AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 's...
mimic_iii
CREATE TABLE Customer_Event_Notes ( Customer_Event_Note_ID INTEGER, Customer_Event_ID INTEGER, service_type_code CHAR(15), resident_id INTEGER, property_id INTEGER, date_moved_in DATETIME ) CREATE TABLE Properties ( property_id INTEGER, property_type_code CHAR(15), property_address ...
SELECT other_details, resident_id FROM Residents
nvbench
CREATE TABLE rooms ( roomid text, roomname text, beds number, bedtype text, maxoccupancy number, baseprice number, decor text ) CREATE TABLE reservations ( code number, room text, checkin text, checkout text, rate number, lastname text, firstname text, adults...
SELECT roomname FROM rooms WHERE baseprice > (SELECT AVG(baseprice) FROM rooms)
spider
CREATE TABLE table_name_53 ( owner VARCHAR, horse_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the owner of Icabad Crane?
SELECT owner FROM table_name_53 WHERE horse_name = "icabad crane"
sql_create_context
CREATE TABLE table_204_795 ( id number, "date" text, "opponent" text, "score" text, "result" text, "location" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many total wins did the team have in 1949 ?
SELECT COUNT(*) FROM table_204_795 WHERE "result" = 'win' AND "date" = 1949
squall
CREATE TABLE table_name_93 ( player VARCHAR, total VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is that player from South Africa who had a total score under 293?
SELECT player FROM table_name_93 WHERE total < 293 AND country = "south africa"
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 zzmzjzjlb.ZZYSGH, zzmzjzjlb.QTJZYSGH FROM zzmzjzjlb WHERE zzmzjzjlb.JZLSH = '91413607292' UNION SELECT fzzmzjzjlb.ZZYSGH, fzzmzjzjlb.QTJZYSGH FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZLSH = '91413607292'
css
CREATE TABLE table_26493520_1 ( title VARCHAR, written_by VARCHAR, directed_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many episodes were written by Alexander Woo and directed by Scott Winant?
SELECT COUNT(title) FROM table_26493520_1 WHERE written_by = "Alexander Woo" AND directed_by = "Scott Winant"
sql_create_context
CREATE TABLE table_50540 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What i...
SELECT "High rebounds" FROM table_50540 WHERE "Date" = 'march 12'
wikisql
CREATE TABLE table_name_86 ( record VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record after the January 18 game?
SELECT record FROM table_name_86 WHERE date = "january 18"
sql_create_context
CREATE TABLE table_35305 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Runner(s)-up has a Margin of victory of 1 stroke, and a Tournament of worl...
SELECT "Runner(s)-up" FROM table_35305 WHERE "Margin of victory" = '1 stroke' AND "Tournament" = 'world seniors invitational'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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,...
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC 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.BG...
css