instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM ...
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_mzjzjlb.JZLSH = mzjzjl...
css
CREATE TABLE table_name_49 ( player VARCHAR, place VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player from the United States is in a place of T2?
SELECT player FROM table_name_49 WHERE place = "t2" AND country = "united states"
sql_create_context
CREATE TABLE stay ( stayid number, patient number, room number, staystart time, stayend time ) CREATE TABLE procedures ( code number, name text, cost number ) CREATE TABLE on_call ( nurse number, blockfloor number, blockcode number, oncallstart time, oncallend time ...
SELECT COUNT(*) FROM patient WHERE NOT ssn IN (SELECT T1.patient FROM prescribes AS T1 JOIN medication AS T2 ON T1.medication = T2.code WHERE T2.name = 'Procrastin-X')
spider
CREATE TABLE table_38249 ( "Election" text, "D\u00e1il" text, "Share of votes" text, "Seats" real, "Government" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Government has 57 seats?
SELECT "Government" FROM table_38249 WHERE "Seats" = '57'
wikisql
CREATE TABLE table_name_50 ( opponent VARCHAR, date VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the opponent for jul 31 and score of w 5-1
SELECT opponent FROM table_name_50 WHERE date = "jul 31" AND score = "w 5-1"
sql_create_context
CREATE TABLE table_23346303_4 ( rebounds VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many rebounds did crystal ayers have?
SELECT COUNT(rebounds) FROM table_23346303_4 WHERE player = "Crystal Ayers"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.label = "CD4/CD8 Ratio"
mimicsql_data
CREATE TABLE table_8512 ( "Rank" real, "Team" text, "Round1" real, "Round2" real, "Round3" real, "Round4" real, "Round5" real, "Total Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is round1 when round3 is less than 51, tota...
SELECT AVG("Round1") FROM table_8512 WHERE "Round3" < '51' AND "Total Points" < '273' AND "Round2" < '98' AND "Round5" < '24'
wikisql
CREATE TABLE table_11677 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many laps have a Time/Retired of + 4 laps, and a Driver of graham hill?
SELECT "Laps" FROM table_11677 WHERE "Time/Retired" = '+ 4 laps' AND "Driver" = 'graham hill'
wikisql
CREATE TABLE table_65010 ( "School" text, "Location" text, "Mascot" text, "Enrollment 08-09" real, "IHSAA Class" text, "County" text, "Year Joined" real, "Previous Conference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell m...
SELECT "County" FROM table_65010 WHERE "Location" = 'shelbyville'
wikisql
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_i...
mimic_iii
CREATE TABLE table_name_86 ( catalogue VARCHAR, song_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What catalogue is the song It's Now or Never?
SELECT catalogue FROM table_name_86 WHERE song_title = "it's now or never"
sql_create_context
CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME, Day_Number INTEGER ) CREATE TABLE All_Documents ( Document_ID INTEGER, Date_Stored DATETIME, Document_Type_Code CHAR(15), Document_Name CHAR(255), Document_Description CHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Documents_to_...
SELECT Calendar_Date, Day_Number FROM Ref_Calendar
nvbench
CREATE TABLE table_name_93 ( game__number INTEGER, home VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the first game that has a home team of Detroit?
SELECT MIN(game__number) FROM table_name_93 WHERE home = "detroit"
sql_create_context
CREATE TABLE table_66711 ( "2005" real, "2006" real, "2007" real, "2008" real, "2009" real, "2010" real, "Total" real, "Average annual" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average value for 2005, when the value for...
SELECT AVG("2005") FROM table_66711 WHERE "Average annual" = '767'
wikisql
CREATE TABLE table_24167 ( "Episode" text, "Broadcast date" text, "Run time" text, "Viewers (in millions)" text, "Archive" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many archive were when run time is 24:34
SELECT "Archive" FROM table_24167 WHERE "Run time" = '24:34'
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 procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2176" AND procedures.short_title = "Abdominal wall incision"
mimicsql_data
CREATE TABLE table_40379 ( "Index" text, "Name" text, "Song" text, "Group Song" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Score, when Name is Nicole ?
SELECT "Score" FROM table_40379 WHERE "Name" = 'nicole 赖淞凤'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Medicare" AND lab.label = "Atypical Lymphocytes"
mimicsql_data
CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIGH_DEGREE varchar(5) ) CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_C...
SELECT STU_FNAME, SUM(STU_GPA) FROM STUDENT WHERE STU_GPA < (SELECT AVG(STU_GPA) FROM STUDENT) GROUP BY STU_FNAME ORDER BY SUM(STU_GPA)
nvbench
CREATE TABLE city ( city_id number, county_id number, name text, white number, black number, amerindian number, asian number, multiracial number, hispanic number ) CREATE TABLE county_public_safety ( county_id number, name text, population number, police_officers num...
SELECT police_force, COUNT(*) FROM county_public_safety GROUP BY police_force
spider
CREATE TABLE table_20891 ( "Archbishop" text, "Born" text, "Ordained Priest" text, "Ordained Bishop" text, "Appointed Archbishop" text, "Vacated throne" text, "Died" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was the person ord...
SELECT "Ordained Bishop" FROM table_20891 WHERE "Ordained Priest" = 'December 1838'
wikisql
CREATE TABLE table_name_12 ( party VARCHAR, years_in_senate VARCHAR, years_in_assembly VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Party has Years in Senate of , and Years in Assembly of 2012 present?
SELECT party FROM table_name_12 WHERE years_in_senate = "—" AND years_in_assembly = "2012–present"
sql_create_context
CREATE TABLE table_54940 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where did the away team score 11.15 (81)?
SELECT "Venue" FROM table_54940 WHERE "Away team score" = '11.15 (81)'
wikisql
CREATE TABLE musical ( Musical_ID int, Name text, Year int, Award text, Category text, Nominee text, Result text ) CREATE TABLE actor ( Actor_ID int, Name text, Musical_ID int, Character text, Duration text, age int ) -- Using valid SQLite, answer the following que...
SELECT T2.Name, COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID
nvbench
CREATE TABLE table_33118 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the away team's score against Hawthorn?...
SELECT "Away team score" FROM table_33118 WHERE "Home team" = 'hawthorn'
wikisql
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text...
SELECT meter_700, meter_100 FROM swimmer ORDER BY meter_700
nvbench
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 d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE STRFTIME('%y', procedures_icd.charttime) = '2103' GROUP BY procedures_icd.icd9_code) AS t1 ...
mimic_iii
CREATE TABLE table_27114708_2 ( manner_of_departure VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For livorno team mention all the manner of departure
SELECT manner_of_departure FROM table_27114708_2 WHERE team = "Livorno"
sql_create_context
CREATE TABLE table_43544 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of attendance for the games played at Los Angeles Rams?
SELECT SUM("Attendance") FROM table_43544 WHERE "Opponent" = 'at los angeles rams'
wikisql
CREATE TABLE table_80133 ( "Year" text, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the year when Conrad H ckst dt won Men's S...
SELECT "Year" FROM table_80133 WHERE "Men's singles" = 'conrad hückstädt'
wikisql
CREATE TABLE table_name_88 ( laps INTEGER, manufacturer VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the sum of Laps that has the Manufacturer of kawasaki, and the Grid smaller than 7?
SELECT SUM(laps) FROM table_name_88 WHERE manufacturer = "kawasaki" AND grid < 7
sql_create_context
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 T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T1.Code
nvbench
CREATE TABLE table_name_23 ( music VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What music is in the film before 1962?
SELECT music FROM table_name_23 WHERE year = 1962
sql_create_context
CREATE TABLE Products ( product_id INTEGER, product_type_code VARCHAR(10), product_name VARCHAR(80), product_price DECIMAL(19,4) ) CREATE TABLE Staff_Department_Assignments ( staff_id INTEGER, department_id INTEGER, date_assigned_from DATETIME, job_title_code VARCHAR(10), date_assig...
SELECT product_type_code, MAX(product_price) FROM Products GROUP BY product_type_code ORDER BY product_type_code DESC
nvbench
CREATE TABLE table_204_91 ( id number, "year" number, "original title" text, "english title" text, "role" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many times does fy & bi film appear under the notes column ?
SELECT COUNT(*) FROM table_204_91 WHERE "notes" = 'fy & bi film'
squall
CREATE TABLE table_3301 ( "Season" real, "Champion" text, "Second" text, "Third" text, "Team Champion" text, "National Trophy/Rookie" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If second is Sergey Sirotkin, what is the third name?
SELECT "Third" FROM table_3301 WHERE "Second" = 'Sergey Sirotkin'
wikisql
CREATE TABLE table_name_22 ( screening_completed VARCHAR, screening_started VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the screening completed for screening started 23 january 2006
SELECT screening_completed FROM table_name_22 WHERE screening_started = "23 january 2006"
sql_create_context
CREATE TABLE table_45456 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the player with a pick less than 234 and a quarterback position?
SELECT "Player" FROM table_45456 WHERE "Pick" < '234' AND "Position" = 'quarterback'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "4610" AND prescriptions.drug_type = "MAIN"
mimicsql_data
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 SUM(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 = '021-25705')) AND intakeoutput.cellpath LIKE '%in...
eicu
CREATE TABLE table_name_6 ( date VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Date, when Opponent is 'Philadelphia 76ers'?
SELECT date FROM table_name_6 WHERE opponent = "philadelphia 76ers"
sql_create_context
CREATE TABLE table_41343 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many drawns have 7 for the lost?
SELECT SUM("Drawn") FROM table_41343 WHERE "Lost" = '7'
wikisql
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT 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 = 433)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt' A...
mimic_iii
CREATE TABLE table_17336 ( "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 ha...
SELECT "High rebounds" FROM table_17336 WHERE "Score" = 'L 84–102 (OT)'
wikisql
CREATE TABLE table_dev_44 ( "id" int, "gender" string, "arterial_ph" float, "systolic_blood_pressure_sbp" int, "serum_bicarbonate" int, "anion_gap" int, "diabetic" string, "diabetic_ketoacidosis" bool, "blood_glucose" int, "diastolic_blood_pressure_dbp" int, "positive_serum_k...
SELECT * FROM table_dev_44 WHERE diabetic_ketoacidosis = 1 OR (arterial_ph < 7.24 OR serum_bicarbonate < 15 OR positive_serum_ketones = 1 OR anion_gap > 12)
criteria2sql
CREATE TABLE table_79461 ( "Actor" text, "Role" text, "Years" text, "Seasons" text, "Episodes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many episodes did the actor David Faustino appear in?
SELECT "Episodes" FROM table_79461 WHERE "Actor" = 'david faustino'
wikisql
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NA...
SELECT DEPARTMENT_NAME, COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID GROUP BY DEPARTMENT_NAME ORDER BY DEPARTMENT_NAME
nvbench
CREATE TABLE table_21277 ( "Country" text, "Preliminary" text, "Interview" text, "Swimsuit" text, "Evening Gown" text, "Average" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- State average scores of participants from arizona
SELECT "Average" FROM table_21277 WHERE "Country" = 'Arizona'
wikisql
CREATE TABLE table_name_13 ( country VARCHAR, place VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The golfer in place 1 if from what country?
SELECT country FROM table_name_13 WHERE place = "1"
sql_create_context
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, ...
SELECT COUNT(DISTINCT course_offering.section_number) FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id WHERE course.department = 'UKR' AND course.number = 320
advising
CREATE TABLE table_32915 ( "Player" text, "Span" text, "Start" real, "Tries" real, "Conv" real, "Pens" real, "Drop" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of tries that has a start larger than 32, is a play...
SELECT AVG("Tries") FROM table_32915 WHERE "Start" > '32' AND "Player" = 'seremaia bai' AND "Conv" > '47'
wikisql
CREATE TABLE table_61037 ( "Date" text, "Name" text, "Nationality" text, "Tonnage (GRT)" real, "Fate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Fate has a Tonnage (GRT) larger than 1,352, and a Name of lavington court?
SELECT "Fate" FROM table_61037 WHERE "Tonnage (GRT)" > '1,352' AND "Name" = 'lavington court'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartr...
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hyper...
eicu
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, COUNT(Name) FROM Products WHERE Price <= 200 GROUP BY Name ORDER BY COUNT(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 T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T1.Code
nvbench
CREATE TABLE table_62623 ( "Name" text, "Tournaments" real, "Pro Debut" text, "Top division debut" text, "Highest rank" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Rank is Highest for Yoshiazuma?
SELECT "Highest rank" FROM table_62623 WHERE "Name" = 'yoshiazuma'
wikisql
CREATE TABLE table_58660 ( "Mininera DFL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Againsts have more than 15 wins?
SELECT COUNT("Against") FROM table_58660 WHERE "Wins" > '15'
wikisql
CREATE TABLE table_17058226_8 ( location_attendance VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where are all of Utah's games held and how many have attended?
SELECT location_attendance FROM table_17058226_8 WHERE team = "Utah"
sql_create_context
CREATE TABLE table_name_63 ( ties INTEGER, team VARCHAR, win_pct VARCHAR, losses VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of ties for the Detroit Lions team when they have fewer than 5 wins, fewer th...
SELECT AVG(ties) FROM table_name_63 WHERE losses < 3 AND wins < 5 AND win_pct = "0.800" AND team = "detroit lions"
sql_create_context
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 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 BETWEEN 40 AND 49) AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(...
eicu
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'pco2') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15794 AND admissions.dis...
mimic_iii
CREATE TABLE table_74570 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the home team that scored 12.6 (78)?
SELECT "Home team" FROM table_74570 WHERE "Home team score" = '12.6 (78)'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, ...
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDBM = 'Z83.066' AND jyjgzbb.JCZBDM = '549027'
css
CREATE TABLE table_test_22 ( "id" int, "ejection_fraction_ef" int, "pregnancy_or_lactation" bool, "child_pugh_class" string, "hbv" bool, "systolic_blood_pressure_sbp" int, "active_infection" bool, "leukocyte_count" int, "hiv_infection" bool, "left_ventricular_dysfunction" bool, ...
SELECT * FROM table_test_22 WHERE renal_disease = 1 OR estimated_glomerular_filtration_rate_egfr < 30
criteria2sql
CREATE TABLE member ( Member_ID int, Member_Name text, Party_ID text, In_office text ) CREATE TABLE party ( Party_ID int, Minister text, Took_office text, Left_office text, Region_ID int, Party_name text ) CREATE TABLE region ( Region_ID int, Region_name text, Date ...
SELECT Minister, COUNT(Minister) FROM party GROUP BY Minister ORDER BY Minister DESC
nvbench
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2195" AND diagnoses.icd9_code = "78659"
mimicsql_data
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE...
SELECT Users.Id, Users.DisplayName, COUNT(ans.Id) FROM Users AS users JOIN Posts AS qtns ON qtns.PostTypeId = 1 AND Users.Id = qtns.OwnerUserId JOIN Posts AS ans ON ans.PostTypeId = 2 AND qtns.AcceptedAnswerId = ans.Id WHERE ans.OwnerUserId = @UserId GROUP BY Users.Id, Users.DisplayName ORDER BY COUNT(ans.Id) DESC
sede
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 icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_pro...
mimic_iii
CREATE TABLE table_name_83 ( score VARCHAR, record VARCHAR, visitor VARCHAR, home VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Score has a Visitor of toronto st. pats, and a Home of montreal canadiens, and a Record of 3 2 0?
SELECT score FROM table_name_83 WHERE visitor = "toronto st. pats" AND home = "montreal canadiens" AND record = "3–2–0"
sql_create_context
CREATE TABLE table_name_43 ( games INTEGER, drawn VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What game is the lowest with 1 draw and less than 7 points?
SELECT MIN(games) FROM table_name_43 WHERE drawn = 1 AND points < 7
sql_create_context
CREATE TABLE table_36578 ( "Player" text, "Touchdowns (5 points)" real, "Extra points 1 point" real, "Field goals (5 points)" real, "Total Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Touchdowns (5 points) have an Extra points 1 p...
SELECT COUNT("Touchdowns (5 points)") FROM table_36578 WHERE "Extra points 1 point" = '0' AND "Field goals (5 points)" > '0'
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.formulary_drug_cd = "BACT2C"
mimicsql_data
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId n...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE LOWER('%##CountryName##%') AND LOWER(AboutMe) LIKE LOWER('%##Keyword##%') AND Reputation >= '##MinReputation##' ORDER BY Reputation DESC
sede
CREATE TABLE table_name_40 ( name VARCHAR, spouse VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which member of house of Habsburg-Lorraine had the spouse Charles II?
SELECT name FROM table_name_40 WHERE spouse = "charles ii"
sql_create_context
CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS varchar(20), DEPT_EXTENSION varchar(4) ) CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), ...
SELECT STU_FNAME, COUNT(STU_FNAME) FROM STUDENT WHERE STU_GPA < (SELECT AVG(STU_GPA) FROM STUDENT) GROUP BY STU_FNAME ORDER BY COUNT(STU_FNAME)
nvbench
CREATE TABLE table_name_2 ( home_campus VARCHAR, arena_venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which campus has the San Agustin gym?
SELECT home_campus FROM table_name_2 WHERE arena_venue = "san agustin gym"
sql_create_context
CREATE TABLE table_51216 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score when the away team was Footsc...
SELECT "Away team score" FROM table_51216 WHERE "Away team" = 'footscray'
wikisql
CREATE TABLE table_23575917_2 ( davids_team VARCHAR, first_broadcast VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the davids team for 8 august 2008
SELECT davids_team FROM table_23575917_2 WHERE first_broadcast = "8 August 2008"
sql_create_context
CREATE TABLE table_204_957 ( id number, "year" number, "team" text, "games" number, "combined tackles" number, "tackles" number, "assisted tackles" number, "sacks" number, "forced fumbles" number, "fumble recoveries" number, "fumble return yards" number, "interceptions" n...
SELECT SUM("interception return yards") FROM table_204_957
squall
CREATE TABLE table_37527 ( "Type" text, "Numbers" text, "Year built" real, "Quantity built" text, "Power (horsepower)" real, "Max Speed (km/h)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the power of the unit built after 1995?
SELECT SUM("Power (horsepower)") FROM table_37527 WHERE "Year built" > '1995'
wikisql
CREATE TABLE table_62044 ( "Tie no" real, "Home team" text, "Score" text, "Away team" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the sum of tie no for home team burgess hill town?
SELECT SUM("Tie no") FROM table_62044 WHERE "Home team" = 'burgess hill town'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.ethnicity = "HISPANIC OR LATINO"
mimicsql_data
CREATE TABLE table_8213 ( "Date" text, "Ship" text, "Nationality" text, "Tonnage" real, "Fate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Tonnage, when Date is '25 June 1943'?
SELECT COUNT("Tonnage") FROM table_8213 WHERE "Date" = '25 june 1943'
wikisql
CREATE TABLE table_24814477_2 ( opponent VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent in Week 8?
SELECT opponent FROM table_24814477_2 WHERE week = 8
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT zyjybgb.KSBM, zyjybgb.KSMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE person_in...
css
CREATE TABLE table_name_89 ( head_of_household VARCHAR, married_filing_separately VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the head of household that has married filing separately of $104,426 $186,475
SELECT head_of_household FROM table_name_89 WHERE married_filing_separately = "$104,426–$186,475"
sql_create_context
CREATE TABLE table_20279 ( "Name" text, "Overs Bowled" text, "Maidens" real, "Runs Conceded" real, "Wickets" real, "Extras" real, "E.R." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many players named sanath jayasuriya?
SELECT COUNT("Runs Conceded") FROM table_20279 WHERE "Name" = 'Sanath Jayasuriya'
wikisql
CREATE TABLE table_203_363 ( id number, "city\n2010 census" text, "chinese" text, "built-up area" number, "urban area" number, "level" text, "administrative area" number, "province-level division" text, "remarks" text ) -- Using valid SQLite, answer the following questions for the ...
SELECT "city\n2010 census" FROM table_203_363 WHERE "city\n2010 census" IN ('beijing', 'shanghai') ORDER BY "built-up area" DESC LIMIT 1
squall
CREATE TABLE performance ( songid number, bandmate number, stageposition text ) CREATE TABLE instruments ( songid number, bandmateid number, instrument text ) CREATE TABLE songs ( songid number, title text ) CREATE TABLE tracklists ( albumid number, position number, songid...
SELECT COUNT(DISTINCT instrument) FROM instruments AS T1 JOIN band AS T2 ON T1.bandmateid = T2.id WHERE T2.lastname = "Heilo"
spider
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. -- For e...
SELECT director, MAX(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director <> "null" GROUP BY director ORDER BY director DESC
nvbench
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) 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,...
SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE mzjzjlb.JZZDSM = '过敏性皮炎' GROUP BY person_info.JGDM
css
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 t_kc21.MED_CLINIC_ID FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '褚力言' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2006-12-21' AND '2015-08-04'
css
CREATE TABLE table_74525 ( "Year" real, "Tournaments played" real, "Cuts made*" real, "Wins" real, "Top 10s" real, "Best finish" text, "Earnings ( $ )" text, "Scoring average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the hi...
SELECT MAX("Wins") FROM table_74525 WHERE "Year" < '2000' AND "Best finish" = '4' AND "Tournaments played" < '3'
wikisql
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 t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'amlodipine' AND DATETIME(medication.drugstarttime, ...
eicu
CREATE TABLE table_51114 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Silver that has a Total smaller than 2, and a Nation of south korea?
SELECT AVG("Silver") FROM table_51114 WHERE "Total" < '2' AND "Nation" = 'south korea'
wikisql
CREATE TABLE table_12208 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What event was a loss in 5:00?
SELECT "Event" FROM table_12208 WHERE "Res." = 'loss' AND "Time" = '5:00'
wikisql
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) 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,...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM progra...
advising
CREATE TABLE table_204_753 ( id number, "no." number, "name" text, "position" text, "date of birth (age)" text, "signed from" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total number of df positions on the list ?...
SELECT COUNT(*) FROM table_204_753 WHERE "position" = 'df'
squall
CREATE TABLE table_75976 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Points difference" text, "Tries For" text, "Tries Against" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wh...
SELECT "Tries For" FROM table_75976 WHERE "Played" = '18' AND "Points against" = '375'
wikisql