context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_7025 ( "Name" text, "Status" text, "Authors" text, "Unit" text, "Location" text )
Who is the author for the malasaurus?
SELECT "Authors" FROM table_7025 WHERE "Name" = 'malasaurus'
wikisql
CREATE TABLE table_59321 ( "Date" text, "Time" text, "Opponent#" text, "Rank #" text, "Result" text, "Attendance" text )
What was the rank# of the opponent when there was 93,829 in attendance?
SELECT "Rank #" FROM table_59321 WHERE "Attendance" = '93,829'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
calculate the number of patients with icd9 code 44020 who had a lab test for joint fluid
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "44020" AND lab.fluid = "Joint Fluid"
mimicsql_data
CREATE TABLE table_name_65 ( ties INTEGER, wins VARCHAR, losses VARCHAR, starts VARCHAR )
Which Ties is the highest one that has Losses smaller than 9, and Starts of 26, and Wins smaller than 21?
SELECT MAX(ties) FROM table_name_65 WHERE losses < 9 AND starts = 26 AND wins < 21
sql_create_context
CREATE TABLE table_5364 ( "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 )
How many tries for Nelson RFC?
SELECT "Tries for" FROM table_5364 WHERE "Club" = 'nelson rfc'
wikisql
CREATE TABLE table_62519 ( "Constituency number" text, "Name" text, "Reserved for ( SC / ST /None)" text, "District" text, "Number of electorates (2009)" real )
With the number of electorates (2009) greater than 272,902, and 192 as the constituency number, what is the reserved for (SC / ST /None)?
SELECT "Reserved for ( SC / ST /None)" FROM table_62519 WHERE "Number of electorates (2009)" > '272,902' AND "Constituency number" = '192'
wikisql
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
Top posts from users who never come back/are unregistered.
SELECT p.Id AS "post_link" FROM Posts AS p LEFT JOIN Users AS u ON p.OwnerUserId = u.Id WHERE P.PostTypeId = 1 AND CAST((JULIANDAY(LastAccessDate) - JULIANDAY(u.CreationDate)) * 24.0 AS INT) <= 1 AND p.Score > 5
sede
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, uniquepid text,...
how many patients were prescribed sodium chloride 0.9% 1000 ml lvp within the same month last year after the procedure of antihyperlipidemic agent - hmg-coa reductase inhibitor.
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antihyperlipidemic agent - hmg-coa reductase inhibitor' AND DATETIME(treatment.treatmenttime, 'start of year...
eicu
CREATE TABLE table_43090 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
How many weeks had an attendance at 69,149?
SELECT COUNT("Week") FROM table_43090 WHERE "Attendance" = '69,149'
wikisql
CREATE TABLE table_55435 ( "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real )
What is the average Attendance at Venue A on 16 October 2004?
SELECT AVG("Attendance") FROM table_55435 WHERE "Venue" = 'a' AND "Date" = '16 october 2004'
wikisql
CREATE TABLE table_203_362 ( id number, "school" text, "location" text, "outright titles" number, "shared titles" number, "runners-up" number, "total finals" number, "last title" number, "last final" number )
which schools have the largest number of shared titles ?
SELECT "school" FROM table_203_362 WHERE "shared titles" = (SELECT MAX("shared titles") FROM table_203_362)
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 jyjgzbb ( BGDH text, BGRQ tim...
患者华红豆自二零一七年十二月二日开始,截止到二零二零年二月十六日,由哪几位医务人员为其检测游离β-绒毛膜促性腺激素的,查查这些医务人员的工号及姓名
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB ...
css
CREATE TABLE table_43256 ( "Season" text, "Staffel A" text, "Staffel B" text, "Staffel C" text, "Staffel D" text, "Staffel E" text )
What is the Staffel A that has a Staffel D of Energie Cottbus and a Staffel C of Chemie Leipzig and a Staffel B of 1. FC Union Berlin?
SELECT "Staffel A" FROM table_43256 WHERE "Staffel D" = 'energie cottbus' AND "Staffel C" = 'chemie leipzig' AND "Staffel B" = '1. fc union berlin'
wikisql
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE Badges ( Id number, UserId numb...
Users who accepted my answers.
WITH Q AS (SELECT * FROM Posts WHERE NOT AcceptedAnswerId IS NULL AND NOT OwnerUserId IS NULL AND OwnerUserId != @UserId) SELECT Q.OwnerUserId AS "user_link", COUNT(*) AS Num FROM Posts INNER JOIN Q ON Q.Id = Posts.ParentId WHERE Posts.OwnerUserId = @UserId GROUP BY Q.OwnerUserId HAVING COUNT(*) > 1 ORDER BY Num DESC
sede
CREATE TABLE table_44512 ( "Year" text, "Supplier" text, "Chest" text, "Sleeves" text, "Back" text )
Which Sleeves have a Year of 2006-2008?
SELECT "Sleeves" FROM table_44512 WHERE "Year" = '2006-2008'
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...
哪些工号及姓名的医务人员在患者沈云梦就诊过程中为他检测地高辛的,时间是从0二年二月六日到0四年五月十二日
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb....
css
CREATE TABLE table_31110 ( "Round" real, "Circuit" text, "Date" text, "Pole Position" text, "Fastest Lap" text, "Winning driver" text, "Winning team" text )
Valmir Benavides won pole position at which circuit?
SELECT "Circuit" FROM table_31110 WHERE "Pole Position" = 'Valmir Benavides'
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...
For all employees who have the letters D or S in their first name, draw a bar chart about the distribution of hire_date and the average of manager_id bin hire_date by time.
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE table_12779 ( "Satellite" text, "Launch date" text, "Carrier rocket" text, "Launch site" text, "COSPAR ID" text )
From where did the Scout carrier rocket with the satellite that has a COSPAR ID of 1971-109a launch?
SELECT "Launch site" FROM table_12779 WHERE "Carrier rocket" = 'scout' AND "COSPAR ID" = '1971-109a'
wikisql
CREATE TABLE table_5816 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "Location Attendance" text, "Record" text )
What team has a Score of l 88 94 (ot)?
SELECT "Team" FROM table_5816 WHERE "Score" = 'l 88–94 (ot)'
wikisql
CREATE TABLE table_11993 ( "Race" text, "Circuit" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Constructor" text, "Tyre" text, "Report" text )
Name the date of the italian grand prix
SELECT "Date" FROM table_11993 WHERE "Race" = 'italian grand prix'
wikisql
CREATE TABLE course ( course_id varchar(8), title varchar(50), dept_name varchar(20), credits numeric(2,0) ) CREATE TABLE department ( dept_name varchar(20), building varchar(15), budget numeric(12,2) ) CREATE TABLE time_slot ( time_slot_id varchar(4), day varchar(1), start_hr ...
Find the number of courses that have two prerequisites for each title in a bar chart, and show names in ascending order.
SELECT title, COUNT(title) FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY title ORDER BY title
nvbench
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTyp...
Top 10 user in Indore.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%indore%' OR UPPER(Location) LIKE '%INDORE%' OR Location LIKE '%indore%' AND Reputation >= 10000 ORDER BY Reputation DESC LIMIT 50
sede
CREATE TABLE table_5693 ( "Week 6 Oct 5" text, "Week 7 Oct 12" text, "Week 9 Oct 26" text, "Week 10 Nov 2" text, "Week 11 Nov 9" text, "Week 13 Nov 23" text, "Week 14 Nov 30" text, "Week 15 (Final) Dec 7" text )
Which Week 10 Nov 2 has a Week 9 Oct 26 of lsu (5-2)?
SELECT "Week 10 Nov 2" FROM table_5693 WHERE "Week 9 Oct 26" = 'lsu (5-2)'
wikisql
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, ...
Creation date for a Tag.
WITH oldestPost AS (SELECT t.Id, MIN(q.CreationDate) AS "oldest_post" FROM Tags AS t LEFT JOIN PostTags AS pt ON t.Id = pt.TagId INNER JOIN Posts AS q ON q.Id = pt.PostId WHERE t.TagName = '##TargTagName:string##' GROUP BY t.Id), foo AS (SELECT 1 AS bar) SELECT * FROM oldestPost AS op, foo
sede
CREATE TABLE table_31632 ( "Name" text, "Circuit" text, "Date" text, "Winning drivers" text, "Winning constructor" text, "Report" text )
When was the Monza circuit?
SELECT "Date" FROM table_31632 WHERE "Circuit" = 'monza'
wikisql
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE airport ( ...
which UA flights go through DENVER
SELECT DISTINCT flight.flight_id FROM airport_service, city, flight, flight_stop WHERE city.city_code = airport_service.city_code AND city.city_name = 'DENVER' AND flight_stop.stop_airport = airport_service.airport_code AND flight.airline_code = 'UA' AND flight.flight_id = flight_stop.flight_id
atis
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...
Show me about the correlation between Team_ID and All_Games_Percent , and group by attribute All_Neutral in a scatter chart.
SELECT Team_ID, All_Games_Percent FROM basketball_match GROUP BY All_Neutral
nvbench
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtim...
count the number of patients who have been given the procedure for a systemic antibiotics - penicillins two or more times since 2102.
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'systemic antibiotics - penicillins' AND STRFTIME('%y', treatment.treatmenttime) >= '2102') GROUP BY patien...
eicu
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...
列出患者的平均年龄在这所医院7831903中所有医疗就诊记录都是多少?必须要不同的科室编码和入院诊断疾病名称,
SELECT qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_NM, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '7831903' GROUP BY qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_NM UNION SELECT gyb.MED_ORG_DEPT_CD, gyb.IN_DIAG_DIS_NM, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '7831903' GROUP BY gyb.MED_ORG_DEPT_CD, gyb.IN_...
css
CREATE TABLE table_29135051_2 ( singer_s_ VARCHAR, guest_s_ VARCHAR )
Name the singer for bruce forsyth
SELECT singer_s_ FROM table_29135051_2 WHERE guest_s_ = "Bruce Forsyth"
sql_create_context
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE date_day ...
give me the flights from BALTIMORE to PITTSBURGH
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 = 'PITT...
atis
CREATE TABLE table_3132 ( "No." real, "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text, "Runner(s)-up" text )
What was the margin of victory when runner-up was K. J. Choi?
SELECT "Margin of victory" FROM table_3132 WHERE "Runner(s)-up" = 'K. J. Choi'
wikisql
CREATE TABLE table_name_73 ( nationality VARCHAR, years_for_jazz VARCHAR )
What is the nationality of the player on the Jazz from 1974-79?
SELECT nationality FROM table_name_73 WHERE years_for_jazz = "1974-79"
sql_create_context
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CR...
until 3 years ago, what was the daily average weight of patient 10539?
SELECT AVG(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 = 10539)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admi...
mimic_iii
CREATE TABLE table_33562 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Kickoff" text, "Attendance" text )
What was the final of the New England Patriots game?
SELECT "Result" FROM table_33562 WHERE "Opponent" = 'new england patriots'
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE Posts ( Id number, PostTypeId number, Accepted...
Users with the most rep-gaining answer acceptances.
SELECT u.Id AS "user_link", u.Reputation, (SELECT COUNT(*) FROM Posts AS q WHERE q.OwnerUserId = u.Id AND q.PostTypeId = 1) AS "All Questions", (SELECT COUNT(*) FROM Votes AS v INNER JOIN Posts AS a ON a.Id = v.PostId INNER JOIN Posts AS q ON q.Id = a.ParentId WHERE q.OwnerUserId = u.Id AND v.VoteTypeId = 1 AND q.Owner...
sede
CREATE TABLE table_66331 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What is the result for the event that lasted 2:20?
SELECT "Res." FROM table_66331 WHERE "Time" = '2:20'
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 procedure icd9 code is 41?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.icd9_code = "41"
mimicsql_data
CREATE TABLE table_527 ( "Branding" text, "Callsign" text, "Frequency" text, "Power (kW)" text, "Location" text )
How many places featured the DXCL Callsign?
SELECT COUNT("Location") FROM table_527 WHERE "Callsign" = 'DXCL'
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 diagnosed with icd9 code v1582 and suggested the main drug type?
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.icd9_code = "V1582" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE table_train_131 ( "id" int, "thyroid_disease" bool, "pulmonary_disease" bool, "right_bundle_branch_block" bool, "allergy_to_piperidine_derivatives" bool, "obstructive_pulmonary_disease" bool, "inflammatory_bowel_disease" bool, "renal_disease" bool, "hepatic_disease" bool...
evidence of active, clinically significant and unstable gastrointestinal, renal, hepatic, endocrine or cardiovascular system disease.
SELECT * FROM table_train_131 WHERE gastrointestinal_disease = 1 OR renal_disease = 1 OR hepatic_disease = 1 OR endocrine_disease = 1 OR cardiovascular_disease = 1
criteria2sql
CREATE TABLE table_name_96 ( col__m_ INTEGER, island VARCHAR, rank VARCHAR )
What's the lowest Col ranked less than 6 with an Island of Moloka i?
SELECT MIN(col__m_) FROM table_name_96 WHERE island = "island of molokaʻi" AND rank < 6
sql_create_context
CREATE TABLE table_name_17 ( date VARCHAR, away_team VARCHAR )
What was the date of the game for the Wrexham away team?
SELECT date FROM table_name_17 WHERE away_team = "wrexham"
sql_create_context
CREATE TABLE table_1439096_1 ( title VARCHAR, original_air_date__atv_ VARCHAR )
What is the title of the episode with the original air date of 28 September 1969?
SELECT title FROM table_1439096_1 WHERE original_air_date__atv_ = "28 September 1969"
sql_create_context
CREATE TABLE table_204_180 ( id number, "date" text, "opponent#" text, "rank#" text, "site" text, "result" text, "attendance" number )
did they win or lose to iowa ?
SELECT "result" FROM table_204_180 WHERE "opponent#" = 'iowa'
squall
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...
列出费用明细项目在医疗就诊03647045581中的所有异地结算的有多少?
SELECT t_kc22.MED_EXP_DET_ID 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 = '03647045581' AND t_kc22.REMOTE_SETTLE_FLG = '异地1' OR t_kc22.REMOTE_SETTLE_FLG = '异地2'
css
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
what is admission location and diagnoses short title of subject id 3623?
SELECT demographic.admission_location, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "3623"
mimicsql_data
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...
give me the number of english speaking patients who had alkaline phosphatase lab test.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.language = "ENGL" AND lab.label = "Alkaline Phosphatase"
mimicsql_data
CREATE TABLE table_38965 ( "Week 2 Sept 7" text, "Week 3 Sept 14" text, "Week 4 Sept 21" text, "Week 5 Sept 28" text, "Week 6 Oct 5" text, "Week 7 Oct 12" text, "Week 10 Nov 2" text, "Week 12 Nov 16" text, "Week 14 Nov 30" text, "Week 15 Dec 7" text, "Week 16 (Final) Jan 9" t...
What is the week 12 opponent for the year that had a week 3 opponent of South Florida (3-0)?
SELECT "Week 12 Nov 16" FROM table_38965 WHERE "Week 3 Sept 14" = 'south florida (3-0)'
wikisql
CREATE TABLE student ( id text, name text, dept_name text, tot_cred number ) CREATE TABLE teaches ( id text, course_id text, sec_id text, semester text, year number ) CREATE TABLE classroom ( building text, room_number text, capacity number ) CREATE TABLE instructor ( ...
Find the name of the instructors who taught C Programming course before.
SELECT T1.name FROM instructor AS T1 JOIN teaches AS T2 ON T1.id = T2.id JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.title = 'C Programming'
spider
CREATE TABLE table_73818 ( "Settlement" text, "Cyrillic Name Other Names" text, "Type" text, "Population (2011)" real, "Largest ethnic group (2002)" text, "Dominant religion (2002)" text )
How many dominant religions are in ala?
SELECT COUNT("Dominant religion (2002)") FROM table_73818 WHERE "Settlement" = 'Đala'
wikisql
CREATE TABLE table_1655 ( "Pick" real, "Player" text, "Nationality" text, "New WNBA Team" text, "Former WNBA Team" text, "College/Country/Team" text )
Name the number of former wnba team for 2
SELECT COUNT("Former WNBA Team") FROM table_1655 WHERE "Pick" = '2'
wikisql
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE month ( month_number int, month_name text ) CREATE TA...
in BOS is there ground transportation between airport and downtown
SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = airport_service.city_code AND CITY_1.city_name = 'BOSTON' AND ground_service.airpor...
atis
CREATE TABLE table_name_99 ( shoots VARCHAR, acquired VARCHAR, player VARCHAR )
What is the shooting preference of Matthew Myers, acquired in 2010?
SELECT shoots FROM table_name_99 WHERE acquired = 2010 AND player = "matthew myers"
sql_create_context
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
排序一下团伙成员苗建木最常去的哪些医院?
SELECT MED_SER_ORG_NO FROM t_kc21 WHERE PERSON_NM = '苗建木' GROUP BY MED_SER_ORG_NO ORDER BY COUNT(*) DESC
css
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
Revival badge progress for user for specific tag.
SELECT a.Id AS "post_link", a.Score, a.CreationDate FROM Posts AS a WHERE a.PostTypeId = 2 AND EXISTS(SELECT * FROM Posts AS q WHERE q.Id = a.ParentId AND q.PostTypeId = 1 AND a.CreationDate > q.CreationDate + 30 AND Tags LIKE '%<' + LOWER(@tag) + '>%') ORDER BY a.Score DESC LIMIT 1000
sede
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 TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text,...
what airlines fly from TORONTO to SAN DIEGO
SELECT DISTINCT airline.airline_code FROM airline, 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 = 'TORONTO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_n...
atis
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate t...
Buscar Usuarios por Pa s y Reputaci n.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE LOWER('%##NombrePais##%') ORDER BY Reputation DESC
sede
CREATE TABLE table_26454128_9 ( points VARCHAR, distance__metres_ VARCHAR )
What is the total number of times points were listed when the distance was 41.05 metres?
SELECT COUNT(points) FROM table_26454128_9 WHERE distance__metres_ = "41.05"
sql_create_context
CREATE TABLE table_13246 ( "Country" text, "Airport" text, "City" text, "2009" real, "Change (09/08)" text, "Worldwide ranking" text )
Which Country has a 2009 larger than 527,180, and a Worldwide ranking of 666?
SELECT "Country" FROM table_13246 WHERE "2009" > '527,180' AND "Worldwide ranking" = '666'
wikisql
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime tim...
when is the last time patient 85700 has been prescribed medicine this month?
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 85700) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') ORDER BY prescriptions.startdate DESC LIMIT 1
mimic_iii
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
tell me the minimum age of patients with death status as 0 and discharge location as disc-tran cancer chldrn h.
SELECT MIN(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H"
mimicsql_data
CREATE TABLE Settlements ( Settlement_ID INTEGER, Claim_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER, Customer_Policy_ID INTEGER ) CREATE TABLE Claims ( Claim_ID INTEGER, Policy_ID INTEGER, Date_Claim_Made DATE, Da...
Please use a bar chart to show the total amount of payment by each payment method code.
SELECT Payment_Method_Code, SUM(Amount_Payment) FROM Payments GROUP BY Payment_Method_Code
nvbench
CREATE TABLE table_name_55 ( away_team VARCHAR, tie_no VARCHAR, home_team VARCHAR )
Which Away Team has a Tie no of replay and a Home Team of Chesterfield?
SELECT away_team FROM table_name_55 WHERE tie_no = "replay" AND home_team = "chesterfield"
sql_create_context
CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) ) CREATE TABLE Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) CREATE TABLE Student ( StuID INTEGER, ...
Show the number of male and female assistant professors with a bar chart, list y axis in ascending order.
SELECT Sex, COUNT(*) FROM Faculty WHERE Rank = "AsstProf" GROUP BY Sex ORDER BY COUNT(*)
nvbench
CREATE TABLE table_75178 ( "Pick #" real, "Round" text, "Player" text, "Position" text, "College" text )
What is the largest pick# for Greg Harris?
SELECT MAX("Pick #") FROM table_75178 WHERE "Player" = 'greg harris'
wikisql
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE airport ( airport_code varchar, airp...
what is the earliest BREAKFAST flight from PHILADELPHIA to FORT WORTH
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, food_service WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'FORT WORTH' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND foo...
atis
CREATE TABLE table_name_66 ( bronze INTEGER, gold VARCHAR, total VARCHAR, silver VARCHAR )
How many bronze medals has a total less than 3 with a silver less than 1 and gold more than 1?
SELECT AVG(bronze) FROM table_name_66 WHERE total < 3 AND silver < 1 AND gold > 1
sql_create_context
CREATE TABLE Customers ( customer_id INTEGER, payment_method_code VARCHAR(10), customer_code VARCHAR(20), customer_name VARCHAR(80), customer_address VARCHAR(255), customer_phone VARCHAR(80), customer_email VARCHAR(80) ) CREATE TABLE Product_Suppliers ( product_id INTEGER, supplier_...
How many customers use each payment method, and display by the y axis in descending.
SELECT payment_method_code, COUNT(*) FROM Customers GROUP BY payment_method_code ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_40641 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
Name the Result on october 15, 1995?
SELECT "Result" FROM table_40641 WHERE "Date" = 'october 15, 1995'
wikisql
CREATE TABLE table_name_84 ( opponents VARCHAR, venue VARCHAR, date VARCHAR )
Who was the game played against on 2004-02-28 at Skytteholms IP?
SELECT opponents FROM table_name_84 WHERE venue = "skytteholms ip" AND date = "2004-02-28"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM t...
查一下在医疗就诊41430407750中给患者55801049做检验的科室名称及编码
SELECT JYKSBM, JYKSMC FROM jybgb WHERE JZLSH = '41430407750'
css
CREATE TABLE order_items ( order_item_id number, product_id number, order_id number, order_item_status text, order_item_details text ) CREATE TABLE shipments ( shipment_id number, order_id number, invoice_number number, shipment_tracking_number text, shipment_date time, othe...
On what day was the order with invoice number 10 placed?
SELECT T1.date_order_placed FROM orders AS T1 JOIN shipments AS T2 ON T1.order_id = T2.order_id WHERE T2.invoice_number = 10
spider
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...
因疾病O27.911在科室514住院的人在2000年2月3日到2005年12月31间的平均费用?
SELECT AVG(zyb.MED_CLINIC_ID) FROM zyb WHERE zyb.MED_ORG_DEPT_NM = '514' AND zyb.IN_HOSP_DAYS BETWEEN '2000-02-03' AND '2005-12-31' AND zyb.IN_DIAG_DIS_NM = 'O27.911'
css
CREATE TABLE table_name_74 ( laps INTEGER, grid VARCHAR )
I want the average Laps for grid of 9
SELECT AVG(laps) FROM table_name_74 WHERE grid = 9
sql_create_context
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
among patients who received other skin & subq i & d since 2105, what are the top four most common procedures that followed afterwards in the same month?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admi...
mimic_iii
CREATE TABLE table_27726 ( "Institution" text, "Location" text, "Nickname" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" real, "Left" real, "Current Conference" text )
Where is the University of North Carolina at Greensboro located?
SELECT "Location" FROM table_27726 WHERE "Institution" = 'University of North Carolina at Greensboro'
wikisql
CREATE TABLE table_204_443 ( id number, "week" number, "date" text, "opponent" text, "result" text, "game site" text, "attendance" number, "bye" text )
how many games were attended by at least 60,000 people ?
SELECT COUNT(*) FROM table_204_443 WHERE "attendance" >= 60000
squall
CREATE TABLE table_9331 ( "Province" text, "Area (km 2 )" real, "Total population (2000 census)" text, "Total population (2005 estimate)" real, "Total population (2010 census)" real )
Which Total population (2005 estimate) has a Total population (2010 census) of 3,626,119?
SELECT AVG("Total population (2005 estimate)") FROM table_9331 WHERE "Total population (2010 census)" = '3,626,119'
wikisql
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
统计出院诊断为腔隙性脑梗死的在医院6694892的医疗记录中最低和最高医疗费总额有多少?
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '6694892' AND t_kc21.OUT_DIAG_DIS_NM = '腔隙性脑梗死')
css
CREATE TABLE table_20406 ( "Country" text, "Total Freshwater Withdrawal (km 3 /yr)" text, "Per Capita Withdrawal (m 3 /p/yr)" real, "Domestic Use (m 3 /p/yr)(in %)" text, "Industrial Use (m 3 /p/yr)(in %)" text, "Agricultural Use (m 3 /p/yr)(in %)" text )
In Pakistan, what was the total freshwater withdrawal (km 3 /yr) where the agricultural use (m 3 /p/yr)(in %) was 1029(96%)?
SELECT "Total Freshwater Withdrawal (km 3 /yr)" FROM table_20406 WHERE "Agricultural Use (m 3 /p/yr)(in %)" = '1029(96%)'
wikisql
CREATE TABLE table_203_610 ( id number, "institution" text, "location" text, "nickname" text, "founded" number, "historical affiliation" text, "enrollment" number, "primary conference" text )
what college has the top enrollment ?
SELECT "institution" FROM table_203_610 ORDER BY "enrollment" DESC LIMIT 1
squall
CREATE TABLE MEDIATYPE ( Name VARCHAR, MediaTypeId VARCHAR ) CREATE TABLE TRACK ( MediaTypeId VARCHAR )
What is the least common media type in all tracks?
SELECT T1.Name FROM MEDIATYPE AS T1 JOIN TRACK AS T2 ON T1.MediaTypeId = T2.MediaTypeId GROUP BY T2.MediaTypeId ORDER BY COUNT(*) LIMIT 1
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
列出按平均住院时长升序排序各科室在医院6489822的名称和编码以及平均住院时长都是什么?
SELECT qtb.MED_ORG_DEPT_CD, qtb.MED_ORG_DEPT_NM, AVG(qtb.IN_HOSP_DAYS) FROM qtb WHERE qtb.MED_SER_ORG_NO = '6489822' GROUP BY qtb.MED_ORG_DEPT_CD ORDER BY AVG(qtb.IN_HOSP_DAYS) UNION SELECT gyb.MED_ORG_DEPT_CD, gyb.MED_ORG_DEPT_NM, AVG(gyb.IN_HOSP_DAYS) FROM gyb WHERE gyb.MED_SER_ORG_NO = '6489822' GROUP BY gyb.MED_ORG...
css
CREATE TABLE table_name_60 ( score VARCHAR, home VARCHAR, leading_scorer VARCHAR )
What is the score of the home game for the Cavaliers where Lebron James (46) was the lead scorer?
SELECT score FROM table_name_60 WHERE home = "cavaliers" AND leading_scorer = "lebron james (46)"
sql_create_context
CREATE TABLE table_name_46 ( wins INTEGER, goal_difference VARCHAR, played VARCHAR )
What is the most wins for a position with more than 30 played and a goal difference of 11?
SELECT MAX(wins) FROM table_name_46 WHERE goal_difference = 11 AND played > 30
sql_create_context
CREATE TABLE table_name_10 ( horse VARCHAR, faults VARCHAR, total VARCHAR )
What horse did not start and had a total of over 16.16?
SELECT horse FROM table_name_10 WHERE faults = "did not start" AND total > 16.16
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...
how many patients whose primary disease is sepsis and lab test fluid is urine?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "SEPSIS" AND lab.fluid = "Urine"
mimicsql_data
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, ...
La persona que publique una respuesta con la mayor puntuaci n..
SELECT p.OwnerUserId, p.Id, parent.Title, p.Score FROM Posts AS p JOIN Posts AS parent ON parent.Id = p.ParentId JOIN PostTags AS t ON t.PostId = parent.Id WHERE t.TagId = 175 AND p.PostTypeId = 2 AND p.CreationDate >= '2019-01-01' AND p.CreationDate < '2019-02-01' ORDER BY p.Score DESC
sede
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) C...
what flights are available from PITTSBURGH to BOSTON on saturday
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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND date_day.day_number = 26 AND date_day.month_number = 7 AND da...
atis
CREATE TABLE table_name_55 ( film VARCHAR, category VARCHAR, director_s_ VARCHAR )
What film did ian mackinnon direct that was in the short film 2007 prix uip category?
SELECT film FROM table_name_55 WHERE category = "short film 2007 prix uip" AND director_s_ = "ian mackinnon"
sql_create_context
CREATE TABLE Customers ( customer_id INTEGER, customer_first_name VARCHAR(20), customer_last_name VARCHAR(20), customer_address VARCHAR(255), customer_phone VARCHAR(255), customer_email VARCHAR(255), other_customer_details VARCHAR(255) ) CREATE TABLE Financial_Transactions ( transaction...
Show the number of customers for different customer last name in a bar chart, could you sort x-axis in ascending order?
SELECT customer_last_name, COUNT(customer_last_name) FROM Customers GROUP BY customer_last_name ORDER BY customer_last_name
nvbench
CREATE TABLE table_29769 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Who had the high assists against detroit?
SELECT "High assists" FROM table_29769 WHERE "Team" = 'Detroit'
wikisql
CREATE TABLE table_name_10 ( game INTEGER, record VARCHAR )
What's the highest game found when the record is 2-1?
SELECT MAX(game) FROM table_name_10 WHERE record = "2-1"
sql_create_context
CREATE TABLE table_name_15 ( division INTEGER, goals VARCHAR, season VARCHAR )
What is the lowest Division, when Goals is less than 5, and when Season is '2002-03'?
SELECT MIN(division) FROM table_name_15 WHERE goals < 5 AND season = "2002-03"
sql_create_context
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, Deletio...
Avg rep for 10 users with most answers.
SELECT AVG(Reputation) FROM Users WHERE Id IN (SELECT OwnerUserId FROM Posts WHERE PostTypeId = 2 AND OwnerUserId > 0 GROUP BY OwnerUserId ORDER BY COUNT(*) DESC LIMIT 10)
sede
CREATE TABLE table_44139 ( "Season" real, "Wins" real, "Poles" real, "Podiums" real, "Position" text )
What is the total number of Podiums, when Position is '2nd', when Wins is less than 6, and when Poles is greater than 0?
SELECT COUNT("Podiums") FROM table_44139 WHERE "Position" = '2nd' AND "Wins" < '6' AND "Poles" > '0'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
what is drug name and drug route of drug code nyst500t?
SELECT prescriptions.drug, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "NYST500T"
mimicsql_data
CREATE TABLE table_name_72 ( length__m_ INTEGER, country VARCHAR, maximum_grade___percentage_ VARCHAR, vertical_drop__m_ VARCHAR )
What is the shortest length of a track in Norway that has a maximum grade of 15% and a vertical drop less than 122.22 m?
SELECT MIN(length__m_) FROM table_name_72 WHERE maximum_grade___percentage_ = "15" AND vertical_drop__m_ < 122.22 AND country = "norway"
sql_create_context