instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_93 ( attendance INTEGER, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the the total top attendance with a score of 0 4?
SELECT MAX(attendance) FROM table_name_93 WHERE score = "0 – 4"
sql_create_context
CREATE TABLE table_17322817_10 ( location_attendance VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the location attendance for april 5
SELECT location_attendance FROM table_17322817_10 WHERE date = "April 5"
sql_create_context
CREATE TABLE table_name_66 ( date VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did South Melbourne play as the home team?
SELECT date FROM table_name_66 WHERE home_team = "south melbourne"
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 T1.Code, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder
nvbench
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABL...
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'morphine sulfate sr')
mimic_iii
CREATE TABLE table_33462 ( "Network" text, "Origin of Programming" text, "Language" text, "Genre" text, "Service" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where does the network Star Cricket originate?
SELECT "Origin of Programming" FROM table_33462 WHERE "Genre" = 'cricket' AND "Network" = 'star cricket'
wikisql
CREATE TABLE table_name_70 ( title VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title of the TV series in 2012?
SELECT title FROM table_name_70 WHERE year = "2012"
sql_create_context
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'sodium') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11362) AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_...
mimic_iii
CREATE TABLE table_25799 ( "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. -- Who sc...
SELECT "High points" FROM table_25799 WHERE "Team" = 'Raptors'
wikisql
CREATE TABLE table_23183 ( "Institution" text, "Location" text, "Nickname" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many different enrollment numbers are there for the ...
SELECT COUNT("Enrollment") FROM table_23183 WHERE "Nickname" = 'Barons'
wikisql
CREATE TABLE manufacturer ( Manufacturer_ID int, Open_Year real, Name text, Num_of_Factories int, Num_of_Shops int ) CREATE TABLE furniture ( Furniture_ID int, Name text, Num_of_Component int, Market_Rate real ) CREATE TABLE furniture_manufacte ( Manufacturer_ID int, Furnit...
SELECT Name, Price_in_Dollar FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID
nvbench
CREATE TABLE table_29651 ( "Week #" text, "Theme" text, "Song Choice" text, "Original Artist" text, "Order #" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result for Barreto when his song choice was 'Olhar 43'?
SELECT "Result" FROM table_29651 WHERE "Song Choice" = 'Olhar 43'
wikisql
CREATE TABLE table_43003 ( "Result" text, "Date" text, "Race" text, "Venue" text, "Group" text, "Distance" text, "Weight (kg)" real, "Time" text, "Jockey" text, "Winner/2nd" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHo is W...
SELECT "Winner/2nd" FROM table_43003 WHERE "Jockey" = 'c. symons'
wikisql
CREATE TABLE table_25355501_2 ( march_27_29 VARCHAR, june_10_11 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- march 27-29 where june 10-11 is 127?
SELECT march_27_29 FROM table_25355501_2 WHERE june_10_11 = "127"
sql_create_context
CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int, STU_CLASS varchar(2), STU_GPA float(8), STU_TRANSFER numeric, DEPT_CODE varchar(18), STU_PHONE varchar(4), PROF_NUM int ) CREATE TABLE EM...
SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM GROUP BY EMP_FNAME ORDER BY COUNT(EMP_FNAME) DESC
nvbench
CREATE TABLE table_204_675 ( id number, "year" number, "game of the year" text, "abstract strategy" text, "advanced strategy" text, "family" text, "family card" text, "family strategy" text, "party" text, "puzzle" text, "word" text, "historical simulation" text, "othe...
SELECT COUNT("puzzle") FROM table_204_675
squall
CREATE TABLE table_32628 ( "Rank" real, "Player" text, "Nation" text, "Games" real, "Goals" real, "Years" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest number of goals for the player from 2008-present named tony beltran, ra...
SELECT MIN("Goals") FROM table_32628 WHERE "Years" = '2008-present' AND "Player" = 'tony beltran' AND "Rank" > '7'
wikisql
CREATE TABLE table_name_13 ( score VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the game with a record of 33 25 9?
SELECT score FROM table_name_13 WHERE record = "33–25–9"
sql_create_context
CREATE TABLE table_name_63 ( election VARCHAR, outcome_of_election VARCHAR, number_of_votes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the election with an outcome of ndc opposition and 2,728,241 votes?
SELECT election FROM table_name_63 WHERE outcome_of_election = "ndc opposition" AND number_of_votes = "2,728,241"
sql_create_context
CREATE TABLE table_21878 ( "Position" real, "Team" text, "Played" real, "Won" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" text ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT "Lost" FROM table_21878 WHERE "Drawn" = '10' AND "Goals For" = '45'
wikisql
CREATE TABLE table_train_209 ( "id" int, "body_weight" float, "diabetic" string, "lactose_intolerance" bool, "galactose_intolerance" bool, "allergy_to_food" bool, "body_mass_index_bmi" float, "a1c" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the...
SELECT * FROM table_train_209 WHERE lactose_intolerance = 1 OR galactose_intolerance = 1
criteria2sql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugst...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-157753') AND patient.unitdischargetime IS NULL)...
eicu
CREATE TABLE table_name_43 ( goals INTEGER, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Highest Goals for Grella?
SELECT MAX(goals) FROM table_name_43 WHERE name = "grella"
sql_create_context
CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_description VARCHAR(255) ) CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGER, date_of_enrolment DATETIME, date_o...
SELECT personal_name, gender_mf FROM Course_Authors_and_Tutors ORDER BY personal_name
nvbench
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T1.Name, COUNT(T1.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name
nvbench
CREATE TABLE table_26677 ( "Date (YYYY-MM-DD)" text, "Time (UTC)" text, "Latitude" text, "Longitude" text, "Depth" text, "Magnitude" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 11:40:26 is the time (utc) what is the depth?
SELECT "Depth" FROM table_26677 WHERE "Time (UTC)" = '11:40:26'
wikisql
CREATE TABLE ftxmzjzjlb ( 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 * FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i...
css
CREATE TABLE savings ( balance INTEGER, custid VARCHAR ) CREATE TABLE accounts ( name VARCHAR, custid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the total saving balance for each account name.
SELECT SUM(T2.balance), T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid GROUP BY T1.name
sql_create_context
CREATE TABLE table_29229 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the pick # of cfl team bc lions (7)
SELECT "Pick #" FROM table_29229 WHERE "CFL Team" = 'BC Lions (7)'
wikisql
CREATE TABLE table_name_67 ( opponents_in_the_final VARCHAR, partner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Opponents In The Final, when Partner is 'Ji Nov k'?
SELECT opponents_in_the_final FROM table_name_67 WHERE partner = "jiří novák"
sql_create_context
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTaskResults ( Id number, ...
SELECT Ranking = ROW_NUMBER() OVER (ORDER BY Reputation DESC), u.Id AS "user_link", u.Reputation FROM Users AS u WHERE u.Id NOT IN (SELECT DISTINCT OwnerUserId FROM Posts WHERE PostTypeId = 1 AND OwnerUserId != '') ORDER BY u.Reputation DESC LIMIT 100
sede
CREATE TABLE table_72907 ( "Class" text, "Part 1" text, "Part 2" text, "Part 3" text, "Part 4" text, "Verb meaning" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What class in the word with part 4 'giheizan'?
SELECT "Class" FROM table_72907 WHERE "Part 4" = 'giheizan'
wikisql
CREATE TABLE table_name_21 ( elevation_ VARCHAR, _height VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the elevation and height for Halfbeak?
SELECT elevation_ + _height FROM table_name_21 WHERE name = "halfbeak"
sql_create_context
CREATE TABLE table_name_67 ( floors INTEGER, built VARCHAR, roof___m__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the average number of floors that were built in 2004, and have a roof (m) of 106?
SELECT AVG(floors) FROM table_name_67 WHERE built = 2004 AND roof___m__ = 106
sql_create_context
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
(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 student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Old Church Slavic%' OR name LIKE '%Old Church Slavic%') AND credits = 5
advising
CREATE TABLE table_204_870 ( id number, "product" text, "main functionality" text, "input format" text, "output format" text, "platform" text, "license and cost" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which product ...
SELECT "product" FROM table_204_870 WHERE "input format" = 'rdf' OR "output format" = 'rdf'
squall
CREATE TABLE table_name_95 ( function__figure_ VARCHAR, serial_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Function (figure) has Serial number AF 934103?
SELECT function__figure_ FROM table_name_95 WHERE serial_number = "af 934103"
sql_create_context
CREATE TABLE table_24556 ( "Municipality" text, "Type" text, "District" text, "Area (km\u00b2)" text, "Population (2010)" real, "Pop. Density (per km\u00b2)" text, "No. of Barangays" real, "Municipal Mayor" text ) -- Using valid SQLite, answer the following questions for the tables pro...
SELECT COUNT("Population (2010)") FROM table_24556 WHERE "Municipality" = 'Cavinti'
wikisql
CREATE TABLE table_name_21 ( position VARCHAR, league_from VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team is from the Russian Major League?
SELECT position FROM table_name_21 WHERE league_from = "russian major league"
sql_create_context
CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Has_Allergy ( StuID INTEGE...
SELECT Allergy, COUNT(*) FROM Has_Allergy GROUP BY Allergy ORDER BY COUNT(*)
nvbench
CREATE TABLE table_30676 ( "Couple" text, "Style" text, "Music" text, "Trine Dehli Cleve" real, "Tor Fl\u00f8ysvik" real, "Karianne Gulliksen" real, "Christer Tornell" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is ...
SELECT MAX("Karianne Gulliksen") FROM table_30676
wikisql
CREATE TABLE table_1682026_7 ( market_value__billion_$_ VARCHAR, assets__billion_$_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the market value in billions when the assets totaled 1,380.88?
SELECT market_value__billion_$_ FROM table_1682026_7 WHERE assets__billion_$_ = "1,380.88"
sql_create_context
CREATE TABLE endowment ( endowment_id int, School_id int, donator_name text, amount real ) CREATE TABLE budget ( School_id int, Year int, Budgeted int, total_budget_percent_budgeted real, Invested int, total_budget_percent_invested real, Budget_invested_percent text ) CREAT...
SELECT County, COUNT(*) FROM School GROUP BY County
nvbench
CREATE TABLE table_21483 ( "Year" real, "West Manila" text, "East Manila" text, "Consumer Price Index (2005=100)" text, "West Manila as a share of 1996 real tariff" text, "East Manila as a share of 1996 real tariff" text ) -- Using valid SQLite, answer the following questions for the tables pr...
SELECT "West Manila" FROM table_21483 WHERE "Consumer Price Index (2005=100)" = '119.4'
wikisql
CREATE TABLE table_name_25 ( score_in_the_final VARCHAR, opponent_in_the_final VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of the match that was against alberto berasategui?
SELECT score_in_the_final FROM table_name_25 WHERE opponent_in_the_final = "alberto berasategui"
sql_create_context
CREATE TABLE table_36241 ( "Team" text, "Location" text, "Venue" text, "Capacity" real, "Position in 2000" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Capacity has a Location of mogilev?
SELECT SUM("Capacity") FROM table_36241 WHERE "Location" = 'mogilev'
wikisql
CREATE TABLE company ( Company_ID int, Rank int, Company text, Headquarters text, Main_Industry text, Sales_billion real, Profits_billion real, Assets_billion real, Market_Value real ) CREATE TABLE station_company ( Station_ID int, Company_ID int, Rank_of_the_Year int ) ...
SELECT Rank, Market_Value FROM company WHERE Main_Industry = 'Banking'
nvbench
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) 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 nu...
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JYZBLSH AND jybgb_jyjgzbb.jyjgzbb_id ...
css
CREATE TABLE table_name_73 ( against VARCHAR, losses VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number against when losses are smaller than 3, and wins arelarger than 16?
SELECT COUNT(against) FROM table_name_73 WHERE losses < 3 AND wins > 16
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE l...
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-42758')) AND intakeoutput.cellpath LIKE '%output%' AND D...
eicu
CREATE TABLE departments ( department_id number, department_name text, manager_id number, location_id number ) CREATE TABLE locations ( location_id number, street_address text, postal_code text, city text, state_province text, country_id text ) CREATE TABLE regions ( region...
SELECT job_title FROM jobs WHERE min_salary > 9000
spider
CREATE TABLE table_20522228_2 ( rating VARCHAR, viewers__millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the ratings/share ratio when viewers are 5.50 Million?
SELECT rating / SHARE(18 - 49) FROM table_20522228_2 WHERE viewers__millions_ = "5.50"
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND diagnoses.short_title = "Crbl art ocl NOS w infrc"
mimicsql_data
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellv...
SELECT 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 = '030-56105')) AND lab.labname = 'alt (sgpt)' AND STRFTIME('%y-%m', lab.labresulttime) <=...
eicu
CREATE TABLE table_67880 ( "7:00" text, "7:30" text, "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is on tv at 8:00 on the same channel that had Loft Story on at 7:00?
SELECT "8:00" FROM table_67880 WHERE "7:00" = 'loft story'
wikisql
CREATE TABLE table_21602734_1 ( league VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What league was involved in 2010?
SELECT league FROM table_21602734_1 WHERE year = 2010
sql_create_context
CREATE TABLE table_name_87 ( profits__billion_ INTEGER, sales__billion_$_ VARCHAR, headquarters VARCHAR, market_value__billion_$_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest profits in billions of the company headquartered in t...
SELECT MAX(profits__billion_) AS $_ FROM table_name_87 WHERE headquarters = "usa" AND market_value__billion_$_ = 194.87 AND sales__billion_$_ < 76.66
sql_create_context
CREATE TABLE table_203_502 ( id number, "team" text, "titles" number, "runner-up" number, "third place" number, "fourth place" number, "years participated" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is above michigan in years of pa...
SELECT "team" FROM table_203_502 WHERE "years participated" > (SELECT "years participated" FROM table_203_502 WHERE "team" = 'michigan')
squall
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 COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '3026245' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2012-08-12' AND '2020-06-16' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) < 82.99) AS T
css
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE faculty_participates_in ( facid number, actid number ) CREATE TABLE participates_in ( stuid number, actid number ) CREATE TABLE faculty ( facid number, lname text, fname text, rank text, sex text, phone number, room text, building text ) CREATE TABLE stude...
SELECT facid FROM faculty EXCEPT SELECT advisor FROM student
spider
CREATE TABLE table_name_82 ( attendance VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance of the game on December 11, 2005?
SELECT attendance FROM table_name_82 WHERE date = "december 11, 2005"
sql_create_context
CREATE TABLE time_interval ( period text, begin_time int, end_time 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_req...
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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number...
SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'phosphate') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 76332 AND admissions.dischtime IS NULL) ORDER BY labevents.charttime DESC ...
mimic_iii
CREATE TABLE table_name_62 ( time_retired VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the time/retired of the team with a grid of 14?
SELECT time_retired FROM table_name_62 WHERE grid = 14
sql_create_context
CREATE TABLE Student_Course_Registrations ( student_id INTEGER, course_id INTEGER, registration_date DATETIME ) CREATE TABLE Candidates ( candidate_id INTEGER, candidate_details VARCHAR(255) ) CREATE TABLE Courses ( course_id VARCHAR(100), course_name VARCHAR(120), course_description V...
SELECT last_name, COUNT(last_name) FROM People GROUP BY last_name ORDER BY last_name
nvbench
CREATE TABLE table_45876 ( "Region" text, "Host" text, "Venue" text, "City" text, "State" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which state includes the Harry A. Gampel Pavilion venue?
SELECT "State" FROM table_45876 WHERE "Venue" = 'harry a. gampel pavilion'
wikisql
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE lab ( labid numbe...
SELECT 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 = '017-45919')) AND treatment.treatmentname = 'mannitol - bolus .25-...
eicu
CREATE TABLE table_27835 ( "No. in series" real, "No. in season" 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 is the original air d...
SELECT "Original air date" FROM table_27835 WHERE "Title" = 'One Rat, One Ranger'
wikisql
CREATE TABLE table_name_20 ( round VARCHAR, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Round for the jiu-jitsu vs martial arts?
SELECT round FROM table_name_20 WHERE event = "jiu-jitsu vs martial arts"
sql_create_context
CREATE TABLE table_55758 ( "Sport" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Bronze that has a Total larger than 18 and a Silver smaller than 143?
SELECT MIN("Bronze") FROM table_55758 WHERE "Total" > '18' AND "Sport" = 'total' AND "Silver" < '143'
wikisql
CREATE TABLE table_name_32 ( team VARCHAR, rider VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team does Anthony Redmond ride for?
SELECT team FROM table_name_32 WHERE rider = "anthony redmond"
sql_create_context
CREATE TABLE table_name_94 ( name VARCHAR, perfection VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had a perfection percentage of 77.96%?
SELECT name FROM table_name_94 WHERE perfection = "77.96%"
sql_create_context
CREATE TABLE table_1571238_2 ( years_participated INTEGER, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many years did notre dame participate?
SELECT MAX(years_participated) FROM table_1571238_2 WHERE team = "Notre Dame"
sql_create_context
CREATE TABLE table_2048 ( "Province" text, "Latin Americans 2001" real, "% 2001" text, "Latin Americans 2011" real, "% 2011" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the percentages in 2001 in all the provinces where the percentage in...
SELECT "% 2001" FROM table_2048 WHERE "% 2011" = '0.2%'
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversa...
SELECT Tags.TagName, CAST(SUM(CASE WHEN Posts.Score < 1 THEN 1 ELSE 0 END) AS FLOAT) / CAST(COUNT(*) AS FLOAT) AS fraction_of_nonpositive_Qs FROM (PostTags INNER JOIN Tags ON PostTags.TagId = Tags.Id) INNER JOIN Posts ON Posts.Id = PostTags.PostId WHERE Tags.Count > 9 GROUP BY Tags.TagName ORDER BY fraction_of_nonposit...
sede
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, a...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'mri - head' AND STRFTIME('%y', treatment.treatmenttime) = '2103') AS t1 J...
eicu
CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Movie ( mID int, title text, year int, director text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Pleas...
SELECT T2.title, AVG(MIN(T1.stars)) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.title ORDER BY T2.title DESC
nvbench
CREATE TABLE table_name_21 ( circuit VARCHAR, winning_driver VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What circuit did Rupert Keegan win in round 8?
SELECT circuit FROM table_name_21 WHERE winning_driver = "rupert keegan" AND round = 8
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'chest pain' AND DATETIME(diagnosis.diagnosistime) ...
eicu
CREATE TABLE qtb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT qtb.MED_CLINIC_ID, qtb.PERSON_ID, qtb.PERSON_NM, qtb.IDENTITY_CARD, qtb.PERSON_SEX, qtb.PERSON_AGE FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc24.MED_AMOUT = (SELECT t_kc24.MED_AMOUT FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID = '11812286713') UNION SELECT gyb.MED_CLINIC_ID, gyb.PERSON_...
css
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, sc...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Karen Acton%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offer...
advising
CREATE TABLE table_23981882_1 ( title VARCHAR, no_in_season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the episode title for number 7 in the season?
SELECT title FROM table_23981882_1 WHERE no_in_season = 7
sql_create_context
CREATE TABLE table_name_18 ( to_par VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Ben Crenshaw has what To par?
SELECT to_par FROM table_name_18 WHERE player = "ben crenshaw"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, ...
SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjz...
css
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )...
SELECT patient.wardid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-35988') AND STRFTIME('%y', patient.unitadmittime) = '2103' ORDER BY patient.unitadmittime LIMIT 1
eicu
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '78591362' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE ...
css
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_lo...
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 = 'MILWAUKEE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENV...
atis
CREATE TABLE table_29079 ( "Date" text, "Time" text, "Visiting team" text, "Home team" text, "Site" text, "Broadcast" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List all times with Kentucky as the ho...
SELECT "Time" FROM table_29079 WHERE "Home team" = 'Kentucky'
wikisql
CREATE TABLE Roles ( Role_Code CHAR(15), Role_Name VARCHAR(255), Role_Description VARCHAR(255) ) CREATE TABLE Documents_to_be_Destroyed ( Document_ID INTEGER, Destruction_Authorised_by_Employee_ID INTEGER, Destroyed_by_Employee_ID INTEGER, Planned_Destruction_Date DATETIME, Actual_Destr...
SELECT Role_Code, COUNT(*) FROM Employees GROUP BY Role_Code ORDER BY Role_Code
nvbench
CREATE TABLE wdmzjzjlb ( 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(hz_info.RYBH) FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE wdmzjzjlb.ZZYSGH = '26801950' AND wdmzjzjlb.JZKSRQ BETWEEN '2010-08-07' AND '2015-02-03' UNION SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN bdmzjzjlb ON hz_info...
css
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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 ...
SELECT * FROM t_kc21 WHERE t_kc21.PERSON_ID = '78905782' AND t_kc21.MED_SER_ORG_NO = '9077478' AND t_kc21.MED_ORG_DEPT_NM LIKE '%科室%'
css
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 demographic.dischtime, lab.label FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Bessie Giordano"
mimicsql_data
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, C...
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '华曼衍' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 7616.57)
css
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, v...
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 94956 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label ...
mimic_iii
CREATE TABLE table_57501 ( "City of license/market" text, "Station" text, "Channel TV ( RF )" text, "Year of affiliation" real, "Year of disaffiliation" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest year of disaffiliation of a ...
SELECT MIN("Year of disaffiliation") FROM table_57501 WHERE "City of license/market" = 'hamilton, ontario'
wikisql
CREATE TABLE table_10211 ( "Rank" real, "Stadium" text, "Capacity" real, "Location" text, "County" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Gaelic Football Stadium at McHale Park's ranking in total capacity?
SELECT COUNT("Rank") FROM table_10211 WHERE "Stadium" = 'mchale park'
wikisql
CREATE TABLE table_64028 ( "Class to 1928" text, "Class from 1928" text, "Seats" text, "Quantity" real, "Year(s) of Manufacture" text, "Remarks" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest quantity having a Class to 1928 ...
SELECT MIN("Quantity") FROM table_64028 WHERE "Class to 1928" = 'bdi-21'
wikisql
CREATE TABLE table_48563 ( "Driver" text, "Entrant" text, "Constructor" text, "Time/Retired" text, "Grid" text, "Heat 1/2" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Menato Boffa's grid?
SELECT "Grid" FROM table_48563 WHERE "Driver" = 'menato boffa'
wikisql