instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_9 ( points_against VARCHAR, lost VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With the lost of 3, how many points?
SELECT points_against FROM table_name_9 WHERE lost = "3"
sql_create_context
CREATE TABLE table_4852 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the home team of Richmond play?
SELECT "Date" FROM table_4852 WHERE "Home team" = 'richmond'
wikisql
CREATE TABLE table_22833 ( "\u5366\u540d Name" text, "\u81ea\u7136 Nature" text, "\u5b63\u8282 Season" text, "\u6027\u60c5 Personality" text, "\u5bb6\u65cf Family" text, "\u65b9\u4f4d Direction" text, "\u610f\u7fa9 Meaning" text ) -- Using valid SQLite, answer the following questions for t...
SELECT "\u610f\u7fa9 Meaning" FROM table_22833 WHERE "\u6027\u60c5 Personality" = 'Gentle'
wikisql
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 procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2170" AND procedures.icd9_code = "9962"
mimicsql_data
CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIGH_DEGREE varchar(5) ) CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE CLASS ( ...
SELECT DEPT_CODE, SUM(T1.CRS_CREDIT) FROM COURSE AS T1 JOIN CLASS AS T2 ON T1.CRS_CODE = T2.CRS_CODE GROUP BY T1.DEPT_CODE
nvbench
CREATE TABLE certificate ( eid number, aid number ) CREATE TABLE aircraft ( aid number, name text, distance number ) CREATE TABLE flight ( flno number, origin text, destination text, distance number, departure_date time, arrival_date time, price number, aid number )...
SELECT name FROM employee ORDER BY salary LIMIT 3
spider
CREATE TABLE table_2509113_2 ( vinto_municipality INTEGER, language VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the language is Spanish, what is the Vinto Municipality minimum?
SELECT MIN(vinto_municipality) FROM table_2509113_2 WHERE language = "Spanish"
sql_create_context
CREATE TABLE table_11266 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Home Team has an Away Score of 7.2 (44)?
SELECT "Home team" FROM table_11266 WHERE "Away team score" = '7.2 (44)'
wikisql
CREATE TABLE table_25775 ( "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. -- How ma...
SELECT COUNT("High assists") FROM table_25775 WHERE "Date" = 'December 11'
wikisql
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_gradu...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course_offering.semester < (SELECT SEMESTERalias0.semester_id FROM semester AS SEMESTERalias0 WHERE SEMESTERalias0.semester = 'WN' AND SEMESTERalias0.year = 2016) AND course.course_id = cour...
advising
CREATE TABLE table_58169 ( "Name" text, "Team" text, "Qual 1" text, "Qual 2" text, "Best" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the person with a qual 1 time of 1:16.850?
SELECT "Name" FROM table_58169 WHERE "Qual 1" = '1:16.850'
wikisql
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 12572 AND STRFTIME('%y', admissions.admittime) = '2104' ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE table_204_915 ( id number, "draw" number, "artist" text, "song" text, "points" number, "place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many artists scored more than 30 points ?
SELECT COUNT("artist") FROM table_204_915 WHERE "points" > 30
squall
CREATE TABLE table_36688 ( "Rank" real, "Name" text, "Nationality" text, "1st (m)" real, "2nd (m)" real, "Points" real, "Overall FHT points" text, "Overall WC points (Rank)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowe...
SELECT MIN("2nd (m)") FROM table_36688 WHERE "Points" > '251.6'
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 cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, ...
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 = 15794) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_item...
mimic_iii
CREATE TABLE table_39578 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of top-25s for the major that has 11 to...
SELECT COUNT("Top-25") FROM table_39578 WHERE "Top-10" = '11'
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 demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "ABDOMINAL ABSCESS" AND procedures.icd9_code = "4591"
mimicsql_data
CREATE TABLE table_2827 ( "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. -- Which t...
SELECT "Team" FROM table_2827 WHERE "High rebounds" = 'Dirk Nowitski (13)'
wikisql
CREATE TABLE table_2140071_10 ( episode VARCHAR, coach VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of episode summary for jesse csincsak
SELECT COUNT(episode) AS Summary FROM table_2140071_10 WHERE coach = "Jesse Csincsak"
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDBM = 'K94.890' AND jyjgzbb.JCZBDM = '397278'
css
CREATE TABLE table_26346 ( "Music Library" text, "Year" real, "Media type" text, "Name of the media" text, "Composition name" text, "Composer" text, "Genre" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every composition name when t...
SELECT "Composition name" FROM table_26346 WHERE "Music Library" = 'Heart of Asia' AND "Media type" = 'Album' AND "Genre" = 'Trance'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "LONG TERM CARE HOSPITAL" AND diagnoses.long_title = "Abnormal coagulation profile"
mimicsql_data
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME HEALTH CARE" AND demographic.admityear < "2112"
mimicsql_data
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2158.0" AND prescriptions.drug = "OxycoDONE-Acetaminophen Elixir"
mimicsql_data
CREATE TABLE table_23704 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Spanish title" text, "Director" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Spanish title of the film whose title used in nominat...
SELECT "Spanish title" FROM table_23704 WHERE "Film title used in nomination" = 'Ogu and Mampato in Rapa Nui'
wikisql
CREATE TABLE table_1473672_9 ( player VARCHAR, pick__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the the player with pick # being 132
SELECT player FROM table_1473672_9 WHERE pick__number = 132
sql_create_context
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student_record ( student_id int, course_id int, semester int, ...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload 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 '%software%' AND program_course.workload < (SELECT MIN(PROGRAM_COURSEalias...
advising
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
SELECT DISTINCT program_requirement.additional_req, program_requirement.category, program_requirement.min_credit, program.name FROM program, program_requirement WHERE program.name LIKE '%CS-LSA%' AND program.program_id = program_requirement.program_id
advising
CREATE TABLE table_name_38 ( competition VARCHAR, opponents VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Competition has Opponents of pkns fc, and a Score of 0-0?
SELECT competition FROM table_name_38 WHERE opponents = "pkns fc" AND score = "0-0"
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 zyjzjlb ( CYBQDM text, CYBQMC...
SELECT jybgb.BBCJBW FROM hz_info JOIN mzjzjlb JOIN jybgb 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.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_in...
css
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
SELECT p.Title, CreationDate, LastActivityDate FROM Posts AS p WHERE CreationDate > '2013-01-13 12:00:00' AND LastActivityDate < '2013-01-13 12:01:00' ORDER BY CreationDate DESC
sede
CREATE TABLE table_name_77 ( opponent VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the opponent on October 28, 2001?
SELECT opponent FROM table_name_77 WHERE date = "october 28, 2001"
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId ...
WITH PostMonth AS (SELECT DATEFROMPARTS(TIME_TO_STR(CreationDate, '%Y'), TIME_TO_STR(CreationDate, '%M'), 1) AS Month, COUNT(*) AS Count FROM Posts WHERE PostTypeId = 1 GROUP BY DATEFROMPARTS(TIME_TO_STR(CreationDate, '%Y'), TIME_TO_STR(CreationDate, '%M'), 1)), TopTags AS (SELECT Id FROM Tags WHERE Count > '##MinTagCo...
sede
CREATE TABLE table_50491 ( "Position" real, "Equipment" text, "Points" real, "Wins" text, "Second" text, "Third" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Equipment, when Position is greater than 28, and when Points is greater than ...
SELECT "Equipment" FROM table_50491 WHERE "Position" > '28' AND "Points" > '10'
wikisql
CREATE TABLE table_name_28 ( ast_avg INTEGER, player VARCHAR, games VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many assists does cam long average in under 132 games?
SELECT MAX(ast_avg) FROM table_name_28 WHERE player = "cam long" AND games < 132
sql_create_context
CREATE TABLE table_name_61 ( partial_thromboplastin_time VARCHAR, condition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which Partial thromboplastin time has a Condition of liver failure , early?
SELECT partial_thromboplastin_time FROM table_name_61 WHERE condition = "liver failure , early"
sql_create_context
CREATE TABLE table_name_12 ( country VARCHAR, language VARCHAR, television_service VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Country when the language is italian english, and the television service is disney xd +1?
SELECT country FROM table_name_12 WHERE language = "italian english" AND television_service = "disney xd +1"
sql_create_context
CREATE TABLE table_name_49 ( wchmp INTEGER, podiums VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If podiums are 26, what's the lowest WChmp?
SELECT MIN(wchmp) FROM table_name_49 WHERE podiums = 26
sql_create_context
CREATE TABLE table_name_68 ( water__sqmi_ INTEGER, land___sqmi__ VARCHAR, longitude VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the total of Water (sqmi) with a Land (sqmi) of 35.918 and has a Longitude that is smaller than -97.115459?
SELECT SUM(water__sqmi_) FROM table_name_68 WHERE land___sqmi__ = 35.918 AND longitude < -97.115459
sql_create_context
CREATE TABLE table_70103 ( "Tournament" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the 2011 for tokyo tournament
SELECT "2011" FROM table_70103 WHERE "Tournament" = 'tokyo'
wikisql
CREATE TABLE table_28544 ( "Round" text, "Circuit" text, "Date" text, "Pole Position" text, "Fastest Lap" text, "Winning Driver" text, "Winning Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date is the winning team Abt Sportsl...
SELECT "Date" FROM table_28544 WHERE "Winning Team" = 'Abt Sportsline' AND "Pole Position" = 'Mattias Ekström' AND "Circuit" = 'Circuit Ricardo Tormo , Valencia'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TA...
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 = '035-15069')) AND medication.routeadmin = 'iv' AND DATETIME(med...
eicu
CREATE TABLE table_57799 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the Rockies play the Giants with an attendance over 24,100?
SELECT "Date" FROM table_57799 WHERE "Opponent" = 'giants' AND "Attendance" > '24,100'
wikisql
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE...
SELECT Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Jaipur%' ORDER BY Reputation DESC LIMIT 1550
sede
CREATE TABLE table_name_63 ( birthdate VARCHAR, defining_characteristics VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the birth date of the member with the Defining characteristic of pink hair?
SELECT birthdate FROM table_name_63 WHERE defining_characteristics = "pink hair"
sql_create_context
CREATE TABLE table_203_146 ( id number, "year" number, "association" text, "category" text, "nominated work" text, "result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which association awarded jones ' first award after the year 2000 ?
SELECT "association" FROM table_203_146 WHERE "year" > 2000 ORDER BY "year" LIMIT 1
squall
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, ...
SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '10580420' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WH...
css
CREATE TABLE table_name_87 ( week_3_sept_14 VARCHAR, week_6_oct_5 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Week 3 Sept 14 has a Week 6 Oct 5 of kansas (4-1)?
SELECT week_3_sept_14 FROM table_name_87 WHERE week_6_oct_5 = "kansas (4-1)"
sql_create_context
CREATE TABLE table_58320 ( "Date" text, "Pilot" text, "Weapon Systems Officer" text, "Aircraft" text, "Tail Code" text, "Call Sign" text, "Kill" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which aircraft Weapon Systems Officer Capt Charle...
SELECT "Aircraft" FROM table_58320 WHERE "Weapon Systems Officer" = 'capt charles b. debellevue'
wikisql
CREATE TABLE table_2226817_12 ( title VARCHAR, original_air_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the name of the episode whose premiere was in march 2, 1997?
SELECT title FROM table_2226817_12 WHERE original_air_date = "March 2, 1997"
sql_create_context
CREATE TABLE table_27072 ( "Team" text, "Hosted" real, "Average" real, "Highest" real, "Lowest" real, "Total" real, "Last Year" real, "Up/Down" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team has an up/down of + 3479?
SELECT "Team" FROM table_27072 WHERE "Up/Down" = '+ 3479'
wikisql
CREATE TABLE table_66490 ( "Pick" real, "Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Pick does the College Southeastern Louisiana have?
SELECT "Pick" FROM table_66490 WHERE "College" = 'southeastern louisiana'
wikisql
CREATE TABLE table_20774 ( "Institution" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Team Nickname" text, "Primary conference" text, "Home Rink" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Private/Ca...
SELECT MIN("Enrollment") FROM table_20774 WHERE "Affiliation" = 'Private/Catholic'
wikisql
CREATE TABLE table_name_1 ( season INTEGER, winners VARCHAR, fourth_placed VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What season had Dalian Wanda as the winner with Yanbian Aodong winning 4th?
SELECT SUM(season) FROM table_name_1 WHERE winners = "dalian wanda" AND fourth_placed = "yanbian aodong"
sql_create_context
CREATE TABLE university ( enrollment INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total and minimum enrollment of all schools?
SELECT SUM(enrollment), MIN(enrollment) FROM university
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age te...
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-22492')) AND intakeoutput.cellpath LIKE '%intake%...
eicu
CREATE TABLE track ( LOCATION VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are distinct locations where tracks are located?
SELECT DISTINCT LOCATION FROM track
sql_create_context
CREATE TABLE table_6355 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text ) -- Using valid SQLite, answer the following questions fo...
SELECT "Points" FROM table_6355 WHERE "Lost" = '13' AND "Points against" = '461'
wikisql
CREATE TABLE table_name_39 ( attendance VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On August 22, how many people came to the game?
SELECT attendance FROM table_name_39 WHERE date = "august 22"
sql_create_context
CREATE TABLE table_name_11 ( attendance INTEGER, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many attendances had the Detroit Lions as opponents?
SELECT SUM(attendance) FROM table_name_11 WHERE opponent = "detroit lions"
sql_create_context
CREATE TABLE table_20704243_6 ( title VARCHAR, directed_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What episode did John Rogers direct?
SELECT title FROM table_20704243_6 WHERE directed_by = "John Rogers"
sql_create_context
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_descriptio...
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, fare, flight, flight_fare 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_...
atis
CREATE TABLE table_name_42 ( record VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the record for April 21?
SELECT record FROM table_name_42 WHERE date = "april 21"
sql_create_context
CREATE TABLE table_77118 ( "Day 1" text, "Day 2" text, "Day 3" text, "Day 4" text, "Day 5" text, "Wednesday" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Wednesday when day 3 is math?
SELECT "Wednesday" FROM table_77118 WHERE "Day 3" = 'math'
wikisql
CREATE TABLE table_9468 ( "Date" text, "Home" text, "Score" text, "Away" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Away has a Score of 1:2, and a Home of vida?
SELECT "Away" FROM table_9468 WHERE "Score" = '1:2' AND "Home" = 'vida'
wikisql
CREATE TABLE table_24011830_2 ( world_record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the 26 august 2005 asian record
SELECT 26 AS _august_2005 FROM table_24011830_2 WHERE world_record = "Asian record"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-80884')) AND intakeoutput.cellpath LIKE '%ou...
eicu
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT U.Id AS "user_link", (SELECT COUNT(Pt.Id) FROM PostTypes AS Pt, PostHistoryTypes AS Pht, PostHistory AS Ph, Tags AS T WHERE Pt.Id = Ph.PostHistoryTypeId AND U.Id = Ph.UserId AND Pht.Id = 24 AND Pt.Id IN (4, 5) AND (Ph.PostId = T.ExcerptPostId OR Ph.PostId = T.WikiPostId)) AS "edits" FROM Users AS U WHERE (SELECT...
sede
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "RASH" AND prescriptions.route = "IV"
mimicsql_data
CREATE TABLE table_26003 ( "Round" real, "Finishing Date" text, "Rally Name" text, "Rally Base" text, "Surface" text, "Support Category" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name surface for 8 round
SELECT "Surface" FROM table_26003 WHERE "Round" = '8'
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 PendingFlags ( Id number, FlagTypeId number, Po...
SELECT Id AS "post_link", ViewCount, Score FROM Posts WHERE CreationDate > CURRENT_TIMESTAMP() - '##Days##' ORDER BY ViewCount DESC LIMIT 100
sede
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 COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_MED_SER_ORG_NO = '8564108' AND t_kc22.SOC_SRT_DIRE_NM = '阿戈美拉汀片'
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 MIN(demographic.age) FROM demographic WHERE demographic.insurance = "Government" AND demographic.admityear >= "2178"
mimicsql_data
CREATE TABLE table_53538 ( "Driver" text, "Constructor" text, "Laps" real, "Time/retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the grid when the laps is 2?
SELECT "Grid" FROM table_53538 WHERE "Laps" = '2'
wikisql
CREATE TABLE journal ( Journal_ID int, Date text, Theme text, Sales int ) CREATE TABLE editor ( Editor_ID int, Name text, Age real ) CREATE TABLE journal_committee ( Editor_ID int, Journal_ID int, Work_Type text ) -- Using valid SQLite, answer the following questions for the ...
SELECT Name, COUNT(Name) FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID WHERE T3.Sales > 3000 GROUP BY Name ORDER BY COUNT(Name)
nvbench
CREATE TABLE Documents_to_be_Destroyed ( Document_ID INTEGER, Destruction_Authorised_by_Employee_ID INTEGER, Destroyed_by_Employee_ID INTEGER, Planned_Destruction_Date DATETIME, Actual_Destruction_Date DATETIME, Other_Details VARCHAR(255) ) CREATE TABLE Roles ( Role_Code CHAR(15), Role_...
SELECT Destroyed_by_Employee_ID, COUNT(*) FROM Documents_to_be_Destroyed GROUP BY Destroyed_by_Employee_ID
nvbench
CREATE TABLE table_name_24 ( grid VARCHAR, time_retired VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which grid has a time/retired of +27.347?
SELECT COUNT(grid) FROM table_name_24 WHERE time_retired = "+27.347"
sql_create_context
CREATE TABLE table_24307126_3 ( april_2013_cum_rank VARCHAR, rank_2012 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of rank for april 2013 for 2012 ran kbeing 225
SELECT COUNT(april_2013_cum_rank) FROM table_24307126_3 WHERE rank_2012 = 225
sql_create_context
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 * 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 requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TA...
SELECT DISTINCT course.name, course.number, program_course.workload FROM course, program_course WHERE course.department LIKE '%BIOLOGY%' AND program_course.course_id = course.course_id AND program_course.workload < 3
advising
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "MARRIED" AND procedures.long_title = "Spinal tap"
mimicsql_data
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 1 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI...
eicu
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 intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-78423')) AND intakeoutput.cellpath LIKE '%intake%...
eicu
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
SELECT COUNT(DISTINCT mzjzjlb.ZZYSGH) 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 mzjzjlb.JZKSRQ BETWEEN '2017-09-12' AND '2020-12-29'
css
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text,...
SELECT t.TagName, COUNT(pt.PostId) AS numposts FROM Tags AS t, PostTags AS pt, Posts AS p WHERE pt.TagId = t.Id AND pt.PostId = p.Id AND p.CreationDate > DATEFROMPARTS(2013, 8, 1) GROUP BY t.TagName ORDER BY numposts DESC
sede
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 procedures ( ...
SELECT demographic.admission_type, demographic.discharge_location FROM demographic WHERE demographic.subject_id = "3623"
mimicsql_data
CREATE TABLE table_name_37 ( result VARCHAR, competition VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Result, when Competition is 2010 FIFA World Cup Qualification, and when Date is 10 September 2008?
SELECT result FROM table_name_37 WHERE competition = "2010 fifa world cup qualification" AND date = "10 september 2008"
sql_create_context
CREATE TABLE table_name_93 ( previous_conference VARCHAR, year_joined VARCHAR, mascot VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the previous conference for the school that joined in 2000 with a millers mascot?
SELECT previous_conference FROM table_name_93 WHERE year_joined = 2000 AND mascot = "millers"
sql_create_context
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuest...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE (LOWER(Location) LIKE '%bhubaneswar%' OR LOWER(Location) LIKE '%bhubaneshwar%') AND Reputation >= 1000 ORDER BY Reputation DESC
sede
CREATE TABLE table_14505 ( "Status" text, "Name" text, "First Performance" text, "Last Performance" text, "Style" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the Last Ballet Style Performance of Rhys kosakowski as Billy Elliot...
SELECT "Last Performance" FROM table_14505 WHERE "Style" = 'ballet' AND "Name" = 'rhys kosakowski'
wikisql
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 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 = '0004524' AND zyjzjlb.CYKSMC LIKE '%心%'
css
CREATE TABLE table_44053 ( "Game" real, "Date" text, "Opponent" 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. -- Wh...
SELECT MAX("Game") FROM table_44053 WHERE "Record" = '2-1'
wikisql
CREATE TABLE publication ( abstract varchar, cid int, citation_num int, jid int, pid int, reference_num int, title varchar, year int ) CREATE TABLE publication_keyword ( kid int, pid int ) CREATE TABLE domain_keyword ( did int, kid int ) CREATE TABLE domain ( did i...
SELECT publication.citation_num FROM journal, publication WHERE journal.name = 'PVLDB' AND publication.jid = journal.jid
academic
CREATE TABLE table_22968 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text ) -- Using valid SQLite, answer the following questions for the tables provided ab...
SELECT "Title" FROM table_22968 WHERE "Directed by" = 'Charles Beeson' AND "Written by" = 'Jeremy Carver'
wikisql
CREATE TABLE table_dev_12 ( "id" int, "systolic_blood_pressure_sbp" int, "creatinine_clearance_cl" float, "allergy_to_glucagon" bool, "platelet_count" float, "diastolic_blood_pressure_dbp" int, "insulin_requirement" float, "adverse_reaction_to_glucagon" bool, "NOUSE" float ) -- Usi...
SELECT * FROM table_dev_12 WHERE systolic_blood_pressure_sbp > 160 OR diastolic_blood_pressure_dbp > 100
criteria2sql
CREATE TABLE table_name_78 ( record VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Record, when Team is '@ Atlanta'?
SELECT record FROM table_name_78 WHERE team = "@ atlanta"
sql_create_context
CREATE TABLE table_name_26 ( peak VARCHAR, prom__m_ INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the peak for prom being less than 147
SELECT peak FROM table_name_26 WHERE prom__m_ < 147
sql_create_context
CREATE TABLE table_14648 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year did Austria-Marlboro BRM get more than 0 points?
SELECT AVG("Year") FROM table_14648 WHERE "Entrant" = 'austria-marlboro brm' AND "Points" > '0'
wikisql
CREATE TABLE table_1008653_1 ( country___exonym__ VARCHAR, official_or_native_language_s___alphabet_script_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the English name of the country whose official native language is Dutch Papiamento?
SELECT country___exonym__ FROM table_1008653_1 WHERE official_or_native_language_s___alphabet_script_ = "Dutch Papiamento"
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "16" AND prescriptions.route = "ID"
mimicsql_data