instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_78262 (
"Date" text,
"Venue" text,
"Visitor" text,
"Score" text,
"Home" text,
"Montreal goals" text,
"Decision" text,
"Attendance" real,
"Series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the average ... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the attendance when the VFL played Lake ... | 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... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Spa... | 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,
... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who ha... | SELECT "High points" FROM table_25463 WHERE "Series" = '3-2' | wikisql |
CREATE TABLE table_21458142_1 (
sales_breakdown VARCHAR,
publisher VARCHAR,
release_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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... | 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
)
... | 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... | 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... | 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... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did constructi... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the years of the Tottenham Hotspur career for the player with ... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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 ... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what ... | 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many security forces?
| SELECT MAX("Security forces") FROM table_2478 | wikisql |
CREATE TABLE table_14929574_3 (
series__number INTEGER,
us_viewers__million_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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 |
CREATE TABLE table_25699 (
"Team" text,
"SEC Wins" real,
"SEC Losses" real,
"Percentage" text,
"Home Record" text,
"Road Record" text,
"Overall Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the percentage for the team with a... | SELECT "Percentage" FROM table_25699 WHERE "Road Record" = '3-4' AND "Home Record" = '7-0' | wikisql |
CREATE TABLE table_46067 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score for the away team Chelsea?
| SELECT "Score" FROM table_46067 WHERE "Away team" = 'chelsea' | wikisql |
CREATE TABLE table_name_91 (
wins INTEGER,
rank INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the mean number of wins with a rank that's more than 5?
| SELECT AVG(wins) FROM table_name_91 WHERE rank > 5 | sql_create_context |
CREATE TABLE table_name_73 (
liberal_ticket VARCHAR,
socialist_workers_ticket VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the liberal ticket that has judith white as the socialist workers?
| SELECT liberal_ticket FROM table_name_73 WHERE socialist_workers_ticket = "judith white" | sql_create_context |
CREATE TABLE table_13275 (
"School" text,
"Location" text,
"Mascot" text,
"IHSAA Class" text,
"County" text,
"Year Joined" text,
"Year Left" text,
"Conference Joined" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the location fo... | SELECT "Location" FROM table_13275 WHERE "School" = 'lakewood park christian' | wikisql |
CREATE TABLE table_58720 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the money for place t3 and United States?
| SELECT "Money ( $ )" FROM table_58720 WHERE "Place" = 't3' AND "Country" = 'united states' | wikisql |
CREATE TABLE table_56374 (
"State" text,
"Swimsuit" real,
"Evening gown" real,
"Interview" real,
"Average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of interviews where the evening gown number is less than 8.82, the sta... | SELECT SUM("Interview") FROM table_56374 WHERE "Evening gown" < '8.82' AND "State" = 'kentucky' AND "Average" > '8.85' | wikisql |
CREATE TABLE table_7988 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What wa... | SELECT "Score" FROM table_7988 WHERE "Game" < '20' AND "Team" = 'portland' | wikisql |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7375) AND STRFTIME('%y-%m', prescriptions.startdate) <= '2101-08' GROUP BY prescriptions.drug) AS t1 WHERE t1.c1... | mimic_iii |
CREATE TABLE table_70842 (
"Year" real,
"Competition" text,
"Town" text,
"Opponent" text,
"Final score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the final score in 2007 for the world league in novi sad played against Italy?
| SELECT "Final score" FROM table_70842 WHERE "Year" = '2007' AND "Competition" = 'world league' AND "Town" = 'novi sad' AND "Opponent" = 'italy' | wikisql |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course... | SELECT DISTINCT course_offering.friday FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'REES' AND course.number = 395 AND semester.semester = 'WN' AND semester.year = 2016 | advising |
CREATE TABLE table_1646960_3 (
winning_song VARCHAR,
debut_album VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the winning song for the artist with a debut album 'the winner'?
| SELECT winning_song FROM table_1646960_3 WHERE debut_album = "The winner" | sql_create_context |
CREATE TABLE table_41815 (
"Year" real,
"Tournament Name" text,
"Champions" text,
"Runners-up" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What tournament had a score of 5 7, 6 4, 6 4?
| SELECT "Tournament Name" FROM table_41815 WHERE "Score" = '5–7, 6–4, 6–4' | wikisql |
CREATE TABLE table_38766 (
"Entrants" real,
"Winner" text,
"Prize" text,
"Runner-up" text,
"Results" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the results of the event where $817,781 was awarded to less than 1,236 entrants?
| SELECT "Results" FROM table_38766 WHERE "Entrants" < '1,236' AND "Prize" = '$817,781' | wikisql |
CREATE TABLE table_name_41 (
attendance VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What iwas the attendance of the game that took place on december 6, 1998?
| SELECT attendance FROM table_name_41 WHERE date = "december 6, 1998" | sql_create_context |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
... | SELECT COUNT(*) = 0 FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_exams = 'N' AND program_course.category LIKE '%ULCS%' | advising |
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,
... | 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 = "Perinat GI sys dis NEC" AND prescriptions.route = "PO/NG" | mimicsql_data |
CREATE TABLE table_57618 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is North Melbourne's Away team score?
| SELECT "Away team score" FROM table_57618 WHERE "Away team" = 'north melbourne' | wikisql |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
... | SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 30 AND 39) AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start o... | mimic_iii |
CREATE TABLE table_204_553 (
id number,
"outcome" text,
"no." number,
"date" text,
"tournament" text,
"surface" text,
"partner" text,
"opponents in the final" text,
"score in the final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- ... | SELECT "partner" FROM table_204_553 GROUP BY "partner" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
CREATE TABLE table_2893 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"U.S. viewers (million)" text,
"Original air date" text,
"Production code" real
)
-- Using valid SQLite, answer the following questions for the tables provided abo... | SELECT "Original air date" FROM table_2893 WHERE "U.S. viewers (million)" = '5.72' | wikisql |
CREATE TABLE table_22259 (
"#" real,
"Cover Date" text,
"Story Title" text,
"Writer/s" text,
"Artist/s" text,
"Letterer/s" text,
"Colourist/s" text,
"Editor/s" text,
"Comments" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is t... | SELECT "Story Title" FROM table_22259 WHERE "Artist/s" = 'Barry Kitson and Farmer' | wikisql |
CREATE TABLE table_name_59 (
cup_apps__sub_ VARCHAR,
cup_goals VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Cup Apps (sub) had 2 goals?
| SELECT cup_apps__sub_ FROM table_name_59 WHERE cup_goals = "2" | sql_create_context |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
g... | SELECT COUNT(*) > 0 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 = 95986)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'gastric emesis... | mimic_iii |
CREATE TABLE table_7154 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of bronze medals of the nation with 4 total medals and 1 silver?
| SELECT COUNT("Bronze") FROM table_7154 WHERE "Total" = '4' AND "Silver" = '1' | wikisql |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE ... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", u.Id AS "user_link", u.Reputation, COUNT(p.Id) FROM Users AS u INNER JOIN Posts AS p ON p.OwnerUserId = u.Id INNER JOIN PostTags AS pt ON pt.PostId = p.Id INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE LOWER(Location) LIKE LOWER('%##countryname##%') AND t.TagNa... | sede |
CREATE TABLE table_4901 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who played a home team that scored 9.16 (70)?
| SELECT "Away team" FROM table_4901 WHERE "Home team score" = '9.16 (70)' | wikisql |
CREATE TABLE table_67769 (
"Municipality" text,
"Number" real,
"Population" real,
"Area\u00b9" real,
"Density\u00b2" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least number with density more than 262 with population more than 22,415 and... | SELECT MIN("Number") FROM table_67769 WHERE "Density\u00b2" > '262' AND "Population" > '22,415' AND "Area\u00b9" < '335.14' | wikisql |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | SELECT JZZTDM, JZZTMC FROM mzjzjlb WHERE JZLSH = '34349699182' | css |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '谢芷若' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 5630.09) | css |
CREATE TABLE table_56921 (
"Code" real,
"Type" text,
"Name" text,
"Area (km 2 )" real,
"Population" real,
"Regional County Municipality" text,
"Region" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the number of regions with an area... | SELECT COUNT("Region") FROM table_56921 WHERE "Area (km 2 )" = '58.81' | wikisql |
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... | SELECT mzjzjlb.SG, mzjzjlb.TZ 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 = '18593737' | css |
CREATE TABLE table_43224 (
"Card" text,
"Weight Class" text,
"Round" real,
"Time" text,
"Method" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which weight class had a time of 4:59?
| SELECT "Weight Class" FROM table_43224 WHERE "Time" = '4:59' | wikisql |
CREATE TABLE table_26362 (
"1 January 2010" text,
"DF" text,
"Adam Hinshelwood" text,
"Aldershot Town" text,
"Wycombe Wanderers" text,
"Undisclosed" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the df when Adam Hinshelwood is Junior Me... | SELECT "DF" FROM table_26362 WHERE "Adam Hinshelwood" = 'Junior Mendes' | wikisql |
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,
... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.insurance = "Government" AND demographic.days_stay = "5" | 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... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.dob_year < "1879" | mimicsql_data |
CREATE TABLE table_name_2 (
lost INTEGER,
position VARCHAR,
points VARCHAR,
difference VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total lost that has points greater than 8 and a difference of - 8 and a position of greater than 5?
| SELECT SUM(lost) FROM table_name_2 WHERE points > 8 AND difference = "- 8" AND position > 5 | sql_create_context |
CREATE TABLE table_7565 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player won the Masters in 1976?
| SELECT "Player" FROM table_7565 WHERE "Year(s) won" = '1976' | wikisql |
CREATE TABLE Undergoes (
Patient INTEGER,
Procedures INTEGER,
Stay INTEGER,
DateUndergoes DATETIME,
Physician INTEGER,
AssistingNurse INTEGER
)
CREATE TABLE Room (
RoomNumber INTEGER,
RoomType VARCHAR(30),
BlockFloor INTEGER,
BlockCode INTEGER,
Unavailable BOOLEAN
)
CREATE ... | SELECT T3.Name, COUNT(T3.Name) FROM Physician AS T1 JOIN Affiliated_With AS T2 ON T1.EmployeeID = T2.Physician JOIN Department AS T3 ON T2.Department = T3.DepartmentID WHERE T2.PrimaryAffiliation = 1 GROUP BY T3.Name ORDER BY COUNT(T3.Name) | nvbench |
CREATE TABLE table_17641206_6 (
episode VARCHAR,
written_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of episodes written by david cantor
| SELECT COUNT(episode) FROM table_17641206_6 WHERE written_by = "David Cantor" | sql_create_context |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(EMPLOYEE_ID) DESC | nvbench |
CREATE TABLE table_name_91 (
country VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the country with a 68-73-69=210 score?
| SELECT country FROM table_name_91 WHERE score = 68 - 73 - 69 = 210 | sql_create_context |
CREATE TABLE table_name_61 (
place VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Place of the Player with a Score of 70-71=141?
| SELECT place FROM table_name_61 WHERE score = 70 - 71 = 141 | sql_create_context |
CREATE TABLE table_45729 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score in the final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Outcome which has a Score ... | SELECT "Outcome" FROM table_45729 WHERE "Score in the final" = '4–6, 4–6' AND "Date" = 'october 21, 1990' | wikisql |
CREATE TABLE table_name_42 (
constructor VARCHAR,
driver VARCHAR,
engine VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the Constructor for driver Piercarlo Ghinzani and a Ford cosworth dfv 3.0 v8 engine?
| SELECT constructor FROM table_name_42 WHERE driver = "piercarlo ghinzani" AND engine = "ford cosworth dfv 3.0 v8" | sql_create_context |
CREATE TABLE table_60812 (
"Nat." text,
"Name" text,
"Moving from" text,
"Type" text,
"Transfer window" text,
"Ends" real,
"Transfer fee" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What nationality is Diogo?
| SELECT "Nat." FROM table_60812 WHERE "Name" = 'diogo' | wikisql |
CREATE TABLE table_60262 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who did they play at Atlanta-Fulton County Stadium?
| SELECT "Opponent" FROM table_60262 WHERE "Game site" = 'atlanta-fulton county stadium' | wikisql |
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... | SELECT School_ID, ACC_Percent FROM basketball_match GROUP BY ACC_Home | nvbench |
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 text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND pers... | css |
CREATE TABLE student (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
tot_cred numeric(3,0)
)
CREATE TABLE department (
dept_name varchar(20),
building varchar(15),
budget numeric(12,2)
)
CREATE TABLE classroom (
building varchar(15),
room_number varchar(7),
capacity n... | SELECT T1.dept_name, COUNT(DISTINCT T3.ID) FROM department AS T1 JOIN student AS T2 ON T1.dept_name = T2.dept_name JOIN instructor AS T3 ON T1.dept_name = T3.dept_name ORDER BY COUNT(DISTINCT T3.ID) | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.