context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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... | Draw a bar chart of decor versus minimal baseprice, and sort Y-axis from low to high order. | SELECT decor, MIN(basePrice) FROM Rooms GROUP BY decor ORDER BY MIN(basePrice) | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | Find the number of divorced patients with 2182-12-31 17:20:00 as the lab test chart time. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "DIVORCED" AND lab.charttime = "2182-12-31 17:20:00" | mimicsql_data |
CREATE TABLE customer (
customer_id SMALLINT UNSIGNED,
store_id TINYINT UNSIGNED,
first_name VARCHAR(45),
last_name VARCHAR(45),
email VARCHAR(50),
address_id SMALLINT UNSIGNED,
active BOOLEAN,
create_date DATETIME,
last_update TIMESTAMP
)
CREATE TABLE rental (
rental_id INT,
... | How many films are there in each category? List the genre name and the count with a bar chart, and list the total number in asc order please. | SELECT name, COUNT(*) FROM film_category AS T1 JOIN category AS T2 ON T1.category_id = T2.category_id GROUP BY T1.category_id ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_name_99 (
april INTEGER,
record VARCHAR,
points VARCHAR
) | What is the highest value in April with a record of 35 37 11 and more than 81 points? | SELECT MAX(april) FROM table_name_99 WHERE record = "35–37–11" AND points > 81 | sql_create_context |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE voting_record (
stuid number,
registration_date text,
election_cycle text,
president_vote number,
vice_president_vote number... | What are the maximum and minimum age of students with major 600? | SELECT MAX(age), MIN(age) FROM student WHERE major = 600 | spider |
CREATE TABLE table_45799 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"Record" text,
"Streak" text
) | Which Record has a Score of 111 101? | SELECT "Record" FROM table_45799 WHERE "Score" = '111–101' | wikisql |
CREATE TABLE table_20398823_1 (
podiums INTEGER,
points VARCHAR
) | Name the least podiums for 49 points | SELECT MIN(podiums) FROM table_20398823_1 WHERE points = "49" | sql_create_context |
CREATE TABLE table_name_87 (
lost INTEGER,
goals_scored VARCHAR,
place VARCHAR
) | What the lost in place less than 3 and having more than 63 goals scored? | SELECT SUM(lost) FROM table_name_87 WHERE goals_scored > 63 AND place < 3 | sql_create_context |
CREATE TABLE table_name_43 (
gain INTEGER,
avg_g VARCHAR,
loss VARCHAR
) | What are the gains for the player with average of 26.8 and lost yard fewer than 13? | SELECT SUM(gain) FROM table_name_43 WHERE avg_g = "26.8" AND loss < 13 | sql_create_context |
CREATE TABLE table_22815265_1 (
record VARCHAR,
opponents VARCHAR
) | How many records were there when opponents were 9? | SELECT COUNT(record) FROM table_22815265_1 WHERE opponents = 9 | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | find the number of patients whose insurance is self pay and lab test name is platelet count. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Self Pay" AND lab.label = "Platelet Count" | mimicsql_data |
CREATE TABLE table_11861 (
"Rank" real,
"Player" text,
"Country" text,
"Earnings( $ )" real,
"Wins" real
) | How much has dave stockton earned? | SELECT MAX("Earnings( $ )") FROM table_11861 WHERE "Player" = 'dave stockton' | wikisql |
CREATE TABLE table_24355 (
"Type of Record" text,
"Attendance" real,
"Date/Year" text,
"Stadium" text,
"Result/Games" text
) | what is the highest attendance for a total attendance-regular season record | SELECT MAX("Attendance") FROM table_24355 WHERE "Type of Record" = 'Total Attendance-Regular season' | wikisql |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course (
course_id int,
na... | What is the most challenging class ? | SELECT DISTINCT course.name, course.number, program_course.workload FROM course, program_course WHERE course.department = 'EECS' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MAX(PROGRAM_COURSEalias1.workload) FROM course AS COURSEalias1, program_course AS PROGRAM_COURSEalias1 WH... | advising |
CREATE TABLE table_name_43 (
number_of_households INTEGER,
median_household_income VARCHAR
) | What is the sum of households that makes a median household income of $44,718? | SELECT SUM(number_of_households) FROM table_name_43 WHERE median_household_income = "$44,718" | sql_create_context |
CREATE TABLE table_name_39 (
astc_member VARCHAR,
aam_accredited VARCHAR,
state VARCHAR,
aam_member VARCHAR
) | What is ASTC Member, when State is Arkansas, when AAM Member is No, and when AAM Accredited is Yes? | SELECT astc_member FROM table_name_39 WHERE state = "arkansas" AND aam_member = "no" AND aam_accredited = "yes" | sql_create_context |
CREATE TABLE table_name_72 (
place VARCHAR,
artist VARCHAR,
points VARCHAR
) | Name the total number of places for vicky gordon and points more than 23 | SELECT COUNT(place) FROM table_name_72 WHERE artist = "vicky gordon" AND points > 23 | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions... | what is the number of patients diagnosed with hamartoses nec who have been prescribed additive type drug? | 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 = "Hamartoses NEC" AND prescriptions.drug_type = "ADDITIVE" | mimicsql_data |
CREATE TABLE table_name_30 (
attendance INTEGER,
arena VARCHAR,
points VARCHAR
) | How much Attendance has an Arena of arrowhead pond of anaheim, and Points of 5? | SELECT SUM(attendance) FROM table_name_30 WHERE arena = "arrowhead pond of anaheim" AND points = 5 | sql_create_context |
CREATE TABLE table_204_448 (
id number,
"team" text,
"winners" number,
"runners-up" number,
"years won" text,
"years runner-up" text
) | which teams has the least wins ? | SELECT "team" FROM table_204_448 WHERE "winners" = (SELECT MIN("winners") FROM table_204_448) | squall |
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_description VARCHAR(255)
)
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password... | What are the student IDs and middle names of the students enrolled in at most two courses, rank by the student_id from high to low please. | SELECT T2.middle_name, T1.student_id FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id ORDER BY T1.student_id DESC | nvbench |
CREATE TABLE table_name_65 (
leading_scorer VARCHAR,
attendance VARCHAR,
record VARCHAR
) | What is Leading Scorer, when Attendance is Gund Arena 20,562, and when Record is 20-10? | SELECT leading_scorer FROM table_name_65 WHERE attendance = "gund arena 20,562" AND record = "20-10" | sql_create_context |
CREATE TABLE table_10038 (
"Team" text,
"Match" real,
"Points" real,
"Draw" real,
"Lost" real
) | What is the number of points when the match is smaller than 14? | SELECT COUNT("Points") FROM table_10038 WHERE "Match" < '14' | wikisql |
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
First_Elected real,
Committee text
)
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
CREATE TABLE party (
Party_ID int,
... | For each county, find the name of the county and the number of delegates from that county Show bar chart, and show by the Y from low to high please. | SELECT County_name, COUNT(*) FROM county AS T1 JOIN election AS T2 ON T1.County_Id = T2.District GROUP BY T1.County_Id ORDER BY COUNT(*) | nvbench |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number... | Subtract the preceding value from the current value using php while loop. | SELECT * FROM Posts WHERE Id = '5312400' | sede |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | give me the number of patients whose insurance is medicaid and primary disease is morbid obesity/sda? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Medicaid" AND demographic.diagnosis = "MORBID OBESITY/SDA" | mimicsql_data |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Users with the highest posts to total rep ratio. | SELECT u.Id AS "user_link", u.Reputation, COUNT(*) AS "total_number_of_posts", COUNT(*) / u.Reputation AS Ratio FROM Users AS u JOIN Posts AS p ON p.OwnerUserId = u.Id WHERE p.PostTypeId IN (1, 2) GROUP BY u.Id, u.DisplayName, u.Reputation ORDER BY Ratio DESC LIMIT 100 | sede |
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 ... | provide the number of patients whose admission year is less than 2110 and diagnoses icd9 code is 7885? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2110" AND diagnoses.icd9_code = "7885" | mimicsql_data |
CREATE TABLE table_29471472_1 (
season INTEGER,
team VARCHAR
) | What season was the team autosport academy? | SELECT MAX(season) FROM table_29471472_1 WHERE team = "Autosport Academy" | sql_create_context |
CREATE TABLE table_36446 (
"Year" text,
"Flagship Station" text,
"Play-by-play" text,
"Color commentator(s)" text,
"Studio host" text
) | Name the flagship station for cedric maxwell and year of 1995-96 | SELECT "Flagship Station" FROM table_36446 WHERE "Color commentator(s)" = 'cedric maxwell' AND "Year" = '1995-96' | wikisql |
CREATE TABLE table_13741576_4 (
try_bonus VARCHAR,
tries_against VARCHAR
) | Name the try bonus for tries against is 70 | SELECT try_bonus FROM table_13741576_4 WHERE tries_against = "70" | sql_create_context |
CREATE TABLE table_8235 (
"ISLAND" text,
"CITY / TOWN" text,
"ICAO" text,
"IATA" text,
"AIRPORTNAME" text
) | What is the name of the airport in S o Filipe that has an IATA of sfl? | SELECT "AIRPORTNAME" FROM table_8235 WHERE "CITY / TOWN" = 'são filipe' AND "IATA" = 'sfl' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | how many patients are diagnosed with human immuno virus dis and had their lab test show abnormal status? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Human immuno virus dis" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE table_18662026_10 (
gymnast VARCHAR,
parallel_bars VARCHAR
) | If the parallel bars is 14.025, what is the total number of gymnasts? | SELECT COUNT(gymnast) FROM table_18662026_10 WHERE parallel_bars = "14.025" | sql_create_context |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
... | User's Reputation, Questions, Comments and Answers. | SELECT TOP(100) AS DisplayName, Reputation, AnswerCount, CommentCount FROM Users, Posts ORDER BY Reputation DESC | sede |
CREATE TABLE party (
Party_Theme VARCHAR,
Number_of_hosts VARCHAR
) | List the themes of parties in ascending order of number of hosts. | SELECT Party_Theme FROM party ORDER BY Number_of_hosts | sql_create_context |
CREATE TABLE table_12599 (
"State" text,
"Status" text,
"Association Agreement" text,
"Membership Application" text,
"Candidate status" text,
"Negotiations start" text,
"Screening completed" text,
"Acquis Chapters open/closed" text
) | What is the candidate status of macedonia? | SELECT "Candidate status" FROM table_12599 WHERE "State" = 'macedonia' | wikisql |
CREATE TABLE table_44766 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | What is Name, when Overall is greater than 132, and when Round is 12? | SELECT "Name" FROM table_44766 WHERE "Overall" > '132' AND "Round" = '12' | wikisql |
CREATE TABLE table_43814 (
"Club" text,
"League goals" text,
"FA Cup goals" text,
"League Cup goals" text,
"Total" real
) | Which League Cup goals have a Total larger than 14, and a League goals of 14, and a FA Cup goals of 0? | SELECT "League Cup goals" FROM table_43814 WHERE "Total" > '14' AND "League goals" = '14' AND "FA Cup goals" = '0' | wikisql |
CREATE TABLE table_name_58 (
lost VARCHAR,
points VARCHAR,
points_against VARCHAR
) | when points were 36 and points against 489 what is the lost? | SELECT lost FROM table_name_58 WHERE points = "36" AND points_against = "489" | sql_create_context |
CREATE TABLE table_11216 (
"Pick" real,
"Round" text,
"Player" text,
"Position" text,
"School" text
) | What position did the school of alabama draft? | SELECT "Position" FROM table_11216 WHERE "School" = 'alabama' | wikisql |
CREATE TABLE table_77897 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the home team for victoria park? | SELECT "Home team" FROM table_77897 WHERE "Venue" = 'victoria park' | wikisql |
CREATE TABLE table_name_60 (
tournament VARCHAR,
opponent VARCHAR
) | Which tournament did the opponent Guillermo Carry play? | SELECT tournament FROM table_name_60 WHERE opponent = "guillermo carry" | sql_create_context |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
... | How many views did the question I answered get?. Finds every answer you wrote, and then looks how many views the question got. Kinda cool imo. | SELECT A.ParentId AS "Question ID", Q.Id AS "post_link", Q.Tags AS "Tags", Q.ViewCount AS "Views" FROM Posts AS A INNER JOIN Posts AS Q ON Q.Id = A.ParentId WHERE A.PostTypeId = 2 AND A.OwnerUserId = @UserId ORDER BY Q.ViewCount DESC | sede |
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... | 个人自理金额在医疗就诊42021266388里面需要多少钱? | SELECT PER_SOL FROM t_kc24 WHERE MED_CLINIC_ID = '42021266388' | css |
CREATE TABLE table_name_56 (
crowd INTEGER,
venue VARCHAR
) | Who has the smallest crowd in the Venue of Arden Street Oval? | SELECT MIN(crowd) FROM table_name_56 WHERE venue = "arden street oval" | sql_create_context |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
... | what procedure did patient 15257 until 2104 receive for the last time? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15257) AND STRFTIME('%y', procedures_icd.charttime) <= '2104' ORDER ... | mimic_iii |
CREATE TABLE table_name_99 (
player VARCHAR,
to_par VARCHAR
) | Name the Player which has a To par of 6? | SELECT player FROM table_name_99 WHERE to_par = "–6" | sql_create_context |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number... | what is the name of the specimen test which patient 5878 has last received on the last hospital encounter? | SELECT microbiologyevents.spec_type_desc FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5878 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) ORDER BY microbiologyevents.charttime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_name_13 (
silver VARCHAR,
total VARCHAR,
gold VARCHAR,
bronze VARCHAR
) | What is the total number of silver medals of the team with less than 2 gold, 1 bronze, and more than 2 total medals? | SELECT COUNT(silver) FROM table_name_13 WHERE gold < 2 AND bronze = 1 AND total > 2 | sql_create_context |
CREATE TABLE table_train_233 (
"id" int,
"serum_bicarbonate" int,
"language" string,
"hemoglobin_a1c_hba1c" float,
"creatinine_clearance_cl" float,
"admission_blood_glucose" int,
"urine_albumin" int,
"ketoacidosis" bool,
"age" float,
"NOUSE" float
) | subjects must have an admission blood glucose > 140 mg and < 400 mg / dl and no evidence of ketoacidosis ( serum bicarbonate < 18 meq / l | SELECT * FROM table_train_233 WHERE admission_blood_glucose > 140 AND admission_blood_glucose < 400 AND (ketoacidosis = 0 OR serum_bicarbonate > 18) | criteria2sql |
CREATE TABLE table_name_98 (
opponent VARCHAR,
points VARCHAR
) | Which opponent has 63 points? | SELECT opponent FROM table_name_98 WHERE points = 63 | sql_create_context |
CREATE TABLE settlements (
settlement_id number,
claim_id number,
date_claim_made time,
date_claim_settled time,
amount_claimed number,
amount_settled number,
customer_policy_id number
)
CREATE TABLE payments (
payment_id number,
settlement_id number,
payment_method_code text,
... | Of all the claims, what was the earliest date when any claim was made? | SELECT date_claim_made FROM claims ORDER BY date_claim_made LIMIT 1 | spider |
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... | Visualize a bar chart about the distribution of All_Home and the sum of Team_ID , and group by attribute All_Home, and display by the X in descending please. | SELECT All_Home, SUM(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home DESC | nvbench |
CREATE TABLE table_name_84 (
wins VARCHAR,
year VARCHAR
) | What is listed for the Wins with a Year of 1989? | SELECT wins FROM table_name_84 WHERE year = 1989 | sql_create_context |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
... | Singapore Top User with Python tag. | SELECT ROW_NUMBER() OVER (ORDER BY u.Reputation DESC) AS "#", u.Id AS "user_link", u.Reputation 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(u.Location) LIKE '%singapore%' OR UPPER(u.Location) LIKE '%SG' A... | sede |
CREATE TABLE Transactions (
transaction_id INTEGER,
investor_id INTEGER,
transaction_type_code VARCHAR(10),
date_of_transaction DATETIME,
amount_of_transaction DECIMAL(19,4),
share_count VARCHAR(40),
other_details VARCHAR(255)
)
CREATE TABLE Ref_Transaction_Types (
transaction_type_code... | Show the average amount of transactions for different investors with a scatter chart. | SELECT investor_id, AVG(amount_of_transaction) FROM Transactions GROUP BY investor_id | nvbench |
CREATE TABLE table_name_96 (
city VARCHAR,
club VARCHAR
) | Which city has a club called the Huntsville Stars? | SELECT city FROM table_name_96 WHERE club = "huntsville stars" | sql_create_context |
CREATE TABLE table_4556 (
"Actor/actress" text,
"Character" text,
"Rank" text,
"Tenure" text,
"Episodes" text
) | What rank did actor Aaron Pedersen's character have? | SELECT "Rank" FROM table_4556 WHERE "Actor/actress" = 'aaron pedersen' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREA... | what is the daily maximum amount of urine in patient 025-51980 in 01/this year? | SELECT MAX(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-51980')) AND intakeoutput.celllabel = 'urine... | eicu |
CREATE TABLE table_23846 (
"Parish" text,
"Obama%" text,
"Obama#" real,
"McCain%" text,
"McCain#" real
) | What was McCain's percentage when Obama had 64.39% of the vote? | SELECT "McCain%" FROM table_23846 WHERE "Obama%" = '64.39%' | wikisql |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
C... | 过去患者郎曼吟得过哪些疾病? | SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '郎曼吟' | css |
CREATE TABLE table_204_809 (
id number,
"draw" number,
"country" text,
"language" text,
"artist" text,
"song" text,
"english translation" text,
"national final" text,
"place" number,
"points" number
) | how many countries other than spain placed 2nd in the national final category ? | SELECT COUNT("country") FROM table_204_809 WHERE "country" <> 'spain' AND "national final" = 2 | squall |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime... | what is the yearly minimum amount of output y (ml)-chest tube y - a #1 right b #1 left in patient 016-13544 until 04/2104? | SELECT MIN(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-13544')) AND intakeoutput.celllabel = 'outpu... | eicu |
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,
... | what is the number of patients whose drug name is nifedipine cr? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "NIFEdipine CR" | mimicsql_data |
CREATE TABLE table_57852 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What team was the home team on 27 june 1981, at vfl park? | SELECT "Home team" FROM table_57852 WHERE "Date" = '27 june 1981' AND "Venue" = 'vfl park' | wikisql |
CREATE TABLE table_29289 (
"Season" text,
"Coach" text,
"Conf. Record" text,
"Overall" text,
"Standings" text,
"Postseason" text
) | Who was the coach of the Pandas when their overall record was 20-6-2? | SELECT "Coach" FROM table_29289 WHERE "Overall" = '20-6-2' | wikisql |
CREATE TABLE table_31291 (
"Season" text,
"Level" text,
"Division" text,
"Section" text,
"Position" text,
"Movements" text
) | in what year the position was the 9th | SELECT "Season" FROM table_31291 WHERE "Position" = '9th' | wikisql |
CREATE TABLE table_name_37 (
venue VARCHAR,
kitmaker VARCHAR,
team VARCHAR
) | Which Venue has a Kitmaker of lotto, and a Team of apoel? | SELECT venue FROM table_name_37 WHERE kitmaker = "lotto" AND team = "apoel" | sql_create_context |
CREATE TABLE table_47119 (
"Senator" text,
"Party" text,
"District" real,
"Home Town" text,
"Took Office" real
) | What is the lowest Took Office, when Senator is Eddie Bernice Johnson, and when District is greater than 23? | SELECT MIN("Took Office") FROM table_47119 WHERE "Senator" = 'eddie bernice johnson' AND "District" > '23' | wikisql |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text ... | Never Met A Question Or Answer They Didn't Like!. | SELECT u.Id, u.DisplayName, u.Reputation, u.DownVotes, u.UpVotes, u.LastAccessDate FROM Users AS u WHERE u.Reputation >= 3000 AND u.DownVotes = 0 ORDER BY u.Reputation DESC | sede |
CREATE TABLE table_name_98 (
f_laps VARCHAR,
final_placing VARCHAR,
podiums VARCHAR,
season VARCHAR
) | Which F/Laps has Podiums of 1, and a Season of 2000, and a Final Placing of nc? | SELECT f_laps FROM table_name_98 WHERE podiums = "1" AND season = 2000 AND final_placing = "nc" | sql_create_context |
CREATE TABLE table_34633 (
"Spacecraft" text,
"Destination" text,
"Launched" text,
"Closest approach" text,
"Time elapsed" text
) | What Launched has both a Spacecraft of Ulysses and 491 days (1 yr, 4 mo, 3 d) as Time elapsed? | SELECT "Launched" FROM table_34633 WHERE "Spacecraft" = 'ulysses' AND "Time elapsed" = '491 days (1 yr, 4 mo, 3 d)' | wikisql |
CREATE TABLE course_authors_and_tutors (
author_id number,
author_tutor_atb text,
login_name text,
password text,
personal_name text,
middle_name text,
family_name text,
gender_mf text,
address_line_1 text
)
CREATE TABLE subjects (
subject_id number,
subject_name text
)
CRE... | Which course author teaches the 'advanced database' course? Give me his or her login name. | SELECT T1.login_name FROM course_authors_and_tutors AS T1 JOIN courses AS T2 ON T1.author_id = T2.author_id WHERE T2.course_name = "advanced database" | spider |
CREATE TABLE person (
name text,
age number,
city text,
gender text,
job text
)
CREATE TABLE personfriend (
name text,
friend text,
year number
) | How many type of jobs do they have? | SELECT COUNT(DISTINCT job) FROM person | spider |
CREATE TABLE table_11447995_2 (
liscumb VARCHAR,
gauthier VARCHAR
) | What is the Liscumb when Gauthier is 34? | SELECT liscumb FROM table_11447995_2 WHERE gauthier = "34" | sql_create_context |
CREATE TABLE table_name_73 (
points VARCHAR,
class VARCHAR,
rank VARCHAR
) | How many points did ginger have when she was ranked 5th on a 350cc class bike? | SELECT COUNT(points) FROM table_name_73 WHERE class = "350cc" AND rank = "5th" | sql_create_context |
CREATE TABLE table_name_67 (
away_team VARCHAR,
home_team VARCHAR
) | What away team has tottenham hotspur as the home team? | SELECT away_team FROM table_name_67 WHERE home_team = "tottenham hotspur" | sql_create_context |
CREATE TABLE table_26218783_6 (
points VARCHAR,
player VARCHAR
) | How many times is player Stanislas Wawrinka on the list? | SELECT COUNT(points) AS defending FROM table_26218783_6 WHERE player = "Stanislas Wawrinka" | sql_create_context |
CREATE TABLE table_14408 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | Name the opponent for august 26 | SELECT "Opponent" FROM table_14408 WHERE "Date" = 'august 26' | wikisql |
CREATE TABLE table_name_16 (
no_result VARCHAR,
wins VARCHAR,
losses VARCHAR,
played VARCHAR
) | Name the total number of no result for losses more than 1 and played of 38 and wins less than 19 | SELECT COUNT(no_result) FROM table_name_16 WHERE losses > 1 AND played = 38 AND wins < 19 | sql_create_context |
CREATE TABLE table_name_28 (
to_par VARCHAR,
player VARCHAR,
total VARCHAR
) | What is the total number of To Par, when Player is 'Julius Boros', and when Total is greater than 295? | SELECT COUNT(to_par) FROM table_name_28 WHERE player = "julius boros" AND total > 295 | sql_create_context |
CREATE TABLE table_203_412 (
id number,
"school" text,
"conference" text,
"record (conference)" text,
"head coach" text,
"cws appearances" text,
"cws best finish" text,
"cws record" text
) | which team did not have more than 16 wins ? | SELECT "school" FROM table_203_412 WHERE "record (conference)" <= 16 | squall |
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | Return a scatter chart about the correlation between People_ID and Weight . | SELECT People_ID, Weight FROM people | nvbench |
CREATE TABLE table_name_15 (
partner VARCHAR,
opponents_in_the_final VARCHAR
) | Tell me the partner for opponents of anamika bhargava sylvia krywacz | SELECT partner FROM table_name_15 WHERE opponents_in_the_final = "anamika bhargava sylvia krywacz" | sql_create_context |
CREATE TABLE table_26427332_17 (
measurements__in_cm_ VARCHAR,
city VARCHAR
) | what measurement does the contestant from sindelfingen have? | SELECT measurements__in_cm_ FROM table_26427332_17 WHERE city = "Sindelfingen" | sql_create_context |
CREATE TABLE table_77928 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"Nationality" text,
"Team" text,
"College" text
) | What is the lowest pick number for players from king's (ny)? | SELECT MIN("Pick") FROM table_77928 WHERE "College" = 'king''s (ny)' | wikisql |
CREATE TABLE table_11658094_3 (
joined VARCHAR,
location VARCHAR
) | What year did the school from mars hill, north carolina join? | SELECT joined FROM table_11658094_3 WHERE location = "Mars Hill, North Carolina" | 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(... | For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about the average of employee_id over the hire_date bin hire_date by weekday by a bar chart. | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_name_63 (
a_score VARCHAR,
nation VARCHAR,
t_score VARCHAR
) | What was the total number of A scores for Japan when the T score was more than 4? | SELECT COUNT(a_score) FROM table_name_63 WHERE nation = "japan" AND t_score > 4 | sql_create_context |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TA... | Does ANAT 403 work for ULCS ? | SELECT COUNT(*) > 0 FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = 'ANAT' AND course.number = 403 AND program_course.category LIKE '%ULCS%' | advising |
CREATE TABLE table_21756039_1 (
regular_season_results VARCHAR,
year VARCHAR
) | What is the regular season results for the year 2011-2012? | SELECT regular_season_results FROM table_21756039_1 WHERE year = "2011-2012" | sql_create_context |
CREATE TABLE table_name_57 (
home_team VARCHAR
) | What is the home team's score for north melbourne? | SELECT home_team AS score FROM table_name_57 WHERE home_team = "north melbourne" | sql_create_context |
CREATE TABLE table_name_44 (
date VARCHAR,
surface VARCHAR
) | Which date has a Surface of carpet (i)? | SELECT date FROM table_name_44 WHERE surface = "carpet (i)" | sql_create_context |
CREATE TABLE table_name_47 (
riding VARCHAR,
rank VARCHAR
) | What is the Riding, when the Rank is 4th? | SELECT riding FROM table_name_47 WHERE rank = "4th" | sql_create_context |
CREATE TABLE table_name_29 (
points_difference VARCHAR,
points VARCHAR
) | I want the points difference for points of 14 | SELECT points_difference FROM table_name_29 WHERE points = 14 | sql_create_context |
CREATE TABLE table_name_88 (
Id VARCHAR
) | What is 1994 Grand Slam Tournament if 1993 is also grand slam tournaments? | SELECT 1994 FROM table_name_88 WHERE 1993 = "grand slam tournaments" | sql_create_context |
CREATE TABLE table_name_47 (
lane INTEGER,
semi VARCHAR
) | Which lane did the athlete swim in who had a semi-final time of 49.19? | SELECT MIN(lane) FROM table_name_47 WHERE semi = 49.19 | sql_create_context |
CREATE TABLE table_63470 (
"Draw" real,
"Language" text,
"Artist" text,
"English translation" text,
"Place" real,
"Points" real
) | How many points does mia martini have? | SELECT COUNT("Points") FROM table_63470 WHERE "Artist" = 'mia martini' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | how many patients stayed in hospital for more than 17 days and underwent right and left cardiac catheterization? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "17" AND procedures.long_title = "Combined right and left heart cardiac catheterization" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.