instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, ...
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.JZZDBM = 'J44.682' GROUP BY person_info.JGDM
css
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE labevents ( row_id number, sub...
SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-5 year') GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 <= 5
mimic_iii
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost numb...
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 56490) AND microbiologyevents.spec_type_desc = 'blood culture' AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', ...
mimic_iii
CREATE TABLE table_54346 ( "Dismissals" text, "Player" text, "Versus" text, "Venue" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Player with a Date with 12-03-2003?
SELECT "Player" FROM table_54346 WHERE "Date" = '12-03-2003'
wikisql
CREATE TABLE table_62190 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score when the way team was Wrexham?
SELECT "Score" FROM table_62190 WHERE "Away team" = 'wrexham'
wikisql
CREATE TABLE Apartments ( apt_number VARCHAR, apt_type_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Return the apartment numbers of the apartments with type code 'Flat'.
SELECT apt_number FROM Apartments WHERE apt_type_code = "Flat"
sql_create_context
CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE TABLE election ( Election_ID int, Counties_Represented text, District int, Delegate text, Party int, First_Elected real, Committee text ) CREATE TABLE party ( Party_ID int, ...
SELECT County_name, COUNT(County_name) FROM county AS T1 JOIN election AS T2 ON T1.County_Id = T2.District GROUP BY County_name
nvbench
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuo...
SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 54700) AND DATETIME(cost.chargetime) <= DATETIME(CURRENT_TIME(), '-2 year')
mimic_iii
CREATE TABLE table_64544 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the game played that was at the Seattle Center Coliseum?
SELECT "Date" FROM table_64544 WHERE "Location/Attendance" = 'seattle center coliseum'
wikisql
CREATE TABLE table_53750 ( "Total fat" text, "Saturated fat" text, "Monounsaturated fat" text, "Polyunsaturated fat" text, "Smoke point" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the polyunsaturated fat with total fat of 100g and monounsat...
SELECT "Polyunsaturated fat" FROM table_53750 WHERE "Total fat" = '100g' AND "Monounsaturated fat" = '20g (84g in high oleic variety)'
wikisql
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_40...
SELECT Nationality, COUNT(Nationality) FROM swimmer GROUP BY Nationality ORDER BY Nationality DESC
nvbench
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
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.itemid = "51274"
mimicsql_data
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 * FROM hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.zyjzjlb...
css
CREATE TABLE table_name_47 ( draw VARCHAR, played INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of draw for played more than 18
SELECT COUNT(draw) FROM table_name_47 WHERE played > 18
sql_create_context
CREATE TABLE table_76698 ( "Position" text, "Team #1" text, "Agg." text, "Team #2" text, "1st leg" text, "2nd leg" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2nd leg of the 4-9 agg.?
SELECT "2nd leg" FROM table_76698 WHERE "Agg." = '4-9'
wikisql
CREATE TABLE table_12715 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Charlie Wi's To par?
SELECT "To par" FROM table_12715 WHERE "Player" = 'charlie wi'
wikisql
CREATE TABLE table_name_64 ( earnings__ VARCHAR, player VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much did jim colbert earned ranked above 2?
SELECT COUNT(earnings__) AS $__ FROM table_name_64 WHERE player = "jim colbert" AND rank < 2
sql_create_context
CREATE TABLE table_63952 ( "Name" text, "GP-GS" text, "Effic" real, "Att-Cmp" text, "TD-INT" text, "Avg/G" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which TD-INT has an Effic larger than 111.4?
SELECT "TD-INT" FROM table_63952 WHERE "Effic" > '111.4'
wikisql
CREATE TABLE table_41129 ( "Outcome" text, "Date" text, "Championship" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which outcome has a partner named...
SELECT "Outcome" FROM table_41129 WHERE "Partner" = 'mark dickson' AND "Opponents in the final" = 'hans gildemeister belus prajoux'
wikisql
CREATE TABLE table_28092844_16 ( teams_classification VARCHAR, general_classification_żółta_koszulka VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which teams classification winners had a general classification winner of Allan Davis?
SELECT teams_classification FROM table_28092844_16 WHERE general_classification_żółta_koszulka = "Allan Davis"
sql_create_context
CREATE TABLE table_39900 ( "Player" text, "Nationality" text, "Position" text, "Years in Orlando" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Nationality has a School/Club Team of seattle?
SELECT "Nationality" FROM table_39900 WHERE "School/Club Team" = 'seattle'
wikisql
CREATE TABLE table_name_69 ( nhl_team VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the NHL team for ryan johnson
SELECT nhl_team FROM table_name_69 WHERE player = "ryan johnson"
sql_create_context
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID...
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21'
nvbench
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 demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Drug-induced delirium" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE table_32630 ( "Rank" real, "Player" text, "Nation" text, "Games" real, "Goals" real, "Years" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number of goals for robbie findley ranked above 10?
SELECT MAX("Goals") FROM table_32630 WHERE "Player" = 'robbie findley' AND "Rank" < '10'
wikisql
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Code DESC
nvbench
CREATE TABLE table_23283 ( "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. -- When chris carney is the incumbent what are the results?
SELECT "Result" FROM table_23283 WHERE "Incumbent" = 'Chris Carney'
wikisql
CREATE TABLE table_9058 ( "Event" text, "Time" text, "Club" text, "Date" text, "Meet" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Meet has a Time of 3:50.65?
SELECT "Meet" FROM table_9058 WHERE "Time" = '3:50.65'
wikisql
CREATE TABLE table_name_37 ( format VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which format is in Japan?
SELECT format FROM table_name_37 WHERE country = "japan"
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 AVG(demographic.age) FROM demographic WHERE demographic.age >= "44" AND demographic.admityear >= "2197"
mimicsql_data
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, program_course.workload FROM course, program_course WHERE course.department = 'TURKISH' AND course.number = 101 AND program_course.course_id = course.course_id AND program_course.workload > 3
advising
CREATE TABLE table_21602734_1 ( division INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number of divisions mentioned?
SELECT MAX(division) FROM table_21602734_1
sql_create_context
CREATE TABLE Apartments ( apt_id INTEGER, building_id INTEGER, apt_type_code CHAR(15), apt_number CHAR(10), bathroom_count INTEGER, bedroom_count INTEGER, room_count CHAR(5) ) CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE Apartment_Buildi...
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 2 ORDER BY COUNT(booking_start_date) DESC
nvbench
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 EN...
SELECT CRS_CODE, COUNT(*) FROM CLASS GROUP BY CRS_CODE
nvbench
CREATE TABLE table_11403 ( "Game" real, "Date" text, "Score" text, "Location" text, "Time" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the attendance when the location is veterans stadium, the game is more than 3 an...
SELECT AVG("Attendance") FROM table_11403 WHERE "Location" = 'veterans stadium' AND "Game" > '3' AND "Time" = '2:21'
wikisql
CREATE TABLE table_250230_2 ( power VARCHAR, model VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the power for the Spirit R (Type B)?
SELECT power FROM table_250230_2 WHERE model = "Spirit R (Type B)"
sql_create_context
CREATE TABLE table_name_81 ( player VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player has a score of 71-69-71-67=278?
SELECT player FROM table_name_81 WHERE score = 71 - 69 - 71 - 67 = 278
sql_create_context
CREATE TABLE table_name_71 ( driver VARCHAR, type_of_vehicle VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What driver has a stock car vehicle with a year of 1999?
SELECT driver FROM table_name_71 WHERE type_of_vehicle = "stock car" AND year = 1999
sql_create_context
CREATE TABLE table_58294 ( "Player" text, "Rec." real, "Yards" real, "Avg." real, "TD's" real, "Long" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the lowest yards for 34 long and avg less than 12.6
SELECT MIN("Yards") FROM table_58294 WHERE "Long" = '34' AND "Avg." < '12.6'
wikisql
CREATE TABLE Ref_Detention_Type ( detention_type_code VARCHAR(10), detention_type_description VARCHAR(80) ) CREATE TABLE Ref_Address_Types ( address_type_code VARCHAR(15), address_type_description VARCHAR(80) ) CREATE TABLE Assessment_Notes ( notes_id INTEGER, student_id INTEGER, teacher_i...
SELECT date_address_to, COUNT(date_address_to) FROM Student_Addresses GROUP BY other_details, date_address_to ORDER BY monthly_rental DESC
nvbench
CREATE TABLE table_78476 ( "Number" real, "Name" text, "Position" text, "Height" text, "Weight" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number for the player that has a k position?
SELECT "Number" FROM table_78476 WHERE "Position" = 'k'
wikisql
CREATE TABLE table_name_28 ( track VARCHAR, artist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the track that from lcd soundsystem?
SELECT track FROM table_name_28 WHERE artist = "lcd soundsystem"
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND demographic.diagnosis = "FEMORAL ARTERY THROMBOSIS"
mimicsql_data
CREATE TABLE table_13403120_1 ( writer_s_ VARCHAR, prodcode VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the writer of the episode with prod.code 30-17
SELECT writer_s_ FROM table_13403120_1 WHERE prodcode = "30-17"
sql_create_context
CREATE TABLE table_name_53 ( venue VARCHAR, score VARCHAR, competition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the venue for the friendly competition and score of 4-0?
SELECT venue FROM table_name_53 WHERE score = "4-0" AND competition = "friendly"
sql_create_context
CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER ) CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, baseP...
SELECT decor, MIN(basePrice) FROM Rooms GROUP BY decor ORDER BY decor DESC
nvbench
CREATE TABLE table_name_91 ( _number_of_episodes INTEGER, character VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many episodes had the character of Nick Lucas?
SELECT SUM(_number_of_episodes) FROM table_name_91 WHERE character = "nick lucas"
sql_create_context
CREATE TABLE table_name_10 ( date VARCHAR, partnering VARCHAR, opponent_in_final VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Date, when Partnering is 'Francesca Lubiani', and when Opponent in Final is 'Yuliya Beygelzimer / Jennifer Hopkins...
SELECT date FROM table_name_10 WHERE partnering = "francesca lubiani" AND opponent_in_final = "yuliya beygelzimer / jennifer hopkins"
sql_create_context
CREATE TABLE table_43034 ( "Season" text, "Team" text, "Country" text, "League" text, "Level" real, "Apps" real, "Goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Country for the 2006-07 season?
SELECT "Country" FROM table_43034 WHERE "Season" = '2006-07'
wikisql
CREATE TABLE table_68351 ( "Name" text, "Park" text, "Country" text, "Inversions" real, "Opened" text, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the opened for spain
SELECT "Opened" FROM table_68351 WHERE "Country" = 'spain'
wikisql
CREATE TABLE table_74695 ( "Tujunga" text, "La Crescenta- Montrose" text, "Glendale" text, "La Ca\u00f1ada Flintridge" text, "Pasadena" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the figure for La Crescenta-Montrose when Gelndale is $57,...
SELECT "La Crescenta- Montrose" FROM table_74695 WHERE "Glendale" = '$57,112'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Unspecified fetal and neonatal jaundice" AND prescriptions.drug = "Tamsulosin"
mimicsql_data
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name
nvbench
CREATE TABLE table_30927 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Prod. code" real, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What ...
SELECT "Original air date" FROM table_30927 WHERE "Title" = 'Be Prepared'
wikisql
CREATE TABLE Teachers ( teacher_id INTEGER, address_id INTEGER, first_name VARCHAR(80), middle_name VARCHAR(80), last_name VARCHAR(80), gender VARCHAR(1), cell_mobile_number VARCHAR(40), email_address VARCHAR(40), other_details VARCHAR(255) ) CREATE TABLE Ref_Detention_Type ( de...
SELECT date_address_to, AVG(monthly_rental) FROM Student_Addresses ORDER BY monthly_rental DESC
nvbench
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( ...
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-27397')) AND intakeoutput.cellpath LIKE '%intake%' AND D...
eicu
CREATE TABLE table_name_43 ( silver INTEGER, total VARCHAR, rank VARCHAR, nation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest silver for France with a rank less than 5 and a total larger than 19?
SELECT MIN(silver) FROM table_name_43 WHERE rank < 5 AND nation = "france" AND total > 19
sql_create_context
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTasks ( Id num...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS Rank, Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%krakow%' ORDER BY Reputation DESC
sede
CREATE TABLE table_2419754_1 ( enrollment INTEGER, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people are enrolled at the university in milwaukee, wisconsin
SELECT MIN(enrollment) FROM table_2419754_1 WHERE location = "Milwaukee, Wisconsin"
sql_create_context
CREATE TABLE table_53546 ( "D 50 \u221a" text, "D 49 \u221a" text, "D 48 \u221a" text, "D 47 \u221a" text, "D 46 \u221a" text, "D 45 \u221a" text, "D 44 \u221a" text, "D 43 \u221a" text, "D 42 \u221a" text, "D 41 \u221a" text ) -- Using valid SQLite, answer the following questi...
SELECT "D 42 \u221a" FROM table_53546 WHERE "D 46 \u221a" = 'r 6'
wikisql
CREATE TABLE table_name_86 ( rank INTEGER, bronze INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the average rank for when bronze is more than 1
SELECT AVG(rank) FROM table_name_86 WHERE bronze > 1
sql_create_context
CREATE TABLE table_73809 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name who directed the prod...
SELECT "Directed by" FROM table_73809 WHERE "Production code" = '1L10'
wikisql
CREATE TABLE table_21234111_10 ( robin VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Robin's score when she was eliminated?
SELECT robin FROM table_21234111_10 WHERE result = "Eliminated"
sql_create_context
CREATE TABLE table_3083 ( "Name" text, "Position" text, "Period" text, "Appearances\u00b9" real, "Goals\u00b9" real, "Nationality\u00b2" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the period for uruguay
SELECT "Period" FROM table_3083 WHERE "Nationality\u00b2" = 'Uruguay'
wikisql
CREATE TABLE table_name_62 ( away_team VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the away team's score at the match played at The Western Oval?
SELECT away_team AS score FROM table_name_62 WHERE venue = "western oval"
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 AVG(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT "
mimicsql_data
CREATE TABLE table_27782 ( "Position" real, "Race number" text, "Sail number" text, "Yacht" text, "State/country" text, "Yacht type" text, "LOA (Metres)" text, "Skipper" text, "Elapsed time d:hh:mm:ss" text ) -- Using valid SQLite, answer the following questions for the tables prov...
SELECT "LOA (Metres)" FROM table_27782 WHERE "Elapsed time d:hh:mm:ss" = '3:06:41:37'
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 demographic.days_stay, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "8440"
mimicsql_data
CREATE TABLE table_name_8 ( week INTEGER, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What average week has october 8, 1950 as the date?
SELECT AVG(week) FROM table_name_8 WHERE date = "october 8, 1950"
sql_create_context
CREATE TABLE table_68829 ( "Date" text, "Location" text, "Nature of incident" text, "Circumstances" text, "Casualties" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Casualties have a Location of kunduz, and Circumstances of suicide?
SELECT "Casualties" FROM table_68829 WHERE "Location" = 'kunduz' AND "Circumstances" = 'suicide'
wikisql
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id...
SELECT Posts.Id AS "post_link", Tags FROM Posts INNER JOIN PostHistory ON Posts.Id = PostHistory.PostId WHERE (PostHistoryTypeId = 3 OR PostHistoryTypeId = 6) AND PostHistory.Text LIKE '%##Tag##%' GROUP BY Posts.Id, Tags
sede
CREATE TABLE table_name_64 ( status VARCHAR, founded VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the status of the institution that was founded in 1996?
SELECT status FROM table_name_64 WHERE founded = 1996
sql_create_context
CREATE TABLE table_14122 ( "Elector" text, "Nationality" text, "Cardinalatial order and title" text, "Elevated" text, "Elevator" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the nationality of Cardinal-Bishop of Albano?
SELECT "Nationality" FROM table_14122 WHERE "Cardinalatial order and title" = 'cardinal-bishop of albano'
wikisql
CREATE TABLE table_15142 ( "Name" text, "Design" text, "Manufacturer" text, "Acquired" real, "Disposed" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average year for Wallenstein with 1a1 design?
SELECT AVG("Acquired") FROM table_15142 WHERE "Design" = '1a1' AND "Name" = 'wallenstein'
wikisql
CREATE TABLE table_70627 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text ) -- Using valid SQLite, answer the following questions f...
SELECT "Losing bonus" FROM table_70627 WHERE "Drawn" = '1' AND "Try bonus" = '10'
wikisql
CREATE TABLE table_28298589_4 ( date VARCHAR, visiting_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was the game where Texas Southern was the visiting team?
SELECT date FROM table_28298589_4 WHERE visiting_team = "Texas Southern"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime 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 = 'sodium chloride 0.9% 250 ml pb' AND STRFTIME('%y', ...
eicu
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost numb...
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2498) AND prescriptions.drug IN ('calcium gluconate', 'fosphenytoin', 'vancomycin') AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-1 year')
mimic_iii
CREATE TABLE table_71867 ( "Team" text, "1st Match" text, "Matches" text, "Lost" text, "% Won" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the lost for % won of 55.37
SELECT "Lost" FROM table_71867 WHERE "% Won" = '55.37'
wikisql
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 zyjybgb.SHRGH, zyjybgb.SHRXM FROM zyjybgb WHERE zyjybgb.JZLSH = '00069816988' UNION SELECT mzjybgb.SHRGH, mzjybgb.SHRXM FROM mzjybgb WHERE mzjybgb.JZLSH = '00069816988'
css
CREATE TABLE table_32306 ( "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 attendance when VFL played MCG?
SELECT MAX("Crowd") FROM table_32306 WHERE "Venue" = 'mcg'
wikisql
CREATE TABLE table_19864 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the most recent US ...
SELECT MAX("Year") FROM table_19864 WHERE "Championship" = 'US Open'
wikisql
CREATE TABLE table_25229283_4 ( opponent VARCHAR, points_for VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent with a points for of 177?
SELECT opponent FROM table_25229283_4 WHERE points_for = 177
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid 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 = 22449 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)) AND ch...
mimic_iii
CREATE TABLE table_204_686 ( id number, "date" text, "pos." text, "name" text, "from" text, "fee" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the last date on the chart ?
SELECT "date" FROM table_204_686 ORDER BY id DESC LIMIT 1
squall
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
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 lab.patientunitstayid FROM lab WHERE lab.labname = 'uric acid')) AND DATETIME(cost.chargetime) <= DATETIME(CURRENT_TIME(...
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT demographic.dob FROM demographic WHERE demographic.name = "Tina Henderson"
mimicsql_data
CREATE TABLE table_22862203_2 ( opponent VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the opponents when the record was 11-2?
SELECT opponent FROM table_22862203_2 WHERE record = "11-2"
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Medicare" AND diagnoses.short_title = "Dementia w/o behav dist"
mimicsql_data
CREATE TABLE table_25926 ( "Episode" text, "First broadcast" text, "Seans team" text, "Jasons team" text, "Scores" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the episode(s) that featured Duncan James and Johnny Vegas as Jason's team.
SELECT "Episode" FROM table_25926 WHERE "Jasons team" = 'Duncan James and Johnny Vegas'
wikisql
CREATE TABLE table_name_72 ( opponent VARCHAR, october VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which opponent played in game 3 before October 18?
SELECT opponent FROM table_name_72 WHERE october < 18 AND game = 3
sql_create_context
CREATE TABLE table_name_11 ( home VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the home for 16 april 2008
SELECT home FROM table_name_11 WHERE date = "16 april 2008"
sql_create_context
CREATE TABLE table_65256 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the score on 24 january 1976 with the tie no of 1?
SELECT "Score" FROM table_65256 WHERE "Date" = '24 january 1976' AND "Tie no" = '1'
wikisql
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, ...
SELECT Id AS "user_link", Reputation, UpVotes, DownVotes, ROUND(CAST(UpVotes AS FLOAT) / (UpVotes + DownVotes), 1) * UpVotes AS Weighted FROM Users WHERE UpVotes > 0 AND Id > -1 ORDER BY Weighted DESC LIMIT 50
sede
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE flight_leg ( flight_id int, ...
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'LAS VEGAS' AND ground_service.city_code = city.city_code
atis
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttim...
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11095) AND prescriptions.drug = 'lorazepam' AND STRFTIME('%y', prescriptions.startdate) = '2105'
mimic_iii
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationD...
SELECT u.Id AS "user_link", COUNT(*) AS NumAnswers, SUM(CASE WHEN q.AcceptedAnswerId = a.Id THEN 1 ELSE 0 END) AS NumAccepted, (SUM(CASE WHEN q.AcceptedAnswerId = a.Id THEN 1 ELSE 0 END) * 100.0 / COUNT(*)) AS AcceptedPercent FROM Posts AS a INNER JOIN Users AS u ON u.Id = a.OwnerUserId INNER JOIN Posts AS q ON a.Paren...
sede
CREATE TABLE table_name_83 ( nation VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What nation has 187.84 points?
SELECT nation FROM table_name_83 WHERE points = 187.84
sql_create_context
CREATE TABLE table_name_72 ( rank INTEGER, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Rank has a Total of 12?
SELECT AVG(rank) FROM table_name_72 WHERE total = 12
sql_create_context
CREATE TABLE table_65348 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Tie no when Chester is the away team?
SELECT "Tie no" FROM table_65348 WHERE "Away team" = 'chester'
wikisql