context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_80339 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
What is the region of the release of a CD with catalog 32xa-119?
SELECT "Region" FROM table_80339 WHERE "Format" = 'cd' AND "Catalog" = '32xa-119'
wikisql
CREATE TABLE table_11642945_1 ( director VARCHAR, original_air_date VARCHAR )
If the Original Air Date is 10January2008, what directors released on that date?
SELECT director FROM table_11642945_1 WHERE original_air_date = "10January2008"
sql_create_context
CREATE TABLE table_39050 ( "Unit" text, "Russian" text, "Translation" text, "Ratio" text, "Cubic inches (exact)" text, "Metric value" text, "Imperial" text, "US Customary" text )
How large in US customary terms is the unit called butylka (vodochnaya)?
SELECT "US Customary" FROM table_39050 WHERE "Unit" = 'butylka (vodochnaya)'
wikisql
CREATE TABLE table_203_201 ( id number, "class" text, "type" text, "ships" text, "displacement" text, "note" text )
which class has the least displacement in tonnes ?
SELECT "class" FROM table_203_201 ORDER BY "displacement" LIMIT 1
squall
CREATE TABLE table_name_86 ( bronze INTEGER, total VARCHAR )
What was the bronze medal count of the team that finished with 47 total medals?
SELECT AVG(bronze) FROM table_name_86 WHERE total = 47
sql_create_context
CREATE TABLE table_36542 ( "Line color" text, "Line" text, "Route" text, "Stations served" real, "Length" text )
What route with the line color brown has the lowest number of stations served?
SELECT MIN("Stations served") FROM table_36542 WHERE "Line color" = 'brown'
wikisql
CREATE TABLE table_42478 ( "Year" real, "Winner (Male)" text, "Winner (Female)" text, "Talent (Male)" text, "Talent (Female)" text )
Who is the male winner the year after 1998 with Marleen Renders as the female winner?
SELECT "Winner (Male)" FROM table_42478 WHERE "Winner (Female)" = 'marleen renders' AND "Year" > '1998'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
count the number of patients whose admission year is less than 2180 and procedure short title is thoracentesis?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2180" AND procedures.short_title = "Thoracentesis"
mimicsql_data
CREATE TABLE table_13026799_1 ( winning_score VARCHAR, championship VARCHAR )
What was the winning score of the Masters Tournament?
SELECT winning_score FROM table_13026799_1 WHERE championship = "Masters Tournament"
sql_create_context
CREATE TABLE table_24425976_2 ( original_air_date VARCHAR, production_code VARCHAR )
What original air date was for the episode with production code of 108?
SELECT original_air_date FROM table_24425976_2 WHERE production_code = "108"
sql_create_context
CREATE TABLE people ( Height VARCHAR, Weight VARCHAR )
List the height and weight of people in descending order of height.
SELECT Height, Weight FROM people ORDER BY Height DESC
sql_create_context
CREATE TABLE table_name_55 ( british VARCHAR, letter VARCHAR )
What is the British letter with o /o /?
SELECT british FROM table_name_55 WHERE letter = "o /oʊ/"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( ...
what is item id and lab test name of subject name heather vineyard?
SELECT lab.itemid, lab.label FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Heather Vineyard"
mimicsql_data
CREATE TABLE table_45189 ( "Date" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text )
What was the total when the set 3 was 25 14?
SELECT "Total" FROM table_45189 WHERE "Set 3" = '25–14'
wikisql
CREATE TABLE table_78384 ( "Animal Name" text, "Species" text, "Books" text, "TV Series" text, "Gender" text, "TV Seasons" real, "Mate" text, "Offspring" text, "First Appearance" text, "Last Appearance" text )
What is the smallest season for a tv series with a yes and human was the species?
SELECT MIN("TV Seasons") FROM table_78384 WHERE "TV Series" = 'yes' AND "Species" = 'human'
wikisql
CREATE TABLE market ( market_id number, district text, num_of_employees number, num_of_shops number, ranking number ) CREATE TABLE phone_market ( market_id number, phone_id text, num_of_stock number ) CREATE TABLE phone ( name text, phone_id number, memory_in_g number, ...
List the distinct carriers of phones with memories bigger than 32.
SELECT DISTINCT carrier FROM phone WHERE memory_in_g > 32
spider
CREATE TABLE table_name_2 ( to_par VARCHAR, player VARCHAR )
What's k. j. choi's to par?
SELECT to_par FROM table_name_2 WHERE player = "k. j. choi"
sql_create_context
CREATE TABLE track ( Track_ID int, Name text, Location text, Seating real, Year_Opened real ) CREATE TABLE race ( Race_ID int, Name text, Class text, Date text, Track_ID text )
Show the race class and number of races in each class, and could you display x axis in desc order please?
SELECT Class, COUNT(*) FROM race GROUP BY Class ORDER BY Class DESC
nvbench
CREATE TABLE table_15263 ( "Rank" real, "Team" text, "Country" text, "Value ($M)" real, "Revenue ($M)" real )
Name the total number of value for revenue more than 193 and rank less than 12 for manchester united
SELECT COUNT("Value ($M)") FROM table_15263 WHERE "Revenue ($M)" > '193' AND "Rank" < '12' AND "Team" = 'manchester united'
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...
what is admission type and primary disease of subject name francis baseler?
SELECT demographic.admission_type, demographic.diagnosis FROM demographic WHERE demographic.name = "Francis Baseler"
mimicsql_data
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResults ( Id number, ...
Number of approved suggested edits by user.
SELECT COUNT(*) FROM SuggestedEdits WHERE OwnerUserId = '##userid##' AND NOT ApprovalDate IS NULL
sede
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, find name and the average of revenue , and group by attribute name, and visualize them by a bar chart, could you show y-axis in desc order?
SELECT T2.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Revenue DESC
nvbench
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 Customer_Orders ( order_id INTEGER, customer_id INTEGER, order_date DATETIME, order_...
Compare the frequency of product names using a bar chart, and display in desc by the X-axis.
SELECT product_name, COUNT(product_name) FROM Products GROUP BY product_name ORDER BY product_name DESC
nvbench
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...
tell me the difference between patient 9801's total input and the patient's total output since 1399 days ago.
SELECT (SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9801)) AND DATETIME(inputevents_cv.charttime) >= DATETIME(CURRENT_TIME(), '-1399 d...
mimic_iii
CREATE TABLE table_name_80 ( total VARCHAR, set_2 VARCHAR )
What is the total for the set 2 of 25-18?
SELECT total FROM table_name_80 WHERE set_2 = "25-18"
sql_create_context
CREATE TABLE table_30120566_1 ( area__acres__ VARCHAR, townland VARCHAR )
How many different sizes (in acres) are noted for Rathcoola East?
SELECT COUNT(area__acres__) FROM table_30120566_1 WHERE townland = "Rathcoola East"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE hz_info_zyjzjlb ( JZLSH number, YLJGDM number, zyjzjlb_id number ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, ...
从02年10月11日到15年12月4日医疗机构9671953的风湿免疫科处理的住院就诊数情况如何?
SELECT COUNT(*) FROM zyjzjlb JOIN hz_info_zyjzjlb JOIN hz_info ON hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.zyjzjlb_id = zyjzjlb.zyjzjlb_id AND hz_info_zyjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '96...
css
CREATE TABLE table_14058433_4 ( tries_against VARCHAR, lost VARCHAR )
how many tries against with lost being 11
SELECT COUNT(tries_against) FROM table_14058433_4 WHERE lost = "11"
sql_create_context
CREATE TABLE table_23385853_1 ( rally_base VARCHAR, round VARCHAR )
Name the rally base for 5 round
SELECT rally_base FROM table_23385853_1 WHERE round = 5
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, ...
从二00四年十一月二十日到二0一六年四月五日这段时间,患者63934308的检测指标492955找的哪些医务人员做的,这些医务人员的工号和姓名报一下
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_9780 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What was the Attendance on Week 8?
SELECT AVG("Attendance") FROM table_9780 WHERE "Week" = '8'
wikisql
CREATE TABLE table_name_93 ( school VARCHAR, location VARCHAR )
what is the school in michigantown?
SELECT school FROM table_name_93 WHERE location = "michigantown"
sql_create_context
CREATE TABLE table_73038 ( "Player" text, "Played" real, "Legs Won" real, "Legs Lost" real, "100+" real, "140+" real, "180s" real, "High Checkout" real, "3-dart Average" text )
Who is the player with 41 legs lost?
SELECT "Player" FROM table_73038 WHERE "Legs Lost" = '41'
wikisql
CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, ro...
what are the seating capacities of planes between PITTSBURGH and BALTIMORE
SELECT DISTINCT aircraft.aircraft_code FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.c...
atis
CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type text ) CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working...
Bar graph to show the number of nationality from different nationality, and order by the Nationality in asc.
SELECT Nationality, COUNT(Nationality) FROM journalist GROUP BY Nationality ORDER BY Nationality
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...
查一下37519458这个病人的就诊记录中,有哪几次医疗记录中被开出过3819.76元以上的药品?列出医疗就诊编号
SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '37519458' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 3819.76) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '37519458' AND fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID F...
css
CREATE TABLE table_30096 ( "Series #" real, "Season #" real, "Title" text, "Written by" text, "Original air date" text, "U.S. Viewers (millions)" text )
who wrote the episode 'he ain't heavy'?
SELECT "Written by" FROM table_30096 WHERE "Title" = 'He Ain''t Heavy'
wikisql
CREATE TABLE table_24959 ( "Institution" text, "Date of report" text, "s Risk-weighted asset , \u20ac million" real, "Tier 1 Capital, \u20ac million" real, "Tier 1 ratio" text )
Name the most tier 1 capital for irish nationwide
SELECT MAX("Tier 1 Capital, \u20ac million") FROM table_24959 WHERE "Institution" = 'Irish Nationwide'
wikisql
CREATE TABLE table_204_871 ( id number, "ano" text, "title" text, "role" text, "channel" text, "notes" text )
how many tv shows has natalia oreiro starred in ?
SELECT COUNT("title") FROM table_204_871
squall
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutpu...
how many times does patient 003-48563 have a troponin - i test until 2102?
SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-48563')) AND lab.labname = 'troponin - i' AND STRFTIME('%y', lab.labresulttime) <= '2102...
eicu
CREATE TABLE table_32674 ( "Orchestra" text, "Conductor" text, "Record Company" text, "Year of Recording" real, "Format" text )
Who is the conductor when the chicago symphony orchestra is featured?
SELECT "Conductor" FROM table_32674 WHERE "Orchestra" = 'chicago symphony orchestra'
wikisql
CREATE TABLE table_204_227 ( id number, "week" number, "date" text, "opponent" text, "score" text, "result" text, "record" text )
how many teams played them in october ?
SELECT COUNT(*) FROM table_204_227 WHERE "date" = 10
squall
CREATE TABLE table_43770 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
What was the top score for grier jones?
SELECT MAX("Score") FROM table_43770 WHERE "Player" = 'grier jones'
wikisql
CREATE TABLE bank ( branch_ID int, bname varchar(20), no_of_customers int, city varchar(10), state varchar(20) ) CREATE TABLE customer ( cust_ID varchar(3), cust_name varchar(20), acc_type char(1), acc_bal int, no_of_loans int, credit_score int, branch_ID int, state ...
Draw a bar chart for what is the average account balance of customers with credit score below 50 for the different account types?, display by the bars in desc please.
SELECT acc_type, AVG(acc_bal) FROM customer WHERE credit_score < 50 GROUP BY acc_type ORDER BY acc_type DESC
nvbench
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description...
How many comments are hidden (comments after the 5th comment).
WITH hidden_comments AS (SELECT CASE WHEN COUNT(*) < 5 THEN 0 ELSE COUNT(*) - 5 END AS hidden FROM Comments GROUP BY PostId) SELECT SUM(hidden) FROM hidden_comments
sede
CREATE TABLE table_4847 ( "Player" text, "Nationality" text, "Position" text, "From" real, "School/Country" text )
Who is the player in the center position from 2006 with nationality of the United States?
SELECT "Player" FROM table_4847 WHERE "Nationality" = 'united states' AND "Position" = 'center' AND "From" = '2006'
wikisql
CREATE TABLE table_204_520 ( id number, "outcome" text, "no." number, "date" number, "championship" text, "surface" text, "opponent" text, "score" text )
what is the only indoor championship ?
SELECT "championship" FROM table_204_520 WHERE "surface" = 'indoor'
squall
CREATE TABLE table_77429 ( "Date" text, "Round" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real, "Scorers" text )
What is the result with an attendance larger than 10,107 and Celtic as the opponent?
SELECT "Result" FROM table_77429 WHERE "Attendance" > '10,107' AND "Opponent" = 'celtic'
wikisql
CREATE TABLE table_66446 ( "Rank" real, "Athletes" text, "Country" text, "Time" text, "Notes" text )
Which athlete is ranked below 5 and is from China?
SELECT "Athletes" FROM table_66446 WHERE "Rank" < '5' AND "Country" = 'china'
wikisql
CREATE TABLE table_name_84 ( harris VARCHAR, marplan VARCHAR )
What is Harris, when Marplan is 1.3%
SELECT harris FROM table_name_84 WHERE marplan = "1.3%"
sql_create_context
CREATE TABLE table_27715173_6 ( date VARCHAR, score VARCHAR )
What date was the game with a score of w 116 93 (ot)?
SELECT date FROM table_27715173_6 WHERE score = "W 116–93 (OT)"
sql_create_context
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
A Users total Rep ON META if there was no reputation cap. How much rep would you have if there was no reputation cap
SELECT Users.Id AS "user_link", (SELECT SUM(CASE WHEN VoteTypeId = 1 THEN 15 WHEN VoteTypeId = 2 AND PostTypeId = 1 THEN 5 WHEN VoteTypeId = 2 AND PostTypeId = 2 THEN 10 WHEN VoteTypeId = 3 THEN -2 WHEN VoteTypeId = 9 THEN COALESCE(BountyAmount, 100) WHEN VoteTypeId = 15 THEN 2 WHEN VoteTypeId = 16 THEN 2 END) FROM Vot...
sede
CREATE TABLE broadcast_share ( Channel_ID int, Program_ID int, Date text, Share_in_percent real ) CREATE TABLE program ( Program_ID int, Name text, Origin text, Launch real, Owner text ) CREATE TABLE broadcast ( Channel_ID int, Program_ID int, Time_of_day text ) CREATE...
Find the total rating ratio for each channel owner. Show a pie chart.
SELECT Owner, SUM(Rating_in_percent) FROM channel GROUP BY Owner
nvbench
CREATE TABLE table_name_81 ( record VARCHAR, attendance VARCHAR )
For the game with 26,236 attendance, what was the record?
SELECT record FROM table_name_81 WHERE attendance = "26,236"
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...
give me the number of patients whose gender is m and drug code is milrbase?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.formulary_drug_cd = "MILRBASE"
mimicsql_data
CREATE TABLE table_11734041_2 ( height_in_ft VARCHAR, school_club_team_country VARCHAR )
What is the height of the player who attended Hartford?
SELECT height_in_ft FROM table_11734041_2 WHERE school_club_team_country = "Hartford"
sql_create_context
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE ta ( campus_job_id int,...
Are there any upper-level ROMLANG classes available this Spring ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'ROMLANG' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Spr...
advising
CREATE TABLE table_2755 ( "Pos" text, "##" real, "Name" text, "Team" text, "Lap One" text, "Lap Two" text, "Lap Three" text, "Lap Four" text, "Total Time" text, "Avg. Speed" text )
What was the average speed where lap four's time was 22.9049?
SELECT "Avg. Speed" FROM table_2755 WHERE "Lap Four" = '22.9049'
wikisql
CREATE TABLE table_9764 ( "Stage" real, "Winner" text, "General Classification" text, "Points Classification" text, "Mountains Classification" text, "Metas Volantes Classification" text, "Team Classification" text )
Who was the winner in the stage that Damiano Cunego led the points classification?
SELECT "Winner" FROM table_9764 WHERE "Points Classification" = 'damiano cunego'
wikisql
CREATE TABLE table_18626383_2 ( hometown VARCHAR, country VARCHAR )
When finland is the country how many hometowns are there?
SELECT COUNT(hometown) FROM table_18626383_2 WHERE country = "Finland"
sql_create_context
CREATE TABLE table_name_11 ( airport VARCHAR, icao VARCHAR )
Which airport has an ICAO of ybcg?
SELECT airport FROM table_name_11 WHERE icao = "ybcg"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, ...
在患者81881911的诊疗记录里,从00年9月13日到12年2月14日这期间,为其检测转铁蛋白的医务人员有哪几位,报一下工号及姓名
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE jyjgzbb.JYRQ BETWEEN '2000-09-13' AND '2012-02-1...
css
CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER )
Bar graph to show the average of age from different gender, could you order from high to low by the y-axis?
SELECT gender, AVG(age) FROM Person GROUP BY gender ORDER BY AVG(age) DESC
nvbench
CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIGH_DEGREE varchar(5) ) CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE CLASS ( ...
Show the number of courses for each course description in a stacked bar chart The x-axis is course description and group by office name, and list in descending by the x-axis.
SELECT CRS_DESCRIPTION, COUNT(CRS_DESCRIPTION) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY PROF_OFFICE, CRS_DESCRIPTION ORDER BY CRS_DESCRIPTION DESC
nvbench
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...
从11年2月9日开始,截止到2012年12月3日,列出郑乐山这个患者在6652553这个医院中被开过的所有药品的名字和编码
SELECT SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '郑乐山' AND MED_SER_ORG_NO = '6652553' AND IN_HOSP_DATE BETWEEN '2011-02-09' AND '2012-12-03')
css
CREATE TABLE table_20585 ( "No." real, "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text, "Runner(s)-up" text )
In what tournament was the winning score 68-67-65-66=266?
SELECT "Tournament" FROM table_20585 WHERE "Winning score" = '68-67-65-66=266'
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
Show the number of patients who are under the age of 47 and their year of admission is 2146.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "47" AND demographic.admityear < "2146"
mimicsql_data
CREATE TABLE table_name_99 ( construction_start VARCHAR, design_flow__lpm_ VARCHAR )
What Construction Start has a Design flow (LPM) of 1300?
SELECT construction_start FROM table_name_99 WHERE design_flow__lpm_ = 1300
sql_create_context
CREATE TABLE table_name_75 ( attendance INTEGER, result VARCHAR, week VARCHAR )
Which Attendance has a Result of w 23-21, and a Week smaller than 5?
SELECT AVG(attendance) FROM table_name_75 WHERE result = "w 23-21" AND week < 5
sql_create_context
CREATE TABLE table_64277 ( "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
Which Time has a Lane smaller than 2, and a Nationality of spain?
SELECT "Time" FROM table_64277 WHERE "Lane" < '2' AND "Nationality" = 'spain'
wikisql
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE date_day ( month_number int...
please list the flights from MEMPHIS to NEW YORK on a MONDAY night
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 ((((flight.departure_time <= 2400 AND flight.departure_time >= 1800) AND days.day_name = 'MONDAY' AND flight.flight_days = days.days_code) OR ((flight.depa...
atis
CREATE TABLE table_name_72 ( ryuji_hijikata VARCHAR, block_a VARCHAR )
Tell me the Ryuji Hijikata for Block A of Ryuji Hijikata
SELECT ryuji_hijikata FROM table_name_72 WHERE block_a = "ryuji hijikata"
sql_create_context
CREATE TABLE table_60453 ( "Tournament" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text )
What is 2006, when 2007 is '1R', and when 2002 is 'Q2'?
SELECT "2006" FROM table_60453 WHERE "2007" = '1r' AND "2002" = 'q2'
wikisql
CREATE TABLE table_name_32 ( lost VARCHAR, losing_bonus VARCHAR, points_for VARCHAR )
WHAT IS THE LOST WITH 1 LOSING BONUS, 148 POINTS?
SELECT lost FROM table_name_32 WHERE losing_bonus = "1" AND points_for = "148"
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 divorced patients who had closed biopsy of tongue?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "DIVORCED" AND procedures.short_title = "Closed biopsy of tongue"
mimicsql_data
CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, interval text ) CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperature int, precipitation real, wind_speed_mph int ) CR...
Show me the total number by origin in a histogram, and sort by the names from high to low.
SELECT origin, COUNT(*) FROM train GROUP BY origin ORDER BY origin DESC
nvbench
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospit...
tell me the monthly average heartrate of patient 006-188114 until 92 days ago.
SELECT AVG(vitalperiodic.heartrate) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-188114')) AND NOT vitalperiodic.heartrate IS NUL...
eicu
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREA...
what the first height of patient 006-153198.
SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-153198') AND NOT patient.admissionheight IS NULL ORDER BY patient.unitadmittime LIMIT 1
eicu
CREATE TABLE circuits ( circuitid number, circuitref text, name text, location text, country text, lat number, lng number, alt number, url text ) CREATE TABLE qualifying ( qualifyid number, raceid number, driverid number, constructorid number, number number, ...
What are the ids and locations of all circuits in France or Belgium?
SELECT circuitid, location FROM circuits WHERE country = "France" OR country = "Belgium"
spider
CREATE TABLE table_60573 ( "Date" text, "Time" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text, "Report" text )
Which report has a Set 3 value of 21 25?
SELECT "Report" FROM table_60573 WHERE "Set 3" = '21–25'
wikisql
CREATE TABLE table_name_92 ( name VARCHAR, moving_to VARCHAR, country VARCHAR )
What is the union moving name and is from cmr?
SELECT name FROM table_name_92 WHERE moving_to = "union" AND country = "cmr"
sql_create_context
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, return a bar chart about the distribution of founder and the average of manufacturer , and group by attribute founder.
SELECT Founder, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder
nvbench
CREATE TABLE table_name_34 ( head_coach VARCHAR, shirt_sponsor VARCHAR )
Who is the head coach of the team, whose shirt sponsor is karstadt quelle versicherungen?
SELECT head_coach FROM table_name_34 WHERE shirt_sponsor = "karstadt quelle versicherungen"
sql_create_context
CREATE TABLE table_name_48 ( medal VARCHAR, games VARCHAR, sport VARCHAR )
Which Medal had a Games of 2008 beijing, and a Sport of taekwondo?
SELECT medal FROM table_name_48 WHERE games = "2008 beijing" AND sport = "taekwondo"
sql_create_context
CREATE TABLE table_76422 ( "Date" text, "Opponent" text, "Score" text, "Result" text, "Record" text )
What was the Score of the game with a Record of 0-1?
SELECT "Score" FROM table_76422 WHERE "Record" = '0-1'
wikisql
CREATE TABLE table_25 ( "Rank Each wrestlers total number of days as champion are ranked highest to lowest; wrestlers with the same number mean that they are tied for that certain rank." real, "Wrestler" text, "# of reigns" real, "Combined defenses" real, "Combined days" text )
What rank was Bryan Danielson in this chart?
SELECT "Rank Each wrestlers total number of days as champion are ranked highest to lowest; wrestlers with the same number mean that they are tied for that certain rank." FROM table_25 WHERE "Wrestler" = 'Bryan Danielson'
wikisql
CREATE TABLE table_22060 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" real )
How many total number of attendance were there when the game was held in Anaheim Stadium?
SELECT COUNT("Attendance") FROM table_22060 WHERE "Game site" = 'Anaheim Stadium'
wikisql
CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Reviewer ( rID int, name text )
How many movie reviews does each director get. Show bar chart.
SELECT director, COUNT(*) FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T1.director
nvbench
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, ...
what were the four most commonly ordered procedures for patients who had previously received serum transfusion nec within 2 months, during a year before?
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_dev_41 ( "id" int, "gender" string, "serum_potassium" float, "systolic_blood_pressure_sbp" int, "serum_bicarbonate" int, "renal_disease" bool, "temperature" float, "diastolic_blood_pressure_dbp" int, "liver_disease" bool, "hdl" int, "serum_sodium_concentrat...
any subject with unstable vitals signs ( temperature > 101 degrees f, systolic blood pressure < 90 or > 180 mm hg, diastolic blood pressure < 60 or > 110 mm hg, heart rate < 60 or > 120 beats / minute ) .
SELECT * FROM table_dev_41 WHERE unstable_vitals_signs = 1 OR (temperature > 101 OR (systolic_blood_pressure_sbp < 90 OR systolic_blood_pressure_sbp > 180) OR (diastolic_blood_pressure_dbp < 60 OR diastolic_blood_pressure_dbp > 110) OR (heart_rate < 60 OR heart_rate > 120))
criteria2sql
CREATE TABLE table_name_49 ( score VARCHAR, save VARCHAR )
What was the score when a save of ||25,354||63 43 occurred?
SELECT score FROM table_name_49 WHERE save = "||25,354||63–43"
sql_create_context
CREATE TABLE table_name_96 ( points_difference VARCHAR, points_against VARCHAR )
What is Points Difference, when Points Against is 451?
SELECT points_difference FROM table_name_96 WHERE points_against = "451"
sql_create_context
CREATE TABLE table_name_2 ( termination VARCHAR, earpads VARCHAR, us_msrp VARCHAR )
What was the termination type for the headphones with comfort pads and selling for $150?
SELECT termination FROM table_name_2 WHERE earpads = "comfort pads" AND us_msrp = "$150"
sql_create_context
CREATE TABLE table_12774 ( "Position" real, "Club" text, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
Which Draws has Goals against smaller than 47, and a Position smaller than 13, and Goals for of 52?
SELECT MIN("Draws") FROM table_12774 WHERE "Goals against" < '47' AND "Position" < '13' AND "Goals for" = '52'
wikisql
CREATE TABLE table_52300 ( "D 49 \u221a" text, "D 48 \u221a" text, "D 47 \u221a" text, "D 46 \u221a" text, "D 45 \u221a" text, "D 44 \u221a" text, "D 43 \u221a" text, "D 42 \u221a" text, "D 41 \u221a" text )
What is the D 46 with a D 43 with r 3?
SELECT "D 46 \u221a" FROM table_52300 WHERE "D 43 \u221a" = 'r 3'
wikisql
CREATE TABLE party ( party_id number, year number, party text, governor text, lieutenant_governor text, comptroller text, attorney_general text, us_senate text ) CREATE TABLE county ( county_id number, county_name text, population number, zip_code text ) CREATE TABLE el...
Which committees have delegates from both democratic party and liberal party?
SELECT T1.committee FROM election AS T1 JOIN party AS T2 ON T1.party = T2.party_id WHERE T2.party = "Democratic" INTERSECT SELECT T1.committee FROM election AS T1 JOIN party AS T2 ON T1.party = T2.party_id WHERE T2.party = "Liberal"
spider
CREATE TABLE table_name_14 ( time VARCHAR, method VARCHAR )
What is Time, when Method is 'submission (knees)'?
SELECT time FROM table_name_14 WHERE method = "submission (knees)"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
find the number of patients whose lab test name was specific gravity.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Specific Gravity"
mimicsql_data
CREATE TABLE table_63621 ( "Elector" text, "Nationality" text, "Cardinalatial order and title" text, "Elevated" text, "Elevator" text )
Who was the Elevator of Giacomo Colonna?
SELECT "Elevator" FROM table_63621 WHERE "Elector" = 'giacomo colonna'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, ...
what is the five of the most common output events since 2101?
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT outputevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM outputevents WHERE STRFTIME('%y', outputevents.charttime) >= '2101' GROUP BY outputevents.itemid) AS t1 WHERE t1.c1 <= 5)
mimic_iii