instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE Apartments (
apt_id INTEGER,
building_id INTEGER,
apt_type_code CHAR(15),
apt_number CHAR(10),
bathroom_count INTEGER,
bedroom_count INTEGER,
room_count CHAR(5)
)
CREATE TABLE Apartment_Buildings (
building_id INTEGER,
building_short_name CHAR(15),
building_full_nam... | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id | nvbench |
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.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '81282369' | css |
CREATE TABLE table_name_18 (
attendance VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Date of 1 october 2003 had what attendance?
| SELECT attendance FROM table_name_18 WHERE date = "1 october 2003" | sql_create_context |
CREATE TABLE table_name_75 (
score VARCHAR,
opponents VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score for the opponent luk dlouh leander paes?
| SELECT score FROM table_name_75 WHERE opponents = "lukáš dlouhý leander paes" | sql_create_context |
CREATE TABLE table_name_24 (
rank VARCHAR,
notes VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total rank and fc notes from South Africa?
| SELECT COUNT(rank) FROM table_name_24 WHERE notes = "fc" AND country = "south africa" | sql_create_context |
CREATE TABLE table_name_37 (
home_team VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the home team that played against Aylesbury Vale?
| SELECT home_team FROM table_name_37 WHERE away_team = "aylesbury vale" | sql_create_context |
CREATE TABLE table_745 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result of the election of the incumbent harry r. sheppard?
| SELECT "Result" FROM table_745 WHERE "Incumbent" = 'Harry R. Sheppard' | wikisql |
CREATE TABLE table_name_33 (
player VARCHAR,
country VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What player from the United States had a total of 297?
| SELECT player FROM table_name_33 WHERE country = "united states" AND total = 297 | 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 Name, COUNT(Name) FROM Products GROUP BY Name ORDER BY COUNT(Name) DESC | nvbench |
CREATE TABLE Employee (
EmployeeId integer,
LastName varchar(20),
FirstName varchar(20),
Title varchar(30),
ReportsTo integer,
BirthDate datetime,
HireDate datetime,
Address varchar(70),
City varchar(40),
State varchar(40),
Country varchar(40),
PostalCode varchar(10),
... | SELECT T1.FirstName, T1.SupportRepId FROM Customer AS T1 JOIN Employee AS T2 ON T1.SupportRepId = T2.EmployeeId ORDER BY T1.SupportRepId | nvbench |
CREATE TABLE purchases (
purchase_transaction_id number,
purchase_details text
)
CREATE TABLE sales (
sales_transaction_id number,
sales_details text
)
CREATE TABLE transactions (
transaction_id number,
investor_id number,
transaction_type_code text,
date_of_transaction time,
amoun... | SELECT T2.lot_details FROM investors AS T1 JOIN lots AS T2 ON T1.investor_id = T2.investor_id WHERE T1.investor_details = "l" | spider |
CREATE TABLE table_name_78 (
player VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what player score is higher than 17
| SELECT player FROM table_name_78 WHERE round = 17 | sql_create_context |
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... | SELECT COUNT(*) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'PHIL' AND course.number = 460 AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016 | advising |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT prescriptions.icustay_id FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Stephanie Suchan" | mimicsql_data |
CREATE TABLE table_name_68 (
package_option VARCHAR,
content VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the package/option in Italy when the content is religione?
| SELECT package_option FROM table_name_68 WHERE content = "religione" AND country = "italy" | sql_create_context |
CREATE TABLE table_67434 (
"Season" real,
"Year" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Regular Season Standing" text,
"Final Standing" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many losses occurred with regular season sta... | SELECT COUNT("Losses") FROM table_67434 WHERE "Regular Season Standing" = '17th from 20' AND "Year" > '1996' | wikisql |
CREATE TABLE table_60336 (
"Position" real,
"Club" text,
"Games played" real,
"Wins" real,
"Draws" real,
"Loses" real,
"Goals scored" real,
"Goals conceded" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the av... | SELECT AVG("Points") FROM table_60336 WHERE "Goals conceded" > '23' AND "Position" > '12' | wikisql |
CREATE TABLE table_18424 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were all the candidates when the first elected year was 1961?
| SELECT "Candidates" FROM table_18424 WHERE "First elected" = '1961' | wikisql |
CREATE TABLE table_1543 (
"Rank" real,
"Company" text,
"Headquarters" text,
"Industry" text,
"Sales (billion $)" text,
"Profits (billion $)" text,
"Assets (billion $)" text,
"Market Value (billion $)" text
)
-- Using valid SQLite, answer the following questions for the tables provided ... | SELECT "Company" FROM table_1543 WHERE "Profits (billion $)" = '26.9' | wikisql |
CREATE TABLE table_name_73 (
club VARCHAR,
founded VARCHAR,
sport VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Club which has a Founded larger than 1875, and a Sport of football?
| SELECT club FROM table_name_73 WHERE founded > 1875 AND sport = "football" | sql_create_context |
CREATE TABLE table_32326 (
"Year" text,
"Name" text,
"Date" text,
"Stages" text,
"Distance" text,
"Winner" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many stages are in a distance of 2,192 km?
| SELECT "Stages" FROM table_32326 WHERE "Distance" = '2,192 km' | wikisql |
CREATE TABLE table_44659 (
"Nat." text,
"Name" text,
"Moving from" text,
"Type" text,
"Transfer window" text,
"Ends" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What type is Gonz lez?
| SELECT "Type" FROM table_44659 WHERE "Name" = 'gonzález' | wikisql |
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 PostsWithDeleted (
Id number,
PostTyp... | SELECT * FROM Posts WHERE CreationDate > '2018-01-01' | sede |
CREATE TABLE table_203_153 (
id number,
"stamp issue date" text,
"stamp set" text,
"#cards" text,
"card set ref" text,
"qty. issued" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many stamp sets had at least 50,000 issued ?
| SELECT COUNT("stamp set") FROM table_203_153 WHERE "qty. issued" >= 50000 | squall |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE instructor (
... | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE (course.description LIKE '%lab%' OR course.name LIKE '%lab%') AND (course.description LIKE '%Energy Generation and Storage Using Modern Materials%' OR course.name LIKE '%Energy Generation and Storage Using Modern Materials%') AND course.course_id = course... | advising |
CREATE TABLE table_33243 (
"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.
-- When did an away team score 7.8 (50)?
| SELECT "Date" FROM table_33243 WHERE "Away team score" = '7.8 (50)' | wikisql |
CREATE TABLE table_55999 (
"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 away team score when the home team ... | SELECT "Away team score" FROM table_55999 WHERE "Home team score" = '8.14 (62)' | wikisql |
CREATE TABLE table_name_84 (
record_label VARCHAR,
album VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Record label has an Album of tera roop?
| SELECT record_label FROM table_name_84 WHERE album = "tera roop" | sql_create_context |
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 qtb.MED_ORG_DEPT_CD, qtb.MED_ORG_DEPT_NM FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '4813330' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2003-09-16' AND '2009-07-01' GROUP BY qtb.MED_ORG_DEPT_CD ORDER BY SUM(t_kc24.OVE_PAY) DESC LIMIT 5 UNION SELECT gyb.MED_ORG_DEPT_CD, ... | css |
CREATE TABLE table_80325 (
"Week" real,
"Date" text,
"Visiting Team" text,
"Final Score" text,
"Host Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which week did the Baltimore Ravens play at home ?
| SELECT "Week" FROM table_80325 WHERE "Host Team" = 'baltimore ravens' | wikisql |
CREATE TABLE table_name_86 (
tournament VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What tournament was being played on August 11, 1984?
| SELECT tournament FROM table_name_86 WHERE date = "august 11, 1984" | sql_create_context |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25... | SELECT JOB_ID, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(SALARY) DESC | nvbench |
CREATE TABLE table_19744915_3 (
robin VARCHAR,
jason VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is robin's stat when jason was 2.5
| SELECT robin FROM table_19744915_3 WHERE jason = "2.5" | sql_create_context |
CREATE TABLE zyb (
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 SUM(t_kc24.MED_AMOUT) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.PERSON_NM = '许忆彤' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2001-04-24' AND '2018-07-26' UNION SELECT SUM(t_kc24.MED_AMOUT) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.PERSON_NM = '许忆彤' AND t... | css |
CREATE TABLE table_44344 (
"Class" text,
"Wheel arrangement" text,
"Fleet number(s)" text,
"Manufacturer" text,
"Year made" text,
"Quantity made" text,
"Quantity preserved" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year had a quant... | SELECT "Year made" FROM table_44344 WHERE "Wheel arrangement" = '4-6-2' AND "Quantity made" = '11' | wikisql |
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER
)
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER,
Room VARCHAR(5),
... | SELECT FacID, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.Advisor GROUP BY T1.FacID | nvbench |
CREATE TABLE table_12215 (
"Name" text,
"GP-GS" text,
"Gain" real,
"Loss" real,
"Long" real,
"Avg/G" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's cameron dantley's total avg/g for loss less than 35?
| SELECT COUNT("Avg/G") FROM table_12215 WHERE "Name" = 'cameron dantley' AND "Loss" < '35' | wikisql |
CREATE TABLE table_204_771 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- calculate the difference in the number of gold medals won between... | SELECT (SELECT "gold" FROM table_204_771 WHERE "nation" = 'venezuela') - (SELECT "gold" FROM table_204_771 WHERE "nation" = 'colombia') | squall |
CREATE TABLE table_16439764_1 (
shell__lb_ VARCHAR,
gun VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the gun used is the qf 12 pdr 12 cwt, what is the shell weight?
| SELECT shell__lb_ FROM table_16439764_1 WHERE gun = "QF 12 pdr 12 cwt" | sql_create_context |
CREATE TABLE table_67718 (
"Place" real,
"Team" text,
"Played" real,
"Draw" real,
"Lost" real,
"Goals Scored" real,
"Goals Conceded" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the goals scored when draw is less... | SELECT SUM("Goals Scored") FROM table_67718 WHERE "Draw" < '8' AND "Points" = '19' AND "Goals Conceded" > '26' | wikisql |
CREATE TABLE table_46990 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the Score that has the Player of raymond floyd?
| SELECT "Score" FROM table_46990 WHERE "Player" = 'raymond floyd' | wikisql |
CREATE TABLE table_78767 (
"Time" text,
"Show Name" text,
"Local/Networked" text,
"Ad Freq" text,
"News Freq" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the ad frequency for the Show Off The Bench?
| SELECT "Ad Freq" FROM table_78767 WHERE "Show Name" = 'off the bench' | wikisql |
CREATE TABLE table_59997 (
"Election" text,
"First member" text,
"First party" text,
"Second member" text,
"Second party" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the second member that is a second party Whig in the 1834 election?
| SELECT "Second member" FROM table_59997 WHERE "Second party" = 'whig' AND "Election" = '1834' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "15" AND prescriptions.drug = "Niacin" | mimicsql_data |
CREATE TABLE table_55500 (
"Ship's name" text,
"Entered service" text,
"Ended service" text,
"Gross Tonnage" real,
"Type of Vessel" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the average gross tonnage for april 1919 entered service
| SELECT AVG("Gross Tonnage") FROM table_55500 WHERE "Entered service" = 'april 1919' | wikisql |
CREATE TABLE table_name_1 (
verb VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the verb for Khola?
| SELECT 3 AS __f_ FROM table_name_1 WHERE verb = "khola" | sql_create_context |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time... | SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 566 | advising |
CREATE TABLE table_name_91 (
sixth VARCHAR,
fourth VARCHAR,
first VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team placed sixth during the season where Western Australia placed fourth and Tasmania placed first?
| SELECT sixth FROM table_name_91 WHERE fourth = "western australia" AND first = "tasmania" | sql_create_context |
CREATE TABLE table_50672 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To Par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country has a score of 73-72-67=212?
| SELECT "Country" FROM table_50672 WHERE "Score" = '73-72-67=212' | wikisql |
CREATE TABLE ndecoreexcel_math_grade8 (
year number,
state text,
all_students text,
average_scale_score number
)
CREATE TABLE finrev_fed_17 (
state_code number,
idcensus number,
school_district text,
nces_id text,
yr_data number,
t_fed_rev number,
c14 number,
c25 number
... | SELECT T1.school_district, MAX(T1.t_fed_rev / T3.average_scale_score) FROM finrev_fed_17 AS T1 JOIN finrev_fed_key_17 AS T2 ON T1.state_code = T2.state_code JOIN ndecoreexcel_math_grade8 AS T3 ON T2.state = T3.state | studentmathscore |
CREATE TABLE table_name_75 (
opponent VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the opponent for the date of august 5?
| SELECT opponent FROM table_name_75 WHERE date = "august 5" | 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 JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID | nvbench |
CREATE TABLE table_name_82 (
district VARCHAR,
estd VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which district was established in 1942?
| SELECT district FROM table_name_82 WHERE estd = 1942 | 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 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "30" AND procedures.short_title = "Fiber-optic bronchoscopy" | mimicsql_data |
CREATE TABLE table_name_31 (
silver INTEGER,
rank VARCHAR,
bronze VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number of silvers for teams ranked 5 with 0 bronze?
| SELECT AVG(silver) FROM table_name_31 WHERE rank = "5" AND bronze < 0 | sql_create_context |
CREATE TABLE PROFESSOR (
EMP_NUM int,
DEPT_CODE varchar(10),
PROF_OFFICE varchar(50),
PROF_EXTENSION varchar(4),
PROF_HIGH_DEGREE varchar(5)
)
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS varchar(20),
... | SELECT CRS_CODE, COUNT(*) FROM CLASS GROUP BY CRS_CODE ORDER BY CRS_CODE | nvbench |
CREATE TABLE table_43903 (
"School name" text,
"address" text,
"students" real,
"grades" text,
"2007 API" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which grades have students smaller than 430, and a 2007 API of 510?
| SELECT "grades" FROM table_43903 WHERE "students" < '430' AND "2007 API" = '510' | wikisql |
CREATE TABLE table_66932 (
"Stage" text,
"Time (EEST)" text,
"Name" text,
"Length" text,
"Winner" text,
"Time" text,
"Avg. spd." text,
"Rally leader" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the Winner, when the Name is Ouni... | SELECT "Winner" FROM table_66932 WHERE "Name" = 'ouninpohja 1' | wikisql |
CREATE TABLE table_1560 (
"No. in series" text,
"No. in season" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided ab... | SELECT "Original air date" FROM table_1560 WHERE "No. in season" = '13' | wikisql |
CREATE TABLE endowment (
endowment_id number,
school_id number,
donator_name text,
amount number
)
CREATE TABLE budget (
school_id number,
year number,
budgeted number,
total_budget_percent_budgeted number,
invested number,
total_budget_percent_invested number,
budget_invest... | SELECT AVG(enrollment), MAX(enrollment), MIN(enrollment) FROM school | spider |
CREATE TABLE Detention (
detention_id INTEGER,
detention_type_code VARCHAR(10),
teacher_id INTEGER,
datetime_detention_start DATETIME,
datetime_detention_end DATETIME,
detention_summary VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Ref_Address_Types (
address_type_code VARCHAR... | SELECT date_address_to, SUM(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE allergy (
allergy... | SELECT AVG(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-33898' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospital... | eicu |
CREATE TABLE table_29648 (
"Member" text,
"Electorate" text,
"Province" text,
"MPs term" text,
"Election date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the province with an election date of 5 cannot handle non-empty timestamp argument... | SELECT "Province" FROM table_29648 WHERE "Election date" = '5 Cannot handle non-empty timestamp argument! 1861' | wikisql |
CREATE TABLE table_37721 (
"Season" text,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"Points" text,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest number of wins associated with un... | SELECT MAX("Wins") FROM table_37721 WHERE "Poles" < '0' | wikisql |
CREATE TABLE table_27487712_1 (
result VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result of the election with incumbent bob barr?
| SELECT result FROM table_27487712_1 WHERE incumbent = "Bob Barr" | sql_create_context |
CREATE TABLE table_25498 (
"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 w... | SELECT "Date" FROM table_25498 WHERE "Record" = '23-13' | wikisql |
CREATE TABLE table_24662 (
"Model" text,
"Engine" text,
"Power@rpm" text,
"torque@rpm" text,
"0\u2013100km/h acceleration" text,
"Top speed" text,
"Transmission" text,
"CO 2 emissions" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name ... | SELECT "Transmission" FROM table_24662 WHERE "Power@rpm" = 'PS (kW; hp) @4500-6000' | wikisql |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
... | SELECT q.Id AS "post_link", acc.Id AS "answer_link", q.OwnerUserId AS "post_body", q.PostTypeId AS "Post Body" FROM Posts AS q INNER JOIN PostTags AS pt ON pt.PostId = q.Id INNER JOIN Tags AS t ON t.Id = pt.TagId INNER JOIN Posts AS acc ON acc.Id = q.AcceptedAnswerId WHERE TagName = 'java' AND q.PostTypeId = 1 ORDER BY... | sede |
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
basePrice INTEGER,
decor TEXT
)
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adul... | SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType | nvbench |
CREATE TABLE table_61280 (
"Location" text,
"Year" real,
"Champion" text,
"Runner-up" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score when Flavia Pennetta won the championship?
| SELECT "Score" FROM table_61280 WHERE "Champion" = 'flavia pennetta' | wikisql |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE... | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'DOC' AND course.number = 848 AND semester.semester = 'WN' AND semester.semester_id = course_offe... | advising |
CREATE TABLE table_2538 (
"Dateca" text,
"Event #" text,
"Event" text,
"Winner" text,
"Prize" text,
"Entries" text,
"Prize Pool" text,
"Elapsed Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the winner of event # 1h and date... | SELECT "Winner" FROM table_2538 WHERE "Dateca" = 'Apr 2' AND "Event #" = '1H' | wikisql |
CREATE TABLE table_204_880 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what venue appears most on the list ?
| SELECT "venue" FROM table_204_880 GROUP BY "venue" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
CREATE TABLE table_203_157 (
id number,
"year" number,
"film" text,
"role" text,
"language" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what film game before ter meri kahaani ?
| SELECT "film" FROM table_203_157 WHERE id = (SELECT id FROM table_203_157 WHERE "film" = 'teri meri kahaani') - 1 | squall |
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_DIRE_CD text,
MED_DIRE_NM text,... | SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '1037880' AND t_kc21.IN_HOSP_DATE BETWEEN '2008-02-22' AND '2009-05-23' AND t_kc21.SERVANT_FLG = '公务员' | css |
CREATE TABLE table_73663 (
"Episode no." real,
"Airdate" text,
"Viewers" real,
"BBC Three weekly ranking" text,
"Cable rank" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many entries are shown for viewers when the airdate was 26 november 2009?... | SELECT COUNT("Viewers") FROM table_73663 WHERE "Airdate" = '26 November 2009' | wikisql |
CREATE TABLE table_63219 (
"Island" text,
"Country" text,
"Population" text,
"Area km\u00b2" text,
"Density (per km\u00b2)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which island is in the United Kingdom?
| SELECT "Island" FROM table_63219 WHERE "Country" = 'united kingdom' | wikisql |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE cost (
row_id number,
subject_id n... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.dischtime IS NULL | mimic_iii |
CREATE TABLE table_25282 (
"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.
-- What is every party with a winner of P. Chidambaram?
| SELECT "Party a" FROM table_25282 WHERE "Winner" = 'P. Chidambaram' | wikisql |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '19494267' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2006-02-17' AND '2006-06-28' AND t_kc22.MED_I... | css |
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 zyjybgb.JYKSBM, zyjybgb.JYKSMC FROM zyjybgb WHERE zyjybgb.JZLSH = '80645619078' UNION SELECT mzjybgb.JYKSBM, mzjybgb.JYKSMC FROM mzjybgb WHERE mzjybgb.JZLSH = '80645619078' | css |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city v... | 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 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 zyjzjlb (
CYBQDM text,
CYBQMC... | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM txmzjzjlb JOIN jybgb JOIN jyjgzbb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE txmzjzjlb.JZZDBM = 'C89.828' AND jyjgzbb.JCZBMC = '... | css |
CREATE TABLE table_10548 (
"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.
-- Where was the game played when the home team sco... | SELECT "Venue" FROM table_10548 WHERE "Home team score" = '11.14 (80)' | wikisql |
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 varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE countries (
COUNT... | SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID DESC | nvbench |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT OUT_DIAG_DIS_CD, OUT_DIAG_DIS_NM FROM t_kc21 WHERE MED_CLINIC_ID = '86947036895' | css |
CREATE TABLE table_23239 (
"Rank" real,
"Couple" text,
"Judges" real,
"Public" real,
"Total" real,
"Vote percentage" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What couple had vote percentage of 21.843%?
| SELECT "Couple" FROM table_23239 WHERE "Vote percentage" = '21.843%' | wikisql |
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, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Manufacturer DESC | nvbench |
CREATE TABLE table_60222 (
"Crude oil name \\Rightarrow Location \\Rightarrow" text,
"Barrow Island Australia" real,
"Mutineer-Exeter Australia" real,
"CPC Blend Kazakhstan" real,
"Draugen North Sea" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wh... | SELECT AVG("Barrow Island Australia") FROM table_60222 WHERE "Draugen North Sea" = '17' AND "Mutineer-Exeter Australia" < '6' | wikisql |
CREATE TABLE table_203_9 (
id number,
"state" text,
"last execution date" text,
"name" text,
"crime" text,
"method" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which state had their last execution on 5 february 2014 ?
| SELECT "state" FROM table_203_9 WHERE "last execution date" = '5 february 2014' | squall |
CREATE TABLE table_name_45 (
cuts_made VARCHAR,
top_5 VARCHAR,
events VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of cuts made when the top-5 is 2, and there are 12 events?
| SELECT COUNT(cuts_made) FROM table_name_45 WHERE top_5 = 2 AND events = 12 | sql_create_context |
CREATE TABLE table_35659 (
"Tournament" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"Career W/L" text
)
-- Usi... | SELECT "2005" FROM table_35659 WHERE "2007" = 'sf' | wikisql |
CREATE TABLE table_3648 (
"Country or territory with flag" text,
"Area (km\u00b2) (per sqmi)" text,
"Population (July 2009 est.)" real,
"Population density per km\u00b2" text,
"Capital" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the capi... | SELECT "Capital" FROM table_3648 WHERE "Population density per km\u00b2" = '15.6/km² (/sqmi)' | wikisql |
CREATE TABLE table_34 (
"Player" text,
"Total W\u2013L" text,
"Singles W\u2013L" text,
"Doubles W\u2013L" text,
"Ties played" real,
"Debut" real,
"Years played" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total number of ties ... | SELECT COUNT("Ties played") FROM table_34 WHERE "Total W\u2013L" = '38–24' | wikisql |
CREATE TABLE table_69772 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For the player from Fiji, what was his finish?
| SELECT "Finish" FROM table_69772 WHERE "Country" = 'fiji' | wikisql |
CREATE TABLE advisor (
s_id text,
i_id text
)
CREATE TABLE teaches (
id text,
course_id text,
sec_id text,
semester text,
year number
)
CREATE TABLE department (
dept_name text,
building text,
budget number
)
CREATE TABLE time_slot (
time_slot_id text,
day text,
st... | SELECT dept_name FROM instructor WHERE name LIKE '%Soisalon%' | spider |
CREATE TABLE Apartment_Bookings (
apt_booking_id INTEGER,
apt_id INTEGER,
guest_id INTEGER,
booking_status_code CHAR(15),
booking_start_date DATETIME,
booking_end_date DATETIME
)
CREATE TABLE Guests (
guest_id INTEGER,
gender_code CHAR(1),
guest_first_name VARCHAR(80),
guest_las... | SELECT apt_type_code, MIN(room_count) FROM Apartments GROUP BY apt_type_code ORDER BY apt_type_code | nvbench |
CREATE TABLE table_49783 (
"Rank" real,
"Name" text,
"Team" text,
"Games" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which rank is the lowest with 37 games and more than 613 points?
| SELECT MIN("Rank") FROM table_49783 WHERE "Games" = '37' AND "Points" > '613' | wikisql |
CREATE TABLE table_name_29 (
issue_price INTEGER,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the issue price in the year 2008?
| SELECT SUM(issue_price) FROM table_name_29 WHERE year = 2008 | sql_create_context |
CREATE TABLE table_name_35 (
location VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the location of the game with a 115-105 score?
| SELECT location FROM table_name_35 WHERE score = "115-105" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.