instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '昌正平' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 1846.9)
css
CREATE TABLE table_1507852_1 ( description VARCHAR, type VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the type is 'reset' what is the description?
SELECT description FROM table_1507852_1 WHERE type = "reset"
sql_create_context
CREATE TABLE table_63117 ( "Tournament" text, "Wins" real, "Top-5" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With events less than 0, what is the fewest Top-5?
SELECT MIN("Top-5") FROM table_63117 WHERE "Events" < '0'
wikisql
CREATE TABLE table_10015132_11 ( school_club_team VARCHAR, no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many schools did player number 3 play at?
SELECT COUNT(school_club_team) FROM table_10015132_11 WHERE no = "3"
sql_create_context
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose...
SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 90663 AND admissions.dischtime IS NULL)
mimic_iii
CREATE TABLE table_25863 ( "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 "Score" FROM table_25863 WHERE "Team" = 'Houston'
wikisql
CREATE TABLE table_204_981 ( id number, "ep#" number, "title" text, "broadcast date" text, "written by" text, "directed by" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many episodes aired in july 1995 ?
SELECT COUNT("ep#") FROM table_204_981 WHERE "broadcast date" = 7 AND "broadcast date" = 1995
squall
CREATE TABLE table_name_7 ( result INTEGER, name VARCHAR, reaction_time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest result for Wallace Spearmon when the reaction time is greater than 0.167?
SELECT MAX(result) FROM table_name_7 WHERE name = "wallace spearmon" AND reaction_time > 0.167
sql_create_context
CREATE TABLE Roles ( Role_Code CHAR(15), Role_Name VARCHAR(255), Role_Description VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) CREATE TABLE All_Documents ( Document_ID INTEGER, Da...
SELECT Role_Code, COUNT(*) FROM Employees GROUP BY Role_Code ORDER BY COUNT(*)
nvbench
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "1" AND procedures.long_title = "Aortography"
mimicsql_data
CREATE TABLE table_77909 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me who was the opponent on May 6
SELECT "Opponent" FROM table_77909 WHERE "Date" = 'may 6'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepid text,...
SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355' AND patient.hospitaldischargetime IS NULL)) AND microlab.culturesite...
eicu
CREATE TABLE table_15827397_1 ( no VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many locomotives have a name of City of Birmingham
SELECT COUNT(no) FROM table_15827397_1 WHERE name = "City of Birmingham"
sql_create_context
CREATE TABLE table_name_82 ( ben_tahir VARCHAR, liscumb VARCHAR, libweshya VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Ben-Tahir has a 6 Liscumb and 3 Libweshya?
SELECT ben_tahir FROM table_name_82 WHERE liscumb = "6" AND libweshya = "3"
sql_create_context
CREATE TABLE table_73289 ( "Season" real, "Episode" real, "Episode Summary" text, "Premier date" text, "External Link" text, "Coach" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many seasons feature Rob Masek?
SELECT COUNT("Season") FROM table_73289 WHERE "Coach" = 'Rob Masek'
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.dob_year < "2023" AND procedures.short_title = "Cardiopulm resuscita NOS"
mimicsql_data
CREATE TABLE table_5593 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the oilers record on October 20?
SELECT "Record" FROM table_5593 WHERE "Date" = 'october 20'
wikisql
CREATE TABLE Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CREATE TABLE Transactions_Lots ( transaction_id INTEGER, lot_id INTEGER ) CREATE TABLE Investors ( investor_id INTEGER, Investor_details VARCHAR(255) ) CREATE TABLE Transactions ( transaction_id INTEGER, i...
SELECT date_of_transaction, SUM(share_count) FROM Transactions
nvbench
CREATE TABLE table_name_80 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 1999 answer when 1998 is Grand Slam Tournaments?
SELECT 1999 FROM table_name_80 WHERE 1998 = "grand slam tournaments"
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 demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "PITUITARY BLEED"
mimicsql_data
CREATE TABLE table_name_64 ( character VARCHAR, duration VARCHAR, soap_opera VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What character was portrayed by the same actor for 12 years on Neighbours?
SELECT character FROM table_name_64 WHERE duration = "12 years" AND soap_opera = "neighbours"
sql_create_context
CREATE TABLE table_15366849_1 ( c_ VARCHAR, metropolitan_borough_ VARCHAR, station VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many metropolitan boroughs have dorridge as a station?
SELECT COUNT(metropolitan_borough_) AS "c_" FROM table_15366849_1 WHERE station = "Dorridge"
sql_create_context
CREATE TABLE table_16729457_16 ( driver___passenger VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the driver/passenger for position 8
SELECT driver___passenger FROM table_16729457_16 WHERE position = 8
sql_create_context
CREATE TABLE table_186 ( "Round" real, "Grand Prix" text, "Pole Position" text, "Fastest Lap" text, "Winning Driver" text, "Winning Constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who drove the winning car construc...
SELECT "Winning Driver" FROM table_186 WHERE "Winning Constructor" = 'Jordan - Mugen-Honda'
wikisql
CREATE TABLE table_77298 ( "Year" real, "Award" text, "Category" text, "Country" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Year has an Award of 17th bangkok critics assembly awards, and a Category of best original score?
SELECT "Year" FROM table_77298 WHERE "Award" = '17th bangkok critics assembly awards' AND "Category" = 'best original score'
wikisql
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT t_kc21.MED_ORG_DEPT_NM, t_kc21.IN_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '0671916' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.IN_DIAG_DIS_NM HAVING AVG(t_kc21.PERSON_AGE) < 30
css
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text, person_info_CSD text, person_info_CSRQ time, person_info_GJDM text, person_info_GJMC text, person_info_JGDM text, person_info_JGMC text, person_info_MZDM text, person_info_MZMC text, person_info_XBDM ...
SELECT * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.person_info_XM = '褚伟晔' AND hz_info.YLJGDM = '4466465' AND NOT zyjzjlb.CYKSMC LIKE '%神外%'
css
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( r...
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'coronar arteriogr-2 cath') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73713) AND DATETIME(proced...
mimic_iii
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 jobs ( job_id te...
SELECT DISTINCT * FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T1.employee_id = T2.manager_id
spider
CREATE TABLE table_27723228_12 ( record VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the record for w 101 93 (ot)
SELECT record FROM table_27723228_12 WHERE score = "W 101–93 (OT)"
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 prescriptions.drug, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "NAPH15I"
mimicsql_data
CREATE TABLE table_name_9 ( manner_of_departure VARCHAR, date_of_appointment VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the manner of depature of the manager with a date of appointment on 23 November 2008?
SELECT manner_of_departure FROM table_name_9 WHERE date_of_appointment = "23 november 2008"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE vitalperiodic ( vitalperio...
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'coma')) AND STRFTIME('%y', cost.chargetime) ...
eicu
CREATE TABLE table_1974482_1 ( location VARCHAR, founded VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the location for 1829
SELECT location FROM table_1974482_1 WHERE founded = 1829
sql_create_context
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 (SELECT gwyjzb.MED_ORG_DEPT_CD FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '1011651' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-05-20' AND '2018-12-18' GROUP BY gwyjzb.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) <= 1777.85 UNION SELECT fgwyjzb...
css
CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stock int ) CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price real ) CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Rankin...
SELECT Carrier, SUM(Memory_in_G) FROM phone GROUP BY Carrier ORDER BY Carrier
nvbench
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 real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
SELECT Name, Height FROM people ORDER BY Height
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 Founder, SUM(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder
nvbench
CREATE TABLE table_27940 ( "meas. num." real, "passed" text, "YES votes" real, "NO votes" real, "% YES" text, "Const. Amd.?" text, "type" text, "description" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the aggregate number of ...
SELECT COUNT("YES votes") FROM table_27940 WHERE "NO votes" < '299939.1619948521' AND "% YES" = '66.49%'
wikisql
CREATE TABLE table_10401 ( "NGC number" real, "Object type" text, "Constellation" text, "Right ascension ( J2000 )" text, "Declination ( J2000 )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of NGC number for sagittarius and ...
SELECT COUNT("NGC number") FROM table_10401 WHERE "Constellation" = 'sagittarius' AND "Object type" = 'diffuse nebula' AND "Declination ( J2000 )" = '°02′'
wikisql
CREATE TABLE table_18950570_4 ( brazil_100_percentage__percent_of_the_population_ VARCHAR, age_group VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what ae all of the brazil 100% where the age group is 15-17?
SELECT brazil_100_percentage__percent_of_the_population_ FROM table_18950570_4 WHERE age_group = "15-17"
sql_create_context
CREATE TABLE table_name_21 ( timeslot VARCHAR, calls VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the timeslot of calls of wrko
SELECT timeslot FROM table_name_21 WHERE calls = "wrko"
sql_create_context
CREATE TABLE table_name_38 ( record VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record at the game on November 13, 1932?
SELECT record FROM table_name_38 WHERE date = "november 13, 1932"
sql_create_context
CREATE TABLE table_name_78 ( score VARCHAR, date VARCHAR, competition_round VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of the copa libertadores group 4 competition round on 14 March 1972 with universitario as ...
SELECT score FROM table_name_78 WHERE competition_round = "copa libertadores group 4" AND away_team = "universitario" AND date = "14 march 1972"
sql_create_context
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_CD, MIN(t_kc24.PER_EXP / t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '8925142' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_CD ORDER BY MIN(t_kc24.PER_EXP / t_kc24.MED_AMOUT)
css
CREATE TABLE table_78455 ( "League" text, "Sport" text, "Season" text, "Total attendance" text, "Average attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the highest average attendance in the 2009 season?
SELECT MAX("Average attendance") FROM table_78455 WHERE "Season" = '2009'
wikisql
CREATE TABLE table_21458142_1 ( publisher VARCHAR, genre VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who published the title in the pet-raising simulator genre?
SELECT publisher FROM table_21458142_1 WHERE genre = "Pet-raising simulator"
sql_create_context
CREATE TABLE table_26301697_2 ( represents VARCHAR, contestant VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of represents for clary sermina delgado cid
SELECT COUNT(represents) FROM table_26301697_2 WHERE contestant = "Clary Sermina Delgado Cid"
sql_create_context
CREATE TABLE Ref_Detention_Type ( detention_type_code VARCHAR(10), detention_type_description VARCHAR(80) ) CREATE TABLE Assessment_Notes ( notes_id INTEGER, student_id INTEGER, teacher_id INTEGER, date_of_notes DATETIME, text_of_notes VARCHAR(255), other_details VARCHAR(255) ) CREATE ...
SELECT date_address_from, AVG(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC
nvbench
CREATE TABLE table_10416547_1 ( music_genre_style VARCHAR, lyrics_theme_style VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of music genre/style in which the lyrics are a detective story?
SELECT COUNT(music_genre_style) FROM table_10416547_1 WHERE lyrics_theme_style = "Detective story"
sql_create_context
CREATE TABLE table_75117 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent at the game with a score of 7 6?
SELECT "Opponent" FROM table_75117 WHERE "Score" = '7–6'
wikisql
CREATE TABLE table_name_22 ( byes VARCHAR, draws INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many byes when the draws are less than 0?
SELECT COUNT(byes) FROM table_name_22 WHERE draws < 0
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE vitalperiodic ( ...
SELECT MAX(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-166' AND NOT patient.hospitaldischargetime I...
eicu
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
SELECT demographic.admission_type, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "1121"
mimicsql_data
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( ...
SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age >= 60) GROUP BY medication.drugname) AS t1 WHERE t1.c1 <= 4
eicu
CREATE TABLE table_38040 ( "Name" text, "Goals" real, "Caps" real, "First cap" text, "Latest cap" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the first cap associated with 74 caps?
SELECT "First cap" FROM table_38040 WHERE "Caps" = '74'
wikisql
CREATE TABLE table_33949 ( "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which tournament features the partner julian knowle?
SELECT "Tournament" FROM table_33949 WHERE "Partner" = 'julian knowle'
wikisql
CREATE TABLE table_name_66 ( singapore_gross VARCHAR, director VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the directed by 1991, what was the gross in Singapore?
SELECT singapore_gross FROM table_name_66 WHERE director = "1991"
sql_create_context
CREATE TABLE wedding ( Church_ID int, Male_ID int, Female_ID int, Year int ) CREATE TABLE church ( Church_ID int, Name text, Organized_by text, Open_Date int, Continuation_of text ) CREATE TABLE people ( People_ID int, Name text, Country text, Is_Male text, Age ...
SELECT Country, COUNT(*) FROM people GROUP BY Country ORDER BY COUNT(*)
nvbench
CREATE TABLE table_18233 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the incumbent for first elected 1958
SELECT "Incumbent" FROM table_18233 WHERE "First elected" = '1958'
wikisql
CREATE TABLE staff ( staff_id number, staff_first_name text, staff_last_name text, other_staff_details text ) CREATE TABLE problems ( problem_id number, product_id number, closure_authorised_by_staff_id number, reported_by_staff_id number, date_problem_reported time, date_proble...
SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T3.staff_first_name = "Lacey" AND T3.staff_last_name = "Bosco" INTERSECT SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.pr...
spider
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 * FROM jybgb WHERE jybgb.JZLSH = '11083339230'
css
CREATE TABLE list ( LastName TEXT, FirstName TEXT, Grade INTEGER, Classroom INTEGER ) CREATE TABLE teachers ( LastName TEXT, FirstName TEXT, Classroom INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Scatter plot to show classroom on x axi...
SELECT Classroom, COUNT(*) FROM list GROUP BY Classroom
nvbench
CREATE TABLE table_name_14 ( venue VARCHAR, opposing_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Venue for Hawke's bay?
SELECT venue FROM table_name_14 WHERE opposing_team = "hawke's bay"
sql_create_context
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, star...
SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'SURVMETH' AND course.number = 616 AND instructor.name LIKE '%Michele Papucci%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instr...
advising
CREATE TABLE table_name_2 ( team_1 VARCHAR, team_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team was team 1 that had a team 2 that was la nuova piovese (veneto a)?
SELECT team_1 FROM table_name_2 WHERE team_2 = "la nuova piovese (veneto a)"
sql_create_context
CREATE TABLE table_26129220_2 ( party VARCHAR, residence VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many party classifications are there for the senator from Canton?
SELECT party FROM table_26129220_2 WHERE residence = "Canton"
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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.dob_year < "2104"
mimicsql_data
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 gwyjzb.MED_ORG_DEPT_NM, gwyjzb.OUT_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '7434409' GROUP BY gwyjzb.MED_ORG_DEPT_NM, gwyjzb.OUT_DIAG_DIS_NM UNION SELECT fgwyjzb.MED_ORG_DEPT_NM, fgwyjzb.OUT_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '74...
css
CREATE TABLE table_30935 ( "Series #" real, "Production Code" real, "Title" text, "Directed by" text, "Written by" text, "United States Original Airdate" text, "Canada Original Airdate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was...
SELECT "United States Original Airdate" FROM table_30935 WHERE "Title" = 'The Fraud Princess'
wikisql
CREATE TABLE table_name_14 ( location VARCHAR, silver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where did sohn bong-gak win silver?
SELECT location FROM table_name_14 WHERE silver = "sohn bong-gak"
sql_create_context
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, ...
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23237) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents...
mimic_iii
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.diagnosis, prescriptions.drug FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "85673"
mimicsql_data
CREATE TABLE table_76074 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many weeks have october 31, 1954 as the date?
SELECT COUNT("Week") FROM table_76074 WHERE "Date" = 'october 31, 1954'
wikisql
CREATE TABLE table_2342 ( "English title" text, "Russian title" text, "Published in Russian" text, "Published in English" text, "Type of work" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- when type of work is novel and published in english is 1977...
SELECT "Published in Russian" FROM table_2342 WHERE "Type of work" = 'novel' AND "Published in English" = '1977'
wikisql
CREATE TABLE table_name_52 ( total INTEGER, country VARCHAR, year_s__won VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total sum of the player from the United States who won in 1986?
SELECT SUM(total) FROM table_name_52 WHERE country = "united states" AND year_s__won = "1986"
sql_create_context
CREATE TABLE table_name_36 ( points_for VARCHAR, played_in VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the played in, what are the total points?
SELECT points_for FROM table_name_36 WHERE played_in = "total"
sql_create_context
CREATE TABLE table_58323 ( "Race Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of race that has a winning driver of Stirling moss and ...
SELECT "Race Name" FROM table_58323 WHERE "Winning driver" = 'stirling moss' AND "Circuit" = 'oulton park'
wikisql
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, ...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'mesna' AND DATETIME(prescriptions.startdate, 'start of year') = D...
mimic_iii
CREATE TABLE table_71719 ( "Rank" real, "Player" text, "Games" real, "Goals" real, "Goal Ratio" real, "Debut in Europe" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What lowest games have a Goal Ratio of 0, and Goals smaller than 0?
SELECT MIN("Games") FROM table_71719 WHERE "Goal Ratio" = '0' AND "Goals" < '0'
wikisql
CREATE TABLE table_68509 ( "Date" text, "Course" text, "Distance" text, "Winner" text, "Race Leader" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the winner for rest day race leader
SELECT "Winner" FROM table_68509 WHERE "Race Leader" = 'rest day'
wikisql
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 departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE...
SELECT FIRST_NAME, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY MANAGER_ID
nvbench
CREATE TABLE table_203_612 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many countries have earned over a hundred medals in total ?
SELECT COUNT("nation") FROM table_203_612 WHERE "total" > 100
squall
CREATE TABLE table_name_22 ( english_meaning VARCHAR, full_word VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is English Meaning, when Full Word is 'Shens Gamo'?
SELECT english_meaning FROM table_name_22 WHERE full_word = "shens gamo"
sql_create_context
CREATE TABLE table_name_46 ( source VARCHAR, undecided VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Source has a Undecided of 2%?
SELECT source FROM table_name_46 WHERE undecided = "2%"
sql_create_context
CREATE TABLE table_name_64 ( opponent VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent during the second round?
SELECT opponent FROM table_name_64 WHERE round = "second round"
sql_create_context
CREATE TABLE table_36353 ( "Outcome" text, "Date" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Surface has a Partner of sorana c rstea?
SELECT "Surface" FROM table_36353 WHERE "Partner" = 'sorana cîrstea'
wikisql
CREATE TABLE table_57982 ( "Block A" text, "Ryuji Hijikata" text, "Shuji Kondo" text, "MAZADA" text, "El Samurai" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the Shuji Kondo for MAZADA of X with Ryuji Hijikata of hijikata (14:24)
SELECT "Shuji Kondo" FROM table_57982 WHERE "MAZADA" = 'x' AND "Ryuji Hijikata" = 'hijikata (14:24)'
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 prescriptions.drug_type FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Kelly Gallardo"
mimicsql_data
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_Road, ACC_Percent FROM basketball_match ORDER BY All_Road DESC
nvbench
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, econ...
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, fare, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND NOT fare.round_trip_cost IS NULL AND flight_fare.fare_...
atis
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.t_kc21_MED_SER_ORG_NO FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '花淑华' AND t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '603623-l')
css
CREATE TABLE table_name_99 ( end_date VARCHAR, to_club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- A player was moved to celtic had an end of what date?
SELECT end_date FROM table_name_99 WHERE to_club = "celtic"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.diagnosis = "LEFT COLON CANCER"
mimicsql_data
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 Name, SUM(Price) FROM Products GROUP BY Name ORDER BY SUM(Price) DESC
nvbench
CREATE TABLE table_72878 ( "Fin. Pos" real, "Car No." real, "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Laps Led" real, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of ...
SELECT COUNT("Fin. Pos") FROM table_72878 WHERE "Points" = '12' AND "Time/Retired" = 'Accident'
wikisql
CREATE TABLE table_46371 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Score" text, "Record" text, "Streak" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people attended the green bay packers g...
SELECT SUM("Attendance") FROM table_46371 WHERE "Opponent" = 'green bay packers'
wikisql
CREATE TABLE table_63537 ( "Model number" text, "sSpec number" text, "Frequency" text, "Turbo" text, "Cores" real, "L2 cache" text, "L3 cache" text, "I/O bus" text, "Mult." text, "Memory" text, "Voltage" text, "Socket" text, "Release date" text, "Part number(s)" t...
SELECT "Memory" FROM table_63537 WHERE "Socket" = 'socket g1' AND "Turbo" = '1/1/6/9'
wikisql
CREATE TABLE table_name_79 ( assisted VARCHAR, solo VARCHAR, sack VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the assisted when the solo is 6 and sack is less than 5?
SELECT assisted FROM table_name_79 WHERE solo = 6 AND sack < 5
sql_create_context
CREATE TABLE table_8519 ( "Player" text, "Nationality" text, "Position" text, "Years for Grizzlies" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the school that played for the Grizzlie from 1995-1998?
SELECT "School/Club Team" FROM table_8519 WHERE "Years for Grizzlies" = '1995-1998'
wikisql