context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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 ( ...
what is the total number of patients diagnosed with icd9 code e8791?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "E8791"
mimicsql_data
CREATE TABLE table_name_19 ( points INTEGER, year VARCHAR, entrant VARCHAR )
What is the least amount of points the entrant Simoniz received before 1960?
SELECT MIN(points) FROM table_name_19 WHERE year < 1960 AND entrant = "simoniz"
sql_create_context
CREATE TABLE table_16347 ( "Year [e ] (Ceremony)" text, "Film title used in nomination" text, "Original title" text, "Director" text, "Result" text )
Who were the directors of the film submitted with the title Young T rless?
SELECT "Director" FROM table_16347 WHERE "Film title used in nomination" = 'Young Törless'
wikisql
CREATE TABLE basketball_match ( team_id number, school_id number, team_name text, acc_regular_season text, acc_percent text, acc_home text, acc_road text, all_games text, all_games_percent number, all_home text, all_road text, all_neutral text ) CREATE TABLE university (...
Return the total and minimum enrollments across all schools.
SELECT SUM(enrollment), MIN(enrollment) FROM university
spider
CREATE TABLE county ( county_id number, county_name text, population number, zip_code text ) CREATE TABLE party ( party_id number, year number, party text, governor text, lieutenant_governor text, comptroller text, attorney_general text, us_senate text ) CREATE TABLE el...
Return the maximum and minimum population among all counties.
SELECT MAX(population), MIN(population) FROM county
spider
CREATE TABLE table_8250 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
How many times was the finish t32?
SELECT COUNT("Total") FROM table_8250 WHERE "Finish" = 't32'
wikisql
CREATE TABLE table_42512 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the sum of the gold medals of the total nation, which has more than 19 silver medals?
SELECT SUM("Gold") FROM table_42512 WHERE "Nation" = 'total' AND "Silver" > '19'
wikisql
CREATE TABLE table_1342379_45 ( first_elected INTEGER, incumbent VARCHAR )
What was the last year that incumbent joseph t. deal was first elected?
SELECT MAX(first_elected) FROM table_1342379_45 WHERE incumbent = "Joseph T. Deal"
sql_create_context
CREATE TABLE table_13028 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text )
Which Outcome has a Score in the final of 4 6, 5 7?
SELECT "Outcome" FROM table_13028 WHERE "Score in the final" = '4–6, 5–7'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
how many patients in this year were prescribed promethazine hcl 25 mg/ml ij soln in the same hospital visit after having undergone bronchodilator?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'bronchodilator' AND DATETIME(treatment.treatmenttime, 'start of year') = ...
eicu
CREATE TABLE Financial_Transactions ( transaction_id INTEGER, previous_transaction_id INTEGER, account_id INTEGER, card_id INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DOUBLE, transaction_comment VARCHAR(255), other_transaction_details VARCHAR(...
Visualize a pie chart with what are the different card types, and how many cards are there of each?
SELECT card_type_code, COUNT(*) FROM Customers_Cards GROUP BY card_type_code
nvbench
CREATE TABLE match_season ( season number, player text, position text, country number, team number, draft_pick_number number, draft_class text, college text ) CREATE TABLE team ( team_id number, name text ) CREATE TABLE player ( player_id number, player text, years_...
What are the three colleges from which the most players are from?
SELECT college FROM match_season GROUP BY college ORDER BY COUNT(*) DESC LIMIT 3
spider
CREATE TABLE table_name_35 ( points INTEGER, engine VARCHAR )
What is the lowest amount of points for a Ford Cosworth DFR (Mader) 3.5 V8 engine?
SELECT MIN(points) FROM table_name_35 WHERE engine = "ford cosworth dfr (mader) 3.5 v8"
sql_create_context
CREATE TABLE table_21648 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Attendance" real, "Record" text, "Points" real )
How many points were scored when the record was 6-8-6?
SELECT COUNT("Points") FROM table_21648 WHERE "Record" = '6-8-6'
wikisql
CREATE TABLE table_29413 ( "Athlete" text, "Event" text, "Round of 32" text, "Round of 16" text, "Quarterfinals" text, "Semifinals" text )
When yakup ener is the athlete what is the round of 32?
SELECT "Round of 32" FROM table_29413 WHERE "Athlete" = 'Yakup Şener'
wikisql
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE offering_instructor ( offering_ins...
For the upper level electives , what classes are offered before noon ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.end_time <= '12:00:00' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semest...
advising
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) 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, t...
Does LHSP 130 have 200 as a prerequisite ?
SELECT COUNT(*) > 0 FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_0.department = 'LHSP' AND COURSE_0.number = 200 AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.department = 'LHSP' AND COURSE_1.number = 130
advising
CREATE TABLE table_32392 ( "Region" text, "Host" text, "Venue" text, "City" text, "State" text )
What is the venue that Saint Joseph's University hosted at?
SELECT "Venue" FROM table_32392 WHERE "Host" = 'saint joseph''s university'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
how many patients are primarily suffering from t5 fracture?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "T5 FRACTURE"
mimicsql_data
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...
Find the number of rooms for each bed type. Show the proportion.
SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType
nvbench
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId num...
Comments asking for questions to be made wiki. All comments that contain the text should and wiki
SELECT PostId AS "post_link", Text FROM Comments WHERE Text LIKE '%should%wiki%'
sede
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 t...
provide the number of patients whose diagnoses long title is rheumatic heart disease, unspecified and drug route is iv drip?
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 = "Rheumatic heart disease, unspecified" AND prescriptions.route = "IV DRIP"
mimicsql_data
CREATE TABLE table_204_334 ( id number, "opposition" text, "matches" number, "won" number, "drawn" number, "lost" number, "for" number, "against" number, "win%" text )
which opponent did the comets win more matches against : the delhi wizards or the karnataka lions ?
SELECT "opposition" FROM table_204_334 WHERE "opposition" IN ('delhi wizards', 'karnataka lions') ORDER BY "won" DESC LIMIT 1
squall
CREATE TABLE table_35212 ( "Pos." real, "Car #" real, "Driver" text, "Make" text, "Team" text )
Who is the team of the Chevrolet, and has a position less than 7, for car # 88?
SELECT "Team" FROM table_35212 WHERE "Make" = 'chevrolet' AND "Pos." < '7' AND "Car #" = '88'
wikisql
CREATE TABLE Student ( StuID VARCHAR, Advisor VARCHAR )
Show ids for all students who have advisor 1121.
SELECT StuID FROM Student WHERE Advisor = 1121
sql_create_context
CREATE TABLE table_1734 ( "N" real, "P" text, "Name" text, "EU" text, "Country" text, "Age" real, "Type" text, "Moving from" text, "Transfer window" text, "Ends" text, "Transfer fee" text, "Source" text )
What is the name of the country where moving from is listed as bristol city?
SELECT "Country" FROM table_1734 WHERE "Moving from" = 'Bristol City'
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...
项目563098在医疗机构4874710一共有多少检查记录?
SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_MED_SER_ORG_NO = '4874710' AND t_kc22.SOC_SRT_DIRE_CD = '563098'
css
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, ...
i would like a flight leaving from BOSTON arriving in SAN FRANCISCO with a stopover in ATLANTA
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CIT...
atis
CREATE TABLE table_45332 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What is Date, when Week is 11?
SELECT "Date" FROM table_45332 WHERE "Week" = '11'
wikisql
CREATE TABLE table_203_701 ( id number, "#" number, "title" text, "featured guest(s)" text, "producer(s)" text, "length" text )
what is the last track on the album ?
SELECT "title" FROM table_203_701 ORDER BY "#" DESC LIMIT 1
squall
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, ...
what are the five year survival probability of a patient diagnosed with hypotension?
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI...
eicu
CREATE TABLE table_63898 ( "Frequency" text, "Call sign" text, "Branding" text, "Format" text, "Owner" text )
What's the call sign of The Q?
SELECT "Call sign" FROM table_63898 WHERE "Branding" = 'the q'
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...
医疗就诊66434833127的全部检验报告单里没麻醉这俩字的科室开出的都是啥编号?
SELECT jybgb.BGDH FROM jybgb WHERE jybgb.JZLSH = '66434833127' AND NOT jybgb.KSMC LIKE '%麻醉%'
css
CREATE TABLE table_3661 ( "Series #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text )
How many episodes is episode number 4 in the series?
SELECT COUNT("Title") FROM table_3661 WHERE "Series #" = '4'
wikisql
CREATE TABLE table_name_73 ( area VARCHAR, name VARCHAR )
Which area has a Name of william colenso college?
SELECT area FROM table_name_73 WHERE name = "william colenso college"
sql_create_context
CREATE TABLE table_6765 ( "SANSKRT" text, "CHINESE" text, "VIETNAMESE" text, "JAPANESE" text, "KOREAN" text )
Which KOREAN has a CHINESE of / sh z p t ?
SELECT "KOREAN" FROM table_6765 WHERE "CHINESE" = '師子菩提 / shīzǐpútí'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( ...
what is the monthly minimum amount of troponin - i of patient 016-25367 since 97 months ago?
SELECT MIN(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-25367')) AND lab.labname = 'troponin - i' AND DATETIME(lab.labresulttime) >= D...
eicu
CREATE TABLE table_39841 ( "District" text, "Incumbent" text, "Party" text, "Elected" real, "Status" text, "2008 Candidates" text, "Results" text )
What were the Results in the Washington 2 District?
SELECT "Results" FROM table_39841 WHERE "District" = 'washington 2'
wikisql
CREATE TABLE table_79196 ( "Rank" text, "Capacity" real, "City" text, "State" text, "Year opened" text )
What is the rank for the year opened in 1959 in Pennsylvania?
SELECT "Rank" FROM table_79196 WHERE "Year opened" = '1959' AND "State" = 'pennsylvania'
wikisql
CREATE TABLE table_11545282_18 ( school_club_team VARCHAR, player VARCHAR )
Which school is Kirk Snyder from?
SELECT school_club_team FROM table_11545282_18 WHERE player = "Kirk Snyder"
sql_create_context
CREATE TABLE table_name_98 ( fa_trophy INTEGER, player VARCHAR, league VARCHAR )
What FA trophys have tony hemmings as the player, with a league greater than 15?
SELECT SUM(fa_trophy) FROM table_name_98 WHERE player = "tony hemmings" AND league > 15
sql_create_context
CREATE TABLE table_1467951_4 ( release_date VARCHAR, dvd_name VARCHAR )
How many release dates does volume 4 DVD have?
SELECT COUNT(release_date) FROM table_1467951_4 WHERE dvd_name = "Volume 4"
sql_create_context
CREATE TABLE table_name_71 ( venue VARCHAR, date VARCHAR )
What venue did the game on september 5, 1998 take place at?
SELECT venue FROM table_name_71 WHERE date = "september 5, 1998"
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 ) ...
what was the time of the first o2 sat (%) lab test of patient 003-17096 during the previous month?
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-17096')) AND lab.labname = 'o2 sat (%)' AND DATETIME(lab.labresulttime, 'start ...
eicu
CREATE TABLE customer ( cust_ID varchar(3), cust_name varchar(20), acc_type char(1), acc_bal int, no_of_loans int, credit_score int, branch_ID int, state varchar(20) ) CREATE TABLE bank ( branch_ID int, bname varchar(20), no_of_customers int, city varchar(10), state ...
Draw a bar chart for what is the average account balance of customers with credit score below 50 for the different account types?, and show by the y-axis in ascending.
SELECT acc_type, AVG(acc_bal) FROM customer WHERE credit_score < 50 GROUP BY acc_type ORDER BY AVG(acc_bal)
nvbench
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, find job_id and the amount of job_id , and group by attribute job_id, and visualize them by a bar chart, I want to show by the total number in descending.
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY COUNT(JOB_ID) DESC
nvbench
CREATE TABLE table_15740666_6 ( games_played VARCHAR, kansas_state_vs VARCHAR )
how many games has kansas state and depaul played against each other
SELECT COUNT(games_played) FROM table_15740666_6 WHERE kansas_state_vs = "DePaul"
sql_create_context
CREATE TABLE table_701 ( "District" text, "Incumbent" text, "Party" text, "Elected" real, "Status" text, "Opponent" text )
What district had elections in 1964?
SELECT "District" FROM table_701 WHERE "Elected" = '1964'
wikisql
CREATE TABLE table_name_27 ( enrollment VARCHAR, location VARCHAR )
What is the enrollment number for Rockville?
SELECT COUNT(enrollment) FROM table_name_27 WHERE location = "rockville"
sql_create_context
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body te...
Amount of rep lost by repcap.
WITH TotalRepFromPosts AS (SELECT OwnerUserId, SUM(Score) AS "total_score" FROM Posts GROUP BY OwnerUserId), AmountOfAcceptedAnswers AS (SELECT a.OwnerUserId, COUNT(a.Id) AS aantal FROM Posts AS q INNER JOIN Posts AS a ON q.Id = a.ParentId AND q.AcceptedAnswerId = a.Id GROUP BY a.OwnerUserId) SELECT u.Id AS "user_link"...
sede
CREATE TABLE table_name_65 ( date VARCHAR, opponents_in_the_final VARCHAR )
Which date has opponents, Akgul Amanmuradova Nina Bratchikova, in the final?
SELECT date FROM table_name_65 WHERE opponents_in_the_final = "akgul amanmuradova nina bratchikova"
sql_create_context
CREATE TABLE table_14853156_2 ( cuts_made INTEGER, best_finish VARCHAR )
What is the highest number of cuts made when her best finish is t4?
SELECT MAX(cuts_made) FROM table_14853156_2 WHERE best_finish = "T4"
sql_create_context
CREATE TABLE table_36875 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
Which Position has a Round larger than 10, and a Name of shawn mccarthy?
SELECT "Position" FROM table_36875 WHERE "Round" > '10' AND "Name" = 'shawn mccarthy'
wikisql
CREATE TABLE table_name_89 ( city VARCHAR, name_in_english VARCHAR )
What is the name of the city with the Socialist Party of the Extremadurian People?
SELECT city FROM table_name_89 WHERE name_in_english = "socialist party of the extremadurian people"
sql_create_context
CREATE TABLE table_37662 ( "Name" text, "Period" text, "Starts" real, "Wins" real, "Losses" real, "Ties" real, "Win %" real )
How many Losses have a Name of blair kiel?
SELECT COUNT("Losses") FROM table_37662 WHERE "Name" = 'blair kiel'
wikisql
CREATE TABLE table_name_79 ( roman VARCHAR, sound__allophone_ VARCHAR )
What is the Roman entry for the allophone of [[[|k]]]?
SELECT roman FROM table_name_79 WHERE sound__allophone_ = "[[[|k]]]"
sql_create_context
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number...
Unanswered Geocoding questions within the Google Maps tag.
SELECT post.Title, post.Tags, post.AnswerCount, postType.Name FROM Posts AS post INNER JOIN PostTypes AS postType ON postType.Id = post.PostTypeId WHERE post.Tags LIKE '%google-maps%' AND LOWER(post.Title) LIKE '%geocod%' AND post.AcceptedAnswerId IS NULL ORDER BY post.AnswerCount
sede
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...
查一下23984748患者在医院0159261的门诊诊断内容有白内障这几个字的门诊就诊记录
SELECT * FROM hz_info JOIN mzjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND person_info_hz_i...
css
CREATE TABLE table_14015965_1 ( head_coach VARCHAR, previous_season VARCHAR )
Who was the head coach in season 2?
SELECT head_coach FROM table_14015965_1 WHERE previous_season = "2"
sql_create_context
CREATE TABLE table_69291 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real )
What school in Dalefield has a roll less than 81?
SELECT "Name" FROM table_69291 WHERE "Roll" < '81' AND "Area" = 'dalefield'
wikisql
CREATE TABLE table_41862 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
What is the average event for the Open Championship Tournament, and a Top-5 less than 1?
SELECT AVG("Events") FROM table_41862 WHERE "Tournament" = 'the open championship' AND "Top-5" < '1'
wikisql
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course...
What upper-level electives are offered in the Spring and Summer ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = '...
advising
CREATE TABLE table_80208 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
What was the lowest year that the engine Ilmor 2175a 3.5 v10 was used?
SELECT MIN("Year") FROM table_80208 WHERE "Engine" = 'ilmor 2175a 3.5 v10'
wikisql
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city var...
Which EECS upper-level classes are being offered this Summer ?
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 = 'EECS' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Summer...
advising
CREATE TABLE table_7515 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What is the highest week for Cleveland Browns with 54,205 in attendance?
SELECT MAX("Week") FROM table_7515 WHERE "Opponent" = 'cleveland browns' AND "Attendance" > '54,205'
wikisql
CREATE TABLE table_name_69 ( opponent_in_the_final VARCHAR, surface VARCHAR, score VARCHAR )
Who is the opponent in the final on a hard surface with a score of 6 3 7 6(5)?
SELECT opponent_in_the_final FROM table_name_69 WHERE surface = "hard" AND score = "6–3 7–6(5)"
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...
provide the number of patients whose gender is m and diagnoses icd9 code is 70703?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.icd9_code = "70703"
mimicsql_data
CREATE TABLE table_30558 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
Which player was drafted by the New York Rangers?
SELECT "Player" FROM table_30558 WHERE "NHL team" = 'New York Rangers'
wikisql
CREATE TABLE qualifying ( qualifyId INTEGER, raceId INTEGER, driverId INTEGER, constructorId INTEGER, number INTEGER, position INTEGER, q1 TEXT, q2 TEXT, q3 TEXT ) CREATE TABLE constructorResults ( constructorResultsId INTEGER, raceId INTEGER, constructorId INTEGER, ...
Show me a bar chart about the number of races held in each year after 2014, and I want to list y axis from low to high order please.
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 COUNT(year)
nvbench
CREATE TABLE table_name_68 ( year VARCHAR, runs VARCHAR )
What was the year with runs of 144?
SELECT year FROM table_name_68 WHERE runs = "144"
sql_create_context
CREATE TABLE table_9686 ( "Rank" real, "Airport" text, "Location" text, "2011" real, "2010" real, "2009" real )
What is the sum of the ranks for the Gold Coast Airport which had less than 118,354 aircraft movements in 2010?
SELECT SUM("Rank") FROM table_9686 WHERE "2010" < '118,354' AND "Airport" = 'gold coast airport'
wikisql
CREATE TABLE table_name_79 ( margin INTEGER, st_kilda_saints VARCHAR )
What is the most reduced Margin that has a St Kilda Saints of 11.13 (79)?
SELECT MIN(margin) FROM table_name_79 WHERE st_kilda_saints = "11.13 (79)"
sql_create_context
CREATE TABLE table_204_553 ( id number, "outcome" text, "no." number, "date" text, "tournament" text, "surface" text, "partner" text, "opponents in the final" text, "score in the final" text )
in what city was the outcome winner the most ?
SELECT "tournament" FROM table_204_553 WHERE "outcome" = 'winner' GROUP BY "tournament" ORDER BY COUNT(*) DESC LIMIT 1
squall
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 hz_info ( KH text, KLX number...
患者俞安安为疾病V29.354,门诊诊断的神经元特异性烯醇化酶的结果定量是什么?单位是什么?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB ...
css
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, O...
Cuente la cantidad de usuarios existentes en la base de datos..
SELECT DISTINCT TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostTags.PostId AND Posts.OwnerDisplayName = 'Jon Skeet'
sede
CREATE TABLE table_71802 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
What Country has Player Ky Laffoon?
SELECT "Country" FROM table_71802 WHERE "Player" = 'ky laffoon'
wikisql
CREATE TABLE table_203_574 ( id number, "track number" number, "russian title" text, "english title" text, "music" text, "lyrics" text )
how many songs are not performed by vitas on the album smile ! ?
SELECT COUNT("english title") FROM table_203_574 WHERE "music" <> 'vitas'
squall
CREATE TABLE table_name_73 ( week_2 VARCHAR, week_4 VARCHAR )
Who was the girl on week 2 that was previous to week 4's Chelsie Loraine?
SELECT week_2 FROM table_name_73 WHERE week_4 = "chelsie loraine"
sql_create_context
CREATE TABLE takes ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), grade varchar(2) ) CREATE TABLE prereq ( course_id varchar(8), prereq_id varchar(8) ) CREATE TABLE course ( course_id varchar(8), title varchar(50), dept_nam...
Return a histogram on what are the names and budgets of departments with budgets greater than the average?
SELECT dept_name, budget FROM department WHERE budget > (SELECT AVG(budget) FROM department)
nvbench
CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) ) CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password VARCHAR(40), personal_name VARCHAR(80), middle_name VARCHAR(80), family_name VARCHAR(80),...
Which tests have 'Pass' results? Return the dates when the tests were taken, and count them by a bar chart
SELECT date_test_taken, COUNT(date_test_taken) FROM Student_Tests_Taken WHERE test_result = "Pass" GROUP BY date_test_taken
nvbench
CREATE TABLE table_name_43 ( score VARCHAR, date VARCHAR, opponent VARCHAR )
Name the score for 10 april 2007 and opponent of selima sfar
SELECT score FROM table_name_43 WHERE date = "10 april 2007" AND opponent = "selima sfar"
sql_create_context
CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) )
What is the name of the school that has the smallest enrollment in each state?, and could you show Y-axis in ascending order?
SELECT cName, MIN(enr) FROM College GROUP BY state ORDER BY MIN(enr)
nvbench
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...
how many patients whose marital status is divorced and ethnicity is american indian/alaska native?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE"
mimicsql_data
CREATE TABLE table_name_10 ( pole_position VARCHAR, fastest_lap VARCHAR, circuit VARCHAR )
who had the pole position at rockingham circuit with adam christodoulou having the fastest lap?
SELECT pole_position FROM table_name_10 WHERE fastest_lap = "adam christodoulou" AND circuit = "rockingham"
sql_create_context
CREATE TABLE table_name_16 ( place VARCHAR, player VARCHAR )
Where did Jim Furyk place?
SELECT place FROM table_name_16 WHERE player = "jim furyk"
sql_create_context
CREATE TABLE table_53930 ( "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text )
What is at 8:30 when at 9:30 it is rules of engagement (reruns)?
SELECT "8:30" FROM table_53930 WHERE "9:30" = 'rules of engagement (reruns)'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, pati...
what are the five most frequent events in the output until 2102?
SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%output%' AND STRFTIME('%y', intakeoutput.intakeoutputtime) <= '2102' GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 5
eicu
CREATE TABLE table_14385 ( "Date" text, "Opponents" text, "H / A" text, "Result F\u2013A" text, "Attendance" real, "Group position" text )
What is the Group position for the date of 7 November 2007?
SELECT "Group position" FROM table_14385 WHERE "Date" = '7 november 2007'
wikisql
CREATE TABLE table_name_40 ( khmer VARCHAR, other VARCHAR )
for the other of soun, what's the khmer?
SELECT khmer FROM table_name_40 WHERE other = "soun"
sql_create_context
CREATE TABLE table_80068 ( "Representative" text, "Title" text, "Presentation of Credentials" text, "Termination of Mission" text, "Appointed by" text )
What Title has a Termination of Mission of November 4, 1861?
SELECT "Title" FROM table_80068 WHERE "Termination of Mission" = 'november 4, 1861'
wikisql
CREATE TABLE table_204_270 ( id number, "transmitter" text, "kw" number, "bbca" number, "bbcb" number, "d3&4" number, "sdn" number, "arqa" number, "arqb" number, "pol." text, "a.g." text )
which transmitter is previous to staithes
SELECT "transmitter" FROM table_204_270 WHERE id = (SELECT id FROM table_204_270 WHERE "transmitter" = 'staithes') - 1
squall
CREATE TABLE table_78421 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
How many people were in the crowd with the away team being collingwood?
SELECT COUNT("Crowd") FROM table_78421 WHERE "Away team" = 'collingwood'
wikisql
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TA...
what flights are there from BALTIMORE to SAN FRANCISCO
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 = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN ...
atis
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...
编号为06020567419的检验报告单上的检验技师的工号还有姓名都是什么?
SELECT zyjybgb.JYJSGH, zyjybgb.JYJSQM FROM zyjybgb WHERE zyjybgb.BGDH = '06020567419' UNION SELECT mzjybgb.JYJSGH, mzjybgb.JYJSQM FROM mzjybgb WHERE mzjybgb.BGDH = '06020567419'
css
CREATE TABLE table_15430606_1 ( no_disc INTEGER, no_in_series VARCHAR )
Name the minimum number disc for number in series for 14
SELECT MIN(no_disc) FROM table_15430606_1 WHERE no_in_series = "14"
sql_create_context
CREATE TABLE table_27722 ( "Institution" text, "Location" text, "Nickname" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" real )
When was Piedmont College founded?
SELECT MAX("Founded") FROM table_27722 WHERE "Institution" = 'Piedmont College'
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...
count the number of patients whose diagnoses short title is chr syst/diastl hrt fail and drug type is additive?
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.short_title = "Chr syst/diastl hrt fail" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE table_name_56 ( rider VARCHAR, time VARCHAR, rank VARCHAR )
What is the name of the rider with a time of 1:45.52.84, and a Rank of 8?
SELECT rider FROM table_name_56 WHERE time = "1:45.52.84" AND rank = 8
sql_create_context
CREATE TABLE table_34801 ( "Player" text, "Number" real, "Yards" real, "Average" real, "Long" real, "Touchdowns" real )
What is the highest amount of yards when the average is 9.5?
SELECT MAX("Yards") FROM table_34801 WHERE "Average" = '9.5'
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...
在10年9月29日到21年10月4日内患者22625548的所有检验结果指标记录的检测人为马皓轩的检验指标流水号是多少?
SELECT jyjgzbb.JYZBLSH 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 hz_info.RYBH = '22625548' AND jyjgzbb.JYRQ BETWEEN '2010-09-2...
css