context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_67932 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
On what date was the opponent the White Sox and the record 18-13?
SELECT "Date" FROM table_67932 WHERE "Opponent" = 'white sox' AND "Record" = '18-13'
wikisql
CREATE TABLE table_42479 ( "Name" text, "GP-GS" text, "Effic" real, "Att-Cmp-Int" text, "Avg/G" real )
What is the lowest avg/g that has an effic greater than 34.36, with wesley carroll as the name?
SELECT MIN("Avg/G") FROM table_42479 WHERE "Effic" > '34.36' AND "Name" = 'wesley carroll'
wikisql
CREATE TABLE table_name_95 ( league_cup INTEGER, player VARCHAR )
What is the highest League Cup with a Player that is steed malbranque?
SELECT MAX(league_cup) FROM table_name_95 WHERE player = "steed malbranque"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom te...
what is the amount of phenytoin sodium prescribed to patient 32168 totally until 47 months ago?
SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 32168) AND prescriptions.drug = 'phenytoin sodium' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-47 month')
mimic_iii
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE T...
shortest morning flights from CINCINNATI to TAMPA
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 = 'CINCINNATI' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'T...
atis
CREATE TABLE table_11797 ( "Team" text, "Seasons" text, "Regular season" real, "Tournament" real, "Total" real )
Name the highest total for the tournament more than 0 and regular season after 8
SELECT MAX("Total") FROM table_11797 WHERE "Tournament" > '0' AND "Regular season" > '8'
wikisql
CREATE TABLE table_2147588_4 ( successor VARCHAR, district VARCHAR )
When new york 8th is teh district who is the successor?
SELECT successor FROM table_2147588_4 WHERE district = "New York 8th"
sql_create_context
CREATE TABLE table_name_17 ( away_team VARCHAR, home_team VARCHAR )
Who was the away team when North Melbourne was the home team?
SELECT away_team FROM table_name_17 WHERE home_team = "north melbourne"
sql_create_context
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
在编号为3373155的医院中,55748768病患在科室名有推拿的科室的就诊记录流水号有哪些
SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '55748768' AND hz_info.YLJGDM = '3373155' AND mzjzjlb.JZKSMC LIKE '%推拿%'
css
CREATE TABLE table_46602 ( "Tournament" text, "1983" text, "1984" text, "1985" text, "1986" text, "1987" text, "1988" text, "1989" text, "1990" text, "Career SR" text )
What is the 1989 result for the tournament that had a 1983 and 1987 result of A?
SELECT "1989" FROM table_46602 WHERE "1983" = 'a' AND "1987" = 'a'
wikisql
CREATE TABLE table_18180 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What is the first election year listed?
SELECT MIN("First elected") FROM table_18180
wikisql
CREATE TABLE table_65187 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
what is the to par for mathew goggin?
SELECT "To par" FROM table_65187 WHERE "Player" = 'mathew goggin'
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number...
Questions you've answered, by view count.
SELECT q.Id AS "post_link", q.ViewCount, q.CreationDate AS "asked", a.CreationDate AS "answered" FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE a.OwnerUserId = '##user##' ORDER BY q.ViewCount DESC
sede
CREATE TABLE table_name_93 ( races INTEGER, pole VARCHAR, season VARCHAR, flaps VARCHAR, podiums VARCHAR )
WHAT ARE THE RACES WHEN FLAPS ARE ZERO, PODIUMS ARE LARGER THAN 0, SEASON IS 2008, AND POLE SMALLER THAN 1?
SELECT SUM(races) FROM table_name_93 WHERE flaps = 0 AND podiums > 0 AND season = "2008" AND pole < 1
sql_create_context
CREATE TABLE betfront ( year number, datetime time, country text, competion text, match text, home_opening number, draw_opening number, away_opening number, home_closing number, draw_closing number, away_closing number ) CREATE TABLE football_data ( season text, date...
How many matches did Pinnacle have betting records?
SELECT COUNT(*) FROM football_data WHERE psh <> "" AND psd <> "" AND psa <> ""
worldsoccerdatabase
CREATE TABLE table_71763 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real )
What is the qual with 200 laps and a rank of 27?
SELECT "Qual" FROM table_71763 WHERE "Laps" = '200' AND "Rank" = '27'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication (...
tell me whether patient 002-13643 been prescribed albumin human 25% since 75 months ago?
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-13643')) AND medication.drugname = 'albumin human 25%' AND DATETIME(me...
eicu
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( ...
tell me the age of patient jerry deberry.
SELECT demographic.age FROM demographic WHERE demographic.name = "Jerry Deberry"
mimicsql_data
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program ( program_id int, name v...
For next Winter , who will teach the Core classes ?
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr...
advising
CREATE TABLE table_name_38 ( location VARCHAR, team VARCHAR )
Where is Dynamo-2 located?
SELECT location FROM table_name_38 WHERE team = "dynamo-2"
sql_create_context
CREATE TABLE table_38525 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Gold that has a Rank of 6, and a Bronze larger than 0 had what total number of gold?
SELECT COUNT("Gold") FROM table_38525 WHERE "Rank" = '6' AND "Bronze" > '0'
wikisql
CREATE TABLE table_16376436_1 ( college VARCHAR, position VARCHAR )
What college did the defensive back attend?
SELECT college FROM table_16376436_1 WHERE position = "Defensive Back"
sql_create_context
CREATE TABLE Ref_document_types ( document_type_name VARCHAR, document_type_description VARCHAR, document_type_code VARCHAR )
What is the name and description for document type code RV?
SELECT document_type_name, document_type_description FROM Ref_document_types WHERE document_type_code = "RV"
sql_create_context
CREATE TABLE table_174266_6 ( one_year INTEGER, two_years VARCHAR )
If two years is 159, what is the amount for one year?
SELECT MIN(one_year) FROM table_174266_6 WHERE two_years = 159
sql_create_context
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 different types of ships and the number of ships of each type with a pie chart.
SELECT Type, COUNT(*) FROM ship GROUP BY Type
nvbench
CREATE TABLE table_name_90 ( date VARCHAR, week VARCHAR, attendance VARCHAR )
When was the attendance less than 44,851 during the first 4 weeks of the season?
SELECT date FROM table_name_90 WHERE week < 4 AND attendance = "44,851"
sql_create_context
CREATE TABLE table_204_129 ( id number, "place" number, "team" text, "titles" number, "runners-up" number, "winning years" text )
how many teams won at least 1 title ?
SELECT COUNT("team") FROM table_204_129 WHERE "titles" >= 1
squall
CREATE TABLE table_43097 ( "Week" real, "Date" text, "Opponent" text, "Time" text, "Game Site" text, "Result/Score" text, "Record" text, "Match Report" text )
Which match report has l 7-30 as the result/score?
SELECT "Match Report" FROM table_43097 WHERE "Result/Score" = 'l 7-30'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
count the number of patients whose diagnoses long title is sepsis and drug route is ed?
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.long_title = "Sepsis" AND prescriptions.route = "ED"
mimicsql_data
CREATE TABLE table_name_40 ( kicks VARCHAR, goals VARCHAR )
Name the kicks with goals of 1
SELECT kicks FROM table_name_40 WHERE goals = "1"
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 procedures ( ...
give me the number of patients whose marital status is married and year of birth is less than 2064?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.dob_year < "2064"
mimicsql_data
CREATE TABLE table_name_49 ( to_par VARCHAR, country VARCHAR )
What is the to par for japan
SELECT to_par FROM table_name_49 WHERE country = "japan"
sql_create_context
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, ...
Average Post Length for Users with at least 10,000 Rep.
SELECT p.OwnerUserId, u.DisplayName, AVG(LENGTH(p.Body)) AS AvgLen FROM Posts AS p INNER JOIN Users AS u ON u.Id = p.OwnerUserId WHERE u.Reputation >= 10000 GROUP BY p.OwnerUserId, u.DisplayName ORDER BY AvgLen DESC
sede
CREATE TABLE MediaType ( MediaTypeId integer, Name varchar(120) ) CREATE TABLE Genre ( GenreId integer, Name varchar(120) ) CREATE TABLE Playlist ( PlaylistId integer, Name varchar(120) ) CREATE TABLE Customer ( CustomerId integer, FirstName varchar(40), LastName varchar(20), ...
What are the number of the invoice dates for customers with the first name Astrid and the last name Gruber?, and order from high to low by the Y-axis.
SELECT InvoiceDate, COUNT(InvoiceDate) FROM Customer AS T1 JOIN Invoice AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.FirstName = "Astrid" AND LastName = "Gruber" ORDER BY COUNT(InvoiceDate) DESC
nvbench
CREATE TABLE Settlements ( Settlement_ID INTEGER, Claim_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER, Customer_Policy_ID INTEGER ) CREATE TABLE Customer_Policies ( Policy_ID INTEGER, Customer_ID INTEGER, Policy_Type_Co...
Bin the claim date into the Year interval and count them for visualizing a bar chart, could you list Y-axis in ascending order please?
SELECT Date_Claim_Made, COUNT(Date_Claim_Made) FROM Settlements ORDER BY COUNT(Date_Claim_Made)
nvbench
CREATE TABLE claim_headers ( claim_header_id number, claim_status_code text, claim_type_code text, policy_id number, date_of_claim time, date_of_settlement time, amount_claimed number, amount_piad number ) CREATE TABLE staff ( staff_id number, staff_details text ) CREATE TABLE ...
Which customer have the most policies? Give me the customer details.
SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id GROUP BY t2.customer_details ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_24775967_1 ( notability_profession VARCHAR, season VARCHAR, finish VARCHAR )
What was the profession of the celebrity who was featured on season 15 and finished 7th place?
SELECT notability_profession FROM table_24775967_1 WHERE season = 15 AND finish = "7th"
sql_create_context
CREATE TABLE table_7146 ( "Year" real, "Artist" text, "Album" text, "Label" text, "Credit" text )
What album had the reunion label in 2006?
SELECT "Album" FROM table_7146 WHERE "Label" = 'reunion' AND "Year" = '2006'
wikisql
CREATE TABLE table_name_15 ( week_7_oct_12 VARCHAR, week_11_nov_9 VARCHAR )
Which Week 7 Oct 12 has a Week 11 Nov 9 of week 11 nov 9?
SELECT week_7_oct_12 FROM table_name_15 WHERE week_11_nov_9 = "week 11 nov 9"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
calculate the average age of patients with copd exacerbation primary disease who died before the year 2158.
SELECT AVG(demographic.age) FROM demographic WHERE demographic.diagnosis = "COPD EXACERBATION" AND demographic.dod_year < "2158.0"
mimicsql_data
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE prescriptions ( row_id number, subject_id number, h...
when was patient 3929 prescribed a medication during their current hospital visit for the last time via the po/ng route?
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3929 AND admissions.dischtime IS NULL) AND prescriptions.route = 'po/ng' ORDER BY prescriptions.startdate DESC LIMIT 1
mimic_iii
CREATE TABLE table_name_85 ( home VARCHAR, visitor VARCHAR )
Who was the home team that played the Lakers?
SELECT home FROM table_name_85 WHERE visitor = "lakers"
sql_create_context
CREATE TABLE d_icd_procedures ( 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 TABL...
what were the three most frequent procedures that patients received within 2 months after the diagnosis of wbc disease nec?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissi...
mimic_iii
CREATE TABLE table_31029 ( "Song 1 title" text, "Artist 1" text, "Song 2 title" text, "Artist 2" text, "Mix artist" text, "Venue" text, "Battle Mix?" text, "Setlist" text )
Who is the artist 2 on the setlist where the artist 1 is Sparfunk & D-Code?
SELECT "Artist 2" FROM table_31029 WHERE "Artist 1" = 'Sparfunk & D-Code'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE...
what was the time of the last bicarbonate lab test of patient 24118 when they came to the hospital last time?
SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bicarbonate') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24118 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime...
mimic_iii
CREATE TABLE table_name_44 ( year INTEGER, country VARCHAR )
What is the earliest year of a film from Mexico?
SELECT MIN(year) FROM table_name_44 WHERE country = "mexico"
sql_create_context
CREATE TABLE table_203_499 ( id number, "place" text, "player" text, "country" text, "score" text, "to par" number, "money ($)" number )
what is the average score of the players from the united states ?
SELECT AVG("score") FROM table_203_499 WHERE "country" = 'united states'
squall
CREATE TABLE table_name_68 ( player VARCHAR, hometown VARCHAR )
Which player is from Tampa, Florida?
SELECT player FROM table_name_68 WHERE hometown = "tampa, florida"
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
what is the average age of patients whose marital status is single and primary disease is sepsis?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.diagnosis = "SEPSIS"
mimicsql_data
CREATE TABLE person ( name text, age number, city text, gender text, job text ) CREATE TABLE personfriend ( name text, friend text, year number )
What are the names of the people who are older 40 but no friends under age 30?
SELECT T1.name FROM person AS T1 JOIN personfriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM person WHERE age > 40) EXCEPT SELECT T1.name FROM person AS T1 JOIN personfriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM person WHERE age < 30)
spider
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...
富马酸喹硫平片(薄膜)在医疗就诊60994450821中所属的三大目录类别都有哪些?
SELECT DIRE_TYPE FROM t_kc22 WHERE MED_CLINIC_ID = '60994450821' AND SOC_SRT_DIRE_NM = '富马酸喹硫平片(薄膜)'
css
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerU...
Highly viewed questions with no accepted answer.
SELECT p.ViewCount, p.Id AS "Post Id", p.Title, p.AnswerCount FROM Posts AS p WHERE p.PostTypeId = 1 AND p.AcceptedAnswerId IS NULL AND p.ClosedDate IS NULL AND p.CommunityOwnedDate IS NULL AND p.AnswerCount = 0 ORDER BY p.ViewCount DESC LIMIT 100
sede
CREATE TABLE table_name_65 ( term_in_office VARCHAR, electorate VARCHAR )
Which term in office has an Electorate of hinkler?
SELECT term_in_office FROM table_name_65 WHERE electorate = "hinkler"
sql_create_context
CREATE TABLE table_name_40 ( date_of_appointment VARCHAR, date_of_vacancy VARCHAR )
What is the appointment day for 4 December 2008 vacancy?
SELECT date_of_appointment FROM table_name_40 WHERE date_of_vacancy = "4 december 2008"
sql_create_context
CREATE TABLE table_50081 ( "Lane" real, "Name" text, "Country" text, "Mark" text, "React" real )
What is the lowest Lane, when Mark is 7.66?
SELECT MIN("Lane") FROM table_50081 WHERE "Mark" = '7.66'
wikisql
CREATE TABLE table_17335602_1 ( winning_score VARCHAR, tournament VARCHAR )
How many winning scores were there in the rr donnelley lpga founders cup?
SELECT COUNT(winning_score) FROM table_17335602_1 WHERE tournament = "RR Donnelley LPGA Founders Cup"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
how many patients whose lab test chart time is 2151-12-28 15:30:00?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.charttime = "2151-12-28 15:30:00"
mimicsql_data
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE ground...
i want to know the cheapest way to fly from DENVER to OAKLAND
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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1....
atis
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, ...
What is the availability of section MILSCI 301 between 11:00 and 1:00 ?
SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.end_time <= '1:00' AND course_offering.start_time >= '11:00' AND course.course_id = course_offering.course_id AND course.department = 'MILSCI' AND course.numb...
advising
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW te...
查看一下患者蒋夏彤在二零二一年十月二日到二零一七年八月六日内被开出的所有检验报告单的检验报告单号好嘛
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE person_info.XM = '蒋夏彤' AND jybg...
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
count the number of patients whose diagnosis short title is status autm crd dfbrltr and drug route is im.
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 = "Status autm crd dfbrltr" AND prescriptions.route = "IM"
mimicsql_data
CREATE TABLE table_name_31 ( team VARCHAR, league VARCHAR, year VARCHAR )
What team has a national league in 2001?
SELECT team FROM table_name_31 WHERE league = "national" AND year = 2001
sql_create_context
CREATE TABLE table_2665085_1 ( name VARCHAR, park VARCHAR )
How many parks are called mt. olympus
SELECT COUNT(name) FROM table_2665085_1 WHERE park = "Mt. Olympus"
sql_create_context
CREATE TABLE table_2508633_9 ( player VARCHAR, nfl_team VARCHAR, position VARCHAR )
How many players were the running back draft pick for the New England Patriots?
SELECT COUNT(player) FROM table_2508633_9 WHERE nfl_team = "New England Patriots" AND position = "Running back"
sql_create_context
CREATE TABLE table_40079 ( "Date" text, "Cover model" text, "Centerfold model" text, "Interview subject" text, "Pictorials" text )
Who was the Centerfold model in the issue in which the Interview subject was Paul Simon?
SELECT "Centerfold model" FROM table_40079 WHERE "Interview subject" = 'paul simon'
wikisql
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, ...
what is the yearly maximum intake of pe 24 fs ng that patient 3677 is getting until 11/04/2100?
SELECT MAX(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3677)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.labe...
mimic_iii
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE ReviewTaskResults ( Id number, Review...
Tag badges per question for each year (all classes, combined score).
SELECT YearBadges.Y, CAST(NumQuestions AS FLOAT) / CAST(BadgeScore AS FLOAT) AS Ratio FROM (SELECT SUM(CASE B.Class WHEN 1 THEN 10 WHEN 2 THEN 4 WHEN 3 THEN 1 END) AS BadgeScore, YEAR(Date) AS Y FROM Badges AS B WHERE B.TagBased = 1 AND B.Name = '##TagName##' AND YEAR(B.Date) < 2017 AND YEAR(B.Date) > 2008 GROUP BY YEA...
sede
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additio...
Which classes do n't have any labs ?
SELECT DISTINCT name, number FROM course WHERE department = 'EECS' AND has_lab = 'N'
advising
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE program_requirement ( program_id int...
In the Fall or Winter , what courses meet the Core requirement ?
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id...
advising
CREATE TABLE table_61508 ( "Date" text, "Opponent" text, "Site" text, "Result" text, "Attendance" text )
What Opponent has a Site of razorback stadium fayetteville, ar, and a Date of october 7, 1967?
SELECT "Opponent" FROM table_61508 WHERE "Site" = 'razorback stadium • fayetteville, ar' AND "Date" = 'october 7, 1967'
wikisql
CREATE TABLE table_7267 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What was the To par when the Score was 67-68=135?
SELECT "To par" FROM table_7267 WHERE "Score" = '67-68=135'
wikisql
CREATE TABLE table_40525 ( "Match No." text, "Home Team" text, "Score" text, "Away Team" text, "Attendance" text )
What is the score of match 15?
SELECT "Score" FROM table_40525 WHERE "Match No." = '15'
wikisql
CREATE TABLE table_name_60 ( d_45_o VARCHAR, d_41_√ VARCHAR )
What is the value of D 45 O, when the value of D 41 is r 41 ?
SELECT d_45_o FROM table_name_60 WHERE d_41_√ = "r 41 √"
sql_create_context
CREATE TABLE table_204_152 ( id number, "device" text, "type" text, "iops" text, "interface" text, "notes" text )
which is the only device to have the flash memory array note ?
SELECT "device" FROM table_204_152 WHERE "notes" = 'flash memory array'
squall
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,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the sum of manager_id over the hire_date bin hire_date by time, and sort in descending by the total number.
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(MANAGER_ID) DESC
nvbench
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) 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...
Bar graph to show meter_100 from different meter 700, and display x axis in desc order.
SELECT meter_700, meter_100 FROM swimmer ORDER BY meter_700 DESC
nvbench
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) 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...
看看被门诊诊断为疾病U99.814的患者柏志国的检测指标095190的结果定量是什么?单位又是什么
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_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...
css
CREATE TABLE table_18595004_7 ( tonioli VARCHAR, week__number VARCHAR )
How many sets of marks does Tonioli get in week 3?
SELECT COUNT(tonioli) FROM table_18595004_7 WHERE week__number = 3
sql_create_context
CREATE TABLE table_name_37 ( norwegian_title VARCHAR, pages VARCHAR, translated_title VARCHAR )
What Norwegian title has 218 pages and Translated Title of Breaking Dawn?
SELECT norwegian_title FROM table_name_37 WHERE pages = 218 AND translated_title = "breaking dawn"
sql_create_context
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
患者95900132在02年1月4日到14年9月24日内去了哪几个医院?
SELECT COUNT(DISTINCT MED_SER_ORG_NO) FROM t_kc21 WHERE PERSON_ID = '95900132' AND IN_HOSP_DATE BETWEEN '2002-01-04' AND '2014-09-24'
css
CREATE TABLE table_28719193_19 ( date VARCHAR, matchups_results VARCHAR )
What was the date of the game that had a result of Army 16, SMU 14?
SELECT date FROM table_28719193_19 WHERE matchups_results = "Army 16, SMU 14"
sql_create_context
CREATE TABLE table_3769 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text )
What was the latest number in series that was directed by Skip Sudduth?
SELECT MAX("No. in series") FROM table_3769 WHERE "Directed by" = 'Skip Sudduth'
wikisql
CREATE TABLE table_55576 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the score of the home team in the match at Western Oval?
SELECT "Home team score" FROM table_55576 WHERE "Venue" = 'western oval'
wikisql
CREATE TABLE table_16636344_1 ( league VARCHAR, year VARCHAR )
What was the team's league in 2010?
SELECT league FROM table_16636344_1 WHERE year = "2010"
sql_create_context
CREATE TABLE table_37375 ( "Position" text, "Number" real, "Name" text, "Height" text, "Weight" real, "Class" text, "Hometown" text, "Games\u2191" real )
How many games has number 61 played in?
SELECT MIN("Games\u2191") FROM table_37375 WHERE "Number" = '61'
wikisql
CREATE TABLE table_21091157_1 ( date VARCHAR, record VARCHAR )
Name the number of date for 1-0 record
SELECT COUNT(date) FROM table_21091157_1 WHERE record = "1-0"
sql_create_context
CREATE TABLE table_name_86 ( territory VARCHAR, channel VARCHAR )
Where is channel 83 broadcasted?
SELECT territory FROM table_name_86 WHERE channel = 83
sql_create_context
CREATE TABLE table_name_43 ( date VARCHAR, week VARCHAR )
What was the Date of Week 16?
SELECT date FROM table_name_43 WHERE week = 16
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 jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decima...
You can give me a bar chart, that groups and counts the country name, list in descending by the the number of country name.
SELECT COUNTRY_NAME, COUNT(COUNTRY_NAME) FROM countries GROUP BY COUNTRY_NAME ORDER BY COUNT(COUNTRY_NAME) DESC
nvbench
CREATE TABLE table_name_89 ( end_of_term VARCHAR, age_at_inauguration VARCHAR )
What is the End of term of the President with an Age at inauguration of 78years, 160days?
SELECT end_of_term FROM table_name_89 WHERE age_at_inauguration = "78years, 160days"
sql_create_context
CREATE TABLE table_39817 ( "Date" text, "Opponent" text, "Location" text, "Result" text, "Attendance" real )
What is the average Attendance at a game with a Result of w 30-23?
SELECT AVG("Attendance") FROM table_39817 WHERE "Result" = 'w 30-23'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepi...
how many times has patient 022-20829 been at the intensive care unit until 3 years ago?
SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-20829') AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-3 year')
eicu
CREATE TABLE table_name_14 ( the_tradition VARCHAR, year VARCHAR, senior_players_championship VARCHAR )
When Mark O'meara was the senior player champion in a year greater than 1998, who was the tradition?
SELECT the_tradition FROM table_name_14 WHERE year > 1998 AND senior_players_championship = "mark o'meara"
sql_create_context
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 text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
how many patients whose age is less than 74 and procedure short title is form cutan ileoureterost?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "74" AND procedures.short_title = "Form cutan ileoureterost"
mimicsql_data
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 do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of email and department_id , and order from low to high by the y-axis please.
SELECT EMAIL, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_ID
nvbench
CREATE TABLE table_36822 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text )
Which competition in Budapest, Hungary gave a result of 8th?
SELECT "Competition" FROM table_36822 WHERE "Position" = '8th' AND "Venue" = 'budapest, hungary'
wikisql
CREATE TABLE table_36240 ( "Team" text, "Location" text, "Venue" text, "Capacity" real, "Position in 2000" text )
Which Position in 2000 has a Capacity larger than 10,080, and a Venue of central, rechytsa?
SELECT "Position in 2000" FROM table_36240 WHERE "Capacity" > '10,080' AND "Venue" = 'central, rechytsa'
wikisql
CREATE TABLE table_name_78 ( time VARCHAR, distance VARCHAR, start_time VARCHAR )
What was the finishing time of the Stage that featured a distance of 24.00km and a start time of 21:27?
SELECT time FROM table_name_78 WHERE distance = "24.00km" AND start_time = "21:27"
sql_create_context
CREATE TABLE table_name_83 ( label VARCHAR, date VARCHAR )
What label released a record on December 19, 2001?
SELECT label FROM table_name_83 WHERE date = "december 19, 2001"
sql_create_context
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) 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...
在00年1月17日直到11年5月4日这一段时间,病患云天干内所有检验结果指标记录中的仪器编号以及名称分别叫什么?
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb 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 = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = j...
css