context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_52677 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text )
What date were the high rebounds Evans (14)?
SELECT "Date" FROM table_52677 WHERE "High rebounds" = 'evans (14)'
wikisql
CREATE TABLE table_name_94 ( goal_difference INTEGER, goals_against VARCHAR, draws VARCHAR )
What is the lowest goal difference a club with 61 goals against and less than 11 draws has?
SELECT MIN(goal_difference) FROM table_name_94 WHERE goals_against = 61 AND draws < 11
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewRejectionReasons ( Id...
What percentile am I in for a given tag (Cross-Validated)?. Determines where you rank in a given tag as of the last data load
SELECT STR(NTILE(100) OVER (ORDER BY SUM(answers.Score) DESC), 3) + '%' AS "top", ROW_NUMBER() OVER (ORDER BY SUM(answers.Score) DESC) AS "ranking", Users.DisplayName AS "user_link", SUM(answers.Score) AS "total_score" FROM Tags JOIN PostTags ON Tags.Id = PostTags.TagId AND Tags.TagName = '##TagName##' JOIN Posts AS qu...
sede
CREATE TABLE table_238124_1 ( platelet_count VARCHAR, condition VARCHAR )
What is the platelet count for congenital afibrinogenemia?
SELECT platelet_count FROM table_238124_1 WHERE condition = "Congenital afibrinogenemia"
sql_create_context
CREATE TABLE table_name_21 ( date VARCHAR, label VARCHAR, format VARCHAR )
What is the date for Hydra Head Records with a CD format?
SELECT date FROM table_name_21 WHERE label = "hydra head records" AND format = "cd"
sql_create_context
CREATE TABLE table_name_51 ( length_of_retirement VARCHAR, age_at_inauguration VARCHAR )
What is the Length of retirement of the President with an Age at inauguration of 70years, 53days?
SELECT length_of_retirement FROM table_name_51 WHERE age_at_inauguration = "70years, 53days"
sql_create_context
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(4...
For those employees who did not have any job in the past, return a bar chart about the distribution of job_id and the average of department_id , and group by attribute job_id, and show by the bar in asc please.
SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
How many patients who were diagnosed under icd9 code 481 have pb as drug route?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "481" AND prescriptions.route = "PB"
mimicsql_data
CREATE TABLE table_26516 ( "Co-king" text, "Relationship to Monarch" text, "Crowned" text, "Co-kingship ceased" text, "Reason" text, "Monarch" text )
Name the crownded for 17 september 1025
SELECT "Crowned" FROM table_26516 WHERE "Co-kingship ceased" = '17 September 1025'
wikisql
CREATE TABLE table_73844 ( "Season no." real, "Series no." real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text )
What date did 'd.a.w.' Originally air?
SELECT "Original air date" FROM table_73844 WHERE "Title" = 'D.A.W.'
wikisql
CREATE TABLE table_name_21 ( opponent VARCHAR, result VARCHAR )
What team was the opponent when the result was l 0-27?
SELECT opponent FROM table_name_21 WHERE result = "l 0-27"
sql_create_context
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE ta ( campus_job_id int, ...
Do I need to take any specific courses before taking PHARMACY 690 ?
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT...
advising
CREATE TABLE table_71313 ( "Country" text, "Film title used in nomination" text, "Language" text, "Original title" text, "Director" text )
What was the original title of the Hindi film?
SELECT "Original title" FROM table_71313 WHERE "Language" = 'hindi'
wikisql
CREATE TABLE table_name_8 ( population INTEGER, country_territory_entity VARCHAR, rank VARCHAR )
Name the most population for seychelles and rank less than 13
SELECT MAX(population) FROM table_name_8 WHERE country_territory_entity = "seychelles" AND rank < 13
sql_create_context
CREATE TABLE table_name_69 ( champion VARCHAR, score VARCHAR, location VARCHAR, year VARCHAR )
What is the Champion at Sopot prior to 2006 with a Score of 6 4, 6 7(7), 6 3?
SELECT champion FROM table_name_69 WHERE location = "sopot" AND year < 2006 AND score = "6–4, 6–7(7), 6–3"
sql_create_context
CREATE TABLE table_name_97 ( winner VARCHAR, fifth VARCHAR )
WHAT IS THE WINNER WITH A FIFTH OF JOSS STONE?
SELECT winner FROM table_name_97 WHERE fifth = "joss stone"
sql_create_context
CREATE TABLE table_62597 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
When the total was 290 what was the To par?
SELECT "To par" FROM table_62597 WHERE "Total" = '290'
wikisql
CREATE TABLE table_14044 ( "Rank" real, "Artist" text, "Album" text, "Peak position" text, "Sales" real, "Certification" text )
What is the sales when the artist is kelly clarkson?
SELECT COUNT("Sales") FROM table_14044 WHERE "Artist" = 'kelly clarkson'
wikisql
CREATE TABLE table_name_47 ( left_office VARCHAR, took_office VARCHAR, minister VARCHAR )
What is Left Office, when Took Office is '11 June 2001', and when Minister is 'Mirko Tremaglia'?
SELECT left_office FROM table_name_47 WHERE took_office = "11 june 2001" AND minister = "mirko tremaglia"
sql_create_context
CREATE TABLE table_2093995_1 ( stations VARCHAR, city__neighborhood VARCHAR )
What are the stations in Tarzana?
SELECT stations FROM table_2093995_1 WHERE city__neighborhood = "Tarzana"
sql_create_context
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL v...
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of hire_date and the average of salary bin hire_date by weekday, could you order the average of salary in ascending order?
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(SALARY)
nvbench
CREATE TABLE table_78193 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
When the away team scored 16.21 (117), what was the home teams score?
SELECT "Home team score" FROM table_78193 WHERE "Away team score" = '16.21 (117)'
wikisql
CREATE TABLE table_50501 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What is High Assists, when High Points is 'Tayshaun Prince (23)'?
SELECT "High assists" FROM table_50501 WHERE "High points" = 'tayshaun prince (23)'
wikisql
CREATE TABLE table_54237 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
what is the time/retired when the laps is less than 54 and the driver is mark donohue?
SELECT "Time/Retired" FROM table_54237 WHERE "Laps" < '54' AND "Driver" = 'mark donohue'
wikisql
CREATE TABLE table_1733513_1 ( others_percentage VARCHAR, bush_number VARCHAR )
What is the percentage of others when the number for Bush is 1329?
SELECT others_percentage FROM table_1733513_1 WHERE bush_number = 1329
sql_create_context
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_na...
what ground transportation is available in BOSTON
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'BOSTON' AND ground_service.city_code = city.city_code
atis
CREATE TABLE table_4521 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Who is the home side when north melbourne is the away side?
SELECT "Home team" FROM table_4521 WHERE "Away team" = 'north melbourne'
wikisql
CREATE TABLE table_name_64 ( points_classification VARCHAR, stage VARCHAR )
who is the points classification in stage 1?
SELECT points_classification FROM table_name_64 WHERE stage = "1"
sql_create_context
CREATE TABLE Lots ( lot_id INTEGER, investor_id INTEGER, lot_details VARCHAR(255) ) CREATE TABLE Transactions_Lots ( transaction_id INTEGER, lot_id INTEGER ) CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE TABLE Ref_Transaction_Types ( ...
Bin all date of transactions into the YEAR interval, and sum the share count of each bin Return the result using a line chart, and I want to display from high to low by the x axis please.
SELECT date_of_transaction, SUM(share_count) FROM Transactions ORDER BY date_of_transaction DESC
nvbench
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
在医院3166423就诊的患者77341331其医疗就诊记录里在出院时诊断疾病名称含有含抑郁症的编号都啥?
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '77341331' AND t_kc21.MED_SER_ORG_NO = '3166423' AND NOT t_kc21.OUT_DIAG_DIS_NM LIKE '%抑郁症%'
css
CREATE TABLE table_29535057_4 ( challenge_leader VARCHAR, winner VARCHAR )
Who were the challenge leaders of the games won by boston college (88-76)?
SELECT challenge_leader FROM table_29535057_4 WHERE winner = "Boston College (88-76)"
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, ...
Provide me the number of patients who stayed in the hospital for more than 27 days that had a magnesium lab test.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "27" AND lab.label = "Magnesium"
mimicsql_data
CREATE TABLE table_4212 ( "Player" text, "Starts" real, "Cuts made" real, "Best finish" text, "Money list rank" text, "Earnings ($)" real )
What is Jonathan Kaye's money list ranking?
SELECT COUNT("Money list rank") FROM table_4212 WHERE "Player" = 'Jonathan Kaye'
wikisql
CREATE TABLE table_12759 ( "Date" text, "Opponent#" text, "Rank#" text, "Result" text, "Attendance" text )
What date was the attendance 82,500?
SELECT "Date" FROM table_12759 WHERE "Attendance" = '82,500'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
what is the number of patients whose procedure long title is combined right and left heart angiocardiography?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Combined right and left heart angiocardiography"
mimicsql_data
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
病患00922703的检验结果指标均正常的检验报告单号是什么
SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '00922703' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WH...
css
CREATE TABLE table_name_61 ( built VARCHAR, name VARCHAR )
When was the sargent bridge built?
SELECT built FROM table_name_61 WHERE name = "sargent bridge"
sql_create_context
CREATE TABLE table_66468 ( "Sport" text, "Body" text, "Year" text, "Event type" text, "Location" text, "Nations" text )
What body is at the World Championship for Underwater Target shooting?
SELECT "Body" FROM table_66468 WHERE "Event type" = 'world championship' AND "Sport" = 'underwater target shooting'
wikisql
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,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 countries ( COUNTRY...
For all employees who have the letters D or S in their first name, find hire_date and the average of employee_id bin hire_date by time, and visualize them by a bar chart.
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE table_6897 ( "Peel" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
Which Draws has a Wins smaller than 17, and an Against smaller than 1158?
SELECT COUNT("Draws") FROM table_6897 WHERE "Wins" < '17' AND "Against" < '1158'
wikisql
CREATE TABLE table_71571 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
What was the score of the game on June 1?
SELECT "Score" FROM table_71571 WHERE "Date" = 'june 1'
wikisql
CREATE TABLE race ( Race_ID int, Name text, Class text, Date text, Track_ID text ) CREATE TABLE track ( Track_ID int, Name text, Location text, Seating real, Year_Opened real )
Show names and seatings for all tracks opened after 2000 by a pie chart.
SELECT Name, Seating FROM track WHERE Year_Opened > 2000
nvbench
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
what was the first thing patient 027-142451 got diagnosed with in this year?
SELECT diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-142451')) AND DATETIME(diagnosis.diagnosistime, 'start of yea...
eicu
CREATE TABLE table_27003186_3 ( other VARCHAR, registered_voters VARCHAR )
What is other when registered voters is 50.7%?
SELECT other FROM table_27003186_3 WHERE registered_voters = "50.7%"
sql_create_context
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...
Return a pie chart about the proportion of Team_Name and Team_ID.
SELECT Team_Name, Team_ID FROM basketball_match
nvbench
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, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
36916045402的就诊状态代码和名称在门诊就诊里都分别是什么?
SELECT txmzjzjlb.JZZTDM, txmzjzjlb.JZZTMC FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '36916045402' UNION SELECT ftxmzjzjlb.JZZTDM, ftxmzjzjlb.JZZTMC FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '36916045402'
css
CREATE TABLE table_26842217_4 ( site VARCHAR, visiting_team VARCHAR )
Where's the louisiana-lafayette as a visiting team?
SELECT site FROM table_26842217_4 WHERE visiting_team = "Louisiana-Lafayette"
sql_create_context
CREATE TABLE table_name_69 ( week INTEGER, opponent VARCHAR, attendance VARCHAR )
Which Week has an Opponent of pittsburgh steelers, and an Attendance larger than 47,727?
SELECT MIN(week) FROM table_name_69 WHERE opponent = "pittsburgh steelers" AND attendance > 47 OFFSET 727
sql_create_context
CREATE TABLE table_name_35 ( republican VARCHAR, lead_margin VARCHAR )
What is the percentage for Brown when the lead margin is 26?
SELECT republican AS :_roy_brown FROM table_name_35 WHERE lead_margin = 26
sql_create_context
CREATE TABLE table_35925 ( "Year" real, "Tournament" text, "Venue" text, "Result" text, "Extra" text )
What tournament has a year prior to 2001?
SELECT "Tournament" FROM table_35925 WHERE "Year" < '2001'
wikisql
CREATE TABLE table_name_78 ( crowd INTEGER, away_team VARCHAR )
What is the lowest crowd when essendon is the away team?
SELECT MIN(crowd) FROM table_name_78 WHERE away_team = "essendon"
sql_create_context
CREATE TABLE Students ( personal_name VARCHAR, student_id VARCHAR ) CREATE TABLE Student_Course_Enrolment ( student_id VARCHAR )
Find the student ID and personal name of the student with at least two enrollments.
SELECT T1.student_id, T2.personal_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING COUNT(*) >= 2
sql_create_context
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...
Show me about the distribution of ACC_Road and the average of School_ID , and group by attribute ACC_Road in a bar chart, order X-axis in descending order please.
SELECT ACC_Road, AVG(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road DESC
nvbench
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minu...
EA flight 825 from ATLANTA to DENVER leaving at 555 what type of aircraft is used on that flight
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 (((flight.departure_time = 555 AND flight.flight_number = 825) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1....
atis
CREATE TABLE table_13121 ( "Mark" text, "Wind*" text, "Athlete" text, "Nationality" text, "Venue" text, "Date" text )
Which Date has a Venue of bucharest?
SELECT "Date" FROM table_13121 WHERE "Venue" = 'bucharest'
wikisql
CREATE TABLE table_name_12 ( total VARCHAR, set_3 VARCHAR )
What was the total when the set 3 score was 25 27?
SELECT total FROM table_name_12 WHERE set_3 = "25–27"
sql_create_context
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, hi...
what flights go from DALLAS to BALTIMORE
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 = 'BALTIMO...
atis
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 ) ...
find out the number of divorced patients who were admitted before the year 2121.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.admityear < "2121"
mimicsql_data
CREATE TABLE table_name_24 ( high_assists VARCHAR, game VARCHAR, team VARCHAR )
Who had the high assist in a game number above 77 for Milwaukee?
SELECT high_assists FROM table_name_24 WHERE game > 77 AND team = "milwaukee"
sql_create_context
CREATE TABLE table_6849 ( "Rank" real, "Country" text, "Claimant" text, "Highest point" text, "Height" text )
Which highest rank belongs to the palestinian territories?
SELECT MAX("Rank") FROM table_6849 WHERE "Country" = 'palestinian territories'
wikisql
CREATE TABLE Part_Faults ( part_fault_id INTEGER, part_id INTEGER, fault_short_name VARCHAR(20), fault_description VARCHAR(255), other_fault_details VARCHAR(255) ) CREATE TABLE Fault_Log ( fault_log_entry_id INTEGER, asset_id INTEGER, recorded_by_staff_id INTEGER, fault_log_entry_da...
A bar chart about the number of faults for different fault short name, show in descending by the total number.
SELECT fault_short_name, COUNT(fault_short_name) FROM Part_Faults AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.part_fault_id = T2.part_fault_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY fault_short_name ORDER BY COUNT(fault_short_name) DESC
nvbench
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTask...
Top 10 Gold Badge Users.
SELECT u.DisplayName, Posts.OwnerUserId AS UserId, BadgeCount, COUNT(Posts.Id) AS PostsCount FROM Posts JOIN Users AS u ON u.Id = Posts.OwnerUserId JOIN (SELECT Badges.UserId AS UserId, COUNT(Badges.Id) AS BadgeCount FROM Badges WHERE Badges.Class = 1 GROUP BY Badges.UserId) AS B ON Posts.OwnerUserId = B.UserId GROUP B...
sede
CREATE TABLE table_66359 ( "Position" real, "Team" text, "Played" real, "Wins" real, "Draws" real, "Losses" real, "Scored" real, "Conceded" real, "Points" real )
How much Scored has Losses smaller than 0?
SELECT SUM("Scored") FROM table_66359 WHERE "Losses" < '0'
wikisql
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE weather ( date TEXT, ...
Show me how many long by long in a histogram
SELECT long, COUNT(long) FROM station
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
what is maximum age of patients whose ethnicity is asian and days of hospital stay is 23?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.days_stay = "23"
mimicsql_data
CREATE TABLE table_name_84 ( year__ceremony_ VARCHAR, film_title_used_in_nomination VARCHAR )
What year has a nomination title of 'sangrador'?
SELECT year__ceremony_ FROM table_name_84 WHERE film_title_used_in_nomination = "sangrador"
sql_create_context
CREATE TABLE School ( School_id text, School_name text, Location text, Mascot text, Enrollment int, IHSAA_Class text, IHSAA_Football_Class text, County text ) CREATE TABLE endowment ( endowment_id int, School_id int, donator_name text, amount real ) CREATE TABLE budget ...
Return a bar chart showing the number of schools in each county.
SELECT County, COUNT(*) FROM School GROUP BY County
nvbench
CREATE TABLE table_22753439_1 ( margin VARCHAR, winner VARCHAR )
How many margins have a winner of S. Singaravadivel?
SELECT COUNT(margin) FROM table_22753439_1 WHERE winner = "S. Singaravadivel"
sql_create_context
CREATE TABLE table_name_17 ( played INTEGER, drawn VARCHAR, against VARCHAR )
What is the average played that has a drawn greater than 1, with an against greater than 16?
SELECT AVG(played) FROM table_name_17 WHERE drawn > 1 AND against > 16
sql_create_context
CREATE TABLE table_57819 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text )
Which tournament had Toshiaki Sakai as an opponent in the final on a grass surface?
SELECT "Tournament" FROM table_57819 WHERE "Opponent in the final" = 'toshiaki sakai' AND "Surface" = 'grass'
wikisql
CREATE TABLE table_67265 ( "Title" text, "Studio" text, "Role" text, "Leading lady" text, "Director" text )
Who directed the movie The Star Packer?
SELECT "Director" FROM table_67265 WHERE "Title" = 'the star packer'
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,...
get me the number of patients on ih route of drug administration who have diagnoses of pneumonia, unspecified organism.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Pneumonia, organism NOS" AND prescriptions.route = "IH"
mimicsql_data
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
did patient 025-32034 have a sao2 that was greater than 100.0 on this month/07?
SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-32034')) AND vitalperiodic.sao2 > 100.0 AND NOT vitalperiodic.sa...
eicu
CREATE TABLE table_56693 ( "Year" real, "Champion" text, "Score" text, "Runner-Up" text, "Location" text, "Semi-Finalist #1" text, "Semi-Finalist #2" text )
Who was champion in 2005 where the semi-finalist was #1 in western Carolina?
SELECT "Champion" FROM table_56693 WHERE "Year" = '2005' AND "Semi-Finalist #1" = 'western carolina'
wikisql
CREATE TABLE products ( code number, name text, price number, manufacturer number ) CREATE TABLE manufacturers ( code number, name text, headquarter text, founder text, revenue number )
How many products are not made by Sony?
SELECT COUNT(DISTINCT name) FROM products WHERE NOT name IN (SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.manufacturer = T2.code WHERE T2.name = 'Sony')
spider
CREATE TABLE table_23480 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
how many high points where date is february 19
SELECT COUNT("High points") FROM table_23480 WHERE "Date" = 'February 19'
wikisql
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE offering_instructor ( ...
For BIOPHYS 280 and 115 , what are the prerequisites ?
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE (COURSE_1.number = 280 OR COURSE_1.number = 115) AND COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.depar...
advising
CREATE TABLE table_name_96 ( team_2 VARCHAR )
For a team 2 of Al-Faisaly, what was the 2nd leg?
SELECT 2 AS nd_leg FROM table_name_96 WHERE team_2 = "al-faisaly"
sql_create_context
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
在医院7700550中,根据不同的科室名称和出院诊断疾病编码,列出所有医疗就诊记录中患者平均是多大年龄?
SELECT gwyjzb.MED_ORG_DEPT_NM, gwyjzb.OUT_DIAG_DIS_CD, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '7700550' GROUP BY gwyjzb.MED_ORG_DEPT_NM, gwyjzb.OUT_DIAG_DIS_CD UNION SELECT fgwyjzb.MED_ORG_DEPT_NM, fgwyjzb.OUT_DIAG_DIS_CD, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '77...
css
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jybgb ( BBCJBW text, BBDM tex...
从03年3月14日起到2009年1月3日为止病患柳飞星都进行了什么检测记录在检验结果指标记录里?
SELECT jyjgzbb.JCFF FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND...
css
CREATE TABLE table_72613 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" real )
When 74804 is the attendance what week is it?
SELECT "Week" FROM table_72613 WHERE "Attendance" = '74804'
wikisql
CREATE TABLE manufacturers ( code number, name text, headquarter text, founder text, revenue number ) CREATE TABLE products ( code number, name text, price number, manufacturer number )
What are the average, maximum and total revenues of all companies?
SELECT AVG(revenue), MAX(revenue), SUM(revenue) FROM manufacturers
spider
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 appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area...
Give the neames of wines with prices below 50 and with appelations in Monterey county, and count them by a bar chart, sort y-axis from high to low order please.
SELECT Name, COUNT(Name) FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Monterey" AND T2.Price < 50 GROUP BY Name ORDER BY COUNT(Name) DESC
nvbench
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, pro...
what ground transportation is available in PITTSBURGH
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'PITTSBURGH' AND ground_service.city_code = city.city_code
atis
CREATE TABLE trust ( source_u_id number, target_u_id number, trust number ) CREATE TABLE review ( a_id number, u_id number, i_id number, rating number, rank number ) CREATE TABLE item ( i_id number, title text ) CREATE TABLE useracct ( u_id number, name text )
Find the number of items that did not receive any review.
SELECT COUNT(*) FROM item WHERE NOT i_id IN (SELECT i_id FROM review)
spider
CREATE TABLE table_55398 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Luxembourg received how many gold medals?
SELECT AVG("Gold") FROM table_55398 WHERE "Nation" = 'luxembourg'
wikisql
CREATE TABLE table_9918 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is the place of plyaer Tim Herron from the United States with a to par of +1?
SELECT "Place" FROM table_9918 WHERE "Country" = 'united states' AND "To par" = '+1' AND "Player" = 'tim herron'
wikisql
CREATE TABLE table_61816 ( "Perpetrator" text, "Date" text, "Year" real, "Location" text, "Country" text, "Killed" real, "Additional Notes" text )
What are the additional notes for Cotabato?
SELECT "Additional Notes" FROM table_61816 WHERE "Location" = 'cotabato'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE pr...
calculate the number of patients who have been prescribed magnesium sulfate (ob).
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'magnesium sulfate (ob)')
mimic_iii
CREATE TABLE table_54010 ( "Year" text, "TCKL" real, "SACK" real, "P/KO RET" real, "YARDS" real )
What is the total of all YARDS with 0 SACK and less than 14 P/KO RET?
SELECT COUNT("YARDS") FROM table_54010 WHERE "SACK" = '0' AND "P/KO RET" < '14'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
tell me the name of the allergy patient 006-42293 has since 51 months ago?
SELECT allergy.allergyname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-42293')) AND DATETIME(allergy.allergytime) >= DATETIME(CURRENT_TIME()...
eicu
CREATE TABLE table_name_71 ( week VARCHAR, game_site VARCHAR, attendance VARCHAR )
What week was the game played at Robert f. Kennedy memorial stadium with more than 54,633 people in attendance?
SELECT COUNT(week) FROM table_name_71 WHERE game_site = "robert f. kennedy memorial stadium" AND attendance > 54 OFFSET 633
sql_create_context
CREATE TABLE table_75713 ( "Week #" text, "Theme" text, "Original artist" text, "Order #" text, "Result" text )
What is the order number that has top 20 (10 women) as the week number?
SELECT "Order #" FROM table_75713 WHERE "Week #" = 'top 20 (10 women)'
wikisql
CREATE TABLE table_name_5 ( circuit VARCHAR, race VARCHAR )
What circuit was for the german grand prix?
SELECT circuit FROM table_name_5 WHERE race = "german grand prix"
sql_create_context
CREATE TABLE table_67073 ( "Division" text, "Drawn" real, "Lost" real, "Points" real, "League Pos" text )
What is the drawn result with a league position of 15th and a lost result that is more than 17?
SELECT SUM("Drawn") FROM table_67073 WHERE "League Pos" = '15th' AND "Lost" > '17'
wikisql
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 prescriptions...
what is discharge time of subject id 3343?
SELECT demographic.dischtime FROM demographic WHERE demographic.subject_id = "3343"
mimicsql_data
CREATE TABLE table_44715 ( "Team" text, "Average" real, "Points" real, "Played" real, "2006" text, "2007" text, "2008" text )
What is the sum of Average, when 2006 is '36/40', and when Played is greater than 126?
SELECT SUM("Average") FROM table_44715 WHERE "2006" = '36/40' AND "Played" > '126'
wikisql
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text...
Show me about the distribution of meter_600 and ID in a bar chart, and rank by the meter_600 from high to low.
SELECT meter_600, ID FROM swimmer ORDER BY meter_600 DESC
nvbench
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, Revision...
Most common questioner - answerer pairs.
SELECT Q.OwnerUserId AS "user_link", A.OwnerUserId AS "user_link", COUNT(*) AS Count FROM Posts AS Q, Posts AS A WHERE A.ParentId = Q.Id AND A.OwnerUserId > 0 AND Q.OwnerUserId > 0 AND A.OwnerUserId != Q.OwnerUserId AND Q.CommunityOwnedDate IS NULL AND A.CommunityOwnedDate IS NULL GROUP BY Q.OwnerUserId, A.OwnerUserId ...
sede
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
Do you know who the teacher is for INTLSTD 401 ?
SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'INTLSTD' AND course.number = 401 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offerin...
advising