context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE prescriptions ( row_id number, subject_id number, h...
had patient 99647 ever taken a laboratory test since 12/2102?
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 99647) AND STRFTIME('%y-%m', labevents.charttime) >= '2102-12'
mimic_iii
CREATE TABLE table_26120 ( "Date" text, "Total USAAF" real, "Tot Officers" real, "Tot Enlisted" real, "# overseas" real, "Officers o/s" real, "Enlisted o/s" real )
How many tot officers were there on the date when the number of tot enlisted was 329640?
SELECT "Tot Officers" FROM table_26120 WHERE "Tot Enlisted" = '329640'
wikisql
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate tim...
Protected Questions on Sci Fi SE.
SELECT Hist.PostId AS "post_link", P.ViewCount, P.Score, P.AnswerCount, P.LastActivityDate FROM PostHistory AS Hist INNER JOIN Posts AS P ON P.Id = Hist.PostId WHERE PostHistoryTypeId = 19 AND P.PostTypeId = 1 ORDER BY P.AnswerCount DESC
sede
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...
How many SWC 102 sections are there ?
SELECT COUNT(DISTINCT course_offering.section_number) FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id WHERE course.department = 'SWC' AND course.number = 102
advising
CREATE TABLE table_43198 ( "Year" real, "Winner" text, "Jockey" text, "Trainer" text, "Owner" text, "Distance (Miles)" text, "Time" text, "Purse" text )
What Owner's Trainer is Todd A. Pletcher?
SELECT "Owner" FROM table_43198 WHERE "Trainer" = 'todd a. pletcher'
wikisql
CREATE TABLE table_38489 ( "Gloss" text, "Cholim" text, "Lungchang" text, "Rera" text, "Tikhak" text, "Yonguk" text, "Muklom" text, "Hakhun" text, "Halang" text )
Which Halang has a Rera of o ?
SELECT "Halang" FROM table_38489 WHERE "Rera" = 'ʒo²'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
give me the number of patients whose drug code is pant40i?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "PANT40I"
mimicsql_data
CREATE TABLE table_68930 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text )
What was the score of the game that had an attendance of 32,036?
SELECT "Score" FROM table_68930 WHERE "Attendance" = '32,036'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellv...
what are patient 007-16517's new prescriptions today compared to the prescriptions yesterday?
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '007-16517') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medica...
eicu
CREATE TABLE table_27640 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" text, "Position" text )
What is the fewest number of races Pedro Nunes completed in any series?
SELECT MIN("Races") FROM table_27640
wikisql
CREATE TABLE table_name_70 ( ends INTEGER, transfer_fee VARCHAR )
When the transfer fee is 8.5m, what is the total ends?
SELECT SUM(ends) FROM table_name_70 WHERE transfer_fee = "£8.5m"
sql_create_context
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...
how many patients whose diagnoses long title is unspecified disorder of kidney and ureter and lab test abnormal status is abnormal?
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.long_title = "Unspecified disorder of kidney and ureter" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_name_34 ( ceased_to_be_duchess VARCHAR, birth VARCHAR )
Which duchess was born on 9 october 1574?
SELECT ceased_to_be_duchess FROM table_name_34 WHERE birth = "9 october 1574"
sql_create_context
CREATE TABLE table_29697744_1 ( season VARCHAR, position VARCHAR )
in what year the position was the 9th
SELECT season FROM table_29697744_1 WHERE position = "9th"
sql_create_context
CREATE TABLE Customer_Addresses ( customer_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME ) CREATE TABLE Department_Stores ( dept_store_id INTEGER, dept_store_chain_id INTEGER, store_name VARCHAR(80), store_address VARCHAR(255), store_phone VARCHAR(80), sto...
Show the sum of price supplied by supplier id 3 for different product type code in a bar chart.
SELECT product_type_code, SUM(product_price) FROM Product_Suppliers AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 3 GROUP BY product_type_code
nvbench
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, ...
Posts which used HTML version of FAA P/CG.
SELECT p.Id AS "post_link", pt.Name AS PostType, p.CreationDate, u.DisplayName AS PostWrittenBy, p.Body FROM Posts AS p JOIN PostTypes AS pt ON p.PostTypeId = pt.Id JOIN Users AS u ON p.OwnerUserId = u.Id WHERE p.Body LIKE '%http://www.faa.gov/air_traffic/publications/atpubs/pcg/%' ORDER BY p.CreationDate
sede
CREATE TABLE table_23399481_2 ( directed_by VARCHAR, us_viewers__in_millions_ VARCHAR )
What is the director name is the U.S. viewers is 2.22 million?
SELECT directed_by FROM table_23399481_2 WHERE us_viewers__in_millions_ = "2.22"
sql_create_context
CREATE TABLE table_1342149_3 ( party VARCHAR, incumbent VARCHAR )
Carl Elliott is a member of which party?
SELECT party FROM table_1342149_3 WHERE incumbent = "Carl Elliott"
sql_create_context
CREATE TABLE table_25680 ( "Stage" real, "Winner" text, "General classification" text, "Mountains classification" text, "Points classification" text, "Youth classification" text, "Team Classification" text )
How many Mountains Classifications were in the race with Mike Northey as Youth Classification?
SELECT COUNT("Mountains classification") FROM table_25680 WHERE "Youth classification" = 'Mike Northey'
wikisql
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_...
flights from PHOENIX to MILWAUKEE on wednesday evening
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 = 'MILWAUKEE' AND date_day.day_number = 23 AND date_day.month_number = 4 AN...
atis
CREATE TABLE table_2602958_4 ( writer_s_ VARCHAR, _number VARCHAR )
Who wrote episode 6 in season 3?
SELECT writer_s_ FROM table_2602958_4 WHERE _number = 6
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, 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, JSBBSJ time, ...
在08年1月10日到2014年4月16日内病号韦红艳的所有检验结果指标记录的检测人为82839333的检查指标流水号是多少?
SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_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 = jy...
css
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime t...
how many hours have passed since patient 31854 was admitted to the hospital?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 31854 AND admissions.dischtime IS NULL
mimic_iii
CREATE TABLE table_52164 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Who was Melbourne's home team opponent?
SELECT "Home team" FROM table_52164 WHERE "Away team" = 'melbourne'
wikisql
CREATE TABLE table_name_13 ( election INTEGER, share_of_votes VARCHAR )
What is the earlest election with a 0.9% share of votes?
SELECT MIN(election) FROM table_name_13 WHERE share_of_votes = "0.9%"
sql_create_context
CREATE TABLE table_30598 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (million)" text )
How many people watched the episode 'bad girls'?
SELECT "U.S. viewers (million)" FROM table_30598 WHERE "Title" = 'Bad Girls'
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 demographic (...
calculate the number of patients on government insurance who had colonoscopy
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.long_title = "Colonoscopy"
mimicsql_data
CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT ) CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TE...
Give me a bar chart for the number of area of each area, and I want to show y axis in ascending order.
SELECT Area, COUNT(Area) FROM appellations GROUP BY Area ORDER BY COUNT(Area)
nvbench
CREATE TABLE events ( event_id number, service_id number, event_details text ) CREATE TABLE services ( service_id number, service_type_code text ) CREATE TABLE participants_in_events ( event_id number, participant_id number ) CREATE TABLE participants ( participant_id number, part...
Which services type had both successful and failure event details?
SELECT T1.service_type_code FROM services AS T1 JOIN events AS T2 ON T1.service_id = T2.service_id WHERE T2.event_details = 'Success' INTERSECT SELECT T1.service_type_code FROM services AS T1 JOIN events AS T2 ON T1.service_id = T2.service_id WHERE T2.event_details = 'Fail'
spider
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar...
For CS , will there be any upper elective courses available ?
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id
advising
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
what is maximum days of hospital stay of patients whose gender is f?
SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.gender = "F"
mimicsql_data
CREATE TABLE table_61718 ( "Romanised name" text, "Chinese name" text, "age at appointment" real, "Foreign nationality" text, "Portfolio attachment" text, "Govt salary" text )
What is the Romanised name of the Undersecretary with an education portfolio attachment?
SELECT "Romanised name" FROM table_61718 WHERE "Portfolio attachment" = 'education'
wikisql
CREATE TABLE table_37334 ( "Track" text, "City" text, "State" text, "Opened" text, "Major Series" text, "Turns" text )
What is the number of turns for the City of san antonio?
SELECT "Turns" FROM table_37334 WHERE "City" = 'san antonio'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
provide the number of patients whose year of death is less than or equal to 2165 and procedure icd9 code is 2219?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2165.0" AND procedures.icd9_code = "2219"
mimicsql_data
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE prescript...
tell me the top five frequent input events in this year?
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT inputevents_cv.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM inputevents_cv WHERE DATETIME(inputevents_cv.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY inputevents_cv.it...
mimic_iii
CREATE TABLE table_name_53 ( game VARCHAR, developer_s_ VARCHAR )
What game was developed by Ubisoft Montreal?
SELECT game FROM table_name_53 WHERE developer_s_ = "ubisoft montreal"
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 ...
okay what i'd like to do on this one is go from WASHINGTON to ATLANTA i want a nonstop and i'd like to leave around 5pm
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 (((flight.departure_time <= 1730 AND flight.departure_time >= 1630) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND fligh...
atis
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's the price of paco2.
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'lab' AND cost.eventid IN (SELECT lab.labid FROM lab WHERE lab.labname = 'paco2')
eicu
CREATE TABLE gyb ( 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...
给病人葛芳苓开具的药品均价不超过212.49元在哪几次医疗记录中?医疗就诊编号是什么?
SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '葛芳苓' AND NOT qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 212.49) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '葛芳苓' AND NOT gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT...
css
CREATE TABLE table_66346 ( "Model" text, "Year Introduced" real, "Number of CPUs" text, "Performance (MIPS)" text, "Memory (GB)" text )
Which Year Introduced has a Memory (GB) of 0.125 2?
SELECT MAX("Year Introduced") FROM table_66346 WHERE "Memory (GB)" = '0.125–2'
wikisql
CREATE TABLE Ref_Document_Status ( document_status_description VARCHAR, document_status_code VARCHAR )
What is the description of document status code 'working'?
SELECT document_status_description FROM Ref_Document_Status WHERE document_status_code = "working"
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...
what is the number of urgent hospital admission patients who have stayed for more than 2 days in hospital?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.days_stay > "2"
mimicsql_data
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, ...
统计年龄不高于26岁的患者医疗记录的平均看病费总额是多少元?
SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_AGE <= 26)
css
CREATE TABLE table_1007688_1 ( relapsing_fever INTEGER, malaria VARCHAR )
what is the number of relapsing fever when malaria is 3000
SELECT MIN(relapsing_fever) FROM table_1007688_1 WHERE malaria = "3000"
sql_create_context
CREATE TABLE table_name_15 ( date VARCHAR, athlete VARCHAR )
What is Date, when Athlete is 'Yussuf Alli'?
SELECT date FROM table_name_15 WHERE athlete = "yussuf alli"
sql_create_context
CREATE TABLE table_48861 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is To Par, when Country is United States, and when Score is 71-68-73=212?
SELECT "To par" FROM table_48861 WHERE "Country" = 'united states' AND "Score" = '71-68-73=212'
wikisql
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, ...
how many patients are admitted as newborn and suggested with drug route both eyes?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "NEWBORN" AND prescriptions.route = "BOTH EYES"
mimicsql_data
CREATE TABLE table_name_52 ( date VARCHAR, score VARCHAR, attendance VARCHAR )
Name the Date which has a Score of 3-1 and Attendances of 32 590?
SELECT date FROM table_name_52 WHERE score = "3-1" AND attendance = "32 590"
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 the number of patients taking drug via dwell route who have unspecified opioid dependence diagnoses?
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 = "Opioid dependence-unspec" AND prescriptions.route = "DWELL"
mimicsql_data
CREATE TABLE table_68406 ( "Tournament" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "Win %" text )
What shows for 2010 when 2011 is 1r at the US Open tournament?
SELECT "2010" FROM table_68406 WHERE "2011" = '1r' AND "Tournament" = 'us open'
wikisql
CREATE TABLE table_23430 ( "Colt model no." text, "Military designation" text, "Barrel Length" text, "Barrel" text, "Handguard type" text, "Buttstock type" text, "Pistol grip type" text, "Lower receiver type" text, "Upper receiver type" text, "Rear sight type" text, "Front si...
What is the rear sight type on the model with the acr muzzle brake device?
SELECT "Rear sight type" FROM table_23430 WHERE "Muzzle device" = 'ACR muzzle brake'
wikisql
CREATE TABLE table_78852 ( "Main contestant" text, "Co-contestant (Yaar vs. Pyaar)" text, "Date performed" text, "Scores by each individual judge" text, "Total score/week" text, "Position" text, "Status" text )
What is Tina Sachdev's position?
SELECT "Position" FROM table_78852 WHERE "Co-contestant (Yaar vs. Pyaar)" = 'tina sachdev'
wikisql
CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Student ( StuID INTEGE...
How many male students are there in each city? Show a bar chart, and show from high to low by the city_code.
SELECT city_code, COUNT(*) FROM Student WHERE Sex = 'M' GROUP BY city_code ORDER BY city_code DESC
nvbench
CREATE TABLE table_name_4 ( year_won VARCHAR, to_par VARCHAR, total VARCHAR )
What is the Year won for the player with a larger than 4 To par and less the 157 Total?
SELECT year_won FROM table_name_4 WHERE to_par > 4 AND total < 157
sql_create_context
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, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
罗列出从05年7月13号到06年2月28号内患者47121310所有检验结果指标记录中的仪器编号以及名称是哪些?
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH ...
css
CREATE TABLE host ( host_id number, name text, nationality text, age text ) CREATE TABLE party ( party_id number, party_theme text, location text, first_year text, last_year text, number_of_hosts number ) CREATE TABLE party_host ( party_id number, host_id number, is...
Show the name and the nationality of the oldest host.
SELECT name, nationality FROM host ORDER BY age DESC LIMIT 1
spider
CREATE TABLE table_12043148_2 ( year INTEGER, glos_ VARCHAR, _wilts VARCHAR )
what is the latest year where glos & wilts is warminster?
SELECT MAX(year) FROM table_12043148_2 WHERE glos_ & _wilts = "Warminster"
sql_create_context
CREATE TABLE table_204_686 ( id number, "date" text, "pos." text, "name" text, "from" text, "fee" text )
what is the larges fee listed ?
SELECT MAX("fee") FROM table_204_686
squall
CREATE TABLE table_2133 ( "Rank" real, "Couple" text, "Judges" real, "Public" real, "Total" real, "Vote percentage" text, "Result" text )
What is the result of judge 6?
SELECT "Result" FROM table_2133 WHERE "Judges" = '6'
wikisql
CREATE TABLE table_14107 ( "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Points" real )
What is the sum of the grid of driver ryan hunter-reay, who has more than 24 points?
SELECT SUM("Grid") FROM table_14107 WHERE "Driver" = 'ryan hunter-reay' AND "Points" > '24'
wikisql
CREATE TABLE table_41277 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Original title" text, "Director" text, "Result" text )
What is Director, when Result is nominee, and when Year (Ceremony) is 1969 (42nd)?
SELECT "Director" FROM table_41277 WHERE "Result" = 'nominee' AND "Year (Ceremony)" = '1969 (42nd)'
wikisql
CREATE TABLE table_4219 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real, "U.S. viewers (millions)" text )
Who directed the episode that had 1.48 million viewers in the U.S.?
SELECT "Directed by" FROM table_4219 WHERE "U.S. viewers (millions)" = '1.48'
wikisql
CREATE TABLE table_25922 ( "Episode" text, "First broadcast" text, "Seans team" text, "Jons team" text, "Scores" text )
Name the scores for chris ramsey and carol vorderman
SELECT "Scores" FROM table_25922 WHERE "Seans team" = 'Chris Ramsey and Carol Vorderman'
wikisql
CREATE TABLE table_31884 ( "Tournament" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
Tell me the tournament of 2009 of atp masters series
SELECT "Tournament" FROM table_31884 WHERE "2009" = 'atp masters series'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, ...
for the patients with age 20s what are the top three most frequent diagnoses in this year?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN...
mimic_iii
CREATE TABLE table_name_48 ( home_team VARCHAR, venue VARCHAR )
Which team has a home field at Glenferrie Oval?
SELECT home_team FROM table_name_48 WHERE venue = "glenferrie oval"
sql_create_context
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) 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 re...
Find Sex and the amount of Sex , and group by attribute Sex, and visualize them by a bar chart, I want to rank in desc by the X.
SELECT Sex, COUNT(Sex) FROM people GROUP BY Sex ORDER BY Sex DESC
nvbench
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost numb...
how many hours has passed since the last time on their current hospital visit that patient 42473 was prescribed buprenorphine?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 42473 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'buprenorphine' ORDER BY prescriptions.startd...
mimic_iii
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...
看看桔梗颗粒的医疗机构三大目录编码及名称,是在医疗就诊19775817952中开出的
SELECT MED_DIRE_CD, MED_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '19775817952' AND SOC_SRT_DIRE_NM = '桔梗颗粒'
css
CREATE TABLE table_59172 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
Which Player has a Score of 72-68-78-71=289?
SELECT "Player" FROM table_59172 WHERE "Score" = '72-68-78-71=289'
wikisql
CREATE TABLE table_11257 ( "Margin" real, "Opponent" text, "Score" text, "Venue" text, "Date" text )
On what date was the match against the St. George Illawarra Dragons?
SELECT "Date" FROM table_11257 WHERE "Opponent" = 'st. george illawarra dragons'
wikisql
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREAT...
Are there Friday classes when Prof. Joseph Gennaro teaches 751 ?
SELECT COUNT(*) = 0 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 WHERE course.number = 751 AND c...
advising
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, ...
how many patients diagnosed with abn involun movement nec are unmarried?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.short_title = "Abn involun movement NEC"
mimicsql_data
CREATE TABLE table_11145 ( "Season" real, "Episodes" real, "Originally aired" text, "Season Premiere" text, "Season Finale" text, "DVD release date" text )
What are the originally aired dates of the series premiering on October 3, 2001 with less than 5 seasons?
SELECT "Originally aired" FROM table_11145 WHERE "Season" < '5' AND "Season Premiere" = 'october 3, 2001'
wikisql
CREATE TABLE procedures ( 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 diagnoses ( ...
how many patients below 43 years of age had the diagnosis long title as other preterm infants, 750-999 grams?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "43" AND diagnoses.long_title = "Other preterm infants, 750-999 grams"
mimicsql_data
CREATE TABLE table_203_288 ( id number, "season" text, "premiere date" text, "the winner" text, "runner-up" text, "finalists" text, "contestants in order of elimination" text, "number of contestants" text, "number of concerts" number )
what is the last season that ton won ?
SELECT "season" FROM table_203_288 WHERE "the winner" = 'ton' ORDER BY "premiere date" DESC LIMIT 1
squall
CREATE TABLE table_19732 ( "Name" text, "Years" text, "League" real, "FA Cup" real, "League Cup" real, "Europe" real, "Other a" real, "Total" text )
How many values of Other A correspond to Tommy Johnson Category:Articles with hCards?
SELECT COUNT("Other a") FROM table_19732 WHERE "Name" = 'Tommy Johnson Category:Articles with hCards'
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...
吴德泽病患的药品消费不低于5837.52元的医疗记录有哪几次?把医疗就诊编号一一列出来
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '吴德泽' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 5837.52)
css
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE p...
How many sections does MILSCI 499 include ?
SELECT COUNT(*) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'MILSCI' AND course.number = 499 AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016
advising
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
把医院5188854在二零一零年七月六号到二零二一年六月二十一号期间所有非异地结算的医疗就诊记录列出来
(SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '5188854' AND IN_HOSP_DATE BETWEEN '2010-07-06' AND '2021-06-21') EXCEPT (SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '5188854' AND IN_HOSP_DATE BETWEEN '2010-07-06' AND '2021-06-21' AND (REMOTE_SETTLE_FLG = '异地1' OR REMOTE_SETTLE_FLG = '异地2'))
css
CREATE TABLE table_204_353 ( id number, "no." number, "date/time" text, "aircraft" text, "foe" text, "result" text, "location" text, "notes" text )
was the foe an enemy aircraft or enemy fighter on 4 may 1918 @ 1025 hours ?
SELECT "foe" FROM table_204_353 WHERE "date/time" = '4 may 1918 @ 1025 hours'
squall
CREATE TABLE competition_record ( competition_id number, farm_id number, rank number ) CREATE TABLE city ( city_id number, official_name text, status text, area_km_2 number, population number, census_ranking text ) CREATE TABLE farm ( farm_id number, year number, total_...
What is the total horses record for each farm, sorted ascending?
SELECT total_horses FROM farm ORDER BY total_horses
spider
CREATE TABLE table_35275 ( "7:00" text, "7:30" text, "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text, "10:30" text )
What is the 9:30 program that airs on the station that airs Dawson's Creek at 8:30?
SELECT "9:30" FROM table_35275 WHERE "8:30" = 'dawson''s creek'
wikisql
CREATE TABLE table_203_562 ( id number, "state" text, "no. of candidates" number, "no. of elected" number, "total no. of seats in assembly" number, "year of election" number )
which state other than goa had 3 candidates ?
SELECT "state" FROM table_203_562 WHERE "state" <> 'goa' AND "no. of candidates" = 3
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...
参保人编号为84583960年门诊医疗费一共要多少钱?
SELECT SUM(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.PERSON_ID = '84583960' AND t_kc21.CLINIC_TYPE = '门诊'
css
CREATE TABLE Council_Tax ( council_tax_id INTEGER, cmi_cross_ref_id INTEGER ) CREATE TABLE Rent_Arrears ( council_tax_id INTEGER, cmi_cross_ref_id INTEGER ) CREATE TABLE CMI_Cross_References ( cmi_cross_ref_id INTEGER, master_customer_id INTEGER, source_system_code CHAR(15) ) CREATE TABLE...
Could you draw a bar graph to show all information about customer master index, and sort them by details in descending order.
SELECT cmi_details, master_customer_id FROM Customer_Master_Index ORDER BY cmi_details DESC
nvbench
CREATE TABLE table_29633639_1 ( hk_viewers VARCHAR, english_title VARCHAR )
how many milion of viewers where in the episode called in english 'is a great way to care
SELECT hk_viewers FROM table_29633639_1 WHERE english_title = "A Great Way to Care"
sql_create_context
CREATE TABLE table_name_55 ( county VARCHAR, location VARCHAR )
In which county is East Providence?
SELECT county FROM table_name_55 WHERE location = "east providence"
sql_create_context
CREATE TABLE table_41949 ( "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text )
What was on at 10:00 when ncis was on at 8:00?
SELECT "10:00" FROM table_41949 WHERE "8:00" = 'ncis'
wikisql
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
医疗机构3422258的统筹金额消耗量从17年12月15日到20年5月4日间是多少数额?
SELECT SUM(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '3422258' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2017-12-15' AND '2020-05-04'
css
CREATE TABLE table_58239 ( "Position" real, "Club" text, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
what is the total number of goal different when the club is cf extremadura and the played is less than 38?
SELECT COUNT("Goal Difference") FROM table_58239 WHERE "Club" = 'cf extremadura' AND "Played" < '38'
wikisql
CREATE TABLE table_name_52 ( country VARCHAR, player VARCHAR )
What country does Jeff Sluman play for?
SELECT country FROM table_name_52 WHERE player = "jeff sluman"
sql_create_context
CREATE TABLE table_64224 ( "Name" text, "Type" text, "Population (2011)" real, "Population (2006)" real, "Area (km 2 )" real )
What is the sum of the area in km with a population of 110 in 2011?
SELECT SUM("Area (km 2 )") FROM table_64224 WHERE "Population (2011)" = '110'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
calculate the average days of hospitalization for patients who died before 2158.
SELECT AVG(demographic.days_stay) FROM demographic WHERE demographic.dod_year < "2158.0"
mimicsql_data
CREATE TABLE table_2474 ( "Source" text, "Dates Administered" text, "Terry McAuliffe" text, "Brian Moran" text, "Creigh Deeds" text )
What source showed Brian Moran at 19%?
SELECT "Source" FROM table_2474 WHERE "Brian Moran" = '19%'
wikisql
CREATE TABLE table_51995 ( "Region" text, "Voter registration" real, "Voter turnout" real, "BYuT" real, "OU-PSD" real )
What is the voter registration that has a BYut of 48.2?
SELECT COUNT("Voter registration") FROM table_51995 WHERE "BYuT" = '48.2'
wikisql
CREATE TABLE table_48877 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Attendance" real, "Record" text, "Points" real )
What is the sum of the game numbers for games with less than 30 points?
SELECT SUM("Game") FROM table_48877 WHERE "Points" < '30'
wikisql
CREATE TABLE table_38944 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
Who was the opponent for the game taht was before week 5 on October 10, 1954?
SELECT "Opponent" FROM table_38944 WHERE "Week" < '5' AND "Date" = 'october 10, 1954'
wikisql
CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(50), building_phone VARCHAR(80) ) CREATE TABLE View_Unit_Status ( apt_id INTEG...
How many bookings for each apartment number? Plot a bar chart, and I want to sort by the total number from high to low please.
SELECT apt_number, COUNT(apt_number) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id GROUP BY apt_number ORDER BY COUNT(apt_number) DESC
nvbench
CREATE TABLE fgwyjzb ( 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, ...
一六年一月二十七号到十二月二十五号医疗机构7364699就诊记录里有儿童医保的记录数量
SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '7364699' AND gwyjzb.IN_HOSP_DATE BETWEEN '2016-01-27' AND '2016-12-25' AND gwyjzb.INSU_TYPE = '儿童' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '7364699' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2016-01-27' AND '2016-12-25' AND fgwyjzb.INSU_TYPE =...
css