instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_70 ( year INTEGER, category VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the latest year for the distinguished performance?
SELECT MAX(year) FROM table_name_70 WHERE category = "distinguished performance"
sql_create_context
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 * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON 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 = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb....
css
CREATE TABLE table_79696 ( "Tournament" text, "Wins" 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 sum of top-10s for events with more than 0 wins?
SELECT SUM("Top-10") FROM table_79696 WHERE "Wins" > '0'
wikisql
CREATE TABLE table_2223177_3 ( season INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least season
SELECT MIN(season) FROM table_2223177_3
sql_create_context
CREATE TABLE gsi ( course_offering_id int, student_id int ) 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, good_feedback int, tough_tests int, ...
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'PHYSED' AND course.number = 305 AND semester.semester = 'Spring' AND semester.semester_id = course_offering.semester
advising
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Calculus of bile duct without mention of cholecystitis, without mention of obstruction"
mimicsql_data
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varcha...
SELECT EMPLOYEE_ID, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE table_40519 ( "Year" text, "Team" text, "GP/GS" text, "Goals" text, "Assists" text, "Total Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What assists has the Team SMU and the total points of 85?
SELECT "Assists" FROM table_40519 WHERE "Team" = 'smu' AND "Total Points" = '85'
wikisql
CREATE TABLE table_18733480_1 ( players_left_after_round_1 VARCHAR, team_1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times was team 1 the wykeham wonderers?
SELECT COUNT(players_left_after_round_1) FROM table_18733480_1 WHERE team_1 = "Wykeham Wonderers"
sql_create_context
CREATE TABLE table_52677 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What d...
SELECT "Date" FROM table_52677 WHERE "High rebounds" = 'evans (14)'
wikisql
CREATE TABLE table_name_94 ( goal_difference INTEGER, goals_against VARCHAR, draws VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest goal difference a club with 61 goals against and less than 11 draws has?
SELECT MIN(goal_difference) FROM table_name_94 WHERE goals_against = 61 AND draws < 11
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewRejectionReasons ( Id...
SELECT STR(NTILE(100) OVER (ORDER BY SUM(answers.Score) DESC), 3) + '%' AS "top", ROW_NUMBER() OVER (ORDER BY SUM(answers.Score) DESC) AS "ranking", Users.DisplayName AS "user_link", SUM(answers.Score) AS "total_score" FROM Tags JOIN PostTags ON Tags.Id = PostTags.TagId AND Tags.TagName = '##TagName##' JOIN Posts AS qu...
sede
CREATE TABLE table_238124_1 ( platelet_count VARCHAR, condition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the platelet count for congenital afibrinogenemia?
SELECT platelet_count FROM table_238124_1 WHERE condition = "Congenital afibrinogenemia"
sql_create_context
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 mzjzjlb.YLJGDM 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 = '韩依然') UNION (SELECT zyjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = h...
css
CREATE TABLE table_name_21 ( date VARCHAR, label VARCHAR, format VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date for Hydra Head Records with a CD format?
SELECT date FROM table_name_21 WHERE label = "hydra head records" AND format = "cd"
sql_create_context
CREATE TABLE table_name_51 ( length_of_retirement VARCHAR, age_at_inauguration VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Length of retirement of the President with an Age at inauguration of 70years, 53days?
SELECT length_of_retirement FROM table_name_51 WHERE age_at_inauguration = "70years, 53days"
sql_create_context
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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 locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(4...
SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "481" AND prescriptions.route = "PB"
mimicsql_data
CREATE TABLE table_26516 ( "Co-king" text, "Relationship to Monarch" text, "Crowned" text, "Co-kingship ceased" text, "Reason" text, "Monarch" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the crownded for 17 september 1025
SELECT "Crowned" FROM table_26516 WHERE "Co-kingship ceased" = '17 September 1025'
wikisql
CREATE TABLE table_73844 ( "Season no." real, "Series no." real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date did 'd.a.w.' Originall...
SELECT "Original air date" FROM table_73844 WHERE "Title" = 'D.A.W.'
wikisql
CREATE TABLE table_name_21 ( opponent VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team was the opponent when the result was l 0-27?
SELECT opponent FROM table_name_21 WHERE result = "l 0-27"
sql_create_context
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) 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, ...
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT...
advising
CREATE TABLE table_71313 ( "Country" text, "Film title used in nomination" text, "Language" text, "Original title" text, "Director" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the original title of the Hindi film?
SELECT "Original title" FROM table_71313 WHERE "Language" = 'hindi'
wikisql
CREATE TABLE table_name_8 ( population INTEGER, country_territory_entity VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most population for seychelles and rank less than 13
SELECT MAX(population) FROM table_name_8 WHERE country_territory_entity = "seychelles" AND rank < 13
sql_create_context
CREATE TABLE table_name_69 ( champion VARCHAR, score VARCHAR, location VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Champion at Sopot prior to 2006 with a Score of 6 4, 6 7(7), 6 3?
SELECT champion FROM table_name_69 WHERE location = "sopot" AND year < 2006 AND score = "6–4, 6–7(7), 6–3"
sql_create_context
CREATE TABLE table_name_97 ( winner VARCHAR, fifth VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE WINNER WITH A FIFTH OF JOSS STONE?
SELECT winner FROM table_name_97 WHERE fifth = "joss stone"
sql_create_context
CREATE TABLE table_62597 ( "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. -- When the total was 290 what was the To par?
SELECT "To par" FROM table_62597 WHERE "Total" = '290'
wikisql
CREATE TABLE table_14044 ( "Rank" real, "Artist" text, "Album" text, "Peak position" text, "Sales" real, "Certification" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sales when the artist is kelly clarkson?
SELECT COUNT("Sales") FROM table_14044 WHERE "Artist" = 'kelly clarkson'
wikisql
CREATE TABLE table_name_47 ( left_office VARCHAR, took_office VARCHAR, minister VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Left Office, when Took Office is '11 June 2001', and when Minister is 'Mirko Tremaglia'?
SELECT left_office FROM table_name_47 WHERE took_office = "11 june 2001" AND minister = "mirko tremaglia"
sql_create_context
CREATE TABLE table_2093995_1 ( stations VARCHAR, city__neighborhood VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the stations in Tarzana?
SELECT stations FROM table_2093995_1 WHERE city__neighborhood = "Tarzana"
sql_create_context
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 employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL v...
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(SALARY)
nvbench
CREATE TABLE table_78193 ( "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 the away team scored 16.21 (117), what was ...
SELECT "Home team score" FROM table_78193 WHERE "Away team score" = '16.21 (117)'
wikisql
CREATE TABLE table_50501 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What i...
SELECT "High assists" FROM table_50501 WHERE "High points" = 'tayshaun prince (23)'
wikisql
CREATE TABLE table_54237 ( "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 time/retired when the laps is less than 54 and the driver is mark donohue?
SELECT "Time/Retired" FROM table_54237 WHERE "Laps" < '54' AND "Driver" = 'mark donohue'
wikisql
CREATE TABLE table_1733513_1 ( others_percentage VARCHAR, bush_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the percentage of others when the number for Bush is 1329?
SELECT others_percentage FROM table_1733513_1 WHERE bush_number = 1329
sql_create_context
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_na...
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'BOSTON' AND ground_service.city_code = city.city_code
atis
CREATE TABLE table_4521 ( "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. -- Who is the home side when north melbourne is the ...
SELECT "Home team" FROM table_4521 WHERE "Away team" = 'north melbourne'
wikisql
CREATE TABLE table_name_64 ( points_classification VARCHAR, stage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the points classification in stage 1?
SELECT points_classification FROM table_name_64 WHERE stage = "1"
sql_create_context
CREATE TABLE Lots ( lot_id INTEGER, investor_id INTEGER, lot_details VARCHAR(255) ) CREATE TABLE Transactions_Lots ( transaction_id INTEGER, lot_id INTEGER ) CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE TABLE Ref_Transaction_Types ( ...
SELECT date_of_transaction, SUM(share_count) FROM Transactions ORDER BY date_of_transaction DESC
nvbench
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '77341331' AND t_kc21.MED_SER_ORG_NO = '3166423' AND NOT t_kc21.OUT_DIAG_DIS_NM LIKE '%抑郁症%'
css
CREATE TABLE table_29535057_4 ( challenge_leader VARCHAR, winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the challenge leaders of the games won by boston college (88-76)?
SELECT challenge_leader FROM table_29535057_4 WHERE winner = "Boston College (88-76)"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "27" AND lab.label = "Magnesium"
mimicsql_data
CREATE TABLE table_4212 ( "Player" text, "Starts" real, "Cuts made" real, "Best finish" text, "Money list rank" text, "Earnings ($)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Jonathan Kaye's money list ranking?
SELECT COUNT("Money list rank") FROM table_4212 WHERE "Player" = 'Jonathan Kaye'
wikisql
CREATE TABLE table_12759 ( "Date" text, "Opponent#" text, "Rank#" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was the attendance 82,500?
SELECT "Date" FROM table_12759 WHERE "Attendance" = '82,500'
wikisql
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Combined right and left heart angiocardiography"
mimicsql_data
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 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 = '00922703' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WH...
css
CREATE TABLE table_name_61 ( built VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the sargent bridge built?
SELECT built FROM table_name_61 WHERE name = "sargent bridge"
sql_create_context
CREATE TABLE table_66468 ( "Sport" text, "Body" text, "Year" text, "Event type" text, "Location" text, "Nations" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What body is at the World Championship for Underwater Target shooting?
SELECT "Body" FROM table_66468 WHERE "Event type" = 'world championship' AND "Sport" = 'underwater target shooting'
wikisql
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY...
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE table_6897 ( "Peel" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Draws has a Wins smaller than 17, and an Against smaller than 1158?
SELECT COUNT("Draws") FROM table_6897 WHERE "Wins" < '17' AND "Against" < '1158'
wikisql
CREATE TABLE table_71571 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the game on June 1?
SELECT "Score" FROM table_71571 WHERE "Date" = 'june 1'
wikisql
CREATE TABLE race ( Race_ID int, Name text, Class text, Date text, Track_ID text ) CREATE TABLE track ( Track_ID int, Name text, Location text, Seating real, Year_Opened real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show names ...
SELECT Name, Seating FROM track WHERE Year_Opened > 2000
nvbench
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
SELECT diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-142451')) AND DATETIME(diagnosis.diagnosistime, 'start of yea...
eicu
CREATE TABLE table_27003186_3 ( other VARCHAR, registered_voters VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is other when registered voters is 50.7%?
SELECT other FROM table_27003186_3 WHERE registered_voters = "50.7%"
sql_create_context
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
nvbench
CREATE TABLE txmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
SELECT txmzjzjlb.JZZTDM, txmzjzjlb.JZZTMC FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '36916045402' UNION SELECT ftxmzjzjlb.JZZTDM, ftxmzjzjlb.JZZTMC FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '36916045402'
css
CREATE TABLE table_26842217_4 ( site VARCHAR, visiting_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where's the louisiana-lafayette as a visiting team?
SELECT site FROM table_26842217_4 WHERE visiting_team = "Louisiana-Lafayette"
sql_create_context
CREATE TABLE table_name_69 ( week INTEGER, opponent VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Week has an Opponent of pittsburgh steelers, and an Attendance larger than 47,727?
SELECT MIN(week) FROM table_name_69 WHERE opponent = "pittsburgh steelers" AND attendance > 47 OFFSET 727
sql_create_context
CREATE TABLE table_name_35 ( republican VARCHAR, lead_margin VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the percentage for Brown when the lead margin is 26?
SELECT republican AS :_roy_brown FROM table_name_35 WHERE lead_margin = 26
sql_create_context
CREATE TABLE table_35925 ( "Year" real, "Tournament" text, "Venue" text, "Result" text, "Extra" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What tournament has a year prior to 2001?
SELECT "Tournament" FROM table_35925 WHERE "Year" < '2001'
wikisql
CREATE TABLE table_name_78 ( crowd INTEGER, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest crowd when essendon is the away team?
SELECT MIN(crowd) FROM table_name_78 WHERE away_team = "essendon"
sql_create_context
CREATE TABLE Students ( personal_name VARCHAR, student_id VARCHAR ) CREATE TABLE Student_Course_Enrolment ( student_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the student ID and personal name of the student with at least two enrollments.
SELECT T1.student_id, T2.personal_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) >= 2
sql_create_context
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 ACC_Road, AVG(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road DESC
nvbench
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minu...
SELECT DISTINCT aircraft.aircraft_code FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, flight WHERE (((flight.departure_time = 555 AND flight.flight_number = 825) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1....
atis
CREATE TABLE table_13121 ( "Mark" text, "Wind*" text, "Athlete" text, "Nationality" text, "Venue" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Date has a Venue of bucharest?
SELECT "Date" FROM table_13121 WHERE "Venue" = 'bucharest'
wikisql
CREATE TABLE table_name_12 ( total VARCHAR, set_3 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the total when the set 3 score was 25 27?
SELECT total FROM table_name_12 WHERE set_3 = "25–27"
sql_create_context
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, hi...
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 = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMO...
atis
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.admityear < "2121"
mimicsql_data
CREATE TABLE table_name_24 ( high_assists VARCHAR, game VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the high assist in a game number above 77 for Milwaukee?
SELECT high_assists FROM table_name_24 WHERE game > 77 AND team = "milwaukee"
sql_create_context
CREATE TABLE table_6849 ( "Rank" real, "Country" text, "Claimant" text, "Highest point" text, "Height" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which highest rank belongs to the palestinian territories?
SELECT MAX("Rank") FROM table_6849 WHERE "Country" = 'palestinian territories'
wikisql
CREATE TABLE Part_Faults ( part_fault_id INTEGER, part_id INTEGER, fault_short_name VARCHAR(20), fault_description VARCHAR(255), other_fault_details VARCHAR(255) ) CREATE TABLE Fault_Log ( fault_log_entry_id INTEGER, asset_id INTEGER, recorded_by_staff_id INTEGER, fault_log_entry_da...
SELECT fault_short_name, COUNT(fault_short_name) FROM Part_Faults AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.part_fault_id = T2.part_fault_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY fault_short_name ORDER BY COUNT(fault_short_name) DESC
nvbench
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTask...
SELECT u.DisplayName, Posts.OwnerUserId AS UserId, BadgeCount, COUNT(Posts.Id) AS PostsCount FROM Posts JOIN Users AS u ON u.Id = Posts.OwnerUserId JOIN (SELECT Badges.UserId AS UserId, COUNT(Badges.Id) AS BadgeCount FROM Badges WHERE Badges.Class = 1 GROUP BY Badges.UserId) AS B ON Posts.OwnerUserId = B.UserId GROUP B...
sede
CREATE TABLE table_66359 ( "Position" real, "Team" text, "Played" real, "Wins" real, "Draws" real, "Losses" real, "Scored" real, "Conceded" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much Scored has Losses smal...
SELECT SUM("Scored") FROM table_66359 WHERE "Losses" < '0'
wikisql
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE weather ( date TEXT, ...
SELECT long, COUNT(long) FROM station
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT MAX(demographic.age) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.days_stay = "23"
mimicsql_data
CREATE TABLE table_name_84 ( year__ceremony_ VARCHAR, film_title_used_in_nomination VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year has a nomination title of 'sangrador'?
SELECT year__ceremony_ FROM table_name_84 WHERE film_title_used_in_nomination = "sangrador"
sql_create_context
CREATE TABLE School ( School_id text, School_name text, Location text, Mascot text, Enrollment int, IHSAA_Class text, IHSAA_Football_Class text, County text ) CREATE TABLE endowment ( endowment_id int, School_id int, donator_name text, amount real ) CREATE TABLE budget ...
SELECT County, COUNT(*) FROM School GROUP BY County
nvbench
CREATE TABLE table_22753439_1 ( margin VARCHAR, winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many margins have a winner of S. Singaravadivel?
SELECT COUNT(margin) FROM table_22753439_1 WHERE winner = "S. Singaravadivel"
sql_create_context
CREATE TABLE table_name_17 ( played INTEGER, drawn VARCHAR, against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average played that has a drawn greater than 1, with an against greater than 16?
SELECT AVG(played) FROM table_name_17 WHERE drawn > 1 AND against > 16
sql_create_context
CREATE TABLE table_57819 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which tournament had Toshiaki Sakai as an opponent in the final on a grass surface?
SELECT "Tournament" FROM table_57819 WHERE "Opponent in the final" = 'toshiaki sakai' AND "Surface" = 'grass'
wikisql
CREATE TABLE table_67265 ( "Title" text, "Studio" text, "Role" text, "Leading lady" text, "Director" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed the movie The Star Packer?
SELECT "Director" FROM table_67265 WHERE "Title" = 'the star packer'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Pneumonia, organism NOS" AND prescriptions.route = "IH"
mimicsql_data
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-32034')) AND vitalperiodic.sao2 > 100.0 AND NOT vitalperiodic.sa...
eicu
CREATE TABLE table_56693 ( "Year" real, "Champion" text, "Score" text, "Runner-Up" text, "Location" text, "Semi-Finalist #1" text, "Semi-Finalist #2" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was champion in 2005 where the semi-fina...
SELECT "Champion" FROM table_56693 WHERE "Year" = '2005' AND "Semi-Finalist #1" = 'western carolina'
wikisql
CREATE TABLE products ( code number, name text, price number, manufacturer number ) CREATE TABLE manufacturers ( code number, name text, headquarter text, founder text, revenue number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How ma...
SELECT COUNT(DISTINCT name) FROM products WHERE NOT name IN (SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.manufacturer = T2.code WHERE T2.name = 'Sony')
spider
CREATE TABLE table_23480 ( "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 points") FROM table_23480 WHERE "Date" = 'February 19'
wikisql
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 COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE (COURSE_1.number = 280 OR COURSE_1.number = 115) AND COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.depar...
advising
CREATE TABLE table_name_96 ( team_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For a team 2 of Al-Faisaly, what was the 2nd leg?
SELECT 2 AS nd_leg FROM table_name_96 WHERE team_2 = "al-faisaly"
sql_create_context
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 gwyjzb.MED_ORG_DEPT_NM, gwyjzb.OUT_DIAG_DIS_CD, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '7700550' GROUP BY gwyjzb.MED_ORG_DEPT_NM, gwyjzb.OUT_DIAG_DIS_CD UNION SELECT fgwyjzb.MED_ORG_DEPT_NM, fgwyjzb.OUT_DIAG_DIS_CD, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '77...
css
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 ( BBCJBW text, BBDM tex...
SELECT jyjgzbb.JCFF FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND...
css
CREATE TABLE table_72613 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 74804 is the attendance what week is it?
SELECT "Week" FROM table_72613 WHERE "Attendance" = '74804'
wikisql
CREATE TABLE manufacturers ( code number, name text, headquarter text, founder text, revenue number ) CREATE TABLE products ( code number, name text, price number, manufacturer number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What a...
SELECT AVG(revenue), MAX(revenue), SUM(revenue) FROM manufacturers
spider
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 COUNT(Name) DESC
nvbench
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, pro...
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'PITTSBURGH' AND ground_service.city_code = city.city_code
atis
CREATE TABLE trust ( source_u_id number, target_u_id number, trust number ) CREATE TABLE review ( a_id number, u_id number, i_id number, rating number, rank number ) CREATE TABLE item ( i_id number, title text ) CREATE TABLE useracct ( u_id number, name text ) -- Usi...
SELECT COUNT(*) FROM item WHERE NOT i_id IN (SELECT i_id FROM review)
spider
CREATE TABLE table_55398 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Luxembourg received how many gold medals?
SELECT AVG("Gold") FROM table_55398 WHERE "Nation" = 'luxembourg'
wikisql
CREATE TABLE table_9918 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the place of plyaer Tim Herron from the United States with a to par of +1?
SELECT "Place" FROM table_9918 WHERE "Country" = 'united states' AND "To par" = '+1' AND "Player" = 'tim herron'
wikisql
CREATE TABLE table_61816 ( "Perpetrator" text, "Date" text, "Year" real, "Location" text, "Country" text, "Killed" real, "Additional Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the additional notes for Cotabato?
SELECT "Additional Notes" FROM table_61816 WHERE "Location" = 'cotabato'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE pr...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'magnesium sulfate (ob)')
mimic_iii
CREATE TABLE table_54010 ( "Year" text, "TCKL" real, "SACK" real, "P/KO RET" real, "YARDS" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total of all YARDS with 0 SACK and less than 14 P/KO RET?
SELECT COUNT("YARDS") FROM table_54010 WHERE "SACK" = '0' AND "P/KO RET" < '14'
wikisql