context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_20866024_3 ( engine VARCHAR, model_designation VARCHAR )
What type of engine does the model with model designation 97F00 have?
SELECT engine FROM table_20866024_3 WHERE model_designation = "97F00"
sql_create_context
CREATE TABLE table_18467 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
Who is the incumbent in the Alabama 6 voting district?
SELECT "Incumbent" FROM table_18467 WHERE "District" = 'Alabama 6'
wikisql
CREATE TABLE table_43235 ( "Family" text, "Baltimore group" text, "envelopment" text, "Virion shape" text, "Replication site" text )
What is the replication site when the species is enveloped and is of the bunyaviridae family?
SELECT "Replication site" FROM table_43235 WHERE "envelopment" = 'enveloped' AND "Family" = 'bunyaviridae'
wikisql
CREATE TABLE table_name_62 ( week_4 VARCHAR, week_2 VARCHAR )
What Week 4 has a Week 2 of samantha speer?
SELECT week_4 FROM table_name_62 WHERE week_2 = "samantha speer"
sql_create_context
CREATE TABLE table_204_994 ( id number, "date" text, "time" text, "opponent#" text, "rank#" text, "site" text, "tv" text, "result" text, "attendance" number )
what is the first game listed on the schedule ?
SELECT "opponent#" FROM table_204_994 WHERE id = 1
squall
CREATE TABLE table_name_80 ( drawn INTEGER, team VARCHAR, lost VARCHAR )
Team of corinthians, and a Lost larger than 15 has which highest drawn?
SELECT MAX(drawn) FROM table_name_80 WHERE team = "corinthians" AND lost > 15
sql_create_context
CREATE TABLE table_56495 ( "Date" text, "Venue" text, "Opponent" text, "Result" text, "Tournament" text, "Scored" real )
Who was the opponent with a score of 30-12?
SELECT "Opponent" FROM table_56495 WHERE "Result" = '30-12'
wikisql
CREATE TABLE table_name_36 ( location VARCHAR, home_rink VARCHAR )
Where is the location for the home rink Triangle sports plex/Greensboro ice house?
SELECT location FROM table_name_36 WHERE home_rink = "triangle sports plex/greensboro ice house"
sql_create_context
CREATE TABLE table_name_11 ( wins VARCHAR, byes INTEGER )
What's the total wins of a team with more than 2 byes?
SELECT COUNT(wins) FROM table_name_11 WHERE byes > 2
sql_create_context
CREATE TABLE Catalog_Contents_Additional_Attributes ( catalog_entry_id INTEGER, catalog_level_number INTEGER, attribute_id INTEGER, attribute_value VARCHAR(255) ) CREATE TABLE Catalog_Structure ( catalog_level_number INTEGER, catalog_id INTEGER, catalog_level_name VARCHAR(50) ) CREATE TABL...
Find the number of the names of catalog entries with level number 8.
SELECT catalog_entry_name, COUNT(catalog_entry_name) FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.catalog_level_number = "8" GROUP BY catalog_entry_name
nvbench
CREATE TABLE table_3224 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
What CFL team obtained a draft pick from North Dakota who plays OL position?
SELECT "CFL Team" FROM table_3224 WHERE "Position" = 'OL' AND "College" = 'North Dakota'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid numb...
what specimen tests did patient 031-16123 receive on the last hospital encounter for the first time?
SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-16123' AND NOT patient.hospitaldischargetime IS NULL ORDER BY pati...
eicu
CREATE TABLE table_39438 ( "Rank" real, "Name" text, "Nationality" text, "1st (m)" real, "2nd (m)" real, "Points" real, "Overall NT points" text, "Overall WC points (Rank)" text )
Who had more than 247.1 points and less than 125 meter distance for 1st?
SELECT "Name" FROM table_39438 WHERE "Points" > '247.1' AND "1st (m)" < '125'
wikisql
CREATE TABLE table_79889 ( "Category" text, "Film" text, "Director(s)" text, "Country" text, "Nominating Festival" text )
What film was filmed in Spain?
SELECT "Film" FROM table_79889 WHERE "Country" = 'spain'
wikisql
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...
what is maximum days of hospital stay of patients whose age is greater than or equal to 68?
SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.age >= "68"
mimicsql_data
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, give me the comparison about code over the name , and group by attribute name by a bar chart, and list X from high to low order please.
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Name DESC
nvbench
CREATE TABLE table_74452 ( "Tournament" text, "Player" text, "Nationality" text, "Team" text, "Games played" real, "Goals conceded" real, "Coefficient" text )
How many nationalities are there for the 2011 apertura?
SELECT COUNT("Nationality") FROM table_74452 WHERE "Tournament" = '2011 Apertura'
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 ethnicity is white and procedure short title is ins nondrug elut cor st?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "WHITE" AND procedures.short_title = "Ins nondrug elut cor st"
mimicsql_data
CREATE TABLE table_32290 ( "Date" text, "Time" text, "Epicenter" text, "Magnitude" text, "Fatalities" text, "Name" text )
What Name has a Time of 01:56:52?
SELECT "Name" FROM table_32290 WHERE "Time" = '01:56:52'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) 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, ...
how much of patient 67418's mch second measured on the first hospital visit changed compared to the first value measured on the first hospital visit?
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 67418 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label ...
mimic_iii
CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE writes ( paperid i...
Current research on Bacterial Wilt
SELECT DISTINCT paper.paperid, paper.year FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'Bacterial Wilt' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid ORDER BY paper.year DESC
scholar
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE txmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, K...
赵婉仪这个病人现在的身高和体重分别是多少?
SELECT txmzjzjlb.SG, txmzjzjlb.TZ FROM person_info JOIN hz_info JOIN txmzjzjlb 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 WHERE person_info.XM = '赵婉仪' UNION SELECT ftxmzjzjlb.SG, ftxmzjzjlb.TZ FROM person_info JOIN hz_info JOIN ...
css
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...
let me know the route of administration and the type of drug influenza virus vaccine is.
SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Influenza Virus Vaccine"
mimicsql_data
CREATE TABLE table_name_83 ( constructor VARCHAR, driver VARCHAR )
Who constructed rolf stommelen's car?
SELECT constructor FROM table_name_83 WHERE driver = "rolf stommelen"
sql_create_context
CREATE TABLE table_74271 ( "Pick" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
What is the nationality of Christian Lefebvre?
SELECT "Nationality" FROM table_74271 WHERE "Player" = 'Christian Lefebvre'
wikisql
CREATE TABLE table_65690 ( "Mexico" text, "Ma\u00f1ana es para siempre" text, "El Canal de las Estrellas" text, "October 20, 2008" text, "June 14, 2009" text, "Monday to Friday" text )
When does the El Canal de las Estrellas of pop tv show from Monday to Friday?
SELECT "Monday to Friday" FROM table_65690 WHERE "El Canal de las Estrellas" = 'pop tv'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( i...
what's the cost of a drug known as amiodarone 200 mg tab?
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'amiodarone 200 mg tab')
eicu
CREATE TABLE table_name_78 ( round VARCHAR, res VARCHAR, record VARCHAR )
What is the round when the loss came with a record of 2-4?
SELECT round FROM table_name_78 WHERE res = "loss" AND record = "2-4"
sql_create_context
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 text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
what is the number of patients whose drug route is im?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.route = "IM"
mimicsql_data
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 flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, ...
OAKLAND to PHILADELPHIA saturday
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND date_day.day_number = 26 AND date_day.month_number = 7 ...
atis
CREATE TABLE table_name_6 ( total INTEGER, silver VARCHAR, gold VARCHAR )
For nations with more than 6 silvers and more than 10 golds, what is the lowest total?
SELECT MIN(total) FROM table_name_6 WHERE silver > 6 AND gold > 10
sql_create_context
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 restriction ( restriction_code text, advance_purchase int, stopovers text, saturd...
what flights available between PITTSBURGH and BALTIMORE on 8 11
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 = 'BALTIMORE' AND date_day.day_number = 11 AND date_day.month_number = 8 AND...
atis
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, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
Are there Wood for non-Majors courses that work for the PreMajor requirement ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Wood for non-Majors%' OR course.description LIKE '%Wood for non-Majors%' OR course.name LIKE '%W...
advising
CREATE TABLE constructorResults ( constructorResultsId INTEGER, raceId INTEGER, constructorId INTEGER, points REAL, status TEXT ) CREATE TABLE pitStops ( raceId INTEGER, driverId INTEGER, stop INTEGER, lap INTEGER, time TEXT, duration TEXT, milliseconds INTEGER ) CREATE...
What are the names of races held between 2009 and 2011, and count them by a bar chart, order by the how many name in ascending.
SELECT name, COUNT(name) FROM races WHERE year BETWEEN 2009 AND 2011 GROUP BY name ORDER BY COUNT(name)
nvbench
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
how many of the patients on urgent admission had a hospital stay of more than 4 days?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.days_stay > "4"
mimicsql_data
CREATE TABLE staff ( staff_first_name VARCHAR, staff_last_name VARCHAR, staff_id VARCHAR ) CREATE TABLE problems ( product_id VARCHAR, reported_by_staff_id VARCHAR ) CREATE TABLE product ( product_name VARCHAR, product_id VARCHAR )
Find the first and last name of the staff members who reported problems from the product 'rem' but not 'aut'?
SELECT T3.staff_first_name, T3.staff_last_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T2.product_name = "rem" EXCEPT SELECT T3.staff_first_name, T3.staff_last_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON...
sql_create_context
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
申请超过9份检验报告单在医疗就诊01915965826中有哪些人?列出这些申请人工号是多少?申请人姓名都叫啥?
SELECT SQRGH, SQRXM FROM jybgb WHERE JZLSH = '01915965826' GROUP BY SQRGH HAVING COUNT(*) > 9
css
CREATE TABLE table_name_30 ( game INTEGER, team VARCHAR )
Can you tell me the average Game that has the Team of @ boston?
SELECT AVG(game) FROM table_name_30 WHERE team = "@ boston"
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
Find out the minimum age of female patients who are 27 years of age or more.
SELECT MIN(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.age >= "27"
mimicsql_data
CREATE TABLE table_54993 ( "Year" real, "English title" text, "Korean title" text, "Romanization" text, "Role" text, "Director" text )
What is the English of chae soo-yeon?
SELECT "English title" FROM table_54993 WHERE "Role" = 'chae soo-yeon'
wikisql
CREATE TABLE table_204_139 ( id number, "community" text, "airport name" text, "type" text, "coordinates" text )
which community has the most airports
SELECT "community" FROM table_204_139 GROUP BY "community" ORDER BY COUNT("airport name") DESC LIMIT 1
squall
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLic...
Number of Instances of 'What have you tried' Comments per user.
SELECT C.UserId AS "user_link", COUNT(C.UserId) AS "Number of Instances", MAX(C.CreationDate) AS "Most recent submission" FROM Comments AS C WHERE UPPER(REPLACE(Text, ' ', '')) LIKE 'vote' GROUP BY C.UserId ORDER BY COUNT(C.UserId) DESC
sede
CREATE TABLE table_name_60 ( overall INTEGER, pick__number VARCHAR, round VARCHAR, college VARCHAR )
What is the total overall for the pick that went before round 4, who went to Tennessee for college, and was picked at a number bigger than 9?
SELECT SUM(overall) FROM table_name_60 WHERE round < 4 AND college = "tennessee" AND pick__number > 9
sql_create_context
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE treatment ( treat...
what is the percentile of 39.0 in a laboratory test of total co2 with the same age as patient 002-31956 in the first hospital visit?
SELECT DISTINCT t1.c1 FROM (SELECT lab.labresult, PERCENT_RANK() OVER (ORDER BY lab.labresult) AS c1 FROM lab WHERE lab.labname = 'total co2' AND lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age = (SELECT patient.age FROM patient WHERE patient.uniquepid = '002-31956' AND NOT pat...
eicu
CREATE TABLE table_name_26 ( chassis VARCHAR, entrant VARCHAR, year VARCHAR )
Which Chassis has an Entrant of cooper car company, and a Year of 1963?
SELECT chassis FROM table_name_26 WHERE entrant = "cooper car company" AND year = 1963
sql_create_context
CREATE TABLE table_name_81 ( starts INTEGER, year VARCHAR, poles VARCHAR, position VARCHAR )
Before 2007, what was the avg start that had a pole of 0 and in 65th position?
SELECT AVG(starts) FROM table_name_81 WHERE poles = 0 AND position = "65th" AND year < 2007
sql_create_context
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, ...
what is the number of patients whose primary disease is left colon cancer and year of birth is less than 2041?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "LEFT COLON CANCER" AND demographic.dob_year < "2041"
mimicsql_data
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...
Est-ce que 'mbraux' (un pseudo au hasard :) a d j publi un post ?.
SELECT COUNT(p.Id) FROM Posts AS p JOIN Users AS u ON p.OwnerUserId = u.Id WHERE u.DisplayName = 'Mat Mannion' GROUP BY p.Id
sede
CREATE TABLE salary ( year number, team_id text, league_id text, player_id text, salary number ) CREATE TABLE player_award_vote ( award_id text, year number, league_id text, player_id text, points_won number, points_max number, votes_first text ) CREATE TABLE player ( ...
For award winners, which position that has the most hall of fame players?
SELECT T2.notes FROM hall_of_fame AS T1 JOIN player_award AS T2 ON T1.player_id = T2.player_id WHERE T1.inducted = "Y" GROUP BY notes ORDER BY COUNT(*) DESC LIMIT 1
thehistoryofbaseball
CREATE TABLE Staff_Roles ( role_code VARCHAR(10), role_description VARCHAR(255) ) CREATE TABLE Organisation_Types ( organisation_type VARCHAR(10), organisation_type_description VARCHAR(255) ) CREATE TABLE Organisations ( organisation_id INTEGER, organisation_type VARCHAR(10), organisation_...
Give me the trend about the date_from attributes of all researchers, and bin the date into Year interval, rank by the x axis in desc.
SELECT date_from, COUNT(date_from) FROM Project_Staff ORDER BY date_from DESC
nvbench
CREATE TABLE table_41165 ( "Episode Number" real, "Air Date" text, "Guest Host" text, "Musical Guest (Song performed)" text, "Who knows the most about the guest host? panelists" text )
Who was the guest host for episode numbers under 6 and panelists of Jade Goody and Kenzie?
SELECT "Guest Host" FROM table_41165 WHERE "Episode Number" < '6' AND "Who knows the most about the guest host? panelists" = 'jade goody and kenzie'
wikisql
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, sort the average of revenue from low to high 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
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 of the female patients had icd9 code 2809?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.icd9_code = "2809"
mimicsql_data
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 prescription...
provide the number of patients whose year of death is less than or equal to 2111 and item id is 51104?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2111.0" AND lab.itemid = "51104"
mimicsql_data
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city...
In which area have most of my C 's been earned ?
SELECT DISTINCT DERIVED_TABLEalias0.DERIVED_FIELDalias1 FROM (SELECT AREAalias0.area, COUNT(*) INNER JOIN student_record ON student_record.course_id = AREAalias0.course_id WHERE student_record.grade LIKE 'C' AND student_record.student_id = 1 GROUP BY AREAalias0.area) AS DERIVED_TABLEalias0 WHERE DERIVED_TABLEalias0.DER...
advising
CREATE TABLE table_71718 ( "Rank" real, "Player" text, "Games" real, "Goals" real, "Goal Ratio" real, "Debut in Europe" real )
What is the largest goal ratio with Goals smaller than 0?
SELECT MAX("Goal Ratio") FROM table_71718 WHERE "Goals" < '0'
wikisql
CREATE TABLE table_22143 ( "English name" text, "Thai name" text, "Transcription" text, "Color" text, "Sanskrit word" text, "Planet" text )
What is the thai name of the transcription wan chan?
SELECT "Thai name" FROM table_22143 WHERE "Transcription" = 'wan chan'
wikisql
CREATE TABLE table_1507806_1 ( year INTEGER, runner_up VARCHAR )
WHAT WAS THE YEAR WHEN THE RUNNER-UP WAS WILLIAM MEHLHORN?
SELECT MAX(year) FROM table_1507806_1 WHERE runner_up = "William Mehlhorn"
sql_create_context
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0...
For those employees who do not work in departments with managers that have ids between 100 and 200, find last_name and commission_pct , and visualize them by a bar chart, order by the Y-axis from low to high.
SELECT LAST_NAME, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COMMISSION_PCT
nvbench
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...
i need a flight from NEW YORK to MONTREAL THURSDAY 5 six
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 AS DAYS_0, days AS DAYS_1, flight WHERE ((date_day.day_number = 24 AND date_day.month_number = 5 AND date_day.year = 1991 AND DAYS_0.day_name = date_day.day_na...
atis
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
What is the relationship between School_ID and All_Games_Percent ?
SELECT School_ID, All_Games_Percent FROM basketball_match
nvbench
CREATE TABLE table_33689 ( "Name" text, "Bullet" text, "Length" text, "Base" text, "Shoulder" text, "Neck" text )
What is the shoulder measurement of the gun with a length of 57.85 (2.278)?
SELECT "Shoulder" FROM table_33689 WHERE "Length" = '57.85 (2.278)'
wikisql
CREATE TABLE table_name_33 ( region VARCHAR, date VARCHAR )
Name the region for december 7, 2004
SELECT region FROM table_name_33 WHERE date = "december 7, 2004"
sql_create_context
CREATE TABLE table_28682 ( "Fluorescent dye" text, "Color" text, "mass (g/mol)" real, "Absorb (nm)" real, "Emit (nm)" real, "\u03b5 (M \u22121 cm \u22121 )" text )
How much absorption in nm does the orange dye have?
SELECT MIN("Absorb (nm)") FROM table_28682 WHERE "Color" = 'orange'
wikisql
CREATE TABLE table_21588 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What is the location of the the game on december 10
SELECT "Location Attendance" FROM table_21588 WHERE "Date" = 'December 10'
wikisql
CREATE TABLE table_name_22 ( stage VARCHAR, arrival VARCHAR )
Which stage number did son bou arrive at?
SELECT COUNT(stage) FROM table_name_22 WHERE arrival = "son bou"
sql_create_context
CREATE TABLE table_79362 ( "Name" text, "Pos." text, "Height" text, "Weight" text, "Born" text )
What is the weight of the person born in 1980?
SELECT "Weight" FROM table_79362 WHERE "Born" = '1980'
wikisql
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTasks ( Id num...
Number of questions that remain undeleted (per day, between dates).
SELECT DATE(p.CreationDate), COUNT(p.Id) FROM Posts AS p WHERE p.PostTypeId = 1 AND p.CreationDate >= '##Date1##' AND p.CreationDate <= '##Date2##' GROUP BY DATE(p.CreationDate) ORDER BY DATE(p.CreationDate)
sede
CREATE TABLE table_18924 ( "Date" text, "Winning Team" text, "Score" text, "Winning Pitcher" text, "Losing Pitcher" text, "Attendance" real, "Location" text )
How many games played on june 25?
SELECT COUNT("Score") FROM table_18924 WHERE "Date" = 'June 25'
wikisql
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTaskResults ( Id number, ...
Top Polish users in StackOverFlow.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%australia%' OR UPPER(Location) LIKE '%australia%' ORDER BY Reputation DESC
sede
CREATE TABLE table_77101 ( "Kick Off" text, "Opponents" text, "Result" text, "Referee" text, "Attendance" real )
WHAT OPPONENT HAD A KICKOFF OF 2007-03-06, 20:45?
SELECT "Opponents" FROM table_77101 WHERE "Kick Off" = '2007-03-06, 20:45'
wikisql
CREATE TABLE table_name_2 ( extra_points INTEGER, player VARCHAR, points VARCHAR )
Which Extra points is the highest one that has a Player of herrnstein, and Points smaller than 30?
SELECT MAX(extra_points) FROM table_name_2 WHERE player = "herrnstein" AND points < 30
sql_create_context
CREATE TABLE table_16875 ( "Player" text, "No." real, "Nationality" text, "Position" text, "Years for Jazz" text, "School/Club Team" text )
How many players only played for the Jazz in only 2010?
SELECT COUNT("No.") FROM table_16875 WHERE "Years for Jazz" = '2010'
wikisql
CREATE TABLE table_name_9 ( opponent VARCHAR, game VARCHAR )
What is Opponent, when Game is '37'?
SELECT opponent FROM table_name_9 WHERE game = 37
sql_create_context
CREATE TABLE semester ( semester_id int, semester varchar, year int ) 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, good_feedback int, tough_...
DENTED 607 was taught by who most recently ?
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 WHERE course_offeri...
advising
CREATE TABLE table_name_86 ( pick VARCHAR, round VARCHAR, overall VARCHAR, position VARCHAR )
How many Picks have an Overall smaller than 304, and a Position of g, and a Round smaller than 11?
SELECT COUNT(pick) FROM table_name_86 WHERE overall < 304 AND position = "g" AND round < 11
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
how many patients born before 2069 are asian?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.dob_year < "2069"
mimicsql_data
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
number of questions per day.
SELECT CAST(TIME_TO_STR(CreationDate, '%Y-%m-%d %H:%M:%S') AS TEXT(10)) AS date, COUNT(1) FROM Posts WHERE PostTypeId = 1 GROUP BY CAST(TIME_TO_STR(CreationDate, '%Y-%m-%d %H:%M:%S') AS TEXT(10)) ORDER BY date
sede
CREATE TABLE table_name_85 ( attendance VARCHAR, date VARCHAR )
How many people attended the game on June 18?
SELECT COUNT(attendance) FROM table_name_85 WHERE date = "june 18"
sql_create_context
CREATE TABLE table_name_39 ( date VARCHAR, opponent VARCHAR )
What is Date, when Opponent is 'Chicago Stags'?
SELECT date FROM table_name_39 WHERE opponent = "chicago stags"
sql_create_context
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId n...
Top Votes Comments by network ID.
SELECT c.Score, c.Id AS "comment_link", c.CreationDate FROM Comments AS c INNER JOIN Users AS u ON c.UserId = u.Id WHERE u.AccountId = '##AccountId##' ORDER BY c.Score DESC, c.CreationDate DESC
sede
CREATE TABLE pitStops ( raceId INTEGER, driverId INTEGER, stop INTEGER, lap INTEGER, time TEXT, duration TEXT, milliseconds INTEGER ) CREATE TABLE drivers ( driverId INTEGER, driverRef TEXT, number TEXT, code TEXT, forename TEXT, surname TEXT, dob TEXT, natio...
What are the ids and locations of all circuits in France or Belgium Show bar chart, sort by the total number in desc.
SELECT location, circuitId FROM circuits WHERE country = "France" OR country = "Belgium" ORDER BY circuitId DESC
nvbench
CREATE TABLE table_74961 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
Which Outcome has a Opponent of lindsay lee-waters?
SELECT "Outcome" FROM table_74961 WHERE "Opponent" = 'lindsay lee-waters'
wikisql
CREATE TABLE diagnoses ( 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 ) C...
how many white-russian patients had the drug code mabeli 120?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND prescriptions.formulary_drug_cd = "MABELI120"
mimicsql_data
CREATE TABLE table_203_686 ( id number, "release date" text, "album" text, "record label" text, "uk albums chart" number, "u.s. billboard 200 chart" number )
which recored album is listed before february 1984 ?
SELECT "album" FROM table_203_686 WHERE "release date" < 1984
squall
CREATE TABLE mzb ( 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...
病患82459876开出的所有药品的编号、名称、数量、单价、金额列出在2000年5月9日到2017年10月31日期间的详细情况?
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '82459876' AND qtb.IN_HOSP_DATE BETWEEN '2000-05-09' AND '2017-10-31' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_k...
css
CREATE TABLE table_name_75 ( name VARCHAR, builder VARCHAR, laid_down VARCHAR )
What is the name of the boat that was built by Chatham and Laid down of 25 april 1887?
SELECT name FROM table_name_75 WHERE builder = "chatham" AND laid_down = "25 april 1887"
sql_create_context
CREATE TABLE table_name_51 ( episode VARCHAR, run_time VARCHAR )
What episode has a run time of 25:12?
SELECT episode FROM table_name_51 WHERE run_time = "25:12"
sql_create_context
CREATE TABLE table_47691 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
What was Jack Nicklaus's score after round 1?
SELECT MIN("Score") FROM table_47691 WHERE "Player" = 'jack nicklaus'
wikisql
CREATE TABLE table_202_191 ( id number, "party" text, "votes" number, "%" number, "seats" number, "+/-" number )
after the election , how many seats did the liberal democratic league win ?
SELECT "seats" FROM table_202_191 WHERE "party" = 'liberal democratic league'
squall
CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHA...
Create a bar chart showing sum student capacity across gender, and rank total number in ascending order please.
SELECT gender, SUM(student_capacity) FROM Dorm GROUP BY gender ORDER BY SUM(student_capacity)
nvbench
CREATE TABLE table_66152 ( "Season" real, "First Aired" text, "Last Aired" text, "Episodes" real, "Network" text )
Of the series that first aired April 8, 2011, what is the total number of episodes?
SELECT SUM("Episodes") FROM table_66152 WHERE "First Aired" = 'april 8, 2011'
wikisql
CREATE TABLE table_44027 ( "Rank" real, "Company" text, "Headquarters" text, "Industry" text, "Sales (billion $)" real, "Profits (billion $)" real, "Assets (billion $)" real, "Market Value (billion $)" real )
How much are General Electric's profits who have assets (billion $) under 2,355.83 and a market value (billion $) larger than 169.65?
SELECT AVG("Profits (billion $)") FROM table_44027 WHERE "Assets (billion $)" < '2,355.83' AND "Company" = 'general electric' AND "Market Value (billion $)" > '169.65'
wikisql
CREATE TABLE table_46227 ( "Club" text, "Head Coach" text, "City" text, "Stadium" text, "2007 season" text )
What stadium is in Seoul?
SELECT "Stadium" FROM table_46227 WHERE "City" = 'seoul'
wikisql
CREATE TABLE member_of ( facid number, dno number, appt_type text ) CREATE TABLE faculty ( facid number, lname text, fname text, rank text, sex text, phone number, room text, building text ) CREATE TABLE course ( cid text, cname text, credits number, instruc...
How many courses have more than 2 credits?
SELECT COUNT(*) FROM course WHERE credits > 2
spider
CREATE TABLE table_78180 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Class" text, "FCC info" text )
What class is the city of black mountain, north carolina?
SELECT "Class" FROM table_78180 WHERE "City of license" = 'black mountain, north carolina'
wikisql
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...
把医院医院4876950全部医疗就诊的记录里患者的平均岁数按科室名字和入院诊断编码的差异列出来
SELECT MED_ORG_DEPT_NM, IN_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '4876950' GROUP BY MED_ORG_DEPT_NM, IN_DIAG_DIS_CD
css
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number,...
Number of posts per one active user.
WITH counts_cte AS (SELECT LAST_DATE_OF_MONTH(p.CreationDate) AS Cmonth, COUNT(p.Id) AS "total_posts", SUM(CASE WHEN p.PostTypeId = 1 THEN 1 ELSE 0 END) AS QCount, SUM(CASE WHEN p.PostTypeId = 2 THEN 1 ELSE 0 END) AS ACount FROM Posts AS p GROUP BY LAST_DATE_OF_MONTH(p.CreationDate)), usercounts_cte AS (SELECT LAST_DAT...
sede
CREATE TABLE wdmzjzjlb ( 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...
看看09年7月25号到17年3月26号8275886这个医疗机构的新生儿门诊的就诊记录
SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.YLJGDM = '8275886' AND wdmzjzjlb.JZKSRQ BETWEEN '2009-07-25' AND '2017-03-26' AND wdmzjzjlb.ZSEBZ > 0 UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.YLJGDM = '8275886' AND bdmzjzjlb.JZKSRQ BETWEEN '2009-07-25' AND '2017-03-26' AND bdmzjzjlb.ZSEBZ > 0
css
CREATE TABLE music_festival ( id number, music_festival text, date_of_ceremony text, category text, volume number, result text ) CREATE TABLE artist ( artist_id number, artist text, age number, famous_title text, famous_release_date text ) CREATE TABLE volume ( volume_i...
Find the famous titles of artists that do not have any volume.
SELECT famous_title FROM artist WHERE NOT artist_id IN (SELECT artist_id FROM volume)
spider