instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_14181578_1 (
w_l_d VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the w-l-d with position being 1
| SELECT w_l_d FROM table_14181578_1 WHERE position = 1 | sql_create_context |
CREATE TABLE race (
Race_ID int,
Name text,
Class text,
Date text,
Track_ID text
)
CREATE TABLE track (
Track_ID int,
Name text,
Location text,
Seating real,
Year_Opened real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the na... | SELECT T2.Name, COUNT(*) FROM race AS T1 JOIN track AS T2 ON T1.Track_ID = T2.Track_ID GROUP BY T1.Track_ID | nvbench |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStat... | SELECT p.Id, 'http://movies.stackexchange.com/questions/' + CAST(p.Id AS TEXT(20)) AS Link, p.Title, p.Score FROM Posts AS p LEFT OUTER JOIN (SELECT PostId, ROW_NUMBER() OVER (PARTITION BY PostId ORDER BY CreationDate DESC) AS rn FROM PostHistory AS ph WHERE PostHistoryTypeId = 10 AND Comment = '101') AS cdph ON p.Id =... | sede |
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 jyjgzbb (
BGDH text,
BGRQ tim... | SELECT zzmzjzjlb.JZJSSJ FROM zzmzjzjlb WHERE zzmzjzjlb.JZLSH = '44952998423' UNION SELECT fzzmzjzjlb.JZJSSJ FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZLSH = '44952998423' | css |
CREATE TABLE table_name_36 (
score_in_the_final VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score in the final on 14 august 1994?
| SELECT score_in_the_final FROM table_name_36 WHERE date = "14 august 1994" | sql_create_context |
CREATE TABLE table_23492454_1 (
title VARCHAR,
directed_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the name of the episode directed by Jessica Yu?
| SELECT title FROM table_23492454_1 WHERE directed_by = "Jessica Yu" | sql_create_context |
CREATE TABLE table_65637 (
"Year" real,
"Game" text,
"Genre" text,
"Platform(s)" text,
"Developer(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the platform when the developer was Telltale Games?
| SELECT "Platform(s)" FROM table_65637 WHERE "Developer(s)" = 'telltale games' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsysto... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 966 AND STRFTIME('%y', patient.unitadmittime) = '2104' | eicu |
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 treatment (
treat... | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-23497')) AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TI... | eicu |
CREATE TABLE table_name_72 (
goal_difference INTEGER,
played VARCHAR,
goals_against VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Goal Difference when the goals against were less than 76, and the position larger... | SELECT MAX(goal_difference) FROM table_name_72 WHERE goals_against < 76 AND position > 5 AND played > 30 | sql_create_context |
CREATE TABLE table_22942 (
"School" text,
"Year Founded" text,
"Denomination" text,
"Language" text,
"Grades" text,
"Gender" text,
"Private/Public" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the language of classes in the school f... | SELECT "Language" FROM table_22942 WHERE "Year Founded" = '1874' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid numb... | SELECT diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-13409' AND NOT patient.hospitaldischargetime IS NULL ORDER BY... | eicu |
CREATE TABLE table_name_44 (
player VARCHAR,
pick__number INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What player has a pick # greater than 207?
| SELECT player FROM table_name_44 WHERE pick__number > 207 | sql_create_context |
CREATE TABLE table_7599 (
"Mission name" text,
"Lunar lander" text,
"Lunar landing date" text,
"Lunar blastoff date" text,
"Lunar landing site" text,
"Duration on lunar surface" text,
"Crew" text,
"Number of s EVA" real,
"Total EVA Time (HH:MM)" text
)
-- Using valid SQLite, answer... | SELECT "Crew" FROM table_7599 WHERE "Lunar lander" = 'falcon' | wikisql |
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 person_info.XM FROM person_info JOIN hz_info JOIN zyjzjlb JOIN jybgb JOIN hz_info_zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.YLJGDM = jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZ... | css |
CREATE TABLE table_69818 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many attended on march 1?
| SELECT AVG("Attendance") FROM table_69818 WHERE "Date" = 'march 1' | wikisql |
CREATE TABLE route (
train_id int,
station_id int
)
CREATE TABLE train (
id int,
train_number int,
name text,
origin text,
destination text,
time text,
interval text
)
CREATE TABLE station (
id int,
network_name text,
services text,
local_authority text
)
CREATE TA... | SELECT origin, COUNT(*) FROM train GROUP BY origin ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_63193 (
"Artist" text,
"Album" text,
"Track(s)" text,
"Date" text,
"Label" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Album has an Artist of various artists (compilation), and a Label of laface?
| SELECT "Album" FROM table_63193 WHERE "Artist" = 'various artists (compilation)' AND "Label" = 'laface' | wikisql |
CREATE TABLE table_61187 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the player for t9 and a score of 73-69-74=216?
| SELECT "Player" FROM table_61187 WHERE "Place" = 't9' AND "Score" = '73-69-74=216' | wikisql |
CREATE TABLE table_name_52 (
winner VARCHAR,
trofeo_fast_team VARCHAR,
mountains_classification VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the winner from team Asics-c.g.a. and has a mountains classification of Mariano Piccoli?
| SELECT winner FROM table_name_52 WHERE trofeo_fast_team = "asics-c.g.a." AND mountains_classification = "mariano piccoli" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid num... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', lab.labresulttime)) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-140654' AND patient.hos... | eicu |
CREATE TABLE table_name_37 (
laps INTEGER,
grid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the average laps on a grid of 11?
| SELECT AVG(laps) FROM table_name_37 WHERE grid = 11 | sql_create_context |
CREATE TABLE bdmzjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH number,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZD... | SELECT * FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '褚伟晔' AND hz_info.YLJGDM = '4466465' AND NOT wdmzjzjlb.CYKSMC LIKE '%神外%' UNION SELECT * FROM person_info JO... | css |
CREATE TABLE table_name_25 (
opposition VARCHAR,
tally VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the opposition when the tally was 0-11?
| SELECT opposition FROM table_name_25 WHERE tally = "0-11" | sql_create_context |
CREATE TABLE table_204_164 (
id number,
"branding" text,
"callsign" text,
"frequency" text,
"power (kw)" text,
"location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the number of these stations broadcasting at a frequency of greater ... | SELECT COUNT("branding") FROM table_204_164 WHERE "frequency" > 100 | squall |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT COUNT(DISTINCT PERSON_ID) FROM t_kc21 WHERE IN_DIAG_DIS_CD = 'J29.030' | css |
CREATE TABLE table_21675 (
"Name" text,
"Raw bandwidth (Mbit/s)" real,
"Transfer speed (MB/s)" text,
"Max. cable length (m)" text,
"Power provided" text,
"Devices per channel" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the devices per c... | SELECT "Devices per channel" FROM table_21675 WHERE "Raw bandwidth (Mbit/s)" = '2560' | wikisql |
CREATE TABLE table_33645 (
"Season" real,
"Series Name" text,
"Champion" text,
"Races \u2020" text,
"Pole Positions" text,
"Wins" text,
"Podiums" text,
"Fastest Laps" text,
"Points" text,
"Margin (pts)" text
)
-- Using valid SQLite, answer the following questions for the tables... | SELECT "Fastest Laps" FROM table_33645 WHERE "Races \u2020" = '12/12' | wikisql |
CREATE TABLE table_name_73 (
enrollment INTEGER,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the enrollment for Kendallville?
| SELECT MAX(enrollment) FROM table_name_73 WHERE location = "kendallville" | sql_create_context |
CREATE TABLE table_74317 (
"Track no." real,
"Track" text,
"Original Artist" text,
"Soloist(s)" text,
"Vocal Percussionist" text,
"Arranger(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the percussionist for The Coral?
| SELECT "Vocal Percussionist" FROM table_74317 WHERE "Original Artist" = 'The Coral' | wikisql |
CREATE TABLE table_70260 (
"1-person dive" text,
"2-person dive" text,
"3-person dive" text,
"Surface" text,
"Cage dive" text,
"Seal/turtle decoy" text,
"Catch release" text,
"Attached camera" text,
"Remote camera" text
)
-- Using valid SQLite, answer the following questions for th... | SELECT "2-person dive" FROM table_70260 WHERE "Surface" = '2' | wikisql |
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),
AllergyType VARCHAR(20)
)
CREATE TABLE Has_Allergy (
StuID INTEGE... | SELECT Fname, COUNT(Fname) FROM Student WHERE Sex = 'F' GROUP BY Fname ORDER BY COUNT(Fname) DESC | nvbench |
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 Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREAT... | SELECT dorm_name, AVG(T1.Age) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid GROUP BY T3.dorm_name ORDER BY dorm_name DESC | nvbench |
CREATE TABLE table_53318 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On December 4, Tampa Bay has a record of 12-13-2.
| SELECT "Record" FROM table_53318 WHERE "Home" = 'tampa bay' AND "Date" = 'december 4' | wikisql |
CREATE TABLE table_name_36 (
tally VARCHAR,
county VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Tally in Kerry County?
| SELECT tally FROM table_name_36 WHERE county = "kerry" | sql_create_context |
CREATE TABLE table_16941304_4 (
equipment VARCHAR,
bike_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the equipment for bike number being 3
| SELECT equipment FROM table_16941304_4 WHERE bike_no = 3 | sql_create_context |
CREATE TABLE customer_contact_channels (
customer_id VARCHAR
)
CREATE TABLE customers (
customer_id VARCHAR,
customer_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which contact channel has been used by the customer with name 'Tillman Ernser'?
| SELECT DISTINCT channel_code FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = "Tillman Ernser" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | SELECT demographic.diagnosis, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "990" | mimicsql_data |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE Rev... | SELECT COUNT(1) FROM (SELECT Posts.Id FROM Votes JOIN Posts ON Votes.PostId = Posts.Id JOIN PostTags ON Posts.Id = PostTags.PostId JOIN Tags ON PostTags.TagId = Tags.Id WHERE Posts.ClosedDate IS NULL AND VoteTypeId = 6 AND TagName = 'php' GROUP BY Posts.Id) AS Foo | sede |
CREATE TABLE table_75980 (
"Position" text,
"Jersey #" real,
"Name" text,
"Height (cm)" real,
"Weight (kg)" real,
"Birthdate" text,
"Birthplace" text,
"2007\u20132008 Team" text,
"NHL rights, if any" text
)
-- Using valid SQLite, answer the following questions for the tables provid... | SELECT AVG("Height (cm)") FROM table_75980 WHERE "Birthplace" = 'bloomfield hills, michigan' | wikisql |
CREATE TABLE ref_colors (
color_code text,
color_description text
)
CREATE TABLE product_characteristics (
product_id number,
characteristic_id number,
product_characteristic_value text
)
CREATE TABLE characteristics (
characteristic_id number,
characteristic_type_code text,
characteri... | SELECT product_category_code, typical_buying_price FROM products WHERE product_name = "cumin" | spider |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE diagnoses_icd (
row_id numbe... | SELECT (SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'fall nos')... | mimic_iii |
CREATE TABLE table_9266 (
"Type" text,
"Nominated work" text,
"Award" text,
"Result" text,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What work was nominated at Rockferendum 2007 and got 1st place and got the award for best album?
| SELECT "Nominated work" FROM table_9266 WHERE "Type" = 'rockferendum 2007' AND "Position" = '1st place' AND "Award" = 'best album' | wikisql |
CREATE TABLE table_26914759_3 (
incoming_manager VARCHAR,
position_in_table VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was the incoming manager for the 12th position in the table
| SELECT incoming_manager FROM table_26914759_3 WHERE position_in_table = "12th" | sql_create_context |
CREATE TABLE table_1333612_1 (
country VARCHAR,
es_mulatto VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the country with es mulatto being 3.5%
| SELECT country FROM table_1333612_1 WHERE es_mulatto = "3.5%" | sql_create_context |
CREATE TABLE table_name_45 (
ages VARCHAR,
ofsted VARCHAR,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Ages have an Ofsted larger than 106172, and a School of oakgrove school?
| SELECT ages FROM table_name_45 WHERE ofsted > 106172 AND school = "oakgrove school" | sql_create_context |
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
)
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Visualize a bar chart for w... | SELECT job, AVG(age) FROM Person GROUP BY job ORDER BY job DESC | nvbench |
CREATE TABLE table_name_10 (
year INTEGER,
issue_price VARCHAR,
theme VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year had an issue price of $2,995.95, and a theme of grizzly bear?
| SELECT MAX(year) FROM table_name_10 WHERE issue_price = "$2,995.95" AND theme = "grizzly bear" | sql_create_context |
CREATE TABLE table_64867 (
"Year" real,
"Game" text,
"Genre" text,
"Platform(s)" text,
"Developer(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the genre for Portal 2?
| SELECT "Genre" FROM table_64867 WHERE "Game" = 'portal 2' | wikisql |
CREATE TABLE course (
crs_code text,
dept_code text,
crs_description text,
crs_credit number
)
CREATE TABLE professor (
emp_num number,
dept_code text,
prof_office text,
prof_extension text,
prof_high_degree text
)
CREATE TABLE department (
dept_code text,
dept_name text,
... | SELECT COUNT(DISTINCT dept_name), school_code FROM department GROUP BY school_code | spider |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Name DESC | nvbench |
CREATE TABLE journalist (
age INTEGER,
journalist_id VARCHAR
)
CREATE TABLE news_report (
work_type VARCHAR,
journalist_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the average age and experience working length of journalists working on di... | SELECT AVG(t1.age), AVG(Years_working), t2.work_type FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_id = t2.journalist_id GROUP BY t2.work_type | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | SELECT lab.label FROM lab WHERE lab.subject_id = "6983" | mimicsql_data |
CREATE TABLE table_2668264_8 (
party VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What party did robert p. letcher represent?
| SELECT party FROM table_2668264_8 WHERE incumbent = "Robert P. Letcher" | sql_create_context |
CREATE TABLE table_15644 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Crowd" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the date with record of 55-24
| SELECT "Date" FROM table_15644 WHERE "Record" = '55-24' | wikisql |
CREATE TABLE table_69082 (
"Date" text,
"Team" text,
"Venue" text,
"Win/Draw/Lose" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result of the home game against Derby County?
| SELECT "Win/Draw/Lose" FROM table_69082 WHERE "Venue" = 'home' AND "Team" = 'derby county' | wikisql |
CREATE TABLE table_70139 (
"Member" text,
"Party" text,
"Electorate" text,
"State" text,
"First elected" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the Member when the Party is Alp, and when the Electorate is Grey?
| SELECT "Member" FROM table_70139 WHERE "Party" = 'alp' AND "Electorate" = 'grey' | wikisql |
CREATE TABLE table_203_547 (
id number,
"ship" text,
"built" number,
"in service for cunard" text,
"type" text,
"tonnage" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- the ship with the most tonnage is named after whom ?
| SELECT "ship" FROM table_203_547 ORDER BY "tonnage" DESC LIMIT 1 | squall |
CREATE TABLE table_name_66 (
date VARCHAR,
location VARCHAR,
casualties VARCHAR,
circumstances VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the location 15km NW of Pol-E Khomri, the circumstaances IED and the casualties of 1 WIA?
| SELECT date FROM table_name_66 WHERE casualties = "1 wia" AND circumstances = "ied" AND location = "15km nw of pol-e khomri" | sql_create_context |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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... | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '64675893' AND t_kc22.STA_DATE BETWEEN '2006-03-30' AND '2013-06-05' AND t_kc21.MED_SER_ORG_NO = '0643879' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
... | SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9519 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartevents.item... | mimic_iii |
CREATE TABLE table_8345 (
"Date" text,
"Round" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Result has an Attendance larger than 48,588, and a Venue of A, and a Date of 4 n... | SELECT "Result" FROM table_8345 WHERE "Attendance" > '48,588' AND "Venue" = 'a' AND "Date" = '4 november 2003' | wikisql |
CREATE TABLE table_name_7 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What 1941 has N/A as 1945, N/A for 1948, and 9 for 1953?
| SELECT 1941 FROM table_name_7 WHERE 1945 = "n/a" AND 1948 = "n/a" AND 1953 = "9" | sql_create_context |
CREATE TABLE table_59315 (
"Portland DFL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of draws for all byes larger than 0?
| SELECT SUM("Draws") FROM table_59315 WHERE "Byes" > '0' | wikisql |
CREATE TABLE table_name_27 (
nationality VARCHAR,
lane VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- for the time of 49.04 and lane less than 3, what is the nationality?
| SELECT nationality FROM table_name_27 WHERE lane < 3 AND time = 49.04 | sql_create_context |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT ACC_Road, School_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY ACC_Road DESC | nvbench |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Government" AND lab.label = "Alkaline Phosphatase" | mimicsql_data |
CREATE TABLE table_51722 (
"Year" real,
"Team" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team has jordan 193 chassis after 1990?
| SELECT "Team" FROM table_51722 WHERE "Year" > '1990' AND "Chassis" = 'jordan 193' | wikisql |
CREATE TABLE table_203_834 (
id number,
"rank" number,
"census subdivision" text,
"province" text,
"type" text,
"land area\n(km2, 2011)" number,
"population 2011" number,
"population 2006" number,
"population 2001" number,
"population 1996" number,
"change in % 2006-2011" num... | SELECT "census subdivision" FROM table_203_834 WHERE "population 2011" > 1000000 | squall |
CREATE TABLE table_204_451 (
id number,
"component" text,
"model 01" text,
"model 01+" text,
"model 02" text,
"model e2" text,
"model 2+ (pre-production)" text,
"model 03 (china copy)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what ... | SELECT "component" FROM table_204_451 WHERE id = (SELECT id FROM table_204_451 WHERE "component" = 'usb') - 1 | squall |
CREATE TABLE table_13464416_6 (
high_rebounds VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who made the recovers where the score is 12-30
| SELECT high_rebounds FROM table_13464416_6 WHERE record = "12-30" | sql_create_context |
CREATE TABLE table_name_70 (
motion_picture VARCHAR,
award VARCHAR,
actor VARCHAR,
year VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Motion Picture after 2003 had Viola Davis nominated for Best Supporting Actress?
| SELECT motion_picture FROM table_name_70 WHERE year > 2003 AND result = "nominated" AND actor = "viola davis" AND award = "best supporting actress" | sql_create_context |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON 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 mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH ... | css |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostTags (
PostId num... | SELECT Title FROM Tags, PostTags, Posts, PostTypes WHERE CreationDate <= '2014-10-31' AND Tags.Id = PostTags.TagId AND PostId = Posts.Id AND TagName = 'java' AND Posts.PostTypeId = 1 AND Posts.PostTypeId = PostTypes.Id | sede |
CREATE TABLE table_62364 (
"Week" text,
"Date" text,
"Home team" text,
"Away team" text,
"Venue" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the venue for week 1?
| SELECT "Venue" FROM table_62364 WHERE "Week" = '1' | wikisql |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
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,
JO... | SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_DATE DESC | nvbench |
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, SUM(Revenue) FROM Manufacturers GROUP BY Name ORDER BY SUM(Revenue) | nvbench |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE ... | 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 = 'TORONTO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MILWAU... | atis |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT ACC_Road, SUM(Team_ID) FROM basketball_match GROUP BY ACC_Road | nvbench |
CREATE TABLE Residents_Services (
resident_id INTEGER,
service_id INTEGER,
date_moved_in DATETIME,
property_id INTEGER,
date_requested DATETIME,
date_provided DATETIME,
other_details VARCHAR(255)
)
CREATE TABLE Things (
thing_id INTEGER,
organization_id INTEGER,
Type_of_Thing_Co... | SELECT date_moved_in, COUNT(date_moved_in) FROM Customer_Events GROUP BY date_moved_in | nvbench |
CREATE TABLE table_name_94 (
road_team VARCHAR,
home_team VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the road team playing against Boston on April 16?
| SELECT road_team FROM table_name_94 WHERE home_team = "boston" AND date = "april 16" | sql_create_context |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "ENGL" | mimicsql_data |
CREATE TABLE table_31462 (
"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.
-- How ma... | SELECT COUNT("Game") FROM table_31462 WHERE "Location Attendance" = 'Phog Allen Fieldhouse , Lawrence, KS (16,300)' | wikisql |
CREATE TABLE table_train_280 (
"id" int,
"fpg" float,
"hemoglobin_a1c_hba1c" float,
"heart_disease" bool,
"renal_disease" bool,
"hba1c" float,
"body_mass_index_bmi" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- history o... | SELECT * FROM table_train_280 WHERE heart_disease = 1 | criteria2sql |
CREATE TABLE table_2342078_4 (
episode__number INTEGER,
written_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest episode number written by Harry Winkler?
| SELECT MAX(episode__number) FROM table_2342078_4 WHERE written_by = "Harry Winkler" | sql_create_context |
CREATE TABLE table_name_4 (
sunk_by_u_boat VARCHAR,
sunk_by_mines VARCHAR,
german_submarines_lost VARCHAR,
sunk_by_aircraft VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of sunk by U-boats with less than 2 German submarines ... | SELECT COUNT(sunk_by_u_boat) FROM table_name_4 WHERE german_submarines_lost < 2 AND sunk_by_aircraft = 56328 AND sunk_by_mines > 8269 | sql_create_context |
CREATE TABLE table_55530 (
"Month" text,
"Week" real,
"Overall" text,
"Offensive" text,
"Defensive" text,
"Transition" text,
"Rookie" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who played as overall when Josh Sims was transition?
| SELECT "Overall" FROM table_55530 WHERE "Transition" = 'josh sims' | wikisql |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 82132 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'trazodone' ORDER BY prescriptions.startdate D... | mimic_iii |
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases INTEGER,
Drink TEXT
)
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area... | SELECT Grape, COUNT(Grape) FROM wine WHERE Price > 100 GROUP BY Grape | nvbench |
CREATE TABLE member (
address VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the number of members living in each address.
| SELECT COUNT(*), address FROM member GROUP BY address | sql_create_context |
CREATE TABLE table_name_26 (
power__kw_ VARCHAR,
frequency VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the power when the frequency is 101.5mhz?
| SELECT power__kw_ FROM table_name_26 WHERE frequency = "101.5mhz" | sql_create_context |
CREATE TABLE table_name_60 (
wins INTEGER,
average VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest number of wins for years after 1999 with averages over 73.02?
| SELECT MAX(wins) FROM table_name_60 WHERE average > 73.02 AND year > 1999 | sql_create_context |
CREATE TABLE table_train_83 (
"id" int,
"systolic_blood_pressure_sbp" int,
"renal_disease" bool,
"diabetic" string,
"estimated_glomerular_filtration_rate_egfr" int,
"iq" int,
"geriatric_depression_scale_gds" int,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for... | SELECT * FROM table_train_83 WHERE estimated_glomerular_filtration_rate_egfr < 45 OR renal_disease = 1 | criteria2sql |
CREATE TABLE table_name_55 (
date VARCHAR,
runner_s__up VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Date has a Runner(s)-up of fred funk?
| SELECT date FROM table_name_55 WHERE runner_s__up = "fred funk" | sql_create_context |
CREATE TABLE table_70102 (
"Tournament" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the 2011 for 2010 of olympic games
| SELECT "2011" FROM table_70102 WHERE "2010" = 'olympic games' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2167" AND prescriptions.route = "TP" | mimicsql_data |
CREATE TABLE table_name_88 (
score VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Fredrik Jacobson's score?
| SELECT score FROM table_name_88 WHERE player = "fredrik jacobson" | sql_create_context |
CREATE TABLE table_8751 (
"Name/Designation" text,
"Class" text,
"Range (varies with payload weight)" text,
"Payload" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name/designation for the under development status?
| SELECT "Name/Designation" FROM table_8751 WHERE "Status" = 'under development' | wikisql |
CREATE TABLE table_64179 (
"Position" real,
"Gymnast" text,
"A Score" real,
"B Score" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the A Score when the B Score is more than 9.05, and the total is less than 16.525?
| SELECT COUNT("A Score") FROM table_64179 WHERE "B Score" > '9.05' AND "Total" < '16.525' | wikisql |
CREATE TABLE table_name_20 (
movie VARCHAR,
co_singers VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In which movie is Selva Nambi a co-singer?
| SELECT movie FROM table_name_20 WHERE co_singers = "selva nambi" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.