context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_47046 ( "Squad No." real, "Name" text, "Position" text, "League Apps" text, "League Goals" real, "FA Cup Apps" text, "FA Cup Goals" real, "League Cup Apps" text, "League Cup Goals" real, "FLT Apps" text, "FLT Goals" real, "Playoff Apps" text, "Playo...
How many total goals did the squad with 2 playoff apps, 2 FA Cup Apps, and 0 League Cup goals get?
SELECT SUM("Total Goals") FROM table_47046 WHERE "Playoff Apps" = '2' AND "FA Cup Apps" = '2' AND "League Cup Goals" < '0'
wikisql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuo...
count how many times patient 44848 went to the hospital in 2105.
SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 44848 AND STRFTIME('%y', admissions.admittime) = '2105'
mimic_iii
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
how much has patient 006-76924's change of weight second measured on the current hospital visit compared to the first value measured on the current hospital visit?
SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-76924' AND patient.hospitaldischargetime IS NULL) AND NOT patient.admissionweight IS NULL ORDER BY patient.unitadmittime LIMIT 1 OFFSET 1) ...
eicu
CREATE TABLE table_48561 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text, "Time" text, "Location" text )
Where was the event Kage Kombat 16?
SELECT "Location" FROM table_48561 WHERE "Event" = 'kage kombat 16'
wikisql
CREATE TABLE table_name_61 ( record VARCHAR, opponent VARCHAR )
What record has @ detroit as the opponent?
SELECT record FROM table_name_61 WHERE opponent = "@ detroit"
sql_create_context
CREATE TABLE table_44962 ( "Name" text, "Built" text, "Listed" text, "Location" text, "County" text )
Where is the historic place that was built in 1910?
SELECT "Location" FROM table_44962 WHERE "Built" = '1910'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
count the number of patients whose discharge location is left against medical advi and procedure icd9 code is 3808?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI" AND procedures.icd9_code = "3808"
mimicsql_data
CREATE TABLE table_name_66 ( award VARCHAR, result VARCHAR, film VARCHAR )
What is Award, when Result is 'Nominated', and when Film is 'Sankranthi'?
SELECT award FROM table_name_66 WHERE result = "nominated" AND film = "sankranthi"
sql_create_context
CREATE TABLE table_name_75 ( capacity INTEGER, year_opened VARCHAR )
What is the lowest capacity for 1903?
SELECT MIN(capacity) FROM table_name_75 WHERE year_opened = "1903"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
what is admission location and discharge location of subject id 4589?
SELECT demographic.admission_location, demographic.discharge_location FROM demographic WHERE demographic.subject_id = "4589"
mimicsql_data
CREATE TABLE table_name_25 ( length VARCHAR, junctions VARCHAR, route_name VARCHAR )
What is the length of the highway with junctions i-35 us 83 and named us 83 bus.?
SELECT length FROM table_name_25 WHERE junctions = "i-35 us 83" AND route_name = "us 83 bus."
sql_create_context
CREATE TABLE table_68933 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text, "Time" text, "Location" text )
Name the record with opponent of christian nielson
SELECT "Record" FROM table_68933 WHERE "Opponent" = 'christian nielson'
wikisql
CREATE TABLE table_56992 ( "Name" text, "Latitude" real, "Longitude" real, "Diameter (km)" real, "Named after" text )
Tell me the named after for diameter less than 19.2 and latitude more than -37.5 with longitude less than 67.3
SELECT "Named after" FROM table_56992 WHERE "Diameter (km)" < '19.2' AND "Latitude" > '-37.5' AND "Longitude" < '67.3'
wikisql
CREATE TABLE table_test_9 ( "id" int, "ejection_fraction_ef" int, "anemia" bool, "child_pugh_class" string, "systolic_blood_pressure_sbp" int, "leukopenia" int, "heart_disease" bool, "stroke" bool, "av_block" bool, "renal_disease" bool, "hepatic_disease" bool, "estimated_...
history of leukopenia, anemia, hepatic or renal dysfunction or malignancy
SELECT * FROM table_test_9 WHERE leukopenia = 1 OR anemia = 1 OR hepatic_disease = 1 OR renal_disease = 1 OR malignancy = 1
criteria2sql
CREATE TABLE qtb ( 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...
对于患者54503411高于5443.41元的医疗费总额的医疗记录,列出入院诊断疾病编码和名称分别是?
SELECT qtb.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '54503411' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 5443.41) UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '54503411' AND gyb.MED_CLINIC_ID IN (SELECT t_kc2...
css
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_l...
Which classes in the UKRAINE 400 / 500 level have the least amount of work ?
SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN program_course WHERE ((course.number < 400 + 100 AND course.number >= 400) OR (course.number < 500 + 100 AND course.number >= 500)) AND course.department = 'UKRAINE' AND program_course.workload = (SELECT MIN(PR...
advising
CREATE TABLE table_name_30 ( date VARCHAR, visitor VARCHAR )
What was the date of the Red Wings home game against Anaheim?
SELECT date FROM table_name_30 WHERE visitor = "anaheim"
sql_create_context
CREATE TABLE table_204_933 ( id number, "year" number, "competition" text, "date" text, "location" text, "opponent" text, "score" text, "result" text, "bye" text )
how many games did this team play against spain ?
SELECT COUNT(*) FROM table_204_933 WHERE "opponent" = 'spain'
squall
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...
questions with tag javascript that have code snippets and answer.
SELECT Title, Tags FROM Posts AS Question WHERE Question.Tags LIKE '%<java>%'
sede
CREATE TABLE table_6453 ( "Birth" text, "Marriage" text, "Became Duchess" text, "Ceased to be Duchess" text, "Death" text, "Spouse" text )
What is the Spouse of the Duchess that has a Death on 6 april 1780?
SELECT "Spouse" FROM table_6453 WHERE "Death" = '6 april 1780'
wikisql
CREATE TABLE table_1081459_1 ( introduced INTEGER )
What is the smallest introduced value?
SELECT MIN(introduced) FROM table_1081459_1
sql_create_context
CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name ...
where does CP fly
SELECT DISTINCT airport.airport_code FROM airport, flight WHERE flight.airline_code = 'CP' AND flight.to_airport = airport.airport_code
atis
CREATE TABLE table_66656 ( "Wimmera FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
Which Losses have Draws smaller than 0?
SELECT MAX("Losses") FROM table_66656 WHERE "Draws" < '0'
wikisql
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId ...
My Close Votes for Tag X.
SELECT p.Id AS "post_link", c.CreationDate, Tags FROM Comments AS c JOIN Posts AS p ON c.PostId = p.Id WHERE c.Text LIKE '%voting to close%' AND (Tags LIKE '%<email>%' OR Tags LIKE '%<spam>%') AND c.UserId = '##UserId##'
sede
CREATE TABLE table_name_69 ( away_captain VARCHAR, result VARCHAR )
Name the away captain with result of wi by 9 wkts
SELECT away_captain FROM table_name_69 WHERE result = "wi by 9 wkts"
sql_create_context
CREATE TABLE program ( Program_ID int, Name text, Origin text, Launch real, Owner text ) CREATE TABLE channel ( Channel_ID int, Name text, Owner text, Share_in_percent real, Rating_in_percent real ) CREATE TABLE broadcast ( Channel_ID int, Program_ID int, Time_of_da...
Draw a bar chart of owner versus total number of rating in percent, and display in ascending by the X.
SELECT Owner, SUM(Rating_in_percent) FROM channel GROUP BY Owner ORDER BY Owner
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
How many patients admitted to the hospital before 2139 had a lab test base excess?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2139" AND lab.label = "Base Excess"
mimicsql_data
CREATE TABLE table_name_6 ( date VARCHAR, score VARCHAR )
Which date has a score of 2-1?
SELECT date FROM table_name_6 WHERE score = "2-1"
sql_create_context
CREATE TABLE table_1342370_41 ( result VARCHAR, incumbent VARCHAR )
What was the result in the election where the incumbent was Finis J. Garrett?
SELECT result FROM table_1342370_41 WHERE incumbent = "Finis J. Garrett"
sql_create_context
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time...
show me all flights from SAN DIEGO to LOS ANGELES
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 = 'SAN DIEGO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LOS ...
atis
CREATE TABLE table_15081939_4 ( swimsuit VARCHAR, evening_gown VARCHAR )
What is the swimsuit score for the item that has 7.61 as evening gown
SELECT swimsuit FROM table_15081939_4 WHERE evening_gown = "7.61"
sql_create_context
CREATE TABLE table_name_58 ( friendly VARCHAR, germany VARCHAR )
What is the friendly game for Germany of France?
SELECT friendly FROM table_name_58 WHERE germany = "france"
sql_create_context
CREATE TABLE table_54586 ( "Player" text, "Height" text, "School" text, "Hometown" text, "College" text, "NBA Draft" text )
What is the NBA draft result of the player from Washington, DC?
SELECT "NBA Draft" FROM table_54586 WHERE "Hometown" = 'washington, dc'
wikisql
CREATE TABLE table_name_62 ( points VARCHAR, difference VARCHAR, drawn VARCHAR )
How many points have a difference of 23, with a drawn less than 5?
SELECT COUNT(points) FROM table_name_62 WHERE difference = "23" AND drawn < 5
sql_create_context
CREATE TABLE table_name_65 ( score VARCHAR, dance VARCHAR, result VARCHAR )
What was the score of the team that danced a jive and was safe?
SELECT score FROM table_name_65 WHERE dance = "jive" AND result = "safe"
sql_create_context
CREATE TABLE table_79857 ( "Title" text, "Producer(s)" text, "Artist(s)" text, "Time" text, "Team(s)" text )
Who produced 'Fast Life'?
SELECT "Producer(s)" FROM table_79857 WHERE "Title" = 'fast life'
wikisql
CREATE TABLE table_2850912_12 ( player VARCHAR, college_junior_club_team VARCHAR )
List the players for team bryn s if (sweden).
SELECT player FROM table_2850912_12 WHERE college_junior_club_team = "Brynäs IF (Sweden)"
sql_create_context
CREATE TABLE table_13869651_3 ( frequency VARCHAR, part_number_s_ VARCHAR )
What is the frequency of the model whose part number is ado520biaa5do?
SELECT frequency FROM table_13869651_3 WHERE part_number_s_ = "ADO520BIAA5DO"
sql_create_context
CREATE TABLE table_14875671_1 ( attendance INTEGER, week VARCHAR )
What was the attendance in week 8?
SELECT MAX(attendance) FROM table_14875671_1 WHERE week = 8
sql_create_context
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,...
For those employees who did not have any job in the past, a bar chart shows the distribution of job_id and the amount of job_id , and group by attribute job_id, could you show X-axis in desc order?
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
CREATE TABLE table_name_75 ( insurgents VARCHAR, civilians VARCHAR )
Name the insurgents for civilians being 49
SELECT insurgents FROM table_name_75 WHERE civilians = "49"
sql_create_context
CREATE TABLE table_38374 ( "Issue Date" real, "Album Title" text, "Artist" text, "Sales" real, "Highest Position" real )
What is the highest position Talk on Corners, which had an issue date greater than 1, had?
SELECT COUNT("Highest Position") FROM table_38374 WHERE "Album Title" = 'talk on corners' AND "Issue Date" > '1'
wikisql
CREATE TABLE table_35810 ( "Year" real, "Class" text, "Team" text, "Points" real, "Rank" text, "Wins" real )
What is the average number of points for a team in the 250cc class with fewer than 0 wins?
SELECT AVG("Points") FROM table_35810 WHERE "Class" = '250cc' AND "Wins" < '0'
wikisql
CREATE TABLE table_name_41 ( club_province VARCHAR, player VARCHAR )
Which Club/province has a Player of david penalva?
SELECT club_province FROM table_name_41 WHERE player = "david penalva"
sql_create_context
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE prescriptions ( row_id number, subject_id number,...
how many prescriptions of bengay until 3 years ago are there?
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'bengay' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-3 year')
mimic_iii
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...
what is the number of patients whose drug code is quin20 and lab test fluid is other body fluid?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "QUIN20" AND lab.fluid = "Other Body Fluid"
mimicsql_data
CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station_id INTEGER, bike_id INTEGER, subscription_type TEXT, zip_code INTEGER ) CREATE TABLE status ( station_i...
What are the dates with a maximum temperature higher than 85, and count them by a bar chart, list in asc by the y axis.
SELECT date, COUNT(date) FROM weather WHERE max_temperature_f > 85 ORDER BY COUNT(date)
nvbench
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 the race class and number of races in each class with a bar chart.
SELECT Class, COUNT(*) FROM race GROUP BY Class
nvbench
CREATE TABLE table_28838 ( "Place" real, "Nation" text, "played" real, "won" real, "drawn" real, "lost" real, "for" real, "against" real, "difference" real, "Table points" real )
What is the nation when the for is 326?
SELECT "Nation" FROM table_28838 WHERE "for" = '326'
wikisql
CREATE TABLE table_65543 ( "Rank" real, "Rowers" text, "Country" text, "Time" text, "Notes" text )
Who are the rowers with the time of 5:54.57?
SELECT "Rowers" FROM table_65543 WHERE "Time" = '5:54.57'
wikisql
CREATE TABLE table_name_39 ( goal INTEGER, result VARCHAR )
What is the top goal for the result of 2 3?
SELECT MAX(goal) FROM table_name_39 WHERE result = "2–3"
sql_create_context
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE city ( city_code varchar, city_name varchar, ...
what kind of airplane goes from BOSTON to SAN FRANCISCO before 1200
SELECT DISTINCT aircraft.aircraft_code FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.departure_time < 1200 AND f...
atis
CREATE TABLE table_67768 ( "Film" text, "Director(s)" text, "Producer(s)" text, "Recipient" text, "Date" text, "Award" text )
Who was the director of the film that Sister Films received an award for on 2/3/05?
SELECT "Director(s)" FROM table_67768 WHERE "Date" = '2/3/05' AND "Recipient" = 'sister films'
wikisql
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE flight_leg ( flight_id int, ...
what is the cheapest flight from LONG BEACH to MEMPHIS
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, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'LONG BEACH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CIT...
atis
CREATE TABLE table_37294 ( "7:00" text, "7:30" text, "8:00" text, "8:30" text, "9:00" text, "10:00" text, "10:30" text )
Which 7:00 has an 8:00 of la soir e du hockey?
SELECT "7:00" FROM table_37294 WHERE "8:00" = 'la soirée du hockey'
wikisql
CREATE TABLE domain ( did int, name varchar ) CREATE TABLE publication ( abstract varchar, cid int, citation_num int, jid int, pid int, reference_num int, title varchar, year int ) CREATE TABLE keyword ( keyword varchar, kid int ) CREATE TABLE conference ( cid int,...
return me the total citations of papers in the VLDB conference in 2005 .
SELECT SUM(publication.citation_num) FROM conference, publication WHERE conference.name = 'VLDB' AND publication.cid = conference.cid AND publication.year = 2005
academic
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE...
Bar chart x axis nationality y axis how many nationality, and list in descending by the Y-axis.
SELECT Nationality, COUNT(Nationality) FROM swimmer GROUP BY Nationality ORDER BY COUNT(Nationality) DESC
nvbench
CREATE TABLE table_6085 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What was the date of the game when St. Louis was the home team?
SELECT "Date" FROM table_6085 WHERE "Home" = 'st. louis'
wikisql
CREATE TABLE gyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
从2007年6月11日到2021年9月4日,科室5788因酒精性肝硬化住院产生了多少平均费用?
SELECT AVG(zyb.MED_CLINIC_ID) FROM zyb WHERE zyb.MED_ORG_DEPT_NM = '5788' AND zyb.IN_HOSP_DAYS BETWEEN '2007-06-11' AND '2021-09-04' AND zyb.IN_HOSP_DATE = '酒精性肝硬化'
css
CREATE TABLE table_25479607_3 ( fixed_charge___rs__kwh_ VARCHAR, unit__kwh__time_range VARCHAR )
What is the fixed charge for the user with a unit/time range of i-2: peak (18:30-22:30)?
SELECT fixed_charge___rs__kwh_ FROM table_25479607_3 WHERE unit__kwh__time_range = "I-2: Peak (18:30-22:30)"
sql_create_context
CREATE TABLE table_78906 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
What is the average total in 1969?
SELECT AVG("Total") FROM table_78906 WHERE "Year(s) won" = '1969'
wikisql
CREATE TABLE table_11677691_4 ( school VARCHAR, hometown VARCHAR )
How many players' hometown was Akron, Ohio?
SELECT COUNT(school) FROM table_11677691_4 WHERE hometown = "Akron, Ohio"
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 patient ( uniquep...
when did patient 005-12192 first receive a prescription for calcium gluconate 100 mg/ml (10 %) iv : 10 ml?
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-12192')) AND medication.drugname = 'calcium gluconate 100 ...
eicu
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE...
what does a pros repair atria def-cl cost?
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'procedures_icd' AND cost.event_id IN (SELECT procedures_icd.row_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'pros repair atria def-cl'))
mimic_iii
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) 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(2...
For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of last_name and salary .
SELECT LAST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE table_16771 ( "Race Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Constructor" text, "Report" text )
Who won the Modena circuit?
SELECT "Winning driver" FROM table_16771 WHERE "Circuit" = 'Modena'
wikisql
CREATE TABLE table_test_5 ( "id" int, "systemic_lupus_erythematosus" bool, "anemia" bool, "gender" string, "pregnancy_or_lactation" bool, "serum_potassium" float, "hemoglobin_a1c_hba1c" float, "heart_disease" bool, "renal_disease" bool, "creatinine_clearance_cl" float, "estim...
global lvef between 30 and 45 % .
SELECT * FROM table_test_5 WHERE global_lvef >= 30 AND global_lvef <= 45
criteria2sql
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description...
Users by badges by badge category?.
WITH linqbadges AS (SELECT RANK() OVER (PARTITION BY b.UserId ORDER BY b.Date) AS rn, b.UserId, b.Date, b.Name FROM Badges AS b WHERE b.Name = 'Necromancer') SELECT u.DisplayName, linqbadges.Date AS date_earned, CASE rn WHEN 1 THEN 'bronze linq' WHEN 2 THEN 'silver linq' WHEN 3 THEN 'gold linq' END AS badge, linqbadges...
sede
CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) ...
Show me about the distribution of meter_300 and ID in a bar chart, could you show by the Y-axis in asc?
SELECT meter_300, ID FROM swimmer ORDER BY ID
nvbench
CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int ) CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text )
Show me the comparison of the total number of all ships' nationalities with a bar graph, and I want to sort in desc by the x axis.
SELECT Nationality, COUNT(Nationality) FROM ship GROUP BY Nationality ORDER BY Nationality DESC
nvbench
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...
when was the last time on this hospital visit that patient 007-849 was prescribed medication?
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-849' AND patient.hospitaldischargetime IS NULL)) ORDER BY ...
eicu
CREATE TABLE table_10728 ( "Player" text, "Position" text, "School" text, "Hometown" text, "College" text )
What college did hunter henry go to?
SELECT "College" FROM table_10728 WHERE "Player" = 'hunter henry'
wikisql
CREATE TABLE table_name_52 ( record VARCHAR, opponent VARCHAR )
What is the team's record in games against the Hartford Whalers?
SELECT record FROM table_name_52 WHERE opponent = "hartford whalers"
sql_create_context
CREATE TABLE table_204_144 ( id number, "represent" number, "contestant" text, "age" number, "height" text, "hometown" text )
name each contestant whose age is 21 ?
SELECT "contestant" FROM table_204_144 WHERE "age" = 21
squall
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...
provide the number of patients whose drug code is warf1 and lab test fluid is pleural.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "WARF1" AND lab.fluid = "Pleural"
mimicsql_data
CREATE TABLE table_204_649 ( id number, "rank" number, "name" text, "image" number, "height\nft (m)" text, "floors" number, "year" number, "notes" text )
what is the difference in height between key tower and 55 public square
SELECT ABS((SELECT "height\nft (m)" FROM table_204_649 WHERE "name" = 'key tower') - (SELECT "height\nft (m)" FROM table_204_649 WHERE "name" = '55 public square'))
squall
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREAT...
what times does the late afternoon flight leave from WASHINGTON for DENVER
SELECT DISTINCT flight.departure_time 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 = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name ...
atis
CREATE TABLE table_71139 ( "Year" real, "Tournament" text, "Venue" text, "Result" text, "Event" text )
What tournament was after 2009?
SELECT "Tournament" FROM table_71139 WHERE "Year" > '2009'
wikisql
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE offering_i...
Will the NURS 556 course be offered in Spring-Summer 2002 ?
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'NURS' AND course.number = 556 AND semester.semester = 'Spring-Summer' AND semester.semester_id = course_offering.semester AND semester.year = 2002
advising
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
自二零零三年十二月二十七日开始,截止到二零一九年一月二十九日,看看参保人吴莹华单一药品最大的购买次数共发生过多少次
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '吴莹华' AND t_kc22.STA_DATE BETWEEN '2003-12-27' AND '2019-01-29' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE table_18946749_1 ( prominence__m_ INTEGER, peak VARCHAR )
When mount gauttier is the peak what is the highest prominence in meters?
SELECT MAX(prominence__m_) FROM table_18946749_1 WHERE peak = "Mount Gauttier"
sql_create_context
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
哪些药品供患有胃炎的患者开出,查一下编号和名称
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.IN_DIAG_DIS_NM = '胃炎'
css
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...
how many patients staying in the hospital for more than 20 days had the procedure under icd9 code 9907?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "20" AND procedures.icd9_code = "9907"
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...
same question favoritred multiple times by same user.
SELECT PostId AS "post_link", UserId AS "user_link", COUNT(*) AS "duplication_level" FROM Votes WHERE VoteTypeId = 5 GROUP BY PostId, UserId HAVING COUNT(*) > 1 ORDER BY COUNT(*) DESC
sede
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
what is the maximum hospital cost that involves a procedure known as a esophagogastroduodenoscopy in 2105?
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'esophagogastroduodenoscopy')) AND STRFTIME('...
eicu
CREATE TABLE table_name_3 ( overall VARCHAR, name VARCHAR, round VARCHAR )
Name of calvin o'neal, and a Round smaller than 6 had what number total overall?
SELECT COUNT(overall) FROM table_name_3 WHERE name = "calvin o'neal" AND round < 6
sql_create_context
CREATE TABLE table_name_18 ( common_name VARCHAR, color VARCHAR )
What is the common name for the creature with darker colors?
SELECT common_name FROM table_name_18 WHERE color = "darker colors"
sql_create_context
CREATE TABLE table_22048 ( "Team" text, "Average" text, "Points" real, "Played" real, "1988-89" text, "1989-90" text, "1990-1991" real )
What was the team that scored 122 points?
SELECT "Team" FROM table_22048 WHERE "Points" = '122'
wikisql
CREATE TABLE table_2803106_1 ( dance_song VARCHAR, total VARCHAR )
What dance had a score total of 31?
SELECT dance_song FROM table_2803106_1 WHERE total = "31"
sql_create_context
CREATE TABLE table_38958 ( "Player" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real )
Which Extra points is the lowest one that has a Player of ross kidston, and Points smaller than 5?
SELECT MIN("Extra points") FROM table_38958 WHERE "Player" = 'ross kidston' AND "Points" < '5'
wikisql
CREATE TABLE table_10476 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time/Retired" text, "Grid" real )
How many laps have a Time/Retired of +1:35.553?
SELECT COUNT("Laps") FROM table_10476 WHERE "Time/Retired" = '+1:35.553'
wikisql
CREATE TABLE table_57991 ( "Player" text, "Car." real, "Yards" real, "Avg." real, "TD's" real, "Long" real )
How many yards did kevin swayne average, with a long carry over 7?
SELECT MIN("Avg.") FROM table_57991 WHERE "Player" = 'kevin swayne' AND "Long" > '7'
wikisql
CREATE TABLE table_name_15 ( date VARCHAR, score VARCHAR )
What was the date of the game with a score of 15 6?
SELECT date FROM table_name_15 WHERE score = "15–6"
sql_create_context
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
编号01352770在2014年10月3日到2016年4月14日期间所在检验所有结果指标记录中的仪器编号以及名称都是啥?
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH ...
css
CREATE TABLE table_11239 ( "Date" text, "Visiting Team" text, "Final Score" text, "Host Team" text, "Stadium" text )
Who was the host team at Louisiana Superdome when the final score was 10-20?
SELECT "Host Team" FROM table_11239 WHERE "Stadium" = 'louisiana superdome' AND "Final Score" = '10-20'
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Descr...
Users with the Highest Score in a Tag with at Least X Answers.
SELECT ROW_NUMBER() OVER (ORDER BY Score DESC) AS Rank, Id AS "user_link", Score, 'count' AS TotalAnswers, Average FROM (SELECT u.Id, SUM(a.Score) AS Score, COUNT(a.Score) AS "Count", AVG(a.Score) AS Average FROM Posts AS q INNER JOIN Posts AS a ON q.Id = a.ParentId INNER JOIN PostTags AS pt ON q.Id = pt.PostId INNER J...
sede
CREATE TABLE table_name_57 ( blank_ends VARCHAR, shot_pct VARCHAR, stolen_ends VARCHAR, skip VARCHAR )
What is the number of blank ends when the stolen ends were 17 and Jennifer Jones was skipped with a more than 83 shot pct?
SELECT COUNT(blank_ends) FROM table_name_57 WHERE stolen_ends = 17 AND skip = "jennifer jones" AND shot_pct > 83
sql_create_context
CREATE TABLE table_79865 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
Round larger than 6, and a Pick # smaller than 25, and a College of southern Illinois has what position?
SELECT "Position" FROM table_79865 WHERE "Round" > '6' AND "Pick #" < '25' AND "College" = 'southern illinois'
wikisql
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TA...
Which classes are prerequisites for most other classes and available this semester ?
SELECT COUNT(DISTINCT course_prerequisite.course_id), course.department, course.name, course.number FROM course, course_offering, course_prerequisite, semester WHERE course.course_id = course_offering.course_id AND course.course_id = course_prerequisite.pre_course_id AND course.department = 'EECS' AND semester.semester...
advising
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
了解一下29461728这个病人的上臂各项指标检验的结果
SELECT * FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '29461728' AND jyjgzbb.jybgb_BBCJBW = '上臂' UNION SELECT * FR...
css