context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_6027 (
"Year" real,
"Round" text,
"Series" text,
"Games covered" text,
"Play-by-play" text,
"Colour commentator (s)" text
) | What Games covered had a round of divisional finals? | SELECT "Games covered" FROM table_6027 WHERE "Round" = 'divisional finals' | wikisql |
CREATE TABLE table_name_89 (
total INTEGER,
gold INTEGER
) | What is the lowest medal total with less than 3 gold medals? | SELECT MIN(total) FROM table_name_89 WHERE gold < 3 | sql_create_context |
CREATE TABLE table_47030 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is the record of the game with a game number greater than 24 on December 19? | SELECT "Record" FROM table_47030 WHERE "Game" > '24' AND "Date" = 'december 19' | wikisql |
CREATE TABLE table_name_38 (
set_2 VARCHAR,
set_1 VARCHAR
) | Set 1 of 25 20, what was Set 2? | SELECT set_2 FROM table_name_38 WHERE set_1 = "25–20" | sql_create_context |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number... | SELECT TOP 100 * From Posts. | SELECT * FROM Users LIMIT 1000000 | sede |
CREATE TABLE table_204_243 (
id number,
"year" number,
"album" text,
"song" text,
"duration" text,
"artist" text
) | what album was previous to one dream ? | SELECT "album" FROM table_204_243 WHERE id = (SELECT id FROM table_204_243 WHERE "song" = '"one dream"') - 1 | squall |
CREATE TABLE table_1341549_10 (
incumbent VARCHAR,
first_elected VARCHAR
) | Name the incumbent for 1954 | SELECT incumbent FROM table_1341549_10 WHERE first_elected = "1954" | sql_create_context |
CREATE TABLE table_name_99 (
tournament VARCHAR
) | What is 2011, when 2012 is 'A', and when Tournament is 'French Open'? | SELECT 2011 FROM table_name_99 WHERE 2012 = "a" AND tournament = "french open" | 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 sum of Team_ID , and group by attribute ACC_Road in a bar chart, show names in desc order. | SELECT ACC_Road, SUM(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road DESC | nvbench |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,... | count the number of times that patient 87530 has until 20 months ago had gastric nasogastric output. | SELECT COUNT(*) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 87530)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'gastric nasogastri... | mimic_iii |
CREATE TABLE prereq (
course_id varchar(8),
prereq_id varchar(8)
)
CREATE TABLE section (
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
building varchar(15),
room_number varchar(7),
time_slot_id varchar(4)
)
CREATE TABLE student (
ID varchar(5... | How many courses are provided in each year? Visualize with a line chart, and order x-axis in descending order. | SELECT year, COUNT(*) FROM section GROUP BY year ORDER BY year DESC | 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 stayed in hospital for more than 15 days and were diagnosed for respiratory distress syn? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "15" AND diagnoses.short_title = "Respiratory distress syn" | mimicsql_data |
CREATE TABLE table_1030 (
"Player" text,
"Position" text,
"Starter" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
) | was herb graver a starter? | SELECT "Starter" FROM table_1030 WHERE "Player" = 'Herb Graver' | wikisql |
CREATE TABLE table_32775 (
"Round" real,
"Overall" real,
"Player" text,
"Position" text,
"College" text
) | The safety position is represented in the draft by which colleges? | SELECT "College" FROM table_32775 WHERE "Position" = 'safety' | wikisql |
CREATE TABLE table_name_59 (
city VARCHAR,
icao VARCHAR
) | Which city has an ICAO of Kiah? | SELECT city FROM table_name_59 WHERE icao = "kiah" | sql_create_context |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Na... | Search for mysql_* functions are deprecated. | SELECT CONCAT('id', 'comment_link') FROM Comments WHERE Text LIKE 'mysql_*' | sede |
CREATE TABLE table_204_262 (
id number,
"rank" number,
"athlete" text,
"time" text,
"notes" text,
"q" text
) | what was the time of the person who finished first ? | SELECT "time" FROM table_204_262 WHERE "rank" = 1 | squall |
CREATE TABLE student (
stu_num number,
stu_lname text,
stu_fname text,
stu_init text,
stu_dob time,
stu_hrs number,
stu_class text,
stu_gpa number,
stu_transfer number,
dept_code text,
stu_phone text,
prof_num number
)
CREATE TABLE professor (
emp_num number,
dep... | How many different professors are there for the different schools? | SELECT COUNT(*), T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.school_code | spider |
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,
... | how many married patients had total calcium lab test? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.label = "Calcium, Total" | mimicsql_data |
CREATE TABLE table_58554 (
"Country" text,
"Interview" real,
"Swimsuit" real,
"Evening Gown" real,
"Average" real
) | What is the total swimsuit number with gowns larger than 9.48 with interviews larger than 8.94 in florida? | SELECT COUNT("Swimsuit") FROM table_58554 WHERE "Evening Gown" > '9.48' AND "Country" = 'florida' AND "Interview" > '8.94' | wikisql |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_fro... | what do you have from PHILADELPHIA to DALLAS on saturday morning | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((flight.departure_time BETWEEN 0 AND 1200) AND date_day.day_number = 26 AND date_day.month_number = 7 AND date_day.year = 1991 AND days.day_nam... | atis |
CREATE TABLE table_204_117 (
id number,
"season" number,
"level" text,
"division" text,
"section" text,
"position" text,
"movements" text
) | how many times did they finish above 5th place in division 2 tier 3 ? | SELECT COUNT(*) FROM table_204_117 WHERE "position" < 5 AND "division" = 2 AND "level" = 3 | squall |
CREATE TABLE table_name_98 (
result_f___a VARCHAR,
opponents VARCHAR
) | hat is the Result F A when they played against Leeds United? | SELECT result_f___a FROM table_name_98 WHERE opponents = "leeds united" | sql_create_context |
CREATE TABLE table_name_80 (
finish VARCHAR,
total VARCHAR
) | What was the finish of the player who had a total of 282? | SELECT finish FROM table_name_80 WHERE total = 282 | sql_create_context |
CREATE TABLE table_77015 (
"Round" real,
"Circuit" text,
"Date" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning Driver" text,
"Winning Team" text
) | On what date does Yuji Tachikawa have the fastest lap in round 1? | SELECT "Date" FROM table_77015 WHERE "Fastest Lap" = 'yuji tachikawa' AND "Round" = '1' | wikisql |
CREATE TABLE table_name_70 (
year INTEGER,
overall_pick VARCHAR,
name VARCHAR
) | What year was Jordan Hill picked overall number 8? | SELECT MIN(year) FROM table_name_70 WHERE overall_pick = "8" AND name = "jordan hill" | sql_create_context |
CREATE TABLE table_10051 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is the country with a 66-70-69=205 score? | SELECT "Country" FROM table_10051 WHERE "Score" = '66-70-69=205' | wikisql |
CREATE TABLE table_73708 (
"Model" text,
"Launch" text,
"Model Number" text,
"Code name" text,
"Fab ( nm )" text,
"Bus interface" text,
"Memory ( MiB )" text,
"Core clock ( MHz )" text,
"Memory clock ( MHz )" text,
"Config core 1" text,
"Pixel ( GP /s)" text,
"Texture ( G... | What is every bus type for the texture of fillrate? | SELECT "Bus type" FROM table_73708 WHERE "Texture ( GT /s)" = 'Fillrate' | wikisql |
CREATE TABLE table_14752049_1 (
country VARCHAR,
rank VARCHAR
) | Which country has a rank of 5? | SELECT country FROM table_14752049_1 WHERE rank = 5 | sql_create_context |
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
... | A bar chart about the number of last name for all female students whose sex is F, and rank in asc by the y-axis. | SELECT LName, COUNT(LName) FROM Student WHERE Sex = 'F' GROUP BY LName ORDER BY COUNT(LName) | nvbench |
CREATE TABLE table_name_68 (
date VARCHAR,
record VARCHAR
) | On what date did they have a record of 12-17? | SELECT date FROM table_name_68 WHERE record = "12-17" | sql_create_context |
CREATE TABLE table_27765443_2 (
cpu_type VARCHAR,
period_of_operation VARCHAR
) | Name the cpu type for june 2005 - april 2009 | SELECT cpu_type FROM table_27765443_2 WHERE period_of_operation = "June 2005 - April 2009" | sql_create_context |
CREATE TABLE table_204_928 (
id number,
"year" number,
"album" text,
"territory" text,
"label" text,
"notes" text
) | five and jezebel are apart of which label ? | SELECT "label" FROM table_204_928 WHERE "album" = 'five' | squall |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
ic... | how many patients received parenteral feeds - tpn treatment within 2 months after being diagnosed with coronary artery disease during the last year. | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'coronary artery disease' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), '... | eicu |
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 transfers (
row_id number,
subject_id number,
hadm_... | did patient 65124 receive hemorrhage complic proc diagnosis until 1 year ago? | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hemorrhage complic proc') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65124) AND DATETIME(diagnoses... | mimic_iii |
CREATE TABLE table_24584486_1 (
team VARCHAR,
points VARCHAR
) | What team was he on the year he had 38 points? | SELECT team FROM table_24584486_1 WHERE points = 38 | sql_create_context |
CREATE TABLE table_name_21 (
transfer_window VARCHAR,
moving_from VARCHAR
) | What was the transfer window with a moving from of fenerbah e? | SELECT transfer_window FROM table_name_21 WHERE moving_from = "fenerbahçe" | sql_create_context |
CREATE TABLE Subjects (
subject_id INTEGER,
subject_name VARCHAR(120)
)
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_of_completion DATETIME
)
CREATE TABLE Courses (
course_id INTEGER,
author... | Give me the comparison about author_tutor_ATB over the middle_name . | SELECT middle_name, author_tutor_ATB FROM Course_Authors_and_Tutors ORDER BY personal_name | nvbench |
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 hz_info (
KH text,
KLX number... | 在11-12-13到19-01-19期间内,患者凤飞尘被开出的所有检验报告单中的标本采集部位需要列出来 | SELECT jybgb.BBCJBW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 = jybgb.JZLSH_MZJZJLB AND mzjz... | css |
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 price for the lorazepam inj? | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'lorazepam inj') | eicu |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, give me the comparison about the average of revenue over the founder , and group by attribute founder, and I want to rank in descending by the x axis. | SELECT Founder, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder DESC | nvbench |
CREATE TABLE table_23293785_2 (
sf_round INTEGER,
country VARCHAR
) | What is the highest value for SF round for the country of England? | SELECT MAX(sf_round) FROM table_23293785_2 WHERE country = "England" | sql_create_context |
CREATE TABLE table_71457 (
"Entrant" text,
"Constructor" text,
"Chassis" text,
"Engine \u2020" text,
"Tyre" text,
"Driver" text,
"Rounds" text
) | Which tyre is on the car driven by Pedro de la Rosa? | SELECT "Tyre" FROM table_71457 WHERE "Driver" = 'pedro de la rosa' | wikisql |
CREATE TABLE table_name_35 (
total__000s_ VARCHAR,
germany VARCHAR
) | What was the amount of 000s when Germany had 16.6? | SELECT total__000s_ FROM table_name_35 WHERE germany = 16.6 | sql_create_context |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
... | During the Fall and Winter , what upper-level electives are offered ? | SELECT DISTINCT course.department, course.name, course.number 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.course_id WHERE (semester.semester = ... | advising |
CREATE TABLE table_32752 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the date of the game when the venue is MCG? | SELECT "Date" FROM table_32752 WHERE "Venue" = 'mcg' | wikisql |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
... | Questions & Answers with 'Thanks in advance'. | SELECT p.CreationDate, CASE WHEN (2 = p.PostTypeId) THEN 'Answer' ELSE 'Question' END AS PostType, p.Score, CASE WHEN (2 = p.PostTypeId) THEN t.Title ELSE p.Title END AS QuestionTitle, p.Body, p.Id AS "post_link" FROM Posts AS p LEFT OUTER JOIN Posts AS t ON (p.ParentId = t.Id) WHERE 1 = 1 AND p.CreationDate >= DATEADD... | sede |
CREATE TABLE table_2613 (
"Stage" real,
"Stage winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Malaysian rider classification" text,
"Team classification" text,
"Malaysian team classification" text
) | Which points classification has 4 as the stage? | SELECT "Points classification" FROM table_2613 WHERE "Stage" = '4' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime tim... | have patient 15125 been diagnosed with anything since 1 year ago? | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15125) AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-1 year') | mimic_iii |
CREATE TABLE table_204_793 (
id number,
"call-sign" text,
"location" text,
"rf" number,
"psip" number,
"programming" text
) | how many jstations have an rf of at least 29 ? | SELECT COUNT(*) FROM table_204_793 WHERE "rf" >= 29 | squall |
CREATE TABLE table_78262 (
"Date" text,
"Venue" text,
"Visitor" text,
"Score" text,
"Home" text,
"Montreal goals" text,
"Decision" text,
"Attendance" real,
"Series" text
) | What was the average attendance when the decision was price and montreal were the visitors? | SELECT AVG("Attendance") FROM table_78262 WHERE "Visitor" = 'montreal' AND "Decision" = 'price' | wikisql |
CREATE TABLE table_name_83 (
isolation__km_ INTEGER,
municipality VARCHAR,
elevation__m_ VARCHAR
) | What is the average Isolation in the municipality of Sunndal at an elevation of more than 1850? | SELECT AVG(isolation__km_) FROM table_name_83 WHERE municipality = "sunndal" AND elevation__m_ > 1850 | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
a... | how many times did patient 017-58432 have an intake of ns ivf on 11/07/last year? | SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-58432')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.ce... | eicu |
CREATE TABLE HOTELS (
other_hotel_details VARCHAR,
price_range VARCHAR
) | Show the details of the top 3 most expensive hotels. | SELECT other_hotel_details FROM HOTELS ORDER BY price_range DESC LIMIT 3 | sql_create_context |
CREATE TABLE table_name_6 (
location VARCHAR,
name VARCHAR
) | What is the Location for the newington international airport? | SELECT location FROM table_name_6 WHERE name = "newington international airport" | sql_create_context |
CREATE TABLE table_8997 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | What place had a score smaller than 74 and a par of e? | SELECT "Place" FROM table_8997 WHERE "Score" < '74' AND "To par" = 'e' | wikisql |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_s... | i'd like to see the flights from DENVER to PHILADELPHIA again | 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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADE... | atis |
CREATE TABLE table_46034 (
"Game" real,
"February" real,
"Opponent" text,
"Score" text,
"Record" text
) | What is the game number when the Toronto Maple Leafs were the opponent, and the February was less than 17? | SELECT AVG("Game") FROM table_46034 WHERE "Opponent" = 'toronto maple leafs' AND "February" < '17' | wikisql |
CREATE TABLE table_name_2 (
league VARCHAR,
reg_season VARCHAR
) | Tell me the league with a regular 1st season | SELECT league FROM table_name_2 WHERE reg_season = "1st" | sql_create_context |
CREATE TABLE table_4494 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the attendance when the VFL played Lake Oval? | SELECT COUNT("Crowd") FROM table_4494 WHERE "Venue" = 'lake oval' | wikisql |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
tr... | i'd like the cheapest one way fare from BOSTON to ATLANTA please | SELECT DISTINCT fare.fare_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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_... | atis |
CREATE TABLE table_name_61 (
director VARCHAR,
film_title_used_in_nomination VARCHAR
) | Who was the director of Small Voices, a film title used in nomination? | SELECT director FROM table_name_61 WHERE film_title_used_in_nomination = "small voices" | sql_create_context |
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_seaso... | Show the average price of each film in a bar chart, I want to show y axis from low to high order. | SELECT Title, AVG(Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Title ORDER BY AVG(Price) | nvbench |
CREATE TABLE table_name_87 (
entrant VARCHAR,
points VARCHAR,
chassis VARCHAR
) | with lola t86/50 chassis and less than 7 points what is the entrant? | SELECT entrant FROM table_name_87 WHERE points < 7 AND chassis = "lola t86/50" | sql_create_context |
CREATE TABLE table_1342198_25 (
district VARCHAR,
party VARCHAR
) | What is the district with Republican party in place? | SELECT district FROM table_1342198_25 WHERE party = "Republican" | sql_create_context |
CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
date_account_opened DATETIME,
account_name VARCHAR(50),
other_account_details VARCHAR(255)
)
CREATE TABLE Orders (
order_id INTEGER,
customer_id INTEGER,
date_order_placed DATETIME,
order_details VARCHAR(255)
)
CREATE... | what are total transaction amounts for each transaction type?, and I want to rank by the Y-axis from high to low. | SELECT transaction_type, SUM(transaction_amount) FROM Financial_Transactions GROUP BY transaction_type ORDER BY SUM(transaction_amount) DESC | nvbench |
CREATE TABLE table_28812 (
"Western" text,
"Central" text,
"Eastern" text,
"Old Galician (13th\u201315th c.)" text,
"Portuguese" text,
"Spanish" text,
"Latin" text,
"English" text
) | What is the Spanish word for cas [ kas]? | SELECT "Spanish" FROM table_28812 WHERE "Central" = 'cas [ˈkas]' | wikisql |
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,
... | count the number of times that nitroglycerin 50 mg in d5w 250 ml r has been prescribed until 2103. | SELECT COUNT(*) FROM medication WHERE medication.drugname = 'nitroglycerin 50 mg in d5w 250 ml r' AND STRFTIME('%y', medication.drugstarttime) <= '2103' | eicu |
CREATE TABLE table_65433 (
"Date" text,
"Location" text,
"Lineup" text,
"Assist/pass" text,
"Score" text,
"Result" text,
"Competition" text
) | What's the lineup when the assist/pass was Unassisted? | SELECT "Lineup" FROM table_65433 WHERE "Assist/pass" = 'unassisted' | wikisql |
CREATE TABLE table_name_86 (
game VARCHAR,
team VARCHAR,
record VARCHAR
) | Which Game has a Team of at san antonio, and a Record of 3-3? | SELECT game FROM table_name_86 WHERE team = "at san antonio" AND record = "3-3" | sql_create_context |
CREATE TABLE table_1990460_1 (
division INTEGER
) | What's the highest division number through the years? | SELECT MAX(division) FROM table_1990460_1 | sql_create_context |
CREATE TABLE table_24920 (
"School" text,
"Location" text,
"Team Name" text,
"Colors" text,
"Varsity Teams" real,
"NJCAA Championships" real
) | If the school is John A. Logan College, what are the colors? | SELECT "Colors" FROM table_24920 WHERE "School" = 'John A. Logan College' | wikisql |
CREATE TABLE table_25463 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
) | Who has the high points when 3-2 is the series? | SELECT "High points" FROM table_25463 WHERE "Series" = '3-2' | wikisql |
CREATE TABLE table_21458142_1 (
sales_breakdown VARCHAR,
publisher VARCHAR,
release_date VARCHAR
) | What's the sales breakdown of the Nintendo game released on May 15, 2006? | SELECT sales_breakdown FROM table_21458142_1 WHERE publisher = "Nintendo" AND release_date = "May 15, 2006" | sql_create_context |
CREATE TABLE table_24364 (
"Type of Record" text,
"Attendance" real,
"Date/Year" text,
"Stadium" text,
"Result/Games" text
) | For what year is the type of record 'total attendance-regular season? | SELECT "Date/Year" FROM table_24364 WHERE "Type of Record" = 'Total Attendance-Regular season' | wikisql |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_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,
H... | 在病患55299978的医疗记录中,有哪几次的医疗费总额在6461.54元以上,列出入院诊断疾病的名称和编码 | SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '55299978' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 6461.54) | css |
CREATE TABLE table_25316812_1 (
rate_limit__p_ VARCHAR,
desired_rate_change___percentage_ VARCHAR
) | What is the rate limit when the desired rate change (%) is +40.4? | SELECT rate_limit__p_ FROM table_25316812_1 WHERE desired_rate_change___percentage_ = "+40.4" | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_icd_diag... | tell me the intake method for belatacept study drug (*ind*)? | SELECT DISTINCT prescriptions.route FROM prescriptions WHERE prescriptions.drug = 'belatacept study drug (*ind*)' | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | what is days of hospital stay and primary disease of subject id 2560? | SELECT demographic.days_stay, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | count the number of patients whose age is less than 77 and item id is 51032? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "77" AND lab.itemid = "51032" | mimicsql_data |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description t... | My Tags by Post Count. | SELECT T.TagName, COUNT(Pot.TagId) AS TagCount, SUM(P.Score) AS TagScore FROM Tags AS T, PostTags AS Pot, Posts AS P, Users AS U, PostTypes AS Pt WHERE U.Id = P.OwnerUserId AND Pt.Id = P.PostTypeId AND (u.Id = 548225) AND Pot.PostId = P.ParentId AND T.Id = Pot.TagId GROUP BY T.TagName ORDER BY COUNT(Pot.TagId) DESC | sede |
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... | 列出患者18039764去6690866医院的名称中不包含营养的就诊科室的医疗就诊记录 | SELECT * FROM qtb WHERE qtb.PERSON_ID = '18039764' AND qtb.MED_SER_ORG_NO = '6690866' AND NOT qtb.MED_ORG_DEPT_NM LIKE '%营养%' UNION SELECT * FROM gyb WHERE gyb.PERSON_ID = '18039764' AND gyb.MED_SER_ORG_NO = '6690866' AND NOT gyb.MED_ORG_DEPT_NM LIKE '%营养%' UNION SELECT * FROM zyb WHERE zyb.PERSON_ID = '18039764' AND z... | css |
CREATE TABLE table_19260 (
"AGR Power Station" text,
"Net MWe" real,
"Construction started" real,
"Connected to grid" real,
"Commercial operation" real,
"Accounting closure date" real
) | When did construction start on the Power station with a net MWE of 1190 | SELECT MIN("Construction started") FROM table_19260 WHERE "Net MWe" = '1190' | wikisql |
CREATE TABLE table_name_26 (
tottenham_hotspur_career VARCHAR,
club_apps VARCHAR,
position VARCHAR,
goals VARCHAR,
nationality VARCHAR
) | What were the years of the Tottenham Hotspur career for the player with 10 goals, from England, played the df position, and had 118 club apps? | SELECT tottenham_hotspur_career FROM table_name_26 WHERE goals = "10" AND nationality = "england" AND position = "df" AND club_apps = "118" | sql_create_context |
CREATE TABLE table_23286158_10 (
high_assists VARCHAR,
high_rebounds VARCHAR
) | When marcus camby (15) has the highest amount of rebounds who has the highest amount of assists? | SELECT high_assists FROM table_23286158_10 WHERE high_rebounds = "Marcus Camby (15)" | sql_create_context |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and the sum of revenue , and group by attribute name, list from high to low by the Y-axis. | SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T2.Revenue DESC | nvbench |
CREATE TABLE table_name_99 (
location VARCHAR,
ref_number VARCHAR
) | What is the location of the mill with a reference number of 44? | SELECT location FROM table_name_99 WHERE ref_number = 44 | sql_create_context |
CREATE TABLE table_51352 (
"Draw" real,
"Artist" text,
"Song" text,
"Points" real,
"Place" real
) | What is the high point toal for martine foubert placing below 2? | SELECT MAX("Points") FROM table_51352 WHERE "Artist" = 'martine foubert' AND "Place" > '2' | wikisql |
CREATE TABLE table_2703 (
"Constituency" text,
"Winner" text,
"Party" text,
"Margin" real,
"Runner-up a" text,
"Party a" text
) | Who was the runner up for the Nagapattinam constituency? | SELECT "Runner-up a" FROM table_2703 WHERE "Constituency" = 'Nagapattinam' | 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... | What is the procedure long title and for how many days did subject id 76446 stay in the hospital? | SELECT demographic.days_stay, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "76446" | mimicsql_data |
CREATE TABLE table_18621456_22 (
legs_lost INTEGER
) | What is the most legs lost of all? | SELECT MAX(legs_lost) FROM table_18621456_22 | sql_create_context |
CREATE TABLE table_name_87 (
athlete VARCHAR,
gold VARCHAR,
total VARCHAR
) | What athlete has less than 7 gold and 14 total medals? | SELECT athlete FROM table_name_87 WHERE gold < 7 AND total = 14 | sql_create_context |
CREATE TABLE table_62859 (
"Athlete" text,
"Class" text,
"Horse" text,
"Event" text,
"Result" text,
"Rank" text
) | What event did Sjerstin Vermeulen receive a 66.452 result? | SELECT "Event" FROM table_62859 WHERE "Athlete" = 'sjerstin vermeulen' AND "Result" = '66.452' | wikisql |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE ... | Trendy tags: 2015 to 2016 growth. | SELECT *, CAST(100.0 * (a.y2016 - a.y2015) / NULLIF(a.y2015, 0) AS FLOAT(18, 2)) AS growth FROM (SELECT t.TagName, COUNT(p.Id) AS postCount, SUM(CASE WHEN YEAR(p.CreationDate) = 2014 THEN 1 ELSE 0 END) AS y2014, SUM(CASE WHEN YEAR(p.CreationDate) = 2015 THEN 1 ELSE 0 END) AS y2015, SUM(CASE WHEN YEAR(p.CreationDate) = ... | sede |
CREATE TABLE table_204_156 (
id number,
"year" number,
"crystal bicycle\n(best professional cyclist)" text,
"best young rider" text,
"best manager" text,
"crystal drop of sweat\n(best helper)" text
) | what is the total number of times johan bryneel 's name appears on all of these lists ? | SELECT COUNT(*) FROM table_204_156 WHERE "best manager" = 'johan bruyneel' | squall |
CREATE TABLE bookings (
customer_id VARCHAR
)
CREATE TABLE Customers (
customer_id VARCHAR,
first_name VARCHAR
) | How many bookings did each customer make? List the customer id, first name, and the count. | SELECT T1.customer_id, T1.first_name, COUNT(*) FROM Customers AS T1 JOIN bookings AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id | sql_create_context |
CREATE TABLE table_name_96 (
tournament VARCHAR,
date VARCHAR
) | What is Tournament, when Date is 'Sep 12, 1976'? | SELECT tournament FROM table_name_96 WHERE date = "sep 12, 1976" | sql_create_context |
CREATE TABLE course (
title VARCHAR,
course_id VARCHAR
)
CREATE TABLE prereq (
prereq_id VARCHAR,
course_id VARCHAR
) | What is the title of the prerequisite class of International Finance course? | SELECT title FROM course WHERE course_id IN (SELECT T1.prereq_id FROM prereq AS T1 JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.title = 'International Finance') | sql_create_context |
CREATE TABLE table_2478 (
"Period" text,
"Civilians" real,
"Security forces" real,
"Insurgents" real,
"Total per period" real
) | How many security forces? | SELECT MAX("Security forces") FROM table_2478 | wikisql |
CREATE TABLE table_14929574_3 (
series__number INTEGER,
us_viewers__million_ VARCHAR
) | Which episode number drew in 3.84 million viewers in the U.S.? | SELECT MAX(series__number) FROM table_14929574_3 WHERE us_viewers__million_ = "3.84" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.