instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_55 ( grid VARCHAR, laps VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the grid with 71 laps and the driver, Allan McNish.
SELECT grid FROM table_name_55 WHERE laps = "71" AND driver = "allan mcnish"
sql_create_context
CREATE TABLE table_54051 ( "Year" text, "Winner" text, "Jockey" text, "Trainer" text, "Owner" text, "Time" text, "Purse" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the Trainer with the Year of 2013?
SELECT "Trainer" FROM table_54051 WHERE "Year" = '2013'
wikisql
CREATE TABLE body_builder ( Body_Builder_ID int, People_ID int, Snatch real, Clean_Jerk real, Total real ) CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Birth_Date text, Birth_Place text ) -- Using valid SQLite, answer the following questions fo...
SELECT People_ID, Snatch FROM body_builder
nvbench
CREATE TABLE game ( season VARCHAR, home_team VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the season, home team, away team of all the games.
SELECT season, home_team, away_team FROM game
sql_create_context
CREATE TABLE table_11907 ( "Model" text, "Released" text, "Form factor" text, "Chipset" text, "Memory Type" text, "Max. Memory" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What model number had a chipset of intel q43?
SELECT "Model" FROM table_11907 WHERE "Chipset" = 'intel q43'
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 jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_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 = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH =...
css
CREATE TABLE table_40030 ( "Country" text, "Men's race" real, "Women's race" real, "Men's wheelchair" real, "Women's Wheelchair" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the highest Total when Women's Wheelchair was 2,...
SELECT MAX("Total") FROM table_40030 WHERE "Women's Wheelchair" = '2' AND "Men's wheelchair" < '1' AND "Women's race" > '0'
wikisql
CREATE TABLE table_62822 ( "Location" text, "Year" text, "Champion" text, "Runner-up" text, "Score" text, "Name" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the location in 2009?
SELECT "Location" FROM table_62822 WHERE "Year" = '2009'
wikisql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '章...
css
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 mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.person_info_XM = '袁华皓' AND hz_info.YLJGDM = '3861685' AND mzjzjlb.JZKSMC LIKE '%正骨科%'
css
CREATE TABLE table_6875 ( "Name" text, "Position" text, "Number" real, "School/Club Team" text, "Season" text, "Acquisition via" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Season, when Name is Tony Boy Espinosa?
SELECT "Season" FROM table_6875 WHERE "Name" = 'tony boy espinosa'
wikisql
CREATE TABLE table_name_99 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2005 when the 2008 shows grand slam tournaments?
SELECT 2005 FROM table_name_99 WHERE 2008 = "grand slam tournaments"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_labi...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'chr pulmon heart d...
mimic_iii
CREATE TABLE table_name_76 ( democratic_ticket VARCHAR, workers_ticket VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name on the Democratic ticket when the Workers ticket is franklin p. brill?
SELECT democratic_ticket FROM table_name_76 WHERE workers_ticket = "franklin p. brill"
sql_create_context
CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHIL...
atis
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 COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23724'))
eicu
CREATE TABLE table_name_18 ( country VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country was the game played in when the location was trestles?
SELECT country FROM table_name_18 WHERE location = "trestles"
sql_create_context
CREATE TABLE table_57089 ( "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 Essendon play at home?
SELECT "Date" FROM table_57089 WHERE "Home team" = 'essendon'
wikisql
CREATE TABLE table_1973729_2 ( current_conference VARCHAR, nickname VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which conference has the nickname Chargers?
SELECT current_conference FROM table_1973729_2 WHERE nickname = "Chargers"
sql_create_context
CREATE TABLE table_name_21 ( s390x VARCHAR, ia64 VARCHAR, alpha VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which s390x contains a yes ia64 and a no for alpha?
SELECT s390x FROM table_name_21 WHERE ia64 = "yes" AND alpha = "no"
sql_create_context
CREATE TABLE table_name_7 ( home VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What home team has a record of 4-3?
SELECT home FROM table_name_7 WHERE record = "4-3"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREA...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '016-27397' AND patient.wardid = 613 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1
eicu
CREATE TABLE table_39653 ( "Shirt No" real, "Nationality" text, "Player" text, "Birth Date" text, "Height" real, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the position of the player with a height of 205 and shirt no 8?
SELECT "Position" FROM table_39653 WHERE "Height" = '205' AND "Shirt No" = '8'
wikisql
CREATE TABLE table_23908 ( "School" text, "Location(s)" text, "Control" text, "Type" text, "Accreditation" text, "Founded" text, "Enrollment" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What type of school is Cordoba University?
SELECT "Type" FROM table_23908 WHERE "School" = 'Cordoba University'
wikisql
CREATE TABLE table_51196 ( "Year" real, "Theme" text, "Artist" text, "Composition" text, "Mintage" real, "Issue Price" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the year of the pig theme?
SELECT "Year" FROM table_51196 WHERE "Theme" = 'year of the pig'
wikisql
CREATE TABLE table_name_14 ( record VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which record has john flemming as the opponent?
SELECT record FROM table_name_14 WHERE opponent = "john flemming"
sql_create_context
CREATE TABLE table_name_49 ( date VARCHAR, margin_of_victory VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the 4 strokes margin of victory?
SELECT date FROM table_name_49 WHERE margin_of_victory = "4 strokes"
sql_create_context
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Code
nvbench
CREATE TABLE gwyjzb ( 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 gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '6311978' AND gwyjzb.IN_HOSP_DATE BETWEEN '2003-03-17' AND '2008-10-21'
css
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, g...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'EECS' AND semester.semester = 'Winter' AND (SELECT COUNT(DISTINCT SEMESTE...
advising
CREATE TABLE products ( name VARCHAR, price VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Select the name of the products with a price less than or equal to $200.
SELECT name FROM products WHERE price <= 200
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE vitalperiodic ( ...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-30085...
eicu
CREATE TABLE table_name_16 ( position INTEGER, draws VARCHAR, played VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Position has Draws smaller than 7 and a Played larger than 22?
SELECT AVG(position) FROM table_name_16 WHERE draws < 7 AND played > 22
sql_create_context
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '窦咏歌' AND MED_SER_ORG_NO = '9078958' AND IN_DIAG_DIS_NM LIKE '%性%'
css
CREATE TABLE table_52304 ( "D 49 \u221a" text, "D 48 \u221a" text, "D 47 \u221a" text, "D 46 \u221a" text, "D 45 \u221a" text, "D 44 \u221a" text, "D 43 \u221a" text, "D 42 \u221a" text, "D 41 \u221a" text ) -- Using valid SQLite, answer the following questions for the tables provi...
SELECT "D 46 \u221a" FROM table_52304 WHERE "D 41 \u221a" = 'd 38 √'
wikisql
CREATE TABLE table_204_217 ( id number, "camp" text, "div sec\ndivision" text, "admin\ndistrict" text, "9 feb" number, "11 feb" number, "16 feb" number, "25 feb" number, "27 feb" number, "2 mar" number, "4 mar" number, "6 mar" number, "11 mar" number, "13 mar" num...
SELECT "div sec\ndivision" FROM table_204_217 WHERE id = (SELECT id FROM table_204_217 WHERE "div sec\ndivision" = 'vavuniya') - 1
squall
CREATE TABLE table_name_43 ( nfl_club VARCHAR, player VARCHAR, pick VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which NFL Club has a Player of sam tidmore, and a Pick of 81?
SELECT nfl_club FROM table_name_43 WHERE player = "sam tidmore" AND pick = 81
sql_create_context
CREATE TABLE table_name_49 ( type VARCHAR, unit VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the type for a vessel with a listed unit of naval base swinoujscie (auxiliary squadron)?
SELECT type FROM table_name_49 WHERE unit = "naval base swinoujscie (auxiliary squadron)"
sql_create_context
CREATE TABLE table_1921_1 ( start_of_conflict VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many conflicts started in Afghanistan?
SELECT COUNT(start_of_conflict) FROM table_1921_1 WHERE location = "Afghanistan"
sql_create_context
CREATE TABLE table_73422 ( "Year" real, "Date" text, "Driver" text, "Team" text, "Manufacturer" text, "Laps" text, "Miles (km)" text, "Race Time" text, "Average Speed (mph)" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided abov...
SELECT "Year" FROM table_73422 WHERE "Laps" = '301*'
wikisql
CREATE TABLE table_name_85 ( player VARCHAR, nationality VARCHAR, pick VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the player for nationality of canada for pick of 43
SELECT player FROM table_name_85 WHERE nationality = "canada" AND pick = "43"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.admityear < "2203"
mimicsql_data
CREATE TABLE table_70490 ( "Season" text, "Team" text, "Country" text, "Division" real, "Apps" real, "Goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of goals that the Partizan team from the country of serbia had t...
SELECT SUM("Goals") FROM table_70490 WHERE "Team" = 'partizan' AND "Country" = 'serbia' AND "Division" > '1'
wikisql
CREATE TABLE table_38902 ( "Pos." real, "Car #" real, "Driver" text, "Make" text, "Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Car # has a Make of toyota, and a Pos of 7?
SELECT MAX("Car #") FROM table_38902 WHERE "Make" = 'toyota' AND "Pos." = '7'
wikisql
CREATE TABLE table_36138 ( "Year of Issue" real, "Weight" text, "Diameter" text, "Thickness" text, "Edge" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Year of Issue has a Thickness of 1.42mm?
SELECT MAX("Year of Issue") FROM table_36138 WHERE "Thickness" = '1.42mm'
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2162" AND procedures.short_title = "Clo endosc bx bile duct"
mimicsql_data
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 PostNotices ( Id number, PostId number, PostNot...
SELECT COUNT(*), OwnerUserId FROM Posts WHERE PostTypeId = 2 AND Id IN (SELECT AcceptedAnswerId FROM Posts) GROUP BY OwnerUserId
sede
CREATE TABLE table_name_83 ( years_in_toronto VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How long has Sebastian Telfair played for Toronto?
SELECT years_in_toronto FROM table_name_83 WHERE player = "sebastian telfair"
sql_create_context
CREATE TABLE table_name_62 ( incumbent VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Incumbent has a District of massachusetts 2?
SELECT incumbent FROM table_name_62 WHERE district = "massachusetts 2"
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text )...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE STRFTIME('%y', labevents.charttime) <= '2100' GROUP BY labevents.itemid) AS t1 WHERE t1.c1 <= 5)
mimic_iii
CREATE TABLE table_name_83 ( title VARCHAR, type VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Title has a Type of ep and a Year larger than 2003?
SELECT title FROM table_name_83 WHERE type = "ep" AND year > 2003
sql_create_context
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 JYKSBM, JYKSMC FROM jybgb WHERE BGDH = '65530393272'
css
CREATE TABLE table_74717 ( "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 is the average crowd size when North Melbou...
SELECT AVG("Crowd") FROM table_74717 WHERE "Away team" = 'north melbourne'
wikisql
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, d...
SELECT MIN(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-22492')) AND lab.labname = 'carbamazepine' AND DATETIME(lab.labresulttime) >= ...
eicu
CREATE TABLE table_12055 ( "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 scored 17.7 (109)?
SELECT "Away team" FROM table_12055 WHERE "Away team score" = '17.7 (109)'
wikisql
CREATE TABLE table_name_24 ( city VARCHAR, state_territory VARCHAR, icao VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which city has tasmania as the state/territory and a ICAO of ymhb?
SELECT city FROM table_name_24 WHERE state_territory = "tasmania" AND icao = "ymhb"
sql_create_context
CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area...
SELECT Name, COUNT(Name) FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Monterey" AND T2.Price < 50 GROUP BY Name ORDER BY Name
nvbench
CREATE TABLE table_name_13 ( swimsuit VARCHAR, evening_gown VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the swimsuit score when evening gown score is 9.165 (3)?
SELECT swimsuit FROM table_name_13 WHERE evening_gown = "9.165 (3)"
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.JCRGH, jyjgzbb.JCRXM 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 mzjzj...
css
CREATE TABLE table_name_24 ( bike VARCHAR, rider VARCHAR, grid VARCHAR, laps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What bike has a grid greater than 17, laps less than 8, with milos cihak as the rider?
SELECT bike FROM table_name_24 WHERE grid > 17 AND laps < 8 AND rider = "milos cihak"
sql_create_context
CREATE TABLE table_21637 ( "Position" real, "Team" text, "Played" real, "Won" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Average 1" text, "Points 2" real ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT "Goal Average 1" FROM table_21637 WHERE "Lost" = '9'
wikisql
CREATE TABLE table_13209 ( "Class" text, "Team" text, "103lbs" text, "112lbs" text, "119lbs" text, "125lbs" text, "130lbs" text, "135lbs" text, "140lbs" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 140lbs for 130lbs Jak...
SELECT "140lbs" FROM table_13209 WHERE "130lbs" = 'jake evans (mojave)'
wikisql
CREATE TABLE table_51987 ( "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 is the smallest crowd that attended a game ...
SELECT MIN("Crowd") FROM table_51987 WHERE "Away team score" = '14.19 (103)'
wikisql
CREATE TABLE table_name_59 ( place VARCHAR, to_par VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the place with a to par of E and a score of 69-69-72=210?
SELECT place FROM table_name_59 WHERE to_par = "e" AND score = 69 - 69 - 72 = 210
sql_create_context
CREATE TABLE table_22272 ( "Player" text, "Played" real, "Legs Won" real, "Legs Lost" real, "LWAT" real, "100+" real, "140+" real, "180s" real, "High Checkout" real, "3-dart Average" text ) -- Using valid SQLite, answer the following questions for the tables provided above. --...
SELECT MAX("Played") FROM table_22272 WHERE "140+" = '13'
wikisql
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE jybgb ( YLJGDM text, YLJGDM_M...
SELECT COUNT(*) FROM zyjzjlb WHERE JZKSDM = '61501' AND RYDJSJ BETWEEN '2005-08-16' AND '2008-01-23'
css
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, res...
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'SAN JOSE' AND ground_service.city_code = city.city_code AND ground_service.transport_type = 'RENTAL CAR'
atis
CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, basePrice INTEGER, decor TEXT ) CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adul...
SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType ORDER BY bedType
nvbench
CREATE TABLE table_23676 ( "County" text, "Obama%" text, "Obama#" real, "McCain%" text, "McCain#" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many different results were there for the number of votes fro Obama in the county ...
SELECT COUNT("Obama#") FROM table_23676 WHERE "Obama%" = '27.8%'
wikisql
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswer...
SELECT a.Id AS "post_link", a.Score, u.Reputation, a.Tags, a.AnswerCount, a.CreationDate FROM Posts AS a INNER JOIN Users AS u ON u.Id = a.OwnerUserId WHERE a.ParentId IS NULL AND a.AcceptedAnswerId IS NULL AND u.Reputation > 100 AND (a.Tags LIKE '%python%' OR a.Tags LIKE '%c++%') ORDER BY a.CreationDate DESC LIMIT 100
sede
CREATE TABLE table_10527215_3 ( report VARCHAR, pole_position VARCHAR, winning_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the report on Penske Racing winning while the pole position was Al Unser?
SELECT COUNT(report) FROM table_10527215_3 WHERE pole_position = "Al Unser" AND winning_team = "Penske Racing"
sql_create_context
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Episodic mood disord NOS" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '82459876' AND t_kc21.IN_HOSP_DATE BETWEEN '2000-05-09' AND '2017-10-31'
css
CREATE TABLE table_test_16 ( "id" int, "left_ventricular_ejection_fraction_lvef" int, "systolic_blood_pressure_sbp" int, "severe_hypertension" bool, "adrenaline" bool, "stroke" bool, "renal_disease" bool, "severe_uncontrolled_arterial_hypertension" bool, "hepatic_disease" bool, "...
SELECT * FROM table_test_16 WHERE liver_disease = 1 OR renal_disease = 1 OR estimated_glomerular_filtration_rate_egfr <= 30
criteria2sql
CREATE TABLE table_8571 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date is the Chrysalis Records label.?
SELECT "Date" FROM table_8571 WHERE "Label" = 'chrysalis records'
wikisql
CREATE TABLE table_29162 ( "Chambering" text, "P1 diameter (mm)" text, "A external (cm 2 )" text, "P max ( bar )" real, "F bolt ( kgf )" real, "F bolt" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many external (cm 2 ) are there for the .3...
SELECT COUNT("A external (cm 2 )") FROM table_29162 WHERE "Chambering" = '.338 Lapua Magnum'
wikisql
CREATE TABLE table_49142 ( "E. coli" text, "Yeast (S. cerevisiae)" text, "Human" text, "Type" text, "Substrates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which E. coli has a substrate of uracil?
SELECT "E. coli" FROM table_49142 WHERE "Substrates" = 'uracil'
wikisql
CREATE TABLE table_204_814 ( id number, "date" text, "opposition" text, "result" text, "score" text, "brazil scorers" text, "competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many times did brazil play west germany during the 1...
SELECT COUNT(*) FROM table_204_814 WHERE "opposition" = 'west germany'
squall
CREATE TABLE table_name_38 ( score VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the score for the tournament cagnes-sur-mer?
SELECT score FROM table_name_38 WHERE tournament = "cagnes-sur-mer"
sql_create_context
CREATE TABLE table_name_4 ( player VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The Position of Centre is what Player?
SELECT player FROM table_name_4 WHERE position = "centre"
sql_create_context
CREATE TABLE table_name_50 ( rank INTEGER, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the lowest rank of a player who played in 2012?
SELECT MIN(rank) FROM table_name_50 WHERE event = "2012"
sql_create_context
CREATE TABLE table_29273182_1 ( written_by VARCHAR, production_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wrote the episode with a production code of ip03007?
SELECT written_by FROM table_29273182_1 WHERE production_code = "IP03007"
sql_create_context
CREATE TABLE table_1139835_1 ( crowd VARCHAR, grand_finalist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the crowd when the grand finalist was south melbourne?
SELECT crowd FROM table_1139835_1 WHERE grand_finalist = "South Melbourne"
sql_create_context
CREATE TABLE table_name_33 ( grand_cru VARCHAR, wine_style VARCHAR, village VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Grand Cru with a Wine Style of Red Wine and Village of Gevrey-Chambertin?
SELECT grand_cru FROM table_name_33 WHERE wine_style = "red wine" AND village = "gevrey-chambertin"
sql_create_context
CREATE TABLE table_61463 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player is from scotland?
SELECT "Player" FROM table_61463 WHERE "Country" = 'scotland'
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 mzjzjlb.JZLSH 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_info_mzj...
css
CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE...
SELECT meter_400, ID FROM swimmer ORDER BY meter_400
nvbench
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE regions ( REGION_...
SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID
nvbench
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text...
SELECT * 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 table_name_8 ( date INTEGER, attendance VARCHAR, venue VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the away venue with an opponent of wightlink raiders with an attendance larger than 375?
SELECT SUM(date) FROM table_name_8 WHERE venue = "away" AND opponent = "wightlink raiders" AND attendance > 375
sql_create_context
CREATE TABLE table_79074 ( "Number" real, "Year Start" real, "Year End" real, "Name" text, "Home Club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Year Start has a Number of 28?
SELECT MAX("Year Start") FROM table_79074 WHERE "Number" = '28'
wikisql
CREATE TABLE table_name_65 ( december VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which December has a Record of 4-3-6?
SELECT december FROM table_name_65 WHERE record = "4-3-6"
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 zyjybgb.JYKSBM, zyjybgb.JYKSMC FROM zyjybgb WHERE zyjybgb.BGDH = '40675785383' UNION SELECT mzjybgb.JYKSBM, mzjybgb.JYKSMC FROM mzjybgb WHERE mzjybgb.BGDH = '40675785383'
css
CREATE TABLE table_64545 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the least game that was played in Alexander Memorial Coliseum on Octo...
SELECT MIN("Game") FROM table_64545 WHERE "Location/Attendance" = 'alexander memorial coliseum' AND "Date" = 'october 16'
wikisql
CREATE TABLE table_10707176_2 ( rnd VARCHAR, circuit VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What rnds were there for the phoenix international raceway?
SELECT rnd FROM table_10707176_2 WHERE circuit = "Phoenix International Raceway"
sql_create_context
CREATE TABLE Projects ( Code Char(4), Name Char(50), Hours int ) CREATE TABLE Scientists ( SSN int, Name Char(30) ) CREATE TABLE AssignedTo ( Scientist int, Project char(4) ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the naems of al...
SELECT Name, COUNT(*) FROM Projects AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project GROUP BY T1.Name ORDER BY COUNT(*) DESC
nvbench
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 MIN(demographic.days_stay) FROM demographic WHERE demographic.dod_year < "2173.0"
mimicsql_data
CREATE TABLE table_204_541 ( id number, "name" text, "area" text, "height" text, "floors" number, "year" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- of the buildings , which is only 48 meters tall ?
SELECT "name" FROM table_204_541 WHERE "height" = 48
squall
CREATE TABLE table_27713890_1 ( no_in_series INTEGER, us_viewers__millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wha episode number in the series had 24.8 million u.s. viewers?
SELECT MIN(no_in_series) FROM table_27713890_1 WHERE us_viewers__millions_ = "24.8"
sql_create_context
CREATE TABLE table_204_341 ( id number, "name in english" text, "name in turkish" text, "area (km2)" text, "depth" text, "location (districts and/or provinces)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- other than lake ercek , name a lake i...
SELECT "name in english" FROM table_204_341 WHERE "name in english" <> 'lake ercek' AND "location (districts and/or provinces)" = 'van'
squall