instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE offering_instructor ( ...
SELECT DISTINCT name, number FROM course WHERE credits = 1 AND department = 'EECS'
advising
CREATE TABLE table_4032 ( "English Name" text, "Simplified" text, "Traditional" text, "Pinyin" text, "Area" real, "Population" real, "Density" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many simplified names are there for xin county?...
SELECT COUNT("Simplified") FROM table_4032 WHERE "English Name" = 'Xin County'
wikisql
CREATE TABLE table_22853654_10 ( round VARCHAR, edition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many rounds were there in the 2006 davis cup europe/africa group I?
SELECT COUNT(round) FROM table_22853654_10 WHERE edition = "2006 Davis Cup Europe/Africa Group I"
sql_create_context
CREATE TABLE table_54732 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Away team has an Away team score of 12.19 ...
SELECT "Away team" FROM table_54732 WHERE "Away team score" = '12.19 (91)'
wikisql
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, Acc...
WITH answers AS (SELECT a.OwnerUserId AS UserId, 1.0 / RANK() OVER (PARTITION BY q.Id ORDER BY a.Score DESC) AS utility, 1.0 * q.AnswerCount AS debatableness, 1.0 / RANK() OVER (PARTITION BY q.Id ORDER BY a.Score DESC) * q.AnswerCount / @tag_debate AS EC FROM Posts AS q JOIN Posts AS a ON q.Id = a.ParentId JOIN PostTag...
sede
CREATE TABLE table_name_3 ( date_of_issue VARCHAR, theme VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Date of Issue with a Theme with mental health?
SELECT date_of_issue FROM table_name_3 WHERE theme = "mental health"
sql_create_context
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 demographic.admission_type = "ELECTIVE" AND diagnoses.short_title = "Intracerebral hemorrhage"
mimicsql_data
CREATE TABLE table_19057 ( "Call sign" text, "Frequency MHz" text, "City of license" text, "ERP W" real, "Height m ( ft )" text, "FCC info" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the fcc info with call sign being...
SELECT "FCC info" FROM table_19057 WHERE "Call sign" = 'W265AV'
wikisql
CREATE TABLE table_name_50 ( date_of_birth VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Date of Birth of the Player from the CSK VMF Moscow Club?
SELECT date_of_birth FROM table_name_50 WHERE club = "csk vmf moscow"
sql_create_context
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE flight_stop ( flight_id int, stop_n...
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 = 'SAN FRANCISCO' AND date_day.day_number = 25 AND date_day.month_number = 6...
atis
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT SUM(t_kc24.PER_ACC_PAY) 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.PERSON_NM = '邹萍韵' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-06-01' AND '2001-04-21'
css
CREATE TABLE table_77848 ( "Episode" text, "Air Date" text, "Timeslot" text, "Rating" text, "Share" text, "18\u201349 (Rating/Share)" text, "Viewers (m)" real, "Rank (#)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the share o...
SELECT "Share" FROM table_77848 WHERE "18\u201349 (Rating/Share)" = '0.8/3'
wikisql
CREATE TABLE table_71766 ( "Year" real, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did Julie Still first win Women's singles?
SELECT MIN("Year") FROM table_71766 WHERE "Women's singles" = 'julie still'
wikisql
CREATE TABLE table_14311 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the most points for a vehicle with a lola thl1, chassis later than 1986?
SELECT MAX("Points") FROM table_14311 WHERE "Chassis" = 'lola thl1' AND "Year" > '1986'
wikisql
CREATE TABLE table_name_28 ( date VARCHAR, constructor VARCHAR, fastest_lap VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date that Stirling Moss had his fastest lap in a Maserati?
SELECT date FROM table_name_28 WHERE constructor = "maserati" AND fastest_lap = "stirling moss"
sql_create_context
CREATE TABLE table_52608 ( "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 team was the away team at Junction Oval?
SELECT "Away team" FROM table_52608 WHERE "Venue" = 'junction oval'
wikisql
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE enrolled_in ( stuid number, cid text, grade text ) CREATE TABLE department ( dno number, division text, dname text, ...
SELECT * FROM course ORDER BY credits
spider
CREATE TABLE table_57260 ( "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 South Melbourne's score when they playe...
SELECT "Away team score" FROM table_57260 WHERE "Away team" = 'south melbourne'
wikisql
CREATE TABLE table_31451 ( "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 COUNT("Score") FROM table_31451 WHERE "Team" = 'Philadelphia'
wikisql
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, ...
SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 46480) AND STRFTIME('%y-%m', prescriptions.startdate) <= '2105-11' GROUP BY prescriptions.drug) AS t1 WHERE t1.c...
mimic_iii
CREATE TABLE table_55876 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the attendance at the game where San Jose was the visitor on May 4?
SELECT "Attendance" FROM table_55876 WHERE "Visitor" = 'san jose' AND "Date" = 'may 4'
wikisql
CREATE TABLE table_15885 ( "Season" real, "Player" text, "Position" text, "Nationality" text, "Team" text, "Draft Pick #" text, "Draft Class" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the Metrostars have the...
SELECT MIN("Season") FROM table_15885 WHERE "Team" = 'MetroStars'
wikisql
CREATE TABLE table_name_91 ( type VARCHAR, moving_to VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the type for the Panionios moving to?
SELECT type FROM table_name_91 WHERE moving_to = "panionios"
sql_create_context
CREATE TABLE table_68999 ( "Engine code" text, "Displacement" text, "Power, Torque@rpm" text, "Redline (rpm)" real, "Year" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the displacement of the engine that has a Redline rpm higher than 4750,...
SELECT "Displacement" FROM table_68999 WHERE "Redline (rpm)" > '4750' AND "Year" = '2005'
wikisql
CREATE TABLE table_name_53 ( bronze INTEGER, silver VARCHAR, nation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many bronzes for Iceland with over 2 silvers?
SELECT AVG(bronze) FROM table_name_53 WHERE silver > 2 AND nation = "iceland"
sql_create_context
CREATE TABLE table_59908 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score when Sheffield United was the home team?
SELECT "Score" FROM table_59908 WHERE "Home team" = 'sheffield united'
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 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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Perinatal condition NEC" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE table_76688 ( "Full name" text, "Alias" text, "Age\u00b9" real, "From" text, "Occupation\u00b2" text, "Specialty" text, "Position/ Eliminated" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Full Name, when Age is '20', a...
SELECT "Full name" FROM table_76688 WHERE "Age\u00b9" = '20' AND "Occupation\u00b2" = 'student'
wikisql
CREATE TABLE table_23281 ( "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 did George Miller belong to?
SELECT "District" FROM table_23281 WHERE "Incumbent" = 'George Miller'
wikisql
CREATE TABLE table_26372 ( "Lines" text, "Opening" real, "Traction" text, "Length" text, "Stations" real, "Route" text, "Stops" real, "Travel time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of lines for porta nolana ...
SELECT COUNT("Lines") FROM table_26372 WHERE "Route" = 'Porta Nolana - Ottaviano- Sarno'
wikisql
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT 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 = '006-149778' AND NOT patient.hospitaldischargetime IS NULL ORDER BY ...
eicu
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, ...
SELECT MAX(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 = 16904) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemid ...
mimic_iii
CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
SELECT * 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 hz_info.YLJGDM = '2347656' AND zyjzjlb.JZKSMC LIKE '%拔牙%'
css
CREATE TABLE enroll ( class_code text, stu_num number, enroll_grade text ) CREATE TABLE student ( stu_num number, stu_lname text, stu_fname text, stu_init text, stu_dob time, stu_hrs number, stu_class text, stu_gpa number, stu_transfer number, dept_code text, stu...
SELECT T4.crs_description, T4.crs_credit FROM class AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T3.stu_num = T2.stu_num JOIN course AS T4 ON T4.crs_code = T1.crs_code WHERE T3.stu_lname = 'Smithson'
spider
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID...
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
nvbench
CREATE TABLE table_79863 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Pick # of 25, and an Overall of 207 has what name?
SELECT "Name" FROM table_79863 WHERE "Pick #" = '25' AND "Overall" = '207'
wikisql
CREATE TABLE activity ( actid number, activity_name text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE participates_in ( stuid number, actid number ) CREATE TABLE faculty...
SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name = 'Canoeing' INTERSECT SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name = 'Kayaking'
spider
CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS'...
atis
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABL...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN...
mimic_iii
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TA...
SELECT DATEADD(mm, (YEAR(Posts.CreationDate) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, Tags.TagName, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName IN ...
sede
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-3009')) AND vitalperiodic.temperature > 37.1 AND NOT vitalperiod...
eicu
CREATE TABLE table_name_31 ( pick INTEGER, round VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What number pick was Paul Seymour in round 1?
SELECT SUM(pick) FROM table_name_31 WHERE round = 1 AND player = "paul seymour"
sql_create_context
CREATE TABLE table_name_36 ( location VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Location of the match against Bob Stines?
SELECT location FROM table_name_36 WHERE opponent = "bob stines"
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 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 jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2004-06-19')
css
CREATE TABLE table_6235 ( "Designation" text, "Bus width (bits)" real, "Channels" text, "Clock rate (MHz)" real, "Bandwidth (MB/s)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Clock rate (MHz) smaller than 400, and a Bandwidth (MB/s) of 1420 has ...
SELECT "Channels" FROM table_6235 WHERE "Clock rate (MHz)" < '400' AND "Bandwidth (MB/s)" = '1420'
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 jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN person_info_hz_info JOIN person_info 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 person_info_hz_info.KH = hz_info.KH AND pers...
css
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT PHONE_NUMBER, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE table_5128 ( "Race" text, "Length" text, "Class" text, "Circuit" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the class of the Charlotte Camel gt 500 race?
SELECT "Class" FROM table_5128 WHERE "Race" = 'charlotte camel gt 500'
wikisql
CREATE TABLE table_32483 ( "Band Ch." real, "Call" text, "City" text, "Owner" text, "Operator" text, "Virt. Ch." real, "Nickname" text, "Programming" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What channel has an operator of ivptc?
SELECT "Programming" FROM table_32483 WHERE "Operator" = 'ivptc'
wikisql
CREATE TABLE purchases ( purchase_transaction_id number, purchase_details text ) CREATE TABLE ref_transaction_types ( transaction_type_code text, transaction_type_description text ) CREATE TABLE transactions_lots ( transaction_id number, lot_id number ) CREATE TABLE lots ( lot_id number, ...
SELECT transaction_type_code, MAX(share_count), MIN(share_count) FROM transactions GROUP BY transaction_type_code
spider
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title ...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN...
mimic_iii
CREATE TABLE table_23695 ( "County" text, "McCain #" real, "McCain %" text, "Obama #" real, "Obama %" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the highest mccain # where obama got 33.7%
SELECT MAX("McCain #") FROM table_23695 WHERE "Obama %" = '33.7%'
wikisql
CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(50), building_phone VARCHAR(80) ) CREATE TABLE Apartment_Facilities ( apt_id I...
SELECT apt_type_code, MIN(room_count) FROM Apartments GROUP BY apt_type_code
nvbench
CREATE TABLE table_23593 ( "Season" text, "Bayernliga" text, "Landesliga S\u00fcd" text, "Landesliga Mitte" text, "Landesliga Nord" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the landesliga nord for freier tus regensburg
SELECT "Landesliga Nord" FROM table_23593 WHERE "Landesliga Mitte" = 'Freier TuS Regensburg'
wikisql
CREATE TABLE table_5302 ( "Episode No." text, "Episode Title" text, "UK Broadcast Date" text, "Presenter" text, "Countries Visited" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the broadcast date for the episode titled, 'St. Petersburg to ...
SELECT "UK Broadcast Date" FROM table_5302 WHERE "Episode Title" = 'st. petersburg to tashkent'
wikisql
CREATE TABLE table_13710464_1 ( winning_team VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won the game on may 21?
SELECT winning_team FROM table_13710464_1 WHERE date = "May 21"
sql_create_context
CREATE TABLE qtb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT qtb.IN_DIAG_DIS_NM, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '6867593' GROUP BY qtb.IN_DIAG_DIS_NM UNION SELECT gyb.IN_DIAG_DIS_NM, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '6867593' GROUP BY gyb.IN_DIAG_DIS_NM UNION SELECT zyb.IN_DIAG_DIS_NM, AVG(zyb.PERSON_AGE) FROM zyb WHERE zyb....
css
CREATE TABLE table_10753917_1 ( podiums VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which podiums did the alfa romeo team have?
SELECT podiums FROM table_10753917_1 WHERE team = "Alfa Romeo"
sql_create_context
CREATE TABLE table_63317 ( "Round" real, "Pick" real, "Player" text, "Nationality" text, "College/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the average Round of Pete Laframboise?
SELECT AVG("Round") FROM table_63317 WHERE "Player" = 'pete laframboise'
wikisql
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 t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_CD, MIN(t_kc24.PER_EXP / t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '4523226' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_CD ORDER BY MIN(t_kc24.PER_EXP / t_kc24.MED_AMOUT)
css
CREATE TABLE procedures ( 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 ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2138" AND prescriptions.formulary_drug_cd = "FENT75P"
mimicsql_data
CREATE TABLE table_name_15 ( total VARCHAR, bronze INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total associated with Bronzes over 35?
SELECT total FROM table_name_15 WHERE bronze > 35
sql_create_context
CREATE TABLE table_54470 ( "Wicket Partnership" text, "Runs" text, "Batsmen" text, "Opponents" text, "Venue" text, "Season" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the partnership in the season of 1928
SELECT "Wicket Partnership" FROM table_54470 WHERE "Season" = '1928'
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 d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE icustays ( row_id number, s...
SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10624 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND NOT transfers.wardid IS NULL ORDER BY transfers.intime LIMIT 1
mimic_iii
CREATE TABLE table_name_23 ( round VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what Round was Derrick Franklin picked?
SELECT round FROM table_name_23 WHERE player = "derrick franklin"
sql_create_context
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE program ( program_id int, name varchar, ...
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN course ON course.course_id = course_offering.course_id INNER JOIN semester...
advising
CREATE TABLE table_49575 ( "Date" text, "Place" text, "Race winners" text, "GP winner" text, "Source" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date for a source of result and a place of iffendic?
SELECT "Date" FROM table_49575 WHERE "Source" = 'result' AND "Place" = 'iffendic'
wikisql
CREATE TABLE table_name_89 ( finish INTEGER, start VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average finish that has 24 as the start, with a year after 1987?
SELECT AVG(finish) FROM table_name_89 WHERE start = 24 AND year > 1987
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
SELECT COUNT(*) FROM zyjzjlb WHERE zyjzjlb.JZKSDM = '8477' AND zyjzjlb.RYDJSJ BETWEEN '2010-02-06' AND '2020-04-25'
css
CREATE TABLE table_43932 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the highest pick number for the Hamilton tiger-cats?
SELECT MAX("Pick #") FROM table_43932 WHERE "CFL Team" = 'hamilton tiger-cats'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, a...
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'albuterol-ipratropium 3-0.5mg')) AND DATETIME(...
eicu
CREATE TABLE table_24175 ( "Episode" text, "Broadcast date" text, "Run time" text, "Viewers (in millions)" text, "Archive" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the episode for run time of 22:50
SELECT "Episode" FROM table_24175 WHERE "Run time" = '22:50'
wikisql
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT Team_Name, Team_ID FROM basketball_match ORDER BY Team_Name
nvbench
CREATE TABLE table_name_83 ( altadeña VARCHAR, aprende VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Altade a has a Aprende of jaguars?
SELECT altadeña FROM table_name_83 WHERE aprende = "jaguars"
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 JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID
nvbench
CREATE TABLE has_amenity ( dormid VARCHAR, amenid VARCHAR ) CREATE TABLE dorm ( dorm_name VARCHAR, dormid VARCHAR ) CREATE TABLE dorm_amenity ( amenid VARCHAR, amenity_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the name of dor...
SELECT dorm_name FROM dorm EXCEPT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge'
sql_create_context
CREATE TABLE table_68202 ( "Team" text, "City" text, "Stadium" text, "Manager" text, "Past season" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- where is the pegah team located?
SELECT "City" FROM table_68202 WHERE "Team" = 'pegah'
wikisql
CREATE TABLE table_38107 ( "Orbital regime" text, "Launches" real, "Successes" real, "Failures" real, "Accidentally Achieved" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total failures of heliocentric orbit orbital regimes and launche...
SELECT SUM("Failures") FROM table_38107 WHERE "Orbital regime" = 'heliocentric orbit' AND "Launches" < '1'
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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "LEFT INTERNAL JUGULAR VEIN THROMBOSIS;LEFT ARM EDEMA" AND demographic.dod_year <= "2183.0"
mimicsql_data
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 ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.formulary_drug_cd = "ABAC300"
mimicsql_data
CREATE TABLE table_name_26 ( top_10 INTEGER, cuts_made VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of the value Top-10 that has a Cuts value of 2 and a Wins value smaller than 0?
SELECT SUM(top_10) FROM table_name_26 WHERE cuts_made = 2 AND wins < 0
sql_create_context
CREATE TABLE table_name_34 ( royal_house VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Royal house is named Elah?
SELECT royal_house FROM table_name_34 WHERE name = "elah"
sql_create_context
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
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 JZLSH FROM jybgb WHERE BGRQ <= '2006-07-17')
css
CREATE TABLE Ref_Incident_Type ( incident_type_code VARCHAR(10), incident_type_description VARCHAR(80) ) CREATE TABLE Ref_Address_Types ( address_type_code VARCHAR(15), address_type_description VARCHAR(80) ) CREATE TABLE Ref_Detention_Type ( detention_type_code VARCHAR(10), detention_type_desc...
SELECT date_address_to, SUM(monthly_rental) FROM Student_Addresses ORDER BY monthly_rental DESC
nvbench
CREATE TABLE table_1176371_1 ( location VARCHAR, la_matches VARCHAR, name_of_ground VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is ropery lane and la matches 7 location?
SELECT location FROM table_1176371_1 WHERE la_matches = 7 AND name_of_ground = "Ropery Lane"
sql_create_context
CREATE TABLE table_203_322 ( id number, "club" text, "played" number, "won" number, "drawn" number, "lost" number, "points for" number, "points against" number, "bonus points" number, "points" number ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT "club" FROM table_203_322 ORDER BY "lost" DESC LIMIT 1
squall
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, 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 = admissi...
mimic_iii
CREATE TABLE table_name_16 ( school_club_team VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which School/Club Team has a Player of jud buechler?
SELECT school_club_team FROM table_name_16 WHERE player = "jud buechler"
sql_create_context
CREATE TABLE table_name_81 ( category VARCHAR, nominee VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what category is Carmen Salinas nominated?
SELECT category FROM table_name_81 WHERE nominee = "carmen salinas"
sql_create_context
CREATE TABLE table_name_67 ( goals_for INTEGER, position VARCHAR, draws VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least goals when position is more than 4 and draws is more than 11
SELECT MIN(goals_for) FROM table_name_67 WHERE position > 4 AND draws > 11
sql_create_context
CREATE TABLE table_64425 ( "Player" text, "Original Season" text, "Gender" text, "Eliminated" text, "Placing" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the player in 20th place?
SELECT "Player" FROM table_64425 WHERE "Placing" = '20th place'
wikisql
CREATE TABLE table_name_62 ( rank VARCHAR, games VARCHAR, team VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the rank of the Tau Cer mica that has 377 points and more than 21 games?
SELECT COUNT(rank) FROM table_name_62 WHERE team = "tau cerámica" AND points = 377 AND games > 21
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.insurance = "Government"
mimicsql_data
CREATE TABLE table_24727 ( "School" text, "Location" text, "Enrolment" real, "Founded" real, "Denomination" text, "Boys/Girls" text, "Day/Boarding" text, "School Colors" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many values for ...
SELECT COUNT("Founded") FROM table_24727 WHERE "Enrolment" = '850'
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 COUNT(hz_info.RYBH) FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_in...
css
CREATE TABLE table_75638 ( "Country" text, "Political Rights 2010" real, "Civil Liberties 2010" real, "Status 2010" text, "Political Rights 2011" real, "Civil Liberties 2011" real, "Status 2011" text, "Political Rights 2012" real, "Civil Liberties 2012" real, "Status 2012" text, ...
SELECT AVG("Civil Liberties 2012") FROM table_75638 WHERE "Status 2011" = 'not free' AND "Political Rights 2012" > '6' AND "Political Rights 2011" > '7'
wikisql
CREATE TABLE table_name_61 ( team_d VARCHAR, team_c VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is Team D when Carmen Ada is team C?
SELECT team_d FROM table_name_61 WHERE team_c = "carmen ada"
sql_create_context
CREATE TABLE table_name_68 ( sspec_number VARCHAR, model_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is sSpec Number, when Model Number is Atom N475?
SELECT sspec_number FROM table_name_68 WHERE model_number = "atom n475"
sql_create_context
CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor text ) CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text ) -- Using valid SQLite, answer the following questions for the tabl...
SELECT Date_of_Birth, COUNT(Date_of_Birth) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones" ORDER BY Date_of_Birth DESC
nvbench
CREATE TABLE table_247 ( "Comparisons" text, "Hub Base Class" text, "Emulated Class" text, "Semi-DDM Class" text, "DDM Class" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Is drawing tablet support part of the semi-DDM class?
SELECT "Semi-DDM Class" FROM table_247 WHERE "Comparisons" = 'Drawing Tablet Support'
wikisql