instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_train_226 ( "id" int, "gender" string, "pregnancy_or_lactation" bool, "active_metabolic" bool, "diabetic" string, "hepatic_disease" bool, "gastrointestinal_disease" bool, "body_mass_index_bmi" float, "age" float, "NOUSE" float ) -- Using valid SQLite, answer ...
SELECT * FROM table_train_226 WHERE diabetic = 'ii'
criteria2sql
CREATE TABLE table_name_5 ( coverage VARCHAR, frequency VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the coverage for the 99.5mhz frequency?
SELECT coverage FROM table_name_5 WHERE frequency = "99.5mhz"
sql_create_context
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC te...
SELECT jybgb.SQRGH, jybgb.SQRXM FROM jybgb WHERE jybgb.BGDH = '38029039376'
css
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, h...
SELECT t4.diagnosisname FROM (SELECT t3.diagnosisname, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.diagnosisname, 100 - SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 4 * 365 THEN 1 ELSE 0 END) * 10...
eicu
CREATE TABLE table_68983 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the record for august 31
SELECT "Record" FROM table_68983 WHERE "Date" = 'august 31'
wikisql
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 Headquarter, MAX(Revenue) FROM Manufacturers GROUP BY Headquarter ORDER BY Headquarter DESC
nvbench
CREATE TABLE table_1198175_1 ( weight_lbs_ VARCHAR, born VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the weight(lbs) when born is april 6, 1954 detroit, mi?
SELECT weight_lbs_ FROM table_1198175_1 WHERE born = "April 6, 1954 Detroit, MI"
sql_create_context
CREATE TABLE table_32518 ( "Athlete Name" text, "Jump 1" text, "Jump 2" text, "Jump 3" text, "Best Jump" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has a Jump 2 of 7.06, and what is this person's Jump 3?
SELECT "Jump 3" FROM table_32518 WHERE "Jump 2" = '7.06'
wikisql
CREATE TABLE table_12962773_16 ( year_born VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was Robert Skibniewski born?
SELECT year_born FROM table_12962773_16 WHERE player = "Robert Skibniewski"
sql_create_context
CREATE TABLE table_204_795 ( id number, "date" text, "opponent" text, "score" text, "result" text, "location" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many total wins did the team have in 1948
SELECT COUNT(*) FROM table_204_795 WHERE "result" = 'win' AND "date" = 1948
squall
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE cost ( row_id numbe...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'visual loss, one eye nos') AND DATETIME(diagnoses_icd.char...
mimic_iii
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT All_Games, Team_ID FROM basketball_match ORDER BY All_Games DESC
nvbench
CREATE TABLE table_name_58 ( country VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT COUNTRY HAS A SCORE OF 68-70=138?
SELECT country FROM table_name_58 WHERE score = 68 - 70 = 138
sql_create_context
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, H...
SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '2806498' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_CD
css
CREATE TABLE table_71048 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the score of the game they played against a team with a record of 81-54?
SELECT "Score" FROM table_71048 WHERE "Record" = '81-54'
wikisql
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE T...
SELECT PostHistoryTypeId, PostId, CreationDate, Comment FROM PostHistory WHERE UserId = '##UserID##' AND (DATEDIFF(day, CreationDate, GETDATE())) < 30 ORDER BY CreationDate DESC
sede
CREATE TABLE table_name_75 ( year VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the position 6/13?
SELECT year FROM table_name_75 WHERE position = "6/13"
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_Tests_Taken ( registration_id INTEGER, date_test_taken DATETIME, test_result VARCHAR(255) ) CREATE TABLE Student_Course_Enro...
SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass" GROUP BY date_of_enrolment
nvbench
CREATE TABLE table_2764267_2 ( country VARCHAR, currency VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of countries that have the us dollar
SELECT COUNT(country) FROM table_2764267_2 WHERE currency = "US dollar"
sql_create_context
CREATE TABLE table_19810 ( "Software" text, "Version" text, "Operating systems" text, "Developer" text, "License" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the version with sbagen software?
SELECT "Version" FROM table_19810 WHERE "Software" = 'SBaGen'
wikisql
CREATE TABLE table_59251 ( "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. -- From which country is the player that won in 1998?
SELECT "Country" FROM table_59251 WHERE "Year(s) won" = '1998'
wikisql
CREATE TABLE table_67006 ( "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. -- Who directed Turks Fruit?
SELECT "Director" FROM table_67006 WHERE "Original title" = 'turks fruit'
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.icd9_code = "53390"
mimicsql_data
CREATE TABLE table_name_76 ( rank VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the rank of the team who raced at a time of 7:16.13?
SELECT rank FROM table_name_76 WHERE time = "7:16.13"
sql_create_context
CREATE TABLE table_name_86 ( crowd INTEGER, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest crowd of the west coast home team?
SELECT MIN(crowd) FROM table_name_86 WHERE home_team = "west coast"
sql_create_context
CREATE TABLE table_name_93 ( lost VARCHAR, played VARCHAR, against VARCHAR, drawn VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of lost when against is less than 37, drawn is more than 2, and played is more than 20?
SELECT COUNT(lost) FROM table_name_93 WHERE against < 37 AND drawn > 2 AND played > 20
sql_create_context
CREATE TABLE table_train_85 ( "id" int, "mini_mental_state_examination_mmse" int, "elevated_serum_phenylalanine" int, "elevated_creatinine" float, "renal_disease" bool, "geriatric_depression_scale_gds" int, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the table...
SELECT * FROM table_train_85 WHERE geriatric_depression_scale_gds >= 10
criteria2sql
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semes...
SELECT COUNT(*) > 0 FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND NOT COURSEalias0.course_id IN...
advising
CREATE TABLE table_70461 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average grid with more than 23 laps?
SELECT AVG("Grid") FROM table_70461 WHERE "Laps" > '23'
wikisql
CREATE TABLE table_34969 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which District has a First elected of 1858, and a Result of retired republican gain, and an Inc...
SELECT "District" FROM table_34969 WHERE "First elected" = '1858' AND "Result" = 'retired republican gain' AND "Incumbent" = 'william millward'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.age < "89"
mimicsql_data
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Tags ( Id number, TagName text, ...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS Rank, Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%krak%' AND Reputation > 400 ORDER BY Reputation DESC
sede
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 jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALA...
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY COUNT(HIRE_DATE) DESC
nvbench
CREATE TABLE table_46495 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "TV Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- November 25, 2001 was what week of the season?
SELECT COUNT("Week") FROM table_46495 WHERE "Date" = 'november 25, 2001'
wikisql
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
CREATE TABLE table_name_96 ( total INTEGER, year_s__won VARCHAR, country VARCHAR, to_par VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Total for the United States with a To par more than 6 and 1996 was won?
SELECT AVG(total) FROM table_name_96 WHERE country = "united states" AND to_par > 6 AND year_s__won = "1996"
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicaid" AND procedures.long_title = "Transfusion of other serum"
mimicsql_data
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, ...
SELECT Score, Text, PostId AS "post_link" FROM Comments WHERE UserId = @UserId ORDER BY Score DESC, Text
sede
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 COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '8063652' AND gwyjzb.IN_HOSP_DATE BETWEEN '2003-09-30' AND '2015-02-04' AND gwyjzb.CLINIC_TYPE = '门诊' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '8063652' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2003-09-30' AND '2015-02-04' AND fgwyjzb.CLINIC_TY...
css
CREATE TABLE table_name_78 ( tries_against VARCHAR, points_against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Tries Against, when Points Against is 213?
SELECT tries_against FROM table_name_78 WHERE points_against = "213"
sql_create_context
CREATE TABLE table_name_78 ( name VARCHAR, winning_constructor VARCHAR, winning_driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Name has a Winning constructor of bugatti, and a Winning driver of louis chiron?
SELECT name FROM table_name_78 WHERE winning_constructor = "bugatti" AND winning_driver = "louis chiron"
sql_create_context
CREATE TABLE table_13657883_2 ( rnd VARCHAR, gto_winning_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What round was the gto winning team #48 greenwood racing?
SELECT rnd FROM table_13657883_2 WHERE gto_winning_team = "#48 Greenwood Racing"
sql_create_context
CREATE TABLE table_60741 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which tournament was held on July 13, 2008?
SELECT "Tournament" FROM table_60741 WHERE "Date" = 'july 13, 2008'
wikisql
CREATE TABLE LOCATIONS ( Other_Details VARCHAR, Location_Name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the detail of the location UK Gallery?
SELECT Other_Details FROM LOCATIONS WHERE Location_Name = "UK Gallery"
sql_create_context
CREATE TABLE table_43188 ( "Team" text, "Match" text, "Points" text, "Draw" text, "Lost" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the draw for Lp Gda sk with a match of 8?
SELECT "Draw" FROM table_43188 WHERE "Match" = '8' AND "Team" = 'lpż gdańsk'
wikisql
CREATE TABLE table_name_14 ( result VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the result for opponent of chicago bears
SELECT result FROM table_name_14 WHERE opponent = "chicago bears"
sql_create_context
CREATE TABLE Addresses ( address_id INTEGER, address_content VARCHAR(80), city VARCHAR(50), zip_postcode VARCHAR(20), state_province_county VARCHAR(50), country VARCHAR(50), other_address_details VARCHAR(255) ) CREATE TABLE Customer_Addresses ( customer_id INTEGER, address_id INTEGE...
SELECT date_became_customer, COUNT(date_became_customer) FROM Customers WHERE customer_id BETWEEN 10 AND 20 ORDER BY COUNT(date_became_customer) DESC
nvbench
CREATE TABLE table_name_26 ( position VARCHAR, season VARCHAR, number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the position for the 2009-2010 season, number 1?
SELECT position FROM table_name_26 WHERE season = "2009-2010" AND number = "1"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "16" AND diagnoses.short_title = "Acute kidney failure NOS"
mimicsql_data
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number...
SELECT t.Id, t.TagName, COUNT(DISTINCT p.Id) FROM PostTags AS pt JOIN Posts AS p ON PostId = p.Id JOIN Tags AS t ON TagId = t.Id JOIN Users ON p.OwnerUserId = Users.Id WHERE p.Id IN (SELECT PostId FROM PostTags WHERE TagId = 17) AND Age <= 24 AND PostTypeId = 1 GROUP BY t.Id, t.TagName ORDER BY 3 DESC
sede
CREATE TABLE customers ( customer_id number, customer_first_name text, customer_last_name text, customer_address text, customer_phone text, customer_email text, other_customer_details text ) CREATE TABLE accounts ( account_id number, customer_id number, account_name text, ot...
SELECT T2.customer_first_name, T2.customer_last_name, T2.customer_phone FROM accounts AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.account_name = "162"
spider
CREATE TABLE table_46298 ( "Rank" real, "Heat" real, "Name" text, "Nationality" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the rank when the heat is more than 4?
SELECT SUM("Rank") FROM table_46298 WHERE "Heat" > '4'
wikisql
CREATE TABLE dorm ( dormid number, dorm_name text, student_capacity number, gender text ) CREATE TABLE has_amenity ( dormid number, amenid number ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, c...
SELECT dorm_name FROM dorm WHERE NOT dormid IN (SELECT dormid FROM has_amenity)
spider
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 lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-23267')) AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TI...
eicu
CREATE TABLE table_12828723_4 ( losing_bonus VARCHAR, points_against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many losing bonus where there when points against is 439?
SELECT COUNT(losing_bonus) FROM table_12828723_4 WHERE points_against = "439"
sql_create_context
CREATE TABLE products ( product_id number, product_name text, product_details text ) CREATE TABLE order_items ( order_item_id number, product_id number, order_id number, order_item_status text, order_item_details text ) CREATE TABLE orders ( order_id number, customer_id number,...
SELECT COUNT(*), T3.product_id FROM orders AS T1 JOIN order_items AS T2 JOIN products AS T3 ON T1.order_id = T2.order_id AND T2.product_id = T3.product_id GROUP BY T3.product_id
spider
CREATE TABLE table_name_68 ( brigade VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the brigade Tall Al-Shawk shows for the name?
SELECT brigade FROM table_name_68 WHERE name = "tall al-shawk"
sql_create_context
CREATE TABLE table_15187735_10 ( segment_b VARCHAR, segment_d VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of segment b for s banjo
SELECT COUNT(segment_b) FROM table_15187735_10 WHERE segment_d = "s Banjo"
sql_create_context
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time...
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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA...
atis
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT ACC_Regular_Season, Team_ID FROM basketball_match ORDER BY Team_ID DESC
nvbench
CREATE TABLE table_61069 ( "Constituency number" text, "Name" text, "Reserved for ( SC / ST /None)" text, "District" text, "Number of electorates (2009)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the electorates in 2009 for Modi Nagar?
SELECT AVG("Number of electorates (2009)") FROM table_61069 WHERE "Name" = 'modi nagar'
wikisql
CREATE TABLE table_204_684 ( id number, "wrestler:" text, "times:" number, "date:" text, "location:" text, "notes:" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what are the number of matches that happened in japan ?
SELECT COUNT(*) FROM table_204_684 WHERE "location:" = 'japan'
squall
CREATE TABLE broadcast_share ( channel_id number, program_id number, date text, share_in_percent number ) CREATE TABLE program ( program_id number, name text, origin text, launch number, owner text ) CREATE TABLE broadcast ( channel_id number, program_id number, time_of...
SELECT SUM(rating_in_percent), owner FROM channel GROUP BY owner
spider
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT intakeoutput.patientunitstayid FROM intakeoutput WHERE intakeoutput.celllabel = 'sn iv solution volume (ml)' AND intakeoutput.cellpath LIKE '%input%')
eicu
CREATE TABLE table_50255 ( "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 w...
SELECT SUM("Game") FROM table_50255 WHERE "Team" = 'charlotte'
wikisql
CREATE TABLE table_13759592_2 ( location VARCHAR, institution VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is Interlake located?
SELECT location FROM table_13759592_2 WHERE institution = "Interlake"
sql_create_context
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, g...
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%topic0%' OR name LIKE '%topic0%') AND department = 'EECS'
advising
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "INFL0.5LF" AND lab.fluid = "Blood"
mimicsql_data
CREATE TABLE table_47022 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score at the 2010 FIFA World Cup Qualification that results in a win?
SELECT "Score" FROM table_47022 WHERE "Competition" = '2010 fifa world cup qualification' AND "Result" = 'win'
wikisql
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE ground_service ( city_code text, airp...
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 = 'BOSTON...
atis
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutpu...
SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime, t1.patienthealthsystemstayid FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = ...
eicu
CREATE TABLE table_73392 ( "District" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date successor seated" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the date successor seated for delegate seat established
SELECT "Date successor seated" FROM table_73392 WHERE "Reason for change" = 'Delegate seat established'
wikisql
CREATE TABLE table_65343 ( "Author / Editor / Source" text, "Year of publication" text, "Countries sampled" real, "World Ranking (1)" text, "Ranking in Latin America (2)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the world ranking in 201...
SELECT "World Ranking (1)" FROM table_65343 WHERE "Year of publication" = '2011' AND "Ranking in Latin America (2)" > '3' AND "Countries sampled" > '142'
wikisql
CREATE TABLE table_63510 ( "Total fat" text, "Saturated fat" text, "Monounsaturated fat" text, "Polyunsaturated fat" text, "Smoke point" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the saturated fat with a total fat of 100g and 11g of pol...
SELECT "Saturated fat" FROM table_63510 WHERE "Total fat" = '100g' AND "Polyunsaturated fat" = '11g'
wikisql
CREATE TABLE table_203_385 ( id number, "material" text, "formula" text, "refractive\nindex(es)\n589.3 nm" text, "dispersion\n431 - 687 nm" number, "hardness\n(mohs'\nscale)" text, "density\n(g/cm3)" text, "thermal\ncond." text, "state of\nthe art" text ) -- Using valid SQLite, ans...
SELECT "material" FROM table_203_385 WHERE NOT "thermal\ncond." IS NULL AND "thermal\ncond." <> 'excellent' AND "thermal\ncond." <> 'poor'
squall
CREATE TABLE table_42498 ( "Year" real, "Winner" text, "School" text, "Position" text, "Points" text, "% of Points Possible" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position does the winner from Ohio State with 412 points play?
SELECT "Position" FROM table_42498 WHERE "School" = 'ohio state' AND "Points" = '412'
wikisql
CREATE TABLE table_66383 ( "Year" real, "Gross Domestic Product" real, "US Dollar Exchange" text, "Inflation Index (2000=100)" real, "Per Capita Income (as % of USA)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much Gross Domestic Product has...
SELECT SUM("Gross Domestic Product") FROM table_66383 WHERE "US Dollar Exchange" = '12.19 algerian dinars' AND "Inflation Index (2000=100)" > '22'
wikisql
CREATE TABLE table_23825 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (in millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What series was directed ...
SELECT MIN("Series #") FROM table_23825 WHERE "Directed by" = 'Mark Roskin'
wikisql
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, d...
SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14054) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'pt') AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRENT_TIME...
mimic_iii
CREATE TABLE table_2668374_18 ( incumbent VARCHAR, party VARCHAR, first_elected VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What incumbent was a federalist that was first elected in 1803?
SELECT incumbent FROM table_2668374_18 WHERE party = "Federalist" AND first_elected = "1803"
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 jyjgzbb.JCFF 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 jybgb.YLJGDM = jyj...
css
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) 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...
SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(DEPARTMENT_ID)
nvbench
CREATE TABLE election ( election_id number, representative_id number, date text, votes number, vote_percent number, seats number, place number ) CREATE TABLE representative ( representative_id number, name text, state text, party text, lifespan text ) -- Using valid SQ...
SELECT party, COUNT(*) FROM representative GROUP BY party
spider
CREATE TABLE table_58683 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( S )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which golfer had a score of 68-70-68-66=272?
SELECT "Player" FROM table_58683 WHERE "Score" = '68-70-68-66=272'
wikisql
CREATE TABLE table_55528 ( "Month" text, "Week" real, "Overall" text, "Offensive" text, "Defensive" text, "Transition" text, "Rookie" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the first week that had a transition with Pat Mccre...
SELECT MIN("Week") FROM table_55528 WHERE "Transition" = 'pat mccready'
wikisql
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
SELECT Support_rate, Consider_rate FROM candidate
nvbench
CREATE TABLE table_27771406_1 ( total_dismissals INTEGER, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many total dismissals did the player for Guyana have?
SELECT MAX(total_dismissals) FROM table_27771406_1 WHERE club = "Guyana"
sql_create_context
CREATE TABLE table_20314 ( "Series" text, "Episodes" real, "Series premiere" text, "Series finale" text, "Region 1" text, "Region 2" text, "Region 4" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the region 1 date for series 4
SELECT "Region 1" FROM table_20314 WHERE "Series" = '4'
wikisql
CREATE TABLE table_63475 ( "Pick" real, "Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the College of the Pick from Denver Broncos?
SELECT "College" FROM table_63475 WHERE "Team" = 'denver broncos'
wikisql
CREATE TABLE school_details ( school_id number, nickname text, colors text, league text, class text, division text ) CREATE TABLE school ( school_id number, school text, location text, enrollment number, founded number, denomination text, boys_or_girls text, day_...
SELECT COUNT(DISTINCT position) FROM player
spider
CREATE TABLE table_203_338 ( id number, "#" number, "title" text, "date" text, "director" text, "story" text, "synopsis" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of stories directed by jim ryan ?
SELECT COUNT("title") FROM table_203_338 WHERE "story" = 'jim ryan'
squall
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text...
SELECT jyjgzbb.JYZBLSH 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 jybgb.YLJGDM = ...
css
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescription...
SELECT demographic.marital_status, demographic.admission_type FROM demographic WHERE demographic.name = "Jerry Deberry"
mimicsql_data
CREATE TABLE staff ( staff_id number, staff_details text ) CREATE TABLE claims_processing ( claim_processing_id number, claim_id number, claim_outcome_code text, claim_stage_id number, staff_id number ) CREATE TABLE claims_documents ( claim_id number, document_type_code text, c...
SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.policy_type_code = "Deputy" OR t1.policy_type_code = "Uniform"
spider
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 SUM(t_kc22.AMOUNT) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '90720666' AND t_kc22.t_kc21_CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2000-02-09' AND '2000-05-14' AND t_kc22.MED_INV_ITEM_TYPE = '西药费'
css
CREATE TABLE table_name_63 ( engine VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What engine does the Tasman Motorsports team have?
SELECT engine FROM table_name_63 WHERE team = "tasman motorsports"
sql_create_context
CREATE TABLE table_name_63 ( score INTEGER, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the 27 arrow match event, what's the sum of all scores for that event?
SELECT SUM(score) FROM table_name_63 WHERE event = "27 arrow match"
sql_create_context
CREATE TABLE table_59679 ( "Abbr" text, "Common English" text, "French" text, "Italian" text, "Romansh" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the abbr of argovia?
SELECT "Abbr" FROM table_59679 WHERE "Italian" = 'argovia'
wikisql
CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Movie ( mID int, title text, year int, director text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show ...
SELECT stars, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY stars
nvbench
CREATE TABLE table_14902507_2 ( channel VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many channels were the games shown on in 2001-02?
SELECT COUNT(channel) FROM table_14902507_2 WHERE year = "2001-02"
sql_create_context