instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.label = "Asparate Aminotransferase (AST)"
mimicsql_data
CREATE TABLE table_58544 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What s...
SELECT "Series" FROM table_58544 WHERE "High points" = 'prince (23)'
wikisql
CREATE TABLE technician ( technician_id real, Name text, Team text, Starting_Year real, Age int ) CREATE TABLE machine ( Machine_ID int, Making_Year int, Class text, Team text, Machine_series text, value_points real, quality_rank int ) CREATE TABLE repair_assignment ( ...
SELECT Name, COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_id = T2.technician_id GROUP BY T2.Name ORDER BY Name DESC
nvbench
CREATE TABLE table_name_79 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2009 value with a 2010 A value?
SELECT 2009 FROM table_name_79 WHERE 2010 = "a"
sql_create_context
CREATE TABLE table_name_78 ( laps VARCHAR, grid VARCHAR, bike VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Using a Ducati 999 F06 Bike, how many Laps with a Grid greater than 11 and Time of +53.488?
SELECT COUNT(laps) FROM table_name_78 WHERE bike = "ducati 999 f06" AND time = "+53.488" AND grid > 11
sql_create_context
CREATE TABLE table_name_34 ( japanese_title VARCHAR, romaji_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With the Romaji title of Hanayome Wa Yakudoshi!, what is the Japanese title?
SELECT japanese_title FROM table_name_34 WHERE romaji_title = "hanayome wa yakudoshi!"
sql_create_context
CREATE TABLE table_15431122_2 ( wins INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the minimum number of wins?
SELECT MIN(wins) FROM table_15431122_2
sql_create_context
CREATE TABLE table_name_38 ( rank INTEGER, state VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average rank of a mountain range located in Maine?
SELECT AVG(rank) FROM table_name_38 WHERE state = "maine"
sql_create_context
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 School_ID, ACC_Percent FROM basketball_match GROUP BY Team_Name
nvbench
CREATE TABLE region ( Region_ID int, Region_name text, Date text, Label text, Format text, Catalogue text ) CREATE TABLE party ( Party_ID int, Minister text, Took_office text, Left_office text, Region_ID int, Party_name text ) CREATE TABLE member ( Member_ID int, ...
SELECT Left_office, COUNT(Left_office) FROM party ORDER BY COUNT(Left_office)
nvbench
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid numb...
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 'hyperkalemia - moderate ( 5.5 -6.1 meq/dl)')
eicu
CREATE TABLE table_66528 ( "Airing date" text, "English title (Chinese title)" text, "Number of episodes" real, "Theme song (T) Sub-theme song (ST)" text, "Genre" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Genre has an English title (Chine...
SELECT "Genre" FROM table_66528 WHERE "English title (Chinese title)" = 'the romance of the white hair maiden 白髮魔女傳'
wikisql
CREATE TABLE table_48048 ( "Month" text, "Births" text, "Deaths" text, "Rate (%)" text, "Sort restore" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sort value that had deaths of 71?
SELECT "Sort restore" FROM table_48048 WHERE "Deaths" = '71'
wikisql
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostsWithDe...
SELECT TOP(100) AS SourceTagName FROM TagSynonyms GROUP BY SourceTagName HAVING COUNT(SourceTagName) > 1
sede
CREATE TABLE table_24745 ( "Date" text, "Event #" text, "Event" text, "Winner" text, "Prize" text, "Entries" text, "Prize Pool" text, "Elapsed Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won a prize pool of $61,100?
SELECT "Winner" FROM table_24745 WHERE "Prize Pool" = '$61,100'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number,...
SELECT zyjzjlb.JZLSH 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.RYBH = '27848867' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2004-10-16')
css
CREATE TABLE table_name_54 ( television_service VARCHAR, package_option VARCHAR, language VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Television Service, when Package/Option is Sky Famiglia, and when Language is Italian?
SELECT television_service FROM table_name_54 WHERE package_option = "sky famiglia" AND language = "italian"
sql_create_context
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT MAIN_COND_DES FROM t_kc21 WHERE MED_CLINIC_ID = '59693307352'
css
CREATE TABLE table_25570 ( "R" real, "Player" text, "Position" text, "League" real, "Champions League" real, "Copa del Rey" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the position is AM and the league is larger than 7.0,...
SELECT COUNT("R") FROM table_25570 WHERE "Position" = 'AM' AND "League" > '7.0'
wikisql
CREATE TABLE table_42896 ( "Year" real, "Award" text, "Category" text, "Recipient" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What category was The Suite Life on Deck nominated for later than 2010?
SELECT "Category" FROM table_42896 WHERE "Recipient" = 'the suite life on deck' AND "Year" > '2010'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2069" AND lab.label = "Amylase"
mimicsql_data
CREATE TABLE table_name_51 ( year_erected VARCHAR, artist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what year did enrique alciati make a statue
SELECT year_erected FROM table_name_51 WHERE artist = "enrique alciati"
sql_create_context
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req 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 ...
SELECT COUNT(*) = 0 FROM course, course_offering, instructor, offering_instructor WHERE (NOT instructor.name LIKE '%Rina Ashkenazi%' AND NOT instructor.name LIKE '%Adam Hayden%') AND course.course_id = course_offering.course_id AND course.department = 'INSTHUM' AND course.number = 311 AND offering_instructor.instructor...
advising
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course ( course_id int, name varchar, dep...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'PORTUG' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Spri...
advising
CREATE TABLE table_31116 ( "Provider" text, "Country" text, "Subscribers (2005) (thousands)" real, "Subscribers (2006) (thousands)" real, "Growth %" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many 2006 subscribers are named Vodafone?
SELECT COUNT("Subscribers (2006) (thousands)") FROM table_31116 WHERE "Provider" = 'Vodafone'
wikisql
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, pro...
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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANT...
atis
CREATE TABLE conference ( cid int, homepage varchar, name varchar ) CREATE TABLE writes ( aid int, pid int ) CREATE TABLE publication ( abstract varchar, cid int, citation_num int, jid int, pid int, reference_num int, title varchar, year int ) CREATE TABLE author (...
SELECT publication.title FROM conference, keyword, publication, publication_keyword WHERE conference.name = 'VLDB' AND keyword.keyword = 'Information Retrieval' AND publication_keyword.kid = keyword.kid AND publication.cid = conference.cid AND publication.pid = publication_keyword.pid
academic
CREATE TABLE table_70140 ( "Member" text, "Party" text, "Electorate" text, "State" text, "First elected" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the State, when the year First elected is 1966, and when the Member is Alan Jarman?
SELECT "State" FROM table_70140 WHERE "First elected" = '1966' AND "Member" = 'alan jarman'
wikisql
CREATE TABLE Locations ( Location_ID INTEGER, Location_Name VARCHAR(255), Address VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Staff ( Staff_ID INTEGER, Tourist_Attraction_ID INTEGER, Name VARCHAR(40), Other_Details VARCHAR(255) ) CREATE TABLE Street_Markets ( Market_ID ...
SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID ORDER BY T1.Tourist_Attraction_ID
nvbench
CREATE TABLE table_11128 ( "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 Result with a Date with 22 january 2008?
SELECT "Result" FROM table_11128 WHERE "Date" = '22 january 2008'
wikisql
CREATE TABLE table_name_60 ( round INTEGER, college_junior_club_team__league_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest round for the Minnesota Junior Stars (Mjhl)?
SELECT MAX(round) FROM table_name_60 WHERE college_junior_club_team__league_ = "minnesota junior stars (mjhl)"
sql_create_context
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 WHERE demographic.diagnosis = "SEPSIS"
mimicsql_data
CREATE TABLE table_name_84 ( year_named INTEGER, name VARCHAR, diameter__km_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Year named has a Name of nuptadi planitia, and a Diameter (km) larger than 1,200.0?
SELECT MIN(year_named) FROM table_name_84 WHERE name = "nuptadi planitia" AND diameter__km_ > 1 OFFSET 200.0
sql_create_context
CREATE TABLE table_24558 ( "No." real, "#" real, "Title" text, "Directed by" text, "Written by" text, "U.S. air date" text, "Production code" text, "U.S. viewers (million)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the number...
SELECT "#" FROM table_24558 WHERE "U.S. viewers (million)" = '2.24'
wikisql
CREATE TABLE table_49824 ( "Date" text, "Time" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much is the total with a time at 16:00 and score for set 3 of 18 25?
SELECT "Total" FROM table_49824 WHERE "Time" = '16:00' AND "Set 3" = '18–25'
wikisql
CREATE TABLE table_68219 ( "Name" text, "Entered office" text, "Left office" text, "Party" text, "First Minister" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did first minister Henry Mcleish enter office?
SELECT "Entered office" FROM table_68219 WHERE "First Minister" = 'henry mcleish'
wikisql
CREATE TABLE table_name_25 ( origin_of_programming VARCHAR, genre VARCHAR, network VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where does the network Star Cricket originate?
SELECT origin_of_programming FROM table_name_25 WHERE genre = "cricket" AND network = "star cricket"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.route = "DWELL"
mimicsql_data
CREATE TABLE table_16175064_3 ( series__number VARCHAR, writer_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of episodes where alexa wyatt is the writer?
SELECT COUNT(series__number) FROM table_16175064_3 WHERE writer_s_ = "Alexa Wyatt"
sql_create_context
CREATE TABLE table_30054 ( "Outcome" text, "Edition" text, "Opponent Team" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For opponent is sandra kristj nsd ttir, outcome is winner and edition is 200...
SELECT "Opponent Team" FROM table_30054 WHERE "Edition" = '2009 Europe/Africa Group IIIB' AND "Outcome" = 'Winner' AND "Opponent" = 'Sandra Kristjánsdóttir'
wikisql
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, tes...
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_5829 ( "Week" text, "Song choice" text, "Theme" text, "Performance Order" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of week 2?
SELECT "Result" FROM table_5829 WHERE "Week" = 'week 2'
wikisql
CREATE TABLE table_4146 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the partner that has a winner outcome an...
SELECT "Partner" FROM table_4146 WHERE "Outcome" = 'Winner' AND "Surface" = 'Hard'
wikisql
CREATE TABLE table_21584646_10 ( week_of VARCHAR, champion VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many weeks are shown for the champion of john mcenroe 6 2, 6 3?
SELECT COUNT(week_of) FROM table_21584646_10 WHERE champion = "John McEnroe 6–2, 6–3"
sql_create_context
CREATE TABLE table_name_41 ( result VARCHAR, stadium VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result of the game at Odsal Stadium?
SELECT result FROM table_name_41 WHERE stadium = "odsal stadium"
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDBM = 'G95.886' AND hz_info.RYB...
css
CREATE TABLE table_name_11 ( soap_opera VARCHAR, actor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the soap opera when the actor is dave duffy?
SELECT soap_opera FROM table_name_11 WHERE actor = "dave duffy"
sql_create_context
CREATE TABLE table_train_96 ( "id" int, "gender" string, "elevated_creatinine" float, "diabetic" string, "cerebrovascular_disease" bool, "moca_score" int, "parkinsonism" bool, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- prese...
SELECT * FROM table_train_96 WHERE parkinsonism = 1
criteria2sql
CREATE TABLE table_56942 ( "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 is the combined of Crowd that has a Home te...
SELECT SUM("Crowd") FROM table_56942 WHERE "Home team score" = '12.15 (87)'
wikisql
CREATE TABLE table_78385 ( "Animal Name" text, "Species" text, "Books" text, "TV Series" text, "Gender" text, "TV Seasons" real, "Mate" text, "Offspring" text, "First Appearance" text, "Last Appearance" text ) -- Using valid SQLite, answer the following questions for the tables...
SELECT "Mate" FROM table_78385 WHERE "TV Seasons" > '1' AND "Last Appearance" = 'bully, bully, bully (3x13)' AND "Animal Name" = 'hollow/holly'
wikisql
CREATE TABLE table_name_40 ( week INTEGER, result VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Week has a Result of w 24-0, and an Attendance smaller than 10,000?
SELECT MAX(week) FROM table_name_40 WHERE result = "w 24-0" AND attendance < 10 OFFSET 000
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 WHERE demographic.gender = "F" AND demographic.days_stay > "9"
mimicsql_data
CREATE TABLE table_name_17 ( country VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which county has 2011 as the year?
SELECT country FROM table_name_17 WHERE year = 2011
sql_create_context
CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int, STU_CLASS varchar(2), STU_GPA float(8), STU_TRANSFER numeric, DEPT_CODE varchar(18), STU_PHONE varchar(4), PROF_NUM int ) CREATE TABLE DE...
SELECT CRS_DESCRIPTION, COUNT(CRS_DESCRIPTION) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY CRS_DESCRIPTION ORDER BY CRS_DESCRIPTION DESC
nvbench
CREATE TABLE gwyjzb ( 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 gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '01374197' AND gwyjzb.MED_SER_ORG_NO = '5447381' AND NOT gwyjzb.IN_DIAG_DIS_NM LIKE '%紫癜%' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '01374197' AND fgwyjzb.MED_SER_ORG_NO = '5447381' AND NOT fgwyjzb.IN_DIAG_DIS_NM LIKE '%紫癜...
css
CREATE TABLE table_name_3 ( round VARCHAR, position VARCHAR, pick VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Round has a Position of lb, and a Pick smaller than 25?
SELECT COUNT(round) FROM table_name_3 WHERE position = "lb" AND pick < 25
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 jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '慢性根尖周炎' AND jyjgzbb.JCZBMC = '同型半胱氨酸'
css
CREATE TABLE table_49114 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Whic Date has a Score of 4 2?
SELECT "Date" FROM table_49114 WHERE "Score" = '4–2'
wikisql
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JO...
SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY AVG(EMPLOYEE_ID)
nvbench
CREATE TABLE table_51643 ( "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 venue when the home team was footsc...
SELECT "Venue" FROM table_51643 WHERE "Home team" = 'footscray'
wikisql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( ...
SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23070)) AND DATETIME(inputevents_cv.charttime, 'start of month') = DATETIME(CURRENT_TIME(), ...
mimic_iii
CREATE TABLE table_name_48 ( date VARCHAR, outcome VARCHAR, opponents VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Date, when Outcome is 'Winner', and when Opponents is 'Paul Haarhuis Sandon Stolle'?
SELECT date FROM table_name_48 WHERE outcome = "winner" AND opponents = "paul haarhuis sandon stolle"
sql_create_context
CREATE TABLE table_14710984_2 ( general_classification VARCHAR, stage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the general classification leader for stage 3?
SELECT general_classification FROM table_14710984_2 WHERE stage = 3
sql_create_context
CREATE TABLE table_35840 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Silvers that has a Gold smaller than 1, and a Rank of 9, and a Total smaller than 1...
SELECT SUM("Silver") FROM table_35840 WHERE "Gold" < '1' AND "Rank" = '9' AND "Total" < '1'
wikisql
CREATE TABLE table_name_22 ( year INTEGER, rebounds VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the 1st Year Al Harrington (9) the leader in Rebounds?
SELECT MIN(year) FROM table_name_22 WHERE rebounds = "al harrington (9)"
sql_create_context
CREATE TABLE table_name_97 ( source VARCHAR, moving_from VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the source of the move from Port Vale?
SELECT source FROM table_name_97 WHERE moving_from = "port vale"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.days_stay > "14"
mimicsql_data
CREATE TABLE table_43522 ( "School" text, "Bask" real, "Golf" text, "Soccer" text, "Soft" text, "Swimming" text, "Tennis" real, "Indoor track" text, "Outdoor track" text, "Volleyball" text, "Total" real ) -- Using valid SQLite, answer the following questions for the tables ...
SELECT "Volleyball" FROM table_43522 WHERE "Golf" = '2' AND "Indoor track" = '3'
wikisql
CREATE TABLE table_44392 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the outcome of the match on August 20, 1978?
SELECT "Outcome" FROM table_44392 WHERE "Date" = 'august 20, 1978'
wikisql
CREATE TABLE table_26465 ( "Confederation" text, "Teams started" text, "Teams that have secured qualification" text, "Teams that can still qualify" text, "Teams that have been eliminated" text, "Remaining places in finals" text, "Total places in finals" text, "Qualifying start date" text...
SELECT "Teams that can still qualify" FROM table_26465 WHERE "Teams that have secured qualification" = '0' AND "Teams started" = '52'
wikisql
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
SELECT COUNT(*) > 0 FROM semester WHERE NOT semester IN (SELECT DISTINCT SEMESTERalias1.semester FROM course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias1 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND COURSEalias0.department = 'CAAS' AND COURSEalias0.number =...
advising
CREATE TABLE table_80312 ( "Year" real, "Total Region" real, "Biggenden" real, "Eidsvold" real, "Gayndah" real, "Monto" real, "Mundubbera" real, "Perry" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Total Region number of ht...
SELECT COUNT("Total Region") FROM table_80312 WHERE "Eidsvold" = '970' AND "Biggenden" > '1,570'
wikisql
CREATE TABLE table_73178 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" text, "Avg. Finish" text, "Winnings" text, "Position" text, "Team(s)" text ) -- Using valid SQLite, answer the following questions for the tables prov...
SELECT "Team(s)" FROM table_73178 WHERE "Top 10" = '18'
wikisql
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 (SELECT SUM(t_kc22.STA_FLG) FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '32600850724') = (SELECT COUNT(*) FROM t_kc22 WHERE t_kc21_t_kc22.MED_CLINIC_ID = '32600850724')
css
CREATE TABLE pitStops ( raceId INTEGER, driverId INTEGER, stop INTEGER, lap INTEGER, time TEXT, duration TEXT, milliseconds INTEGER ) CREATE TABLE status ( statusId INTEGER, status TEXT ) CREATE TABLE races ( raceId INTEGER, year INTEGER, round INTEGER, circuitId IN...
SELECT year, COUNT(year) FROM races AS T1 JOIN results AS T2 ON T1.raceId = T2.raceId WHERE T1.year > 2014 GROUP BY year ORDER BY year
nvbench
CREATE TABLE table_71750 ( "Election" text, "1st Member" text, "1st Party" text, "2nd Member" text, "2nd Party" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which 1st Party has an election in 1865?
SELECT "1st Party" FROM table_71750 WHERE "Election" = '1865'
wikisql
CREATE TABLE table_7492 ( "1st built" real, "1913 Class" text, "W.A." text, "No. Built" real, "Builder" text, "Date" text, "LNER Class" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the W.A. of the 1 1st built?
SELECT "W.A." FROM table_7492 WHERE "1st built" = '1'
wikisql
CREATE TABLE table_9077 ( "Country or territory" text, "Area (km\u00b2)" real, "Population" real, "Population density (per km\u00b2)" real, "Capital" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the highest population density for a populati...
SELECT MAX("Population density (per km\u00b2)") FROM table_9077 WHERE "Population" < '6000'
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 demographic.dob, lab.fluid FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Jerry Deberry"
mimicsql_data
CREATE TABLE table_29490 ( "Club" text, "Location" text, "Ground" text, "Manager" text, "Titles" real, "Last title" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is lootos p lva from?
SELECT "Location" FROM table_29490 WHERE "Club" = 'Lootos Põlva'
wikisql
CREATE TABLE table_73632 ( "Institution" text, "Location" text, "Team Name" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Year Joined" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the institution that was located is...
SELECT "Institution" FROM table_73632 WHERE "Location" = 'Circleville, Ohio'
wikisql
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 t1.drugname FROM (SELECT medication.drugname, COUNT(medication.drugstarttime) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021...
eicu
CREATE TABLE table_name_47 ( region VARCHAR, catalog VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the region with catalog of 576 097-2
SELECT region FROM table_name_47 WHERE catalog = "576 097-2"
sql_create_context
CREATE TABLE table_41917 ( "Series" text, "Host" text, "Launch date" text, "Finale date" text, "Days" real, "Winner" text, "Prize" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Series, when Days is greater than 99, and when Prize is...
SELECT "Series" FROM table_41917 WHERE "Days" > '99' AND "Prize" = '€50,000'
wikisql
CREATE TABLE wdmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
SELECT (SELECT COUNT(*) FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '水光耀' AND wdmzjzjlb.JZKSRQ BETWEEN '2005-01-09' AND '2013-08-02' UNION SELECT COUNT(*) FROM p...
css
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, war...
SELECT chartevents.charttime 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 = 31325)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial...
mimic_iii
CREATE TABLE table_26409 ( "Season" text, "Name" text, "Teams" real, "Relegated to league" text, "Promoted to league" text, "Promoted from league" text, "Relegated from league" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many were the...
SELECT MIN("Teams") FROM table_26409
wikisql
CREATE TABLE table_55415 ( "Edition" text, "Round" text, "Date" text, "Surface" text, "Opponent" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On July 15, 1984 what surface was used?
SELECT "Surface" FROM table_55415 WHERE "Date" = 'july 15, 1984'
wikisql
CREATE TABLE table_10815352_1 ( average_attendance INTEGER, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the average attendance of the leagues in the season of 2013?
SELECT MIN(average_attendance) FROM table_10815352_1 WHERE season = "2013"
sql_create_context
CREATE TABLE table_6946 ( "Date" text, "English Name" text, "Chinese Name" text, "Tamil Name" text, "Type" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Tamil Name of the Thaipusam holiday?
SELECT "Tamil Name" FROM table_6946 WHERE "English Name" = 'thaipusam'
wikisql
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE medication ( medi...
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-5308')) AND intakeoutput.cellpath LIKE '%intake%'...
eicu
CREATE TABLE table_name_76 ( home_team VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the home team when Geelong was the away team?
SELECT home_team FROM table_name_76 WHERE away_team = "geelong"
sql_create_context
CREATE TABLE table_41905 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Attendance when the home team was slough town?
SELECT MIN("Attendance") FROM table_41905 WHERE "Home team" = 'slough town'
wikisql
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TI...
SELECT JOB_ID, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID
nvbench
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 COUNT(*) FROM (SELECT zyjybgb.KSBM FROM mzjzjlb JOIN zyjybgb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '7488811' AND zyjybgb.BGRQ BETWEEN '2003-05-07' AND '2009-04-12' GROUP BY zyjybgb.KSBM HAVING COUNT(*) > 25 UNION SELECT mzjybgb.KSBM FROM mzjzj...
css
CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Coun...
SELECT Time, meter_100 FROM swimmer ORDER BY meter_100 DESC
nvbench
CREATE TABLE table_32505 ( "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 crowd size when Essendon was the aw...
SELECT COUNT("Crowd") FROM table_32505 WHERE "Away team" = 'essendon'
wikisql
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 * FROM person_info JOIN hz_info JOIN zyjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_i...
css
CREATE TABLE zyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.MED_SER_ORG_NO = '1027298' AND qtb.OUT_DIAG_DIS_CD = 'J20.239' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.MED_SER_ORG_NO = '1027298' AND gyb.OUT_DIAG_DIS_CD = 'J20.239' UNION...
css
CREATE TABLE table_name_9 ( cups INTEGER, total VARCHAR, player VARCHAR, other VARCHAR, league VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of cups when the other was more than 3, the league more than 3, for Lauri Dalla Valle...
SELECT AVG(cups) FROM table_name_9 WHERE other > 3 AND league > 3 AND player = "lauri dalla valle" AND total > 21
sql_create_context