context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_18659 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What year was the first election when Fritz G. Lanham was elected?
SELECT MAX("First elected") FROM table_18659 WHERE "Incumbent" = 'Fritz G. Lanham'
wikisql
CREATE TABLE table_48328 ( "Team #1" text, "Points" text, "Team #2" text, "1st leg" text, "2nd leg" text )
What is 2nd Leg, when Team #2 is 'San Lorenzo'?
SELECT "2nd leg" FROM table_48328 WHERE "Team #2" = 'san lorenzo'
wikisql
CREATE TABLE table_train_199 ( "id" int, "t2dm" bool, "hemoglobin_a1c_hba1c" float, "renal_disease" bool, "diabetic" string, "hypoglycemia" bool, "diabetes" bool, "seizure_disorder" bool, "glaucoma" bool, "hypertension" bool, "age" float, "NOUSE" float )
age 5 _ 14 at time of enrollment
SELECT * FROM table_train_199 WHERE age >= 5 AND age <= 14
criteria2sql
CREATE TABLE table_11703336_1 ( cpu VARCHAR, ram VARCHAR, display_size VARCHAR )
what is the cpu for the calculator with 28 kb of ram and display size 128 64 pixels 21 8 characters?
SELECT cpu FROM table_11703336_1 WHERE ram = "28 KB of ram" AND display_size = "128×64 pixels 21×8 characters"
sql_create_context
CREATE TABLE table_35604 ( "Team" text, "Copa Libertadores 1996" text, "Supercopa Sudamericana 1996" text, "Copa CONMEBOL 1996" text, "Recopa Sudamericana 1996" text )
What is the recoupa sudaamericana 1996 result of team flamengo, which did not qualify for the copa conmebol 1996?
SELECT "Recopa Sudamericana 1996" FROM table_35604 WHERE "Copa CONMEBOL 1996" = 'did not qualify' AND "Team" = 'flamengo'
wikisql
CREATE TABLE table_name_81 ( Id VARCHAR )
What is 2004, when 2010 is 'Grand Slam Tournaments'?
SELECT 2004 FROM table_name_81 WHERE 2010 = "grand slam tournaments"
sql_create_context
CREATE TABLE table_49153 ( "Scorer" text, "Club" text, "League goals" text, "FA Cup goals" real, "League Cup goals" real, "Euro competitions" text, "Total" real )
what was the total for the Wolverhampton Wanderers?
SELECT "League goals" FROM table_49153 WHERE "Club" = 'wolverhampton wanderers'
wikisql
CREATE TABLE table_67174 ( "Games" real, "Wins" real, "Draws" real, "Losses" real, "Goals For" real, "Goals Against" real, "Goal Differential" text )
for a Goals Against smaller than 9, and a Goal Differential of 0, and a Draws smaller than 2, and a Wins of 1, what's the goal total?
SELECT SUM("Goals For") FROM table_67174 WHERE "Goals Against" < '9' AND "Goal Differential" = '0' AND "Draws" < '2' AND "Wins" = '1'
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...
All questions closed as off-topic. Questions that have been closed (not protected), along with their close reasons, ordered by their view count.
SELECT q.Id AS "post_link", q.CreationDate, q.ClosedDate FROM Posts AS q INNER JOIN PostHistory AS h ON q.Id = h.PostId WHERE h.PostHistoryTypeId = 10 AND NOT q.ClosedDate IS NULL ORDER BY q.ClosedDate DESC
sede
CREATE TABLE Addresses ( address_id INTEGER, line_1_number_building VARCHAR(80), city VARCHAR(50), zip_postcode VARCHAR(20), state_province_county VARCHAR(50), country VARCHAR(50) ) CREATE TABLE Lessons ( lesson_id INTEGER, customer_id INTEGER, lesson_status_code VARCHAR(15), st...
List all customer status codes and the number of customers having each status code, could you rank bar in descending order?
SELECT customer_status_code, COUNT(*) FROM Customers GROUP BY customer_status_code ORDER BY customer_status_code DESC
nvbench
CREATE TABLE table_name_45 ( monday VARCHAR, sunday VARCHAR, series VARCHAR )
Who was the presenter on Monday of 'Big Brother 13' in which Alice Levine Jamie East presented on Sunday?
SELECT monday FROM table_name_45 WHERE sunday = "alice levine jamie east" AND series = "big brother 13"
sql_create_context
CREATE TABLE table_54923 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" real, "Record" text )
How many people attended the game on 8 March 2008?
SELECT SUM("Attendance") FROM table_54923 WHERE "Date" = '8 march 2008'
wikisql
CREATE TABLE table_name_90 ( home_team VARCHAR, away_team VARCHAR )
What is the home team score of the game with Adelaide as the away team?
SELECT home_team AS score FROM table_name_90 WHERE away_team = "adelaide"
sql_create_context
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE requirement ( requirement_id int, require...
Who will teach upper-level classes ?
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN program_...
advising
CREATE TABLE table_name_37 ( position VARCHAR, pick__number VARCHAR )
what is the position of pick #53?
SELECT position FROM table_name_37 WHERE pick__number = 53
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...
what is maximum age of patients whose admission location is emergency room admit and primary disease is copd exacerbation?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.diagnosis = "COPD EXACERBATION"
mimicsql_data
CREATE TABLE table_30705 ( "Track no." real, "Track" text, "Original Artist" text, "Soloist(s)" text, "Vocal Percussionist" text, "Arranger(s)" text )
Who was the vocal percussionist when stevie wonder was the original artist?
SELECT "Vocal Percussionist" FROM table_30705 WHERE "Original Artist" = 'Stevie Wonder'
wikisql
CREATE TABLE table_name_28 ( points INTEGER, goals_for VARCHAR, draws VARCHAR, wins VARCHAR )
What is the highest points of the club with less than 9 draws, 11 wins, and more than 40 goals?
SELECT MAX(points) FROM table_name_28 WHERE draws < 9 AND wins = 11 AND goals_for > 40
sql_create_context
CREATE TABLE table_38351 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What was the Attendance on october 2, 1977?
SELECT "Attendance" FROM table_38351 WHERE "Date" = 'october 2, 1977'
wikisql
CREATE TABLE table_name_91 ( elevated VARCHAR, cardinalatial_order_and_title VARCHAR )
What was the date of elevation for the cardinal given the order and title of Cardinal-Priest of S. Pudenziana?
SELECT elevated FROM table_name_91 WHERE cardinalatial_order_and_title = "cardinal-priest of s. pudenziana"
sql_create_context
CREATE TABLE table_24431264_17 ( points VARCHAR, player VARCHAR )
List the total defensive points for marion bartoli.
SELECT points AS defending FROM table_24431264_17 WHERE player = "Marion Bartoli"
sql_create_context
CREATE TABLE table_11716 ( "Version" text, "Year" text, "Bore x stroke" text, "Displacement" text, "Power" text )
Name the Bore x stroke of 1929-32
SELECT "Bore x stroke" FROM table_11716 WHERE "Year" = '1929-32'
wikisql
CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE...
Find meter_200 and the sum of ID , and group by attribute meter_200, and visualize them by a bar chart, and display by the sum id in desc.
SELECT meter_200, SUM(ID) FROM swimmer GROUP BY meter_200 ORDER BY SUM(ID) DESC
nvbench
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
how many patients whose admission type is emergency and drug name is vitamin b complex?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.drug = "Vitamin B Complex"
mimicsql_data
CREATE TABLE table_24420 ( "Week #" text, "Theme" text, "Song choice" text, "Original artist" text, "Order #" text, "Result" text )
What was Lambert's song choice in the top 13?
SELECT "Song choice" FROM table_24420 WHERE "Week #" = 'Top 13'
wikisql
CREATE TABLE table_name_76 ( date_of_death VARCHAR, date_of_inauguration VARCHAR )
What was the date of death entry in the row that has a date of inauguration entry of date of inauguration?
SELECT date_of_death FROM table_name_76 WHERE date_of_inauguration = "date of inauguration"
sql_create_context
CREATE TABLE table_57157 ( "Rank" real, "Name" text, "Nation" text, "Points" real, "Placings" real )
Tell me the sum of rank for placings of 58
SELECT SUM("Rank") FROM table_57157 WHERE "Placings" = '58'
wikisql
CREATE TABLE table_204_282 ( id number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text, "#" number )
how many times was andorra the opponent ?
SELECT COUNT(*) FROM table_204_282 WHERE "opponent" = 'andorra'
squall
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
列出医院2502709中不同疾病的平均患者年龄是多大,根据出院诊断疾病编码?
SELECT OUT_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '2502709' GROUP BY OUT_DIAG_DIS_CD
css
CREATE TABLE table_name_93 ( nickname VARCHAR, institution VARCHAR )
What is the team nickname of university of wisconsin-platteville?
SELECT nickname FROM table_name_93 WHERE institution = "university of wisconsin-platteville"
sql_create_context
CREATE TABLE player_college ( college_id VARCHAR ) CREATE TABLE college ( name_full VARCHAR, college_id VARCHAR )
what is the full name and id of the college with the largest number of baseball players?
SELECT T1.name_full, T1.college_id FROM college AS T1 JOIN player_college AS T2 ON T1.college_id = T2.college_id GROUP BY T1.college_id ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE table_24386 ( "Title" text, "Total copies sold" text, "Sales breakdown" text, "Genre" text, "Release date" text, "Developer" text, "Publisher" text )
What's the sales breakdown of the Nintendo game released on May 15, 2006?
SELECT "Sales breakdown" FROM table_24386 WHERE "Publisher" = 'Nintendo' AND "Release date" = 'May 15, 2006'
wikisql
CREATE TABLE table_5040 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What was the record when Minnesota was the home team?
SELECT "Record" FROM table_5040 WHERE "Home" = 'minnesota'
wikisql
CREATE TABLE table_55938 ( "Rank" real, "Name" text, "Nation" text, "Placings" text, "Total" real )
What rank goes to a total of 92.7?
SELECT "Rank" FROM table_55938 WHERE "Total" = '92.7'
wikisql
CREATE TABLE table_7447 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text )
Which Against has a Position larger than 11?
SELECT COUNT("Against") FROM table_7447 WHERE "Position" > '11'
wikisql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY ...
For those employees who was hired before 2002-06-21, give me the comparison about the amount of hire_date over the hire_date bin hire_date by weekday.
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE HIRE_DATE < '2002-06-21'
nvbench
CREATE TABLE table_name_1 ( floors VARCHAR, street_address VARCHAR )
How many floors have 207 w. hastings st. as the address?
SELECT COUNT(floors) FROM table_name_1 WHERE street_address = "207 w. hastings st."
sql_create_context
CREATE TABLE table_name_7 ( studio VARCHAR, worldwide_gross VARCHAR )
In what studio was the film grossing $457,640,427 made?
SELECT studio FROM table_name_7 WHERE worldwide_gross = "$457,640,427"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_items ( ...
what were the top three most common lab tests in 2103?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE STRFTIME('%y', labevents.charttime) = '2103' GROUP BY labevents.itemid) AS t1 WHERE t1.c1 <= 3)
mimic_iii
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 zyjzjlb ( CYBQDM text, CYBQMC...
患者37544109在2015年2月26日到2020年8月30日内所做的检测丙戊酸的检查是哪个医务人员工号及姓名都是什么?
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_48978 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
what is the attendance when the date is october 22, 2000?
SELECT "Attendance" FROM table_48978 WHERE "Date" = 'october 22, 2000'
wikisql
CREATE TABLE table_name_28 ( local_letter VARCHAR, capital VARCHAR )
The capital of funadhoo has what local letter?
SELECT local_letter FROM table_name_28 WHERE capital = "funadhoo"
sql_create_context
CREATE TABLE appellations ( no number, appelation text, county text, state text, area text, isava text ) CREATE TABLE grapes ( id number, grape text, color text ) CREATE TABLE wine ( no number, grape text, winery text, appelation text, state text, name text,...
What are the distinct wineries which produce wines costing between 50 and 100?
SELECT DISTINCT winery FROM wine WHERE price BETWEEN 50 AND 100
spider
CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int ) CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real...
How many exhibitions has each artist had Plot them as bar chart, and list y axis in ascending order.
SELECT Name, COUNT(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.Artist_ID = T2.Artist_ID GROUP BY T1.Artist_ID ORDER BY COUNT(*)
nvbench
CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_...
show me all flights from PHILADELPHIA to BOSTON on monday which serve a meal and arrive before 1200
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, food_service WHERE (((flight.arrival_time < 1200 AND food_service.meal_code = flight.meal_code) AND date_day.day_number = 21 AND date_day.month_number...
atis
CREATE TABLE table_25017530_5 ( cfl_team VARCHAR, player VARCHAR )
Name the cfl team for steven turner
SELECT cfl_team FROM table_25017530_5 WHERE player = "Steven Turner"
sql_create_context
CREATE TABLE staff ( staff_id number, staff_details text ) CREATE TABLE customers ( customer_id number, customer_details text ) CREATE TABLE claims_processing ( claim_processing_id number, claim_id number, claim_outcome_code text, claim_stage_id number, staff_id number ) CREATE TA...
Which customers have the substring 'Diana' in their names? Return the customer details.
SELECT customer_details FROM customers WHERE customer_details LIKE "%Diana%"
spider
CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int ) CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text )
Stacked bar chart of how many nationality for with each Type in each nationality, and could you show by the names in desc?
SELECT Nationality, COUNT(Nationality) FROM ship GROUP BY Type, Nationality ORDER BY Nationality DESC
nvbench
CREATE TABLE table_29789_1 ( international_tourist_arrivals__2012_ VARCHAR, country VARCHAR )
How many international tourists visited Russia in 2012?
SELECT international_tourist_arrivals__2012_ FROM table_29789_1 WHERE country = "Russia"
sql_create_context
CREATE TABLE table_name_49 ( residence VARCHAR, representative VARCHAR )
What residence has representative Quincy Murphy?
SELECT residence FROM table_name_49 WHERE representative = "quincy murphy"
sql_create_context
CREATE TABLE table_26603 ( "Week" real, "Date" text, "Opponent" text, "Location" text, "Final Score" text, "Attendance" real, "Record" text )
Name the number of record for week 11
SELECT COUNT("Record") FROM table_26603 WHERE "Week" = '11'
wikisql
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE outputevents ( row_id number, subject_id number, ...
when was the last time until 6 months ago that patient 9297 was prescribed a medication via vg?
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9297) AND prescriptions.route = 'vg' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-6 month') ORDER BY prescriptions.startdate DESC LIMIT 1
mimic_iii
CREATE TABLE table_204_639 ( id number, "poll company" text, "source" text, "publication date" text, "psuv" number, "opposition" number, "undecided" number )
which source was used before may 2010 ?
SELECT "source" FROM table_204_639 WHERE "publication date" < (SELECT "publication date" FROM table_204_639 WHERE "publication date" = 'may 2010')
squall
CREATE TABLE table_name_9 ( result VARCHAR, date VARCHAR )
What was the result of the game on November 7, 1999?
SELECT result FROM table_name_9 WHERE date = "november 7, 1999"
sql_create_context
CREATE TABLE table_43681 ( "Rank" real, "Title" text, "Studio" text, "Director" text, "Gross" text )
What is the sum of the ranks for the film, eddie murphy raw?
SELECT SUM("Rank") FROM table_43681 WHERE "Title" = 'eddie murphy raw'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_nam...
what were the top three most common procedures that followed within 2 months for patients who had nonop remov hrt asst sys since 4 years ago?
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 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 prescriptions...
provide me the number of self pay insurance patients diagnosed with other disorders of the pituitary and other syndromes of diencephalohypophyseal origin.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Self Pay" AND diagnoses.long_title = "Other disorders of the pituitary and other syndromes of diencephalohypophyseal origin"
mimicsql_data
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...
what is the number of patients whose diagnoses icd9 code is 44020 and drug type is base?
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 = "44020" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE table_204_385 ( id number, "round" number, "pick" number, "player" text, "nationality" text, "college/junior/club team" text )
which player was picked in the last round ?
SELECT "player" FROM table_204_385 ORDER BY "round" DESC LIMIT 1
squall
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, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
哪个人门诊就诊中开出的检验报告单21844290233
SELECT person_info.XM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZ...
css
CREATE TABLE Candidate_Assessments ( candidate_id INTEGER, qualification CHAR(15), assessment_date DATETIME, asessment_outcome_code CHAR(15) ) CREATE TABLE Student_Course_Attendance ( student_id INTEGER, course_id INTEGER, date_of_attendance DATETIME ) CREATE TABLE People_Addresses ( p...
For all course_name from courses table, group by the course name and count them with a bar chart, I want to sort in descending by the x axis.
SELECT course_name, COUNT(course_name) FROM Courses GROUP BY course_name ORDER BY course_name DESC
nvbench
CREATE TABLE table_18718 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
How many candidates won the election of john n. sandlin?
SELECT COUNT("Candidates") FROM table_18718 WHERE "Incumbent" = 'John N. Sandlin'
wikisql
CREATE TABLE table_14488 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
Where was the game held on August 20, 2004?
SELECT "Venue" FROM table_14488 WHERE "Date" = 'august 20, 2004'
wikisql
CREATE TABLE bdmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
编号为9925374的这个医疗机构有多少在转诊门诊的就诊记录?在2016-01-06到2020-10-15的这段时间
SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.YLJGDM = '9925374' AND wdmzjzjlb.JZKSRQ BETWEEN '2016-01-06' AND '2020-10-15' AND wdmzjzjlb.ZZBZ > 0 UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.YLJGDM = '9925374' AND bdmzjzjlb.JZKSRQ BETWEEN '2016-01-06' AND '2020-10-15' AND bdmzjzjlb.ZZBZ > 0
css
CREATE TABLE table_name_91 ( year INTEGER, post VARCHAR )
In what year has a Post of designer?
SELECT SUM(year) FROM table_name_91 WHERE post = "designer"
sql_create_context
CREATE TABLE table_56716 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
What was the score on April 22?
SELECT "Score" FROM table_56716 WHERE "Date" = 'april 22'
wikisql
CREATE TABLE table_43830 ( "Team" text, "Manager" text, "Home city" text, "Stadium" text, "Capacity" real )
What is the team at Stadion Maksimir?
SELECT "Team" FROM table_43830 WHERE "Stadium" = 'stadion maksimir'
wikisql
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...
医疗机构6679422中哪20个科室统筹金额消耗的最多?在2000年4月5日到2005年10月9日
SELECT t_kc24.t_kc21_MED_ORG_DEPT_CD, t_kc24.t_kc21_MED_ORG_DEPT_NM FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '6679422' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-04-05' AND '2005-10-09' GROUP BY t_kc24.t_kc21_MED_ORG_DEPT_CD ORDER BY SUM(t_kc24.OVE_PAY) DESC LIMIT 20
css
CREATE TABLE table_name_99 ( silver INTEGER, rank INTEGER )
What is the fewest number of silver medals a nation who ranked below 8 received?
SELECT MIN(silver) FROM table_name_99 WHERE rank > 8
sql_create_context
CREATE TABLE table_773 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
Who were the candidates when Noble Jones Gregory was incumbent?
SELECT "Candidates" FROM table_773 WHERE "Incumbent" = 'Noble Jones Gregory'
wikisql
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
Show me about the distribution of Date_of_Birth and Height in a bar chart.
SELECT Date_of_Birth, Height FROM people
nvbench
CREATE TABLE table_name_47 ( maximum_fps VARCHAR, least_compression_at_maximum_fps VARCHAR, height VARCHAR, least_compression_at_24_fps VARCHAR )
What is the maximum fps HDRx with a height larger than 1080 with a compression at 24 fps of 6:1 with a compression at maximum fps of at least 7:1?
SELECT maximum_fps AS HDRx FROM table_name_47 WHERE height > 1080 AND least_compression_at_24_fps = "6:1" AND least_compression_at_maximum_fps = "7:1"
sql_create_context
CREATE TABLE table_26036 ( "Pos" real, "No." real, "Driver" text, "Team" text, "Chassis/Engine" text, "Laps" real, "Time/Retired" text, "Grid" real, "Laps Led" real, "Points" real )
How many drivers used lola t92/00/ buick for their chassis/engine?
SELECT COUNT("No.") FROM table_26036 WHERE "Chassis/Engine" = 'Lola T92/00/ Buick'
wikisql
CREATE TABLE table_name_44 ( total_time VARCHAR, margin VARCHAR, driver VARCHAR )
How much time did Coad make when the margin was 04:02?
SELECT total_time FROM table_name_44 WHERE margin = "04:02" AND driver = "coad"
sql_create_context
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_...
and how much does it cost to travel from BOS airport to downtown
SELECT DISTINCT ground_service.ground_fare FROM airport, city, ground_service WHERE airport.airport_code = 'BOS' AND city.city_name = 'BOSTON' AND ground_service.airport_code = airport.airport_code AND ground_service.city_code = city.city_code
atis
CREATE TABLE table_name_14 ( player VARCHAR, overall INTEGER )
What is the name of the player with an Overall larger than 227?
SELECT player FROM table_name_14 WHERE overall > 227
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...
Get me the list of patients on an ou route of drug administration who had urgent hospital admission.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.route = "OU"
mimicsql_data
CREATE TABLE table_204_256 ( id number, "position" number, "club" text, "played" number, "points" number, "wins" number, "draws" number, "losses" number, "goals for" number, "goals against" number, "goal difference" number )
which club scored the highest number of goals ?
SELECT "club" FROM table_204_256 ORDER BY "goals for" DESC LIMIT 1
squall
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 flight_stop ( flight_id int, stop_number int, stop_days text, stop_...
show me flights from DENVER to WASHINGTON on WEDNESDAY
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, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND days.day_name = 'WEDNESDAY' AND flight.flight_days = days.days_code...
atis
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
what is the number of patients whose primary disease is liver transplant and procedure icd9 code is 4575?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "LIVER TRANSPLANT" AND procedures.icd9_code = "4575"
mimicsql_data
CREATE TABLE betfront ( year number, datetime time, country text, competion text, match text, home_opening number, draw_opening number, away_opening number, home_closing number, draw_closing number, away_closing number ) CREATE TABLE football_data ( season text, date...
Which games had no goals scored at full time?
SELECT * FROM football_data WHERE (fthg + ftag) = 0
worldsoccerdatabase
CREATE TABLE table_29445 ( "Episode" text, "Date" text, "Official ITV rating (millions)" text, "Weekly rank" real, "Share (%)" text, "Official ITV HD rating (millions)" text, "Total ITV viewers (millions)" text )
What were the official itv ratings in millions for the episode with a total of 8.53 million itv viewers
SELECT "Official ITV rating (millions)" FROM table_29445 WHERE "Total ITV viewers (millions)" = '8.53'
wikisql
CREATE TABLE table_19960 ( "Election" real, "Labour" real, "Conservative" real, "Liberal" real, "Social Democratic Party" real, "Social and Liberal Democrats/ Liberal Democrats" real, "Independent" real, "Green" real, "Other" text, "Control" text )
Name the least leabour for social and liberal democrats being 14
SELECT MIN("Labour") FROM table_19960 WHERE "Social and Liberal Democrats/ Liberal Democrats" = '14'
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 prescriptions...
what is drug type and drug route of drug name digoxin?
SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Digoxin"
mimicsql_data
CREATE TABLE table_19221 ( "Episode" text, "Broadcast date" text, "Run time" text, "Viewers (in millions)" text, "Archive" text )
How many episodes had a broadcast date and run time of 24:43?
SELECT COUNT("Broadcast date") FROM table_19221 WHERE "Run time" = '24:43'
wikisql
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TA...
Retrieve duplicate questions - quora format.
SELECT NEWID() AS id, p.Id AS qid1, p.Body AS question1, dupes.Id AS qid2, dupes.Body AS question2, 1 AS isDuplicate FROM Posts AS p JOIN PostLinks AS links ON (p.Id = links.RelatedPostId AND LinkTypeId = 3) JOIN Posts AS dupes ON (dupes.Id = links.PostId AND dupes.PostTypeId = 1) WHERE p.Tags LIKE '%java%' AND p.Tags ...
sede
CREATE TABLE table_48018 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text )
What was the record of the match against Chris Mounce?
SELECT "Record" FROM table_48018 WHERE "Opponent" = 'chris mounce'
wikisql
CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER...
Show all allergies with number of students affected. Show bar chart.
SELECT Allergy, COUNT(*) FROM Has_Allergy GROUP BY Allergy
nvbench
CREATE TABLE table_60924 ( "Class" text, "Introduced" text, "Number in class" real, "Number in service" real, "Power output (kW)" real )
What is the power output for class 5?
SELECT "Power output (kW)" FROM table_60924 WHERE "Number in class" = '5'
wikisql
CREATE TABLE table_39550 ( "Tournament" text, "1989" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "Career W\u2013L" text )
Which 1997's accompanying 1991 was a when the tournament was the australian open?
SELECT "1997" FROM table_39550 WHERE "1991" = 'a' AND "Tournament" = 'australian open'
wikisql
CREATE TABLE table_75075 ( "Rank" real, "Country/Territory" text, "Nuestra Belleza Latina" real, "1st runner-up" real, "2nd runner-up" real, "3rd runner-up" real, "4th runner-up" real, "5th runner-up" real, "6th runner-up" real, "7th runner-up" real, "8th runner-up" real, ...
What is the 9th runner-up with a top 18/20/24/30 greater than 17 and a 5th runner-up of 2?
SELECT SUM("9th runner-up") FROM table_75075 WHERE "5th runner-up" = '2' AND "Top 18/20/24/30" > '17'
wikisql
CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE airline ( airline_co...
now i need flights leaving from ATLANTA and arriving in PHILADELPHIA on wednesday morning
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 (((((flight.arrival_time < flight.departure_time) AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.da...
atis
CREATE TABLE table_36485 ( "Name v t e" text, "Pos." text, "Height" text, "Weight" text, "Club" text )
What is the weight of the player from the vk primorac kotor club?
SELECT "Weight" FROM table_36485 WHERE "Club" = 'vk primorac kotor'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, ...
从00年12月12日到01年10月14日,科室16206的门诊人次如何
SELECT COUNT(*) FROM mzjzjlb WHERE mzjzjlb.JZKSBM = '16206' AND mzjzjlb.JZKSRQ BETWEEN '2000-12-12' AND '2001-10-14'
css
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) 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 T...
For those employees who do not work in departments with managers that have ids between 100 and 200, find last_name and department_id , and visualize them by a bar chart, and rank by the y axis from high to low please.
SELECT LAST_NAME, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_ID DESC
nvbench
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...
从2003年7月31日开始到2013年12月15日结束名字是韩韵诗的参保人她的门诊西药费总共是多少钱?
SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '韩韵诗' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2003-07-31' AND '2013-12-15' AND t_kc22.MED_INV_ITEM_TYPE = '西药费'
css
CREATE TABLE table_2227 ( "Year" real, "Fowler" real, "Stanier, 3 cylinder" real, "Stanier, 2 cylinder" real, "Fairburn" real, "BR Standard" real, "Total" real )
When the Fowler is 16, what is the number of cylinders?
SELECT COUNT("Stanier, 3 cylinder") FROM table_2227 WHERE "Fowler" = '16'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number,...
从07年8月11日到18年7月17日,患者马芳蕙在470787上的检测记录详情
SELECT * FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jy...
css
CREATE TABLE catalog_contents ( catalog_entry_name VARCHAR, height VARCHAR )
What is the product with the highest height? Give me the catalog entry name.
SELECT catalog_entry_name FROM catalog_contents ORDER BY height DESC LIMIT 1
sql_create_context
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, g...
Of EECS 573 and EECS 512 , which is easier ?
SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 573 OR course.number = 512) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ...
advising