context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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, ...
provide the number of patients whose year of birth is less than 2098 and drug route is id?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2098" AND prescriptions.route = "ID"
mimicsql_data
CREATE TABLE table_name_50 ( career VARCHAR )
What is the 2003 value with a 1r in 1998, a 14 in 1994, and a 7-12 career?
SELECT 2003 FROM table_name_50 WHERE 1998 = "1r" AND 1994 = "1r" AND career = "7-12"
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
what is the number of patients whose admission type is newborn and drug route is ed?
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 = "ED"
mimicsql_data
CREATE TABLE table_67966 ( "Position" real, "Club" text, "Played" real, "Points" text, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
What club has more than 35 goals, more than 7 draws, and 20 losses?
SELECT "Club" FROM table_67966 WHERE "Goals for" > '35' AND "Draws" > '7' AND "Losses" = '20'
wikisql
CREATE TABLE table_1342013_9 ( first_elected VARCHAR, incumbent VARCHAR )
how many first elected with incumbent being charles edward bennett
SELECT COUNT(first_elected) FROM table_1342013_9 WHERE incumbent = "Charles Edward Bennett"
sql_create_context
CREATE TABLE table_203_758 ( id number, "no." number, "dub no." number, "english dubbed title / english subbed title\noriginal japanese title" text, "original air date" text, "english air date" text )
what was the first sailor moon episode to have an english air date in october , 1995 ?
SELECT "english dubbed title / english subbed title\noriginal japanese title" FROM table_203_758 WHERE "english air date" = 10 AND "english air date" = 1995 ORDER BY "english air date" LIMIT 1
squall
CREATE TABLE coach ( Coach_ID int, Coach_name text, Gender text, Club_ID int, Rank int ) CREATE TABLE player_coach ( Player_ID int, Coach_ID int, Starting_year int ) CREATE TABLE player ( Player_ID int, Sponsor_name text, Player_name text, Gender text, Residence tex...
Bar chart x axis occupation y axis how many occupation, and rank by the y-axis from low to high.
SELECT Occupation, COUNT(Occupation) FROM player GROUP BY Occupation ORDER BY COUNT(Occupation)
nvbench
CREATE TABLE debate_people ( Debate_ID int, Affirmative int, Negative int, If_Affirmative_Win bool ) CREATE TABLE people ( People_ID int, District text, Name text, Party text, Age int ) CREATE TABLE debate ( Debate_ID int, Date text, Venue text, Num_of_Audience int ...
List the number of the venues of debates in ascending order of the number of audience.
SELECT Venue, COUNT(Venue) FROM debate GROUP BY Venue ORDER BY Num_of_Audience
nvbench
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
give me the number of patients whose days of hospital stay is greater than 16 and lab test name is sedimentation rate?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "16" AND lab.label = "Sedimentation Rate"
mimicsql_data
CREATE TABLE table_name_48 ( museum VARCHAR, name VARCHAR )
What city has the museum that holds the Sue specimen?
SELECT museum AS city FROM table_name_48 WHERE name = "sue"
sql_create_context
CREATE TABLE table_68353 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( \u00a3 )" text )
Name the to par with money of 200,000 for australia
SELECT "To par" FROM table_68353 WHERE "Money ( \u00a3 )" = '200,000' AND "Country" = 'australia'
wikisql
CREATE TABLE school_details ( school_id number, nickname text, colors text, league text, class text, division text ) CREATE TABLE school ( school_id number, school text, location text, enrollment number, founded number, denomination text, boys_or_girls text, day_...
What is the average enrollment of schools?
SELECT AVG(enrollment) FROM school
spider
CREATE TABLE machine ( Machine_ID int, Making_Year int, Class text, Team text, Machine_series text, value_points real, quality_rank int ) CREATE TABLE repair_assignment ( technician_id int, repair_ID int, Machine_ID int ) CREATE TABLE repair ( repair_ID int, name text, ...
Give me a bar chart that group and count names of technicians with a series of machines they are assigned to repair, and list by the total number in desc.
SELECT Name, COUNT(Name) FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.Machine_ID = T2.Machine_ID JOIN technician AS T3 ON T1.technician_id = T3.technician_id GROUP BY Name ORDER BY COUNT(Name) DESC
nvbench
CREATE TABLE table_66948 ( "Date" text, "Visiting Team" text, "Final Score" text, "Host Team" text, "Stadium" text )
What was the final score of the game on November 24 with the visiting team the Indianapolis Colts?
SELECT "Final Score" FROM table_66948 WHERE "Visiting Team" = 'indianapolis colts' AND "Date" = 'november 24'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
give me the number of patients whose age is less than 45 and drug code is glyc1r?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "45" AND prescriptions.formulary_drug_cd = "GLYC1R"
mimicsql_data
CREATE TABLE table_50429 ( "Track" real, "Song" text, "Author" text, "Worship Leader" text, "Lead Supporting Vocal" text, "Time" text )
Who was the Worship Leader for the song that was 7:05 long?
SELECT "Worship Leader" FROM table_50429 WHERE "Time" = '7:05'
wikisql
CREATE TABLE party ( Party_ID int, Minister text, Took_office text, Left_office text, Region_ID int, Party_name text ) CREATE TABLE party_events ( Event_ID int, Event_Name text, Party_ID int, Member_in_charge_ID int ) CREATE TABLE region ( Region_ID int, Region_name tex...
Please tell me the repeat times of each ministers using a pie chart.
SELECT Minister, COUNT(Minister) FROM party GROUP BY Minister
nvbench
CREATE TABLE table_62957 ( "Draw" real, "Artist" text, "Song" text, "Percentage" text, "Place" real )
What is the Place of Draw 1 by Artist Monika Kirovska?
SELECT AVG("Place") FROM table_62957 WHERE "Artist" = 'monika kirovska' AND "Draw" < '1'
wikisql
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Top 10 Users From Kolkata, India.
SELECT Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Kolkata%' ORDER BY Reputation DESC LIMIT 10
sede
CREATE TABLE table_name_37 ( home_team VARCHAR, away_team VARCHAR )
What is the home team score when the away team is St Kilda?
SELECT home_team AS score FROM table_name_37 WHERE away_team = "st kilda"
sql_create_context
CREATE TABLE table_75399 ( "Game" text, "Date" text, "Home Team" text, "Result" text, "Road Team" text )
Result of 88-85 ot (1-0) involves what game?
SELECT "Game" FROM table_75399 WHERE "Result" = '88-85 ot (1-0)'
wikisql
CREATE TABLE table_1341672_14 ( first_elected VARCHAR, incumbent VARCHAR )
Name the first elected for abner j. mikva
SELECT first_elected FROM table_1341672_14 WHERE incumbent = "Abner J. Mikva"
sql_create_context
CREATE TABLE table_59290 ( "Date" text, "Opponent" text, "Score" text, "Result" text, "Record" text )
What is Record, when Opponent is 'New York Knicks'?
SELECT "Record" FROM table_59290 WHERE "Opponent" = 'new york knicks'
wikisql
CREATE TABLE table_70962 ( "Date" text, "Location" text, "Nature of incident" text, "Circumstances" text, "Casualties" text )
What happened in Mazar-i-sharif?
SELECT "Circumstances" FROM table_70962 WHERE "Location" = 'mazar-i-sharif'
wikisql
CREATE TABLE table_name_69 ( city VARCHAR, iata VARCHAR )
Which city has an IATA of tsa?
SELECT city FROM table_name_69 WHERE iata = "tsa"
sql_create_context
CREATE TABLE table_train_33 ( "id" int, "active_infection" bool, "allergy_to_thiamine" bool, "receiving_vasopressor" bool, "liver_disease" bool, "allergy_to_vitamin_c" bool, "allergy_to_hydrocortisone" bool, "hypertension" bool, "age" float, "serum_aminotransferase_level_alt_ast"...
greater than 18 years old
SELECT * FROM table_train_33 WHERE age > 18
criteria2sql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TA...
on the current intensive care unit visit what was minimum respiration of patient 009-5001?
SELECT MIN(vitalperiodic.respiration) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-5001') AND patient.unitdischargetime IS NULL) ...
eicu
CREATE TABLE table_14638 ( "Year" text, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text )
In 1982, when the Men's doubles had no competition who won the Women's singles?
SELECT "Women's singles" FROM table_14638 WHERE "Men's doubles" = 'no competition' AND "Year" = '1982'
wikisql
CREATE TABLE school ( school_id number, school text, location text, enrollment number, founded number, denomination text, boys_or_girls text, day_or_boarding text, year_entered_competition number, school_colors text ) CREATE TABLE school_performance ( school_id number, s...
What is the denomination of the school the most players belong to?
SELECT T2.denomination FROM player AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id GROUP BY T1.school_id ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_name_46 ( solidat__ INTEGER, sn_sb___percentage_ VARCHAR, liquidat__°c_ VARCHAR )
When the Sn/Sb (%) of 13/17, and a Liquidat (c) bigger than 283 what's the solidat (c)?
SELECT SUM(solidat__) AS °c_ FROM table_name_46 WHERE sn_sb___percentage_ = "13/17" AND liquidat__°c_ > 283
sql_create_context
CREATE TABLE table_name_78 ( date VARCHAR, home___away VARCHAR, location_attendance VARCHAR )
What is the date of the away game at the Blue Cross Arena?
SELECT date FROM table_name_78 WHERE home___away = "away" AND location_attendance = "blue cross arena"
sql_create_context
CREATE TABLE table_74434 ( "Pick #" real, "MLS team" text, "Player" text, "Position" text, "Affiliation" text )
Who was pick number 34?
SELECT "Player" FROM table_74434 WHERE "Pick #" = '34'
wikisql
CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, basePrice INTEGER, decor TEXT ) CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adul...
What are the number of the name of rooms booked by customers whose first name has 'ROY' in part?, and I want to sort by the the number of roomname in desc please.
SELECT roomName, COUNT(roomName) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE FirstName LIKE '%ROY%' GROUP BY roomName ORDER BY COUNT(roomName) DESC
nvbench
CREATE TABLE table_name_61 ( money___ VARCHAR, place VARCHAR, player VARCHAR )
What is the total Money ( ) with a Place of t6, and a Player of ian baker-finch?
SELECT COUNT(money___) AS £__ FROM table_name_61 WHERE place = "t6" AND player = "ian baker-finch"
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 drug code and drug route of drug name calcium acetate?
SELECT prescriptions.formulary_drug_cd, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Calcium Acetate"
mimicsql_data
CREATE TABLE table_name_43 ( position_in_table VARCHAR, replaced_by VARCHAR )
What is Position in Table, when Replaced by is 'Jos Pekerman'?
SELECT position_in_table FROM table_name_43 WHERE replaced_by = "josé pekerman"
sql_create_context
CREATE TABLE products ( product_type_code VARCHAR, product_name VARCHAR, product_price VARCHAR, product_id VARCHAR ) CREATE TABLE product_suppliers ( product_id VARCHAR, supplier_id VARCHAR )
Give me the product type, name and price for all the products supplied by supplier id 3.
SELECT T2.product_type_code, T2.product_name, T2.product_price FROM product_suppliers AS T1 JOIN products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 3
sql_create_context
CREATE TABLE table_name_57 ( name VARCHAR, height VARCHAR, date_of_birth VARCHAR )
Who has the height of m (ft 9in) and was born on 1980-03-05?
SELECT name FROM table_name_57 WHERE height = "m (ft 9in)" AND date_of_birth = "1980-03-05"
sql_create_context
CREATE TABLE table_8017 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text )
What was the score when the series was 3-2?
SELECT "Score" FROM table_8017 WHERE "Series" = '3-2'
wikisql
CREATE TABLE table_name_68 ( fencing_victories__pts_ VARCHAR, total VARCHAR )
Which Fencing Victories (pts) has a Total of 5640?
SELECT fencing_victories__pts_ FROM table_name_68 WHERE total = 5640
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, find founder and the average of manufacturer , and group by attribute founder, and visualize them by a bar chart, list from high to low by the Y-axis.
SELECT Founder, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY AVG(Manufacturer) DESC
nvbench
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
During this semester , what courses are offered ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016 ORDER BY course.department
advising
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...
Find All_Games and School_ID , and visualize them by a bar chart, I want to show by the total number in asc.
SELECT All_Games, School_ID FROM basketball_match ORDER BY School_ID
nvbench
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Find All_Games and ACC_Percent , and visualize them by a bar chart, order by the ACC_Percent in ascending.
SELECT All_Games, ACC_Percent FROM basketball_match ORDER BY ACC_Percent
nvbench
CREATE TABLE table_40773 ( "Rank" real, "Goalkeeper" text, "Club" text, "MINS" real, "SHTS" real, "W\u2013L\u2013T" text )
What is the highest SHTS of Kasey Keller
SELECT MAX("SHTS") FROM table_40773 WHERE "Goalkeeper" = 'kasey keller'
wikisql
CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15), Workshop_Group_ID INTEGER, Product_Description VARCHAR(255), Product_Name VARCHAR(255), Product_Price DECIMAL(20,4), Other_Product_Service_Details VARCHAR(255) ) CREATE TABLE Products ( Product_ID VARCHAR(100), ...
How many drama workshop groups are there in each city? Return both the city and the count. Plot them as bar chart.
SELECT City_Town, COUNT(*) FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID GROUP BY T1.City_Town
nvbench
CREATE TABLE table_name_24 ( event VARCHAR, prize VARCHAR )
What event has a $248,004 prize?
SELECT event FROM table_name_24 WHERE prize = "$248,004"
sql_create_context
CREATE TABLE table_name_15 ( power VARCHAR, torque VARCHAR )
What is the power of the engine with a torque of n m (lb ft) at1,500rpm?
SELECT power FROM table_name_15 WHERE torque = "n·m (lb·ft) at1,500rpm"
sql_create_context
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...
那个号码为44478488的病人在2016年10月10日到2018年3月11日内被开出的所有药品的编码、名称、数量、单价、金额分别都是多些呢?
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '44478488' AND t_kc21.IN_HOSP_DATE BETWEEN...
css
CREATE TABLE table_name_71 ( realization VARCHAR, gloss VARCHAR )
Name the realization for 'to be, to do
SELECT realization FROM table_name_71 WHERE gloss = "'to be, to do'"
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
how many patients are divorced and are diagnosed with cerebral embolism with cerebral infarction?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "DIVORCED" AND diagnoses.long_title = "Cerebral embolism with cerebral infarction"
mimicsql_data
CREATE TABLE table_20927 ( "Antibody" text, "Brand name" text, "Approval date" real, "Type" text, "Target" text, "Approved treatment(s)" text )
What is the brand name for the antibody Brentuximab Vedotin?
SELECT "Brand name" FROM table_20927 WHERE "Antibody" = 'Brentuximab vedotin'
wikisql
CREATE TABLE table_7048 ( "English country name" text, "Arabic romanised country name" text, "Arabic country name" text, "English capital name" text, "Arabic romanised capital name" text, "Arabic capital name" text )
What is the English name of the country that has Doha as its capital?
SELECT "English country name" FROM table_7048 WHERE "English capital name" = 'doha'
wikisql
CREATE TABLE candidate ( candidate_id number, people_id number, poll_source text, date text, support_rate number, consider_rate number, oppose_rate number, unsure_rate number ) CREATE TABLE people ( people_id number, sex text, name text, date_of_birth text, height nu...
Count the number of candidates.
SELECT COUNT(*) FROM candidate
spider
CREATE TABLE table_49877 ( "Tie no" real, "Home team" text, "Score" text, "Away team" text, "Date" text )
What was the score when the Tie no less than 2?
SELECT "Score" FROM table_49877 WHERE "Tie no" < '2'
wikisql
CREATE TABLE table_name_80 ( week INTEGER, attendance VARCHAR )
Attendance of 19,741 had what average week?
SELECT AVG(week) FROM table_name_80 WHERE attendance = "19,741"
sql_create_context
CREATE TABLE table_name_70 ( college_junior_club_team__league_ VARCHAR, player VARCHAR )
Tell me the college for carl hagelin
SELECT college_junior_club_team__league_ FROM table_name_70 WHERE player = "carl hagelin"
sql_create_context
CREATE TABLE table_68562 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
Overall of 62 is what average round?
SELECT AVG("Round") FROM table_68562 WHERE "Overall" = '62'
wikisql
CREATE TABLE table_54141 ( "Year" real, "Pick" text, "Player name" text, "Position" text, "College" text )
What is the name of the player from after 1989 from Washington State?
SELECT "Player name" FROM table_54141 WHERE "Year" > '1989' AND "College" = 'washington state'
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 demographic ( subject_id text, hadm_id t...
give the number of patients with drug code bact2c and admitted in emergency.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.formulary_drug_cd = "BACT2C"
mimicsql_data
CREATE TABLE table_name_79 ( score VARCHAR, visitor VARCHAR, record VARCHAR )
What is the score when Philadelphia was the visitor with a Record of 7 4 0?
SELECT score FROM table_name_79 WHERE visitor = "philadelphia" AND record = "7–4–0"
sql_create_context
CREATE TABLE table_name_25 ( attendance VARCHAR, record VARCHAR )
What was the Bye week attendance?
SELECT attendance FROM table_name_25 WHERE record = "bye"
sql_create_context
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varc...
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about commission_pct over the last_name by a bar chart, and could you order in ascending by the X?
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 LAST_NAME
nvbench
CREATE TABLE playlist ( playlistid number, name text ) CREATE TABLE album ( albumid number, title text, artistid number ) CREATE TABLE track ( trackid number, name text, albumid number, mediatypeid number, genreid number, composer text, milliseconds number, bytes nu...
Find the number of different cities that employees live in.
SELECT COUNT(DISTINCT city) FROM employee
spider
CREATE TABLE table_name_70 ( silver INTEGER, bronze VARCHAR, gold VARCHAR, rank VARCHAR )
Which Silver is the lowest one that has a Gold larger than 0, and a Rank of total, and a Bronze smaller than 32?
SELECT MIN(silver) FROM table_name_70 WHERE gold > 0 AND rank = "total" AND bronze < 32
sql_create_context
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden ...
Top 10 users with largest rep.
SELECT * FROM Users ORDER BY Reputation DESC LIMIT 10
sede
CREATE TABLE table_204_555 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text )
how long did it take martinez to run the 20 km at the central american games in 1994 ?
SELECT "notes" FROM table_204_555 WHERE "competition" = 'central american games' AND "year" = 1994
squall
CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE appellations ( No...
List the number of winery of the wines whose price is bigger than 100 in a bar chart.
SELECT Winery, COUNT(Winery) FROM wine WHERE Price > 100 GROUP BY Winery
nvbench
CREATE TABLE table_name_1 ( time VARCHAR, date VARCHAR )
Date of october 8 happened at what time?
SELECT time FROM table_name_1 WHERE date = "october 8"
sql_create_context
CREATE TABLE table_name_12 ( date VARCHAR, score VARCHAR, tie_no VARCHAR )
When has a Score of 0 1, and a Tie no of 3?
SELECT date FROM table_name_12 WHERE score = "0–1" AND tie_no = "3"
sql_create_context
CREATE TABLE table_name_16 ( label VARCHAR, release VARCHAR )
Which Label has a Release of liebesgr sse aus ost-berlin?
SELECT label FROM table_name_16 WHERE release = "liebesgrüsse aus ost-berlin"
sql_create_context
CREATE TABLE table_name_58 ( rank VARCHAR, team VARCHAR, games VARCHAR )
What is the total rank of team roanne, which has less than 14 games?
SELECT COUNT(rank) FROM table_name_58 WHERE team = "roanne" AND games < 14
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
病患在1967584这个医疗机构对医疗项目自付比例的平均值是多少?就在10年9月13到11年4月9的这段时间
SELECT AVG(t_kc22.SELF_PAY_PRO) FROM t_kc22 WHERE t_kc22.t_kc21_MED_SER_ORG_NO = '1967584' AND t_kc22.STA_DATE BETWEEN '2010-09-13' AND '2011-04-09'
css
CREATE TABLE table_76722 ( "Newspaper/Magazine" text, "Type" text, "Language" text, "Headquarter" text, "Status" text )
What is Headquarter, when Type is Government-Owned, and when Newspaper/Magazine is Al-Jumhuriya?
SELECT "Headquarter" FROM table_76722 WHERE "Type" = 'government-owned' AND "Newspaper/Magazine" = 'al-jumhuriya'
wikisql
CREATE TABLE table_name_21 ( country VARCHAR, film VARCHAR )
What country is the film hi no tsugi ha rekishi from?
SELECT country FROM table_name_21 WHERE film = "hi no tsugi ha rekishi"
sql_create_context
CREATE TABLE table_48645 ( "Discipline" text, "Circuit" text, "Event" text, "Session" text, "Cause" text )
The 1977 Japanese Grand Prix in the open wheel discipline has what session?
SELECT "Session" FROM table_48645 WHERE "Discipline" = 'open wheel' AND "Event" = '1977 japanese grand prix'
wikisql
CREATE TABLE table_3091 ( "Season" real, "Regular Season" text, "Playoffs" text, "U.S. Open Cup" text, "CONCACAF" text, "MLS Regular Season Record" text )
Name the concacaf for 2010 season
SELECT "CONCACAF" FROM table_3091 WHERE "Season" = '2010'
wikisql
CREATE TABLE table_name_98 ( venue VARCHAR, competition VARCHAR )
Which Venue has a Competition of venice marathon?
SELECT venue FROM table_name_98 WHERE competition = "venice marathon"
sql_create_context
CREATE TABLE code_description ( code varchar, description text ) 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 i...
i would like a flight from DALLAS to PHILADELPHIA
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADE...
atis
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number,...
when did patient 006-105495 receive a laboratory test for the first time in this hospital encounter?
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-105495' AND patient.hospitaldischargetime IS NULL)) ORDER BY lab.labresulttime ...
eicu
CREATE TABLE table_dev_18 ( "id" int, "bleeding" int, "chronic_anticoagulant_therapy" bool, "renal_disease" bool, "hyperlipidemia" bool, "creatinine_clearance_cl" float, "chronic_hemostasis_disorders" bool, "significant_proteinuria" bool, "platelet_count" float, "total_cholestero...
increased risk of bleeding ( platelet count < 80000 ; inr > 1.5 ) , other chronic hemostasis disorders, or treatment with chronic anticoagulant therapy ( i.e., heparin or warfarin ) .
SELECT * FROM table_dev_18 WHERE bleeding = 1 OR (platelet_count < 80000 OR inr > 1.5) OR chronic_hemostasis_disorders = 1 OR chronic_anticoagulant_therapy = 1 OR (heparin = 1 OR chronic_warfarin_therapy = 1)
criteria2sql
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...
give the number of patients with private insurance who stayed in the hospital for more than 10 days.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Private" AND demographic.days_stay > "10"
mimicsql_data
CREATE TABLE table_6094 ( "English Name" text, "Height" text, "Weight" text, "Professions" text, "Stat" text )
What was the name in English that had a Stat of 7th cut?
SELECT "English Name" FROM table_6094 WHERE "Stat" = '7th cut'
wikisql
CREATE TABLE table_name_39 ( tournament VARCHAR, outcome VARCHAR, opponents VARCHAR )
what is the tournament when the outcome is winner and the opponents is kerry-anne guse corina morariu?
SELECT tournament FROM table_name_39 WHERE outcome = "winner" AND opponents = "kerry-anne guse corina morariu"
sql_create_context
CREATE TABLE table_9614 ( "Week" real, "Date" text, "Opponent" text, "Stadium" text, "Result" text, "Record" text, "Streak" text, "Attendance" real )
Who was the opposing team at Schaefer Stadium later in the season than week 7?
SELECT "Opponent" FROM table_9614 WHERE "Week" > '7' AND "Stadium" = 'schaefer stadium'
wikisql
CREATE TABLE table_19484 ( "Pick #" real, "NFL Team" text, "Player" text, "Position" text, "College" text )
How many picks played Tight end?
SELECT COUNT("Pick #") FROM table_19484 WHERE "Position" = 'Tight End'
wikisql
CREATE TABLE table_name_71 ( silver INTEGER, gold VARCHAR, total VARCHAR, bronze VARCHAR )
How many silver have a Total smaller than 3, a Bronze of 1, and a Gold larger than 0?
SELECT MAX(silver) FROM table_name_71 WHERE total < 3 AND bronze = 1 AND gold > 0
sql_create_context
CREATE TABLE table_70249 ( "Margin" real, "Score" text, "Opponent" text, "Venue" text, "Round" text )
Which round resulted in 10-52?
SELECT "Round" FROM table_70249 WHERE "Score" = '10-52'
wikisql
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...
Query to get number of posts per hour for a technology.
SELECT TIME_TO_STR(CreationDate, '%I') AS Hours, COUNT(*) AS Total FROM Posts WHERE Posts.Tags LIKE '%' + '##Tags:string##' + '%' GROUP BY TIME_TO_STR(CreationDate, '%I')
sede
CREATE TABLE table_68414 ( "Club" text, "League" text, "Sport" text, "Venue" text, "Established" real, "Championships" real )
Name the sport with championships less than 1 and club of erie bayhawks
SELECT "Sport" FROM table_68414 WHERE "Championships" < '1' AND "Club" = 'erie bayhawks'
wikisql
CREATE TABLE dorm_amenity ( amenid number, amenity_name text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE has_amenity ( dormid number, amenid number ) CREATE TABLE lives...
What are the names and types of the dorms that have a capacity greater than 300 or less than 100?
SELECT dorm_name, gender FROM dorm WHERE student_capacity > 300 OR student_capacity < 100
spider
CREATE TABLE table_203_828 ( id number, "date" text, "opponent#" text, "rank#" text, "site" text, "result" text, "attendance" number )
in how many games were more than 15 points scored by either team ?
SELECT COUNT(*) FROM table_203_828 WHERE "result" > 15 OR "result" > 15
squall
CREATE TABLE technician ( technician_id real, Name text, Team text, Starting_Year real, Age int ) CREATE TABLE machine ( Machine_ID int, Making_Year int, Class text, Team text, Machine_series text, value_points real, quality_rank int ) CREATE TABLE repair_assignment ( ...
Show names of technicians and the number of machines they are assigned to repair with a pie chart.
SELECT Name, COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_id = T2.technician_id GROUP BY T2.Name
nvbench
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
how many patients whose marital status is married and procedure long title is percutaneous abdominal drainage?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "MARRIED" AND procedures.long_title = "Percutaneous abdominal drainage"
mimicsql_data
CREATE TABLE table_name_6 ( report VARCHAR, venue VARCHAR )
Which report is for Townsville Entertainment Centre?
SELECT report FROM table_name_6 WHERE venue = "townsville entertainment centre"
sql_create_context
CREATE TABLE table_62656 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" text )
What's the to par for the t1 place with a score of 70-72-73-72=287?
SELECT "To par" FROM table_62656 WHERE "Place" = 't1' AND "Score" = '70-72-73-72=287'
wikisql
CREATE TABLE table_23117208_3 ( no_in_season INTEGER, no_in_series VARCHAR )
which is the biggest number of episode in the season, where the number of the episode in series is 20?
SELECT MAX(no_in_season) FROM table_23117208_3 WHERE no_in_series = 20
sql_create_context
CREATE TABLE table_25220821_3 ( rank INTEGER, tues_1_june VARCHAR )
If Tuesday 1 June is 20' 59.60 107.834mph, what is the rank maximum?
SELECT MAX(rank) FROM table_25220821_3 WHERE tues_1_june = "20' 59.60 107.834mph"
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )...
tell me the sex of patient 035-19890.
SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '035-19890'
eicu
CREATE TABLE table_name_8 ( opponent VARCHAR, date VARCHAR )
Who was the opponent on april 24, 1999?
SELECT opponent FROM table_name_8 WHERE date = "april 24, 1999"
sql_create_context