instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE Maintenance_Contracts ( maintenance_contract_id INTEGER, maintenance_contract_company_id INTEGER, contract_start_date DATETIME, contract_end_date DATETIME, other_contract_details VARCHAR(255) ) CREATE TABLE Fault_Log ( fault_log_entry_id INTEGER, asset_id INTEGER, recorded_...
SELECT fault_status, COUNT(fault_status) FROM Fault_Log AS T1 JOIN Fault_Log_Parts AS T2 ON T1.fault_log_entry_id = T2.fault_log_entry_id GROUP BY fault_description, fault_status ORDER BY fault_status DESC
nvbench
CREATE TABLE table_17885 ( "No" real, "Player" text, "Height" text, "Position" text, "Year born" real, "Current Club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the current club for number 6
SELECT "Current Club" FROM table_17885 WHERE "No" = '6'
wikisql
CREATE TABLE table_name_91 ( series_sorted VARCHAR, released VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the series sorted value for the episode released December 2009?
SELECT series_sorted FROM table_name_91 WHERE released = "december 2009"
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 jybgb.JYKSBM, jybgb.JYKSMC FROM jybgb WHERE jybgb.JZLSH = '65104652939'
css
CREATE TABLE table_name_24 ( date VARCHAR, visitor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Date has a Visitor of edmonton?
SELECT date FROM table_name_24 WHERE visitor = "edmonton"
sql_create_context
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) 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, round_trip_re...
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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_...
atis
CREATE TABLE table_1407 ( "Position" real, "Club" text, "Games played" real, "Wins" real, "Draws" real, "Loses" real, "Goals scored" real, "Goals conceded" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position d...
SELECT MIN("Position") FROM table_1407 WHERE "Loses" = '3'
wikisql
CREATE TABLE table_name_72 ( week INTEGER, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the latest week with an attendance of 74,162?
SELECT MAX(week) FROM table_name_72 WHERE attendance = "74,162"
sql_create_context
CREATE TABLE zzmzjzjlb ( 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 COUNT(*) FROM zzmzjzjlb WHERE zzmzjzjlb.JZKSBM = '54818' AND zzmzjzjlb.JZKSRQ BETWEEN '2012-03-10' AND '2017-03-23' UNION SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZKSBM = '54818' AND fzzmzjzjlb.JZKSRQ BETWEEN '2012-03-10' AND '2017-03-23'
css
CREATE TABLE table_name_93 ( high_assists VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the high assists that has @ detroit as the team?
SELECT high_assists FROM table_name_93 WHERE team = "@ detroit"
sql_create_context
CREATE TABLE table_23453 ( "Wireless LAN" text, "Chipset" text, "Centrino" text, "Processor" text, "Codename" text, "Release Date" real, "Process Technology" text, "Microarchitecture" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What t...
SELECT "Processor" FROM table_23453 WHERE "Wireless LAN" = 'Intel Centrino Wireless-N 105'
wikisql
CREATE TABLE table_53123 ( "City district" text, "Area km\u00b2" text, "Population 2007 census(hab)" text, "Housing (2007)" text, "Density (hab/km\u00b2)" text, "Elevation msl" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the density o...
SELECT "Density (hab/km\u00b2)" FROM table_53123 WHERE "Elevation msl" = '3,400 msl'
wikisql
CREATE TABLE table_23211041_10 ( location_attendance VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the location attendance for utah
SELECT location_attendance FROM table_23211041_10 WHERE team = "Utah"
sql_create_context
CREATE TABLE table_44812 ( "Game" real, "December" real, "Opponent" text, "Score" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of the dates in december that were against the atlanta flames before game 40?
SELECT SUM("December") FROM table_44812 WHERE "Opponent" = 'atlanta flames' AND "Game" < '40'
wikisql
CREATE TABLE table_47263 ( "Year" real, "Date" text, "Winner" text, "Result" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the location when the year is after 1974 and the date is september 19?
SELECT "Location" FROM table_47263 WHERE "Year" > '1974' AND "Date" = 'september 19'
wikisql
CREATE TABLE table_47412 ( "Circuit" text, "Location" text, "Date" text, "Pole Position" text, "Fastest Lap" text, "Winner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Pole Position, when Fastest Lap is Ben Spies, and when Location is...
SELECT "Pole Position" FROM table_47412 WHERE "Fastest Lap" = 'ben spies' AND "Location" = 'barber motorsports park'
wikisql
CREATE TABLE table_13553701_1 ( mens_doubles VARCHAR, womens_singles VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who are the mens doubles and womens singles is wang shixian?
SELECT mens_doubles FROM table_13553701_1 WHERE womens_singles = "Wang Shixian"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.icd9_code = "25013"
mimicsql_data
CREATE TABLE table_name_84 ( rec VARCHAR, player VARCHAR, yards VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many receptions does Chris Watton with yards of less than 1?
SELECT COUNT(rec) FROM table_name_84 WHERE player = "chris watton" AND yards < 1
sql_create_context
CREATE TABLE table_77687 ( "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the to par of the match with a winning score 69-67-72-64=272?
SELECT "To par" FROM table_77687 WHERE "Winning score" = '69-67-72-64=272'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number,...
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jy...
css
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND lab.label = "Albumin/Creatinine, Urine"
mimicsql_data
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test...
SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.end_time <= '2:00' AND course_offering.start_time >= '10:00' AND course.course_id = course_offering.course_id AND course.department = 'GEOSCI' AND course.numb...
advising
CREATE TABLE table_72551 ( "Rank" real, "Place" text, "County" text, "Per Capita Income" text, "Median House- hold Income" text, "Population" real, "Number of Households" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What county has 2053 ho...
SELECT "County" FROM table_72551 WHERE "Number of Households" = '2053'
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.marital_status = "MARRIED" AND procedures.short_title = "Dx ultrasound-heart"
mimicsql_data
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 * 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_35519 ( "Rank" real, "Name" text, "Height ft (m)" text, "Floors (Stories)" real, "Year Completed" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which is the highest ranked building with more than 15 floors?
SELECT MAX("Rank") FROM table_35519 WHERE "Floors (Stories)" > '15'
wikisql
CREATE TABLE table_name_46 ( score VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Record of 22 20 involved what score?
SELECT score FROM table_name_46 WHERE record = "22–20"
sql_create_context
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, round_trip_required varchar ) CREATE TABLE time_interval ( period text, begin_time int, ...
SELECT DISTINCT flight.flight_id FROM airport, airport_service, city, flight WHERE airport.airport_code = 'SFO' AND city.city_code = airport_service.city_code AND city.city_name = 'DENVER' AND flight.from_airport = airport.airport_code AND flight.to_airport = airport_service.airport_code
atis
CREATE TABLE table_25042332_26 ( region VARCHAR, none VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which region has 0.6% none?
SELECT region FROM table_25042332_26 WHERE none = "0.6%"
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "41" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND person_info_hz_info.KH = hz_info.KH AND pers...
css
CREATE TABLE table_name_33 ( uci_protour_points VARCHAR, cyclist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Davide Rebellin' UCI ProTour Points?
SELECT uci_protour_points FROM table_name_33 WHERE cyclist = "davide rebellin"
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "CALC100I"
mimicsql_data
CREATE TABLE table_27786562_1 ( points__margin_ VARCHAR, top_tens VARCHAR, owner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the points for top tens being 24 and ownder david pearson
SELECT points__margin_ FROM table_27786562_1 WHERE top_tens = 24 AND owner = "David Pearson"
sql_create_context
CREATE TABLE table_name_15 ( released INTEGER, pieces VARCHAR, number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the earliest year with 339 pieces and a number smaller than 7198?
SELECT MIN(released) FROM table_name_15 WHERE pieces = 339 AND number < 7198
sql_create_context
CREATE TABLE table_96 ( "Village (German)" text, "Village (Slovene)" text, "Number of people 1991" real, "Percent of Slovenes 1991" text, "Percent of Slovenes 1951" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the percent of slovenes 1951...
SELECT "Percent of Slovenes 1951" FROM table_96 WHERE "Village (German)" = 'Bach'
wikisql
CREATE TABLE mountain ( Mountain_ID int, Name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE climber ( Climber_ID int, Name text, Country text, Time text, Points real, Mountain_ID int ) -- Using valid SQLite, answer the following questions ...
SELECT T2.Name, COUNT(T2.Name) FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID GROUP BY T2.Name ORDER BY COUNT(T2.Name) DESC
nvbench
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE comment_instructor ( instructor_id int, ...
SELECT DISTINCT COURSE_1.department, COURSE_1.name, COURSE_1.number FROM course AS COURSE_0 INNER JOIN course_prerequisite ON COURSE_0.course_id = course_prerequisite.course_id INNER JOIN course AS COURSE_1 ON COURSE_1.course_id = course_prerequisite.pre_course_id WHERE COURSE_0.department = 'MKT' AND COURSE_0.number =...
advising
CREATE TABLE class ( class_code text, crs_code text, class_section text, class_time text, class_room text, prof_num number ) CREATE TABLE department ( dept_code text, dept_name text, school_code text, emp_num number, dept_address text, dept_extension text ) CREATE TABLE...
SELECT T1.stu_fname, T1.stu_lname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE T2.enroll_grade = 'C' OR T2.enroll_grade = 'A'
spider
CREATE TABLE table_name_45 ( qual_2 VARCHAR, best VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the time for qual 2 that has the best time of 59.266?
SELECT qual_2 FROM table_name_45 WHERE best = "59.266"
sql_create_context
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((((flight.departure_time <= 2200 AND flight.departure_time >= 2000) AND date_day.day_number = 22 AND date_day.month_number = 2 AND date_day.year...
atis
CREATE TABLE table_17288825_9 ( date VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date did the Rockets play Memphis?
SELECT date FROM table_17288825_9 WHERE team = "Memphis"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number...
SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'amputation') AS t...
eicu
CREATE TABLE affected_region ( storm_id VARCHAR ) CREATE TABLE storm ( name VARCHAR, max_speed VARCHAR, storm_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the storm name and max speed which affected the greatest number of regions?
SELECT T1.name, T1.max_speed FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE table_name_91 ( score VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What score has nashville predators as the opponent?
SELECT score FROM table_name_91 WHERE opponent = "nashville predators"
sql_create_context
CREATE TABLE people ( People_ID int, Name text, Age real, Height real, Hometown text ) CREATE TABLE gymnast ( Gymnast_ID int, Floor_Exercise_Points real, Pommel_Horse_Points real, Rings_Points real, Vault_Points real, Parallel_Bars_Points real, Horizontal_Bar_Points real...
SELECT Hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown
nvbench
CREATE TABLE table_name_87 ( current_club VARCHAR, height VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Current Club of the PG/SG player with a Height of less than 1.9500000000000002?
SELECT current_club FROM table_name_87 WHERE height < 1.9500000000000002 AND position = "pg/sg"
sql_create_context
CREATE TABLE CUSTOMER ( Email VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many customers have email that contains 'gmail.com'?
SELECT COUNT(*) FROM CUSTOMER WHERE Email LIKE "%gmail.com%"
sql_create_context
CREATE TABLE purchase ( member_id number, branch_id text, year text, total_pounds number ) CREATE TABLE membership_register_branch ( member_id number, branch_id text, register_year text ) CREATE TABLE member ( member_id number, card_number text, name text, hometown text, ...
SELECT T3.name, T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id ORDER BY T1.register_year
spider
CREATE TABLE fzzmzjzjlb ( 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, MZZYZD...
SELECT zzmzjzjlb.JZZDBM, zzmzjzjlb.JZZDSM FROM zzmzjzjlb WHERE zzmzjzjlb.JZLSH = '91671154792' UNION SELECT fzzmzjzjlb.JZZDBM, fzzmzjzjlb.JZZDSM FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZLSH = '91671154792'
css
CREATE TABLE table_12284 ( "Outcome" text, "Date" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score when Li Na was the opponent?
SELECT "Score" FROM table_12284 WHERE "Opponent" = 'li na'
wikisql
CREATE TABLE country ( Country_name VARCHAR, Country_id VARCHAR ) CREATE TABLE match_season ( Country VARCHAR, Position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the names of countries that have both players with position forward and p...
SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = "Forward" INTERSECT SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country WHERE T2.Position = "Defender"
sql_create_context
CREATE TABLE table_6559 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which First elected has a District of illinois 3?
SELECT MAX("First elected") FROM table_6559 WHERE "District" = 'illinois 3'
wikisql
CREATE TABLE table_28755 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (million)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many different ...
SELECT COUNT("Written by") FROM table_28755 WHERE "Title" = 'Beautifully Broken'
wikisql
CREATE TABLE table_19329 ( "Rank" real, "Name" text, "Nationality" text, "1st (m)" text, "2nd (m)" text, "Points" text, "Overall WC points (Rank)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2nd (m) when the 1st (m) is 216.5?
SELECT "2nd (m)" FROM table_19329 WHERE "1st (m)" = '216.5'
wikisql
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.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB ...
css
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH...
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '郑欣嘉' AND NOT ...
css
CREATE TABLE table_name_42 ( record VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the record for Game 8?
SELECT record FROM table_name_42 WHERE game = "8"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2052" AND lab.label = "Thyroxine (T4), Free"
mimicsql_data
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 COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.dischtime IS NULL AND admissions.age >= 60
mimic_iii
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Age, Location, WebsiteUrl AS Wesbite, LastAccessDate AS Seen, CreationDate FROM Users WHERE Reputation >= '##MinimalReputation:int?10##' AND (UPPER(Location) LIKE UPPER('%Algeria%') OR UPPER(Location) LIKE UPPER('%Algerie%') OR U...
sede
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, Deletio...
SELECT SUM(DownVotes), SUM(UpVotes), SUM(DownVotes) / CAST(TotalDown AS FLOAT) * 100 AS "% of downvotes", SUM(DownVotes) / CAST(TotalPosts AS FLOAT) * 100 AS "% of Posts Downvoted" FROM (SELECT Users.DownVotes, Users.UpVotes FROM Users ORDER BY Users.DownVotes DESC LIMIT 5) AS T CROSS JOIN (SELECT SUM(DownVotes) AS Tot...
sede
CREATE TABLE table_203_268 ( id number, "date" text, "name" text, "nationality" text, "tonnage\n(grt)" number, "fate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many submarines have a tonnage above 4,000 ?
SELECT COUNT("name") FROM table_203_268 WHERE "tonnage\n(grt)" > 4000
squall
CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real ) CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int...
SELECT Name, COUNT(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.Artist_ID = T2.Artist_ID GROUP BY T1.Artist_ID ORDER BY Name DESC
nvbench
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, SUM(School_ID) FROM basketball_match GROUP BY ACC_Road
nvbench
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Self Pay" AND diagnoses.short_title = "Gstr/ddnts NOS w/o hmrhg"
mimicsql_data
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational...
SELECT DISTINCT advisory_requirement, enforced_requirement, name FROM course WHERE department = 'EECS' AND number = 574
advising
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,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 regions ( REGION_ID decimal(5,0), ...
SELECT EMAIL, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID DESC
nvbench
CREATE TABLE table_name_39 ( match INTEGER, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which match did FCR 2001 Duisburg participate as the opponent?
SELECT SUM(match) FROM table_name_39 WHERE opponent = "fcr 2001 duisburg"
sql_create_context
CREATE TABLE table_52637 ( "Draft" real, "Round" real, "Pick" real, "Nationality" text, "College/High School/Club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the nationality of the player with a pick larger than 21 from the College of th...
SELECT "Nationality" FROM table_52637 WHERE "Pick" > '21' AND "College/High School/Club" = 'college of the sequoias'
wikisql
CREATE TABLE table_64717 ( "Japanese Title" text, "Romaji Title" text, "TV Station" text, "Episodes" real, "Average Ratings" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Romaji Title has a Japanese Title of ?
SELECT "Romaji Title" FROM table_64717 WHERE "Japanese Title" = '女王の教室'
wikisql
CREATE TABLE table_70511 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Height m ( ft )" text, "Class" text, "FCC info" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the Call sign with a Frequency MH...
SELECT "Call sign" FROM table_70511 WHERE "Frequency MHz" < '95.9' AND "ERP W" = '10'
wikisql
CREATE TABLE table_name_17 ( name VARCHAR, best VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name for the best of 1:45.361?
SELECT name FROM table_name_17 WHERE best = "1:45.361"
sql_create_context
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_dista...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND date_day.day_number = 6 AND date_day.month_number = 8 AN...
atis
CREATE TABLE Acceptance ( Submission_ID int, Workshop_ID int, Result text ) CREATE TABLE workshop ( Workshop_ID int, Date text, Venue text, Name text ) CREATE TABLE submission ( Submission_ID int, Scores real, Author text, College text ) -- Using valid SQLite, answer the ...
SELECT Result, COUNT(Result) FROM Acceptance GROUP BY Result
nvbench
CREATE TABLE table_name_73 ( street_address VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The Palazzo's street address is listed as what?
SELECT street_address FROM table_name_73 WHERE name = "the palazzo"
sql_create_context
CREATE TABLE table_75484 ( "Game" real, "October" real, "Opponent" text, "Score" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most october for game less than 1
SELECT MAX("October") FROM table_75484 WHERE "Game" < '1'
wikisql
CREATE TABLE table_name_12 ( points VARCHAR, year INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points are there later than 1992?
SELECT COUNT(points) FROM table_name_12 WHERE year > 1992
sql_create_context
CREATE TABLE election ( Election_ID int, Counties_Represented text, District int, Delegate text, Party int, First_Elected real, Committee text ) CREATE TABLE party ( Party_ID int, Year real, Party text, Governor text, Lieutenant_Governor text, Comptroller text, A...
SELECT T2.Party, SUM(COUNT(*)) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party
nvbench
CREATE TABLE table_22347090_6 ( title VARCHAR, no_in_series VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of episode number 41 in the series?
SELECT title FROM table_22347090_6 WHERE no_in_series = 41
sql_create_context
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime t...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 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 ...
mimic_iii
CREATE TABLE table_9303 ( "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Venue, when Result is '0-0'?
SELECT "Venue" FROM table_9303 WHERE "Result" = '0-0'
wikisql
CREATE TABLE table_name_60 ( city_of_license VARCHAR, frequency_mhz VARCHAR, erp_w VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In which city is the station licensed whose frequency MHz is higher than 102.3 and the ERP W is lower than 1,000?
SELECT city_of_license FROM table_name_60 WHERE frequency_mhz = 102.3 AND erp_w < 1 OFFSET 000
sql_create_context
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '3892472' AND t_kc21.IN_HOSP_DATE BETWEEN '2010-05-27' AND '2021-02-21' AND t_kc21.SERVANT_FLG = '公务员'
css
CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Reviewer ( rID int, name text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Compa...
SELECT title, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY title ORDER BY MIN(T1.stars) DESC
nvbench
CREATE TABLE table_11946 ( "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 uses Princes Park as it's venue?...
SELECT "Away team" FROM table_11946 WHERE "Venue" = 'princes park'
wikisql
CREATE TABLE table_name_26 ( cuts_made INTEGER, top_25 INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Cuts made has a Top-25 smaller than 3?
SELECT MAX(cuts_made) FROM table_name_26 WHERE top_25 < 3
sql_create_context
CREATE TABLE table_11790 ( "Name" text, "Appointed/Elected" text, "Term expires" text, "Appointing Governor" text, "Governor's Party Affiliation" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which person has an expiring term of December 31, 2020, ...
SELECT "Name" FROM table_11790 WHERE "Term expires" = 'december 31, 2020' AND "Appointing Governor" = 'terry branstad'
wikisql
CREATE TABLE table_49982 ( "Name" text, "Built" text, "Listed" text, "Location" text, "County" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date Listed of the B & O Bridge in Washington?
SELECT "Listed" FROM table_49982 WHERE "County" = 'washington' AND "Name" = 'b & o bridge'
wikisql
CREATE TABLE table_16818 ( "model" text, "max. motive power" text, "max. torque at rpm" text, "engine displacement" text, "engine type" text, "engine configuration & notes 0-100km/h" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many engine...
SELECT COUNT("model") FROM table_16818 WHERE "engine type" = 'B5234 T3'
wikisql
CREATE TABLE table_64711 ( "Group" text, "Name" text, "Nationality" text, "4.00" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What nation is Marion Buisson playing for?
SELECT "Nationality" FROM table_64711 WHERE "Name" = 'marion buisson'
wikisql
CREATE TABLE table_17808 ( "Club" text, "Played" text, "Won" 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 follo...
SELECT "Losing bonus" FROM table_17808 WHERE "Points against" = '445'
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 jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 jybgb.YLJGDM = jyjgz...
css
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE sportsinfo ( stuid number, sportname text, hoursperweek number, gamesplayed number, onscholarship text ) CREATE TABLE video...
SELECT sportname FROM sportsinfo WHERE onscholarship = 'Y' GROUP BY sportname ORDER BY COUNT(*) DESC LIMIT 1
spider
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 gwyjzb.OUT_DIAG_DOC_CD, gwyjzb.OUT_DIAG_DOC_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '66522063' GROUP BY gwyjzb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC UNION SELECT fgwyjzb.OUT_DIAG_DOC_CD, fgwyjzb.OUT_DIAG_DOC_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '66522063' GROUP BY fgwyjzb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) ...
css
CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) ...
SELECT pName, HS FROM Player WHERE HS < 1500
nvbench
CREATE TABLE table_name_99 ( matches INTEGER, clubs VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest number of matches that has a Clubs of 46 32?
SELECT MIN(matches) FROM table_name_99 WHERE clubs = "46 → 32"
sql_create_context
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT P1.Id AS "post_link", P1.Title, P1.Body, P1.Score, P1.AcceptedAnswerId, (SELECT Id AS Id FROM Comments WHERE Id = P1.AcceptedAnswerId), (SELECT Score AS Score FROM Comments WHERE Id = P1.AcceptedAnswerId), P2.Body AS ANSWER FROM Posts AS P1 INNER JOIN Posts AS P2 ON P1.AcceptedAnswerId = P2.Id WHERE P1.Title LIK...
sede
CREATE TABLE table_70270 ( "Name" text, "League" real, "Play-offs" real, "FA Cup" real, "League Cup" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the total of number of FA Cup that has a League small than 29 with Play-offs...
SELECT COUNT("FA Cup") FROM table_70270 WHERE "League" < '29' AND "Play-offs" < '0'
wikisql