context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_31091 ( "Name" text, "Occupation" text, "Gender" text, "Prison connection" text, "Played by" text, "Status" text )
How many characters does Maurice Dean Wint play in the movie Cube?
SELECT COUNT("Status") FROM table_31091 WHERE "Played by" = 'Maurice Dean Wint'
wikisql
CREATE TABLE table_40219 ( "Administrative Panel" real, "Agricultural Panel" real, "Cultural and Educational Panel" real, "Industrial and Commercial Panel" real, "Labour Panel" real, "National University of Ireland" real, "University of Dublin" real, "Nominated by the Taoiseach" real, ...
Which Agricultural Panel has a Nominated by the Taoiseach larger than 6, and a Total larger than 60?
SELECT SUM("Agricultural Panel") FROM table_40219 WHERE "Nominated by the Taoiseach" > '6' AND "Total" > '60'
wikisql
CREATE TABLE table_name_22 ( event VARCHAR, prize VARCHAR )
What is the name of the event that had a prize of z 1,226,711?
SELECT event FROM table_name_22 WHERE prize = "zł 1,226,711"
sql_create_context
CREATE TABLE table_62976 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
What's the listed average of Cuts made that has a Top-5 of 3, and a Top-10 that's smaller than 5?
SELECT AVG("Cuts made") FROM table_62976 WHERE "Top-5" = '3' AND "Top-10" < '5'
wikisql
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 )
For those records from the products and each product's manufacturer, give me the comparison about the sum of price over the name , and group by attribute name by a bar chart.
SELECT T2.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name
nvbench
CREATE TABLE table_name_86 ( icao VARCHAR, airport VARCHAR )
What is the ICAO for Antalya Airport?
SELECT icao FROM table_name_86 WHERE airport = "antalya airport"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, h...
a year before how many patients were prescribed cefazolin 2gm syr within 2 months after being diagnosed with urinary tract infection?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'urinary tract infection' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), '...
eicu
CREATE TABLE table_66620 ( "Title" text, "Series" text, "Director" text, "Production Num." text, "Release date" text )
Who directed hamateur night?
SELECT "Director" FROM table_66620 WHERE "Title" = 'hamateur night'
wikisql
CREATE TABLE table_73995 ( "Edition" text, "Year" real, "Host city" text, "Host country" text, "Date" text, "No. of athletes" text, "Nations" real )
What was the host city of the 8th edition in the the host country of Croatia?
SELECT "Host city" FROM table_73995 WHERE "Host country" = 'Croatia' AND "Edition" = '8th'
wikisql
CREATE TABLE Staff ( staff_id INTEGER, staff_gender VARCHAR(1), staff_name VARCHAR(80) ) CREATE TABLE Addresses ( address_id INTEGER, address_details VARCHAR(255) ) CREATE TABLE Supplier_Addresses ( supplier_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME ) CR...
what is the average price for each type of product?, I want to display by the x axis in descending.
SELECT product_type_code, AVG(product_price) FROM Products GROUP BY product_type_code ORDER BY product_type_code DESC
nvbench
CREATE TABLE table_name_7 ( rating VARCHAR, air_date VARCHAR, weekly_winner VARCHAR )
What is Rating, when Air Date is 'July 24, 2008*', and when Weekly Winner is 'Sales Rep. Oscar Ledezma'?
SELECT rating FROM table_name_7 WHERE air_date = "july 24, 2008*" AND weekly_winner = "sales rep. oscar ledezma"
sql_create_context
CREATE TABLE table_17758 ( "No." real, "#" real, "Title" text, "Directed by" text, "Written by" text, "Bens location" text, "Original air date" text, "U.S. viewers (million)" text )
Who is the director of the episode titled 'Cheyenne, WY'?
SELECT "Directed by" FROM table_17758 WHERE "Title" = 'Cheyenne, WY'
wikisql
CREATE TABLE table_42955 ( "Member state" text, "Population millions" real, "MEPs" real, "Inhabitants per MEP" real, "Influence" real )
What is the lowest influence with population in the millions less than 60.64, and MEPs less than 22, and 454,059 inhabitant per MEP?
SELECT MIN("Influence") FROM table_42955 WHERE "Population millions" < '60.64' AND "MEPs" < '22' AND "Inhabitants per MEP" = '454,059'
wikisql
CREATE TABLE table_47630 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text )
Which Position has a Competition of european race walking cup?
SELECT "Position" FROM table_47630 WHERE "Competition" = 'european race walking cup'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) ...
among patients in the 40s until 2103 what were the top four most frequent diagnoses?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN...
mimic_iii
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Tags ( Id number, TagName text, Cou...
random 's absurd edit summaries (meta only). Any edit summary comment from random that's over 100 characters is sure to be an interesting read.
SELECT a.CreationDate, a.Comment AS "ridiculous_comment" FROM PostHistory AS a WHERE a.PostHistoryTypeId IN (4, 5, 6) AND LENGTH(a.Comment) > 100 ORDER BY a.CreationDate
sede
CREATE TABLE table_65317 ( "Constituency number" text, "Name" text, "Reserved for ( SC / ST /None)" text, "District" text, "Number of electorates (2003)" real )
What is the lowest number of Electorates (2003) in District bhind, Reserved for none, and Constituency Number 11?
SELECT MIN("Number of electorates (2003)") FROM table_65317 WHERE "District" = 'bhind' AND "Reserved for ( SC / ST /None)" = 'none' AND "Constituency number" = '11'
wikisql
CREATE TABLE table_18390 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What is the name of the incumbent who was first eleccted in 1940?
SELECT "Incumbent" FROM table_18390 WHERE "First elected" = '1940'
wikisql
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 prescription...
provide the number of patients whose year of birth is less than 2098 and drug code is syringens?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2098" AND prescriptions.formulary_drug_cd = "SYRINGENS"
mimicsql_data
CREATE TABLE table_18703133_1 ( losses INTEGER, points VARCHAR )
Name the least amount of losses for 23 points
SELECT MIN(losses) FROM table_18703133_1 WHERE points = 23
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE outputevents ( row_id number, subject_id number, ...
what is the number of patients that were admitted to the hospital in this year?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
mimic_iii
CREATE TABLE customers ( customer_id number, payment_method text, customer_name text, date_became_customer time, other_customer_details text ) CREATE TABLE products ( product_id number, product_details text ) CREATE TABLE order_items ( order_id number, product_id number, order_...
Find the contact channel code that was used by the customer named '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"
spider
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
provide the number of patients whose age is less than 81 and days of hospital stay is greater than 11?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "81" AND demographic.days_stay > "11"
mimicsql_data
CREATE TABLE table_69858 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real )
Which years have a Decile of 4, an Authority of state, and a Name of mapiu school?
SELECT "Years" FROM table_69858 WHERE "Decile" = '4' AND "Authority" = 'state' AND "Name" = 'mapiu school'
wikisql
CREATE TABLE table_204_889 ( id number, "date" text, "week (stage)" text, "song choice" text, "original artist" text, "theme" text, "result" text )
what was the date of the last free choice performance ?
SELECT "date" FROM table_204_889 WHERE "theme" = 'free choice' ORDER BY "date" DESC LIMIT 1
squall
CREATE TABLE table_79149 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text )
Who is the incumbent for the Oregon 5 District that was elected in 1996?
SELECT "Incumbent" FROM table_79149 WHERE "First elected" = '1996' AND "District" = 'oregon 5'
wikisql
CREATE TABLE table_25714995_2 ( l INTEGER, w VARCHAR )
How many l's are there for the skip with 3 for w?
SELECT MAX(l) FROM table_25714995_2 WHERE w = 3
sql_create_context
CREATE TABLE table_71628 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
How many ranks are for Switzerland with more than 2 total medals?
SELECT COUNT("Rank") FROM table_71628 WHERE "Nation" = 'switzerland' AND "Total" > '2'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE txmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, K...
病人韩飞烟在医疗机构8914725的门诊就诊过多少次?在2010-09-30到2019-07-07的这几年里
SELECT COUNT(*) FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE person_info.XM = '韩飞烟' AND txmzjzjlb.JZKSRQ BETWEEN '2010-09-30' AND '2019-07-07' AND txmzjzjlb.YLJGDM = '8914725' UNI...
css
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Homework and non-homework tagged question counts.
SELECT Date, COALESCE(SUM(Homework), 0) AS "Homework", COALESCE(SUM(NotHomework), 0) AS "NotHomework" FROM (SELECT CAST(TIME_TO_STR(p.CreationDate, '%Y.%m.%d') AS TEXT(30)) AS "Date", COUNT(*) AS Homework, NULL AS NotHomework FROM Posts AS p WHERE COALESCE(STR_POSITION(p.Tags, 'homework'), 0) != 0 AND p.PostTypeId = 1 ...
sede
CREATE TABLE table_name_70 ( time INTEGER, react VARCHAR, lane VARCHAR, nationality VARCHAR )
What is the sum of time with a lane larger than 6, a nationality of canada, and the react smaller than 0.151?
SELECT SUM(time) FROM table_name_70 WHERE lane > 6 AND nationality = "canada" AND react < 0.151
sql_create_context
CREATE TABLE table_7182 ( "Television service" text, "Country" text, "Language" text, "Content" text, "HDTV" text, "Package/Option" text )
What is Content, when Package/Option is sky cinema, and when Language is italian originale?
SELECT "Content" FROM table_7182 WHERE "Package/Option" = 'sky cinema' AND "Language" = 'italian originale'
wikisql
CREATE TABLE addresses ( address_id number, line_1_number_building text, town_city text, zip_postcode text, state_province_county text, country text ) CREATE TABLE individuals ( individual_id number, individual_first_name text, individual_middle_name text, inidividual_phone text...
Return the party email that has used party services the greatest number of times.
SELECT t1.party_email FROM parties AS t1 JOIN party_services AS t2 ON t1.party_id = t2.customer_id GROUP BY t1.party_email ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_20257 ( "#" real, "Episode" text, "Rating" text, "Share" real, "Rating/Share (18-49)" text, "Viewers (millions)" text, "Rank (Timeslot)" text, "Rank (Night)" text, "Rank (Week)" text )
what is the rank for the rating 4.4?
SELECT "Rank (Night)" FROM table_20257 WHERE "Rating" = '4.4'
wikisql
CREATE TABLE table_40325 ( "Office" text, "Republican ticket" text, "Democratic ticket" text, "American Labor ticket" text, "Liberal ticket" text, "Communist ticket" text )
What is the American Labor ticket when Henry Epstein is the liberal ticket?
SELECT "American Labor ticket" FROM table_40325 WHERE "Liberal ticket" = 'henry epstein'
wikisql
CREATE TABLE table_1972 ( "Year" real, "Formula" text, "Driver" text, "Constructor" text, "Location" text, "Report" text )
Who is the driver of the entry constructed by Mercedes-Benz?
SELECT "Driver" FROM table_1972 WHERE "Constructor" = 'Mercedes-Benz'
wikisql
CREATE TABLE table_58926 ( "Rank" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the largest number of gold medals when the bronze medals is less than 49, and there is 22 silver medals, and the total is less than 60?
SELECT MAX("Gold") FROM table_58926 WHERE "Bronze" < '49' AND "Silver" = '22' AND "Total" < '60'
wikisql
CREATE TABLE table_1547951_3 ( score VARCHAR, opponents VARCHAR )
Name the score for rick leach zina garrison
SELECT score FROM table_1547951_3 WHERE opponents = "Rick Leach Zina Garrison"
sql_create_context
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) 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 tex...
查一下哪些检验指标记录符合这个条件:检测指标名称和结果定量单位与记录79822349098相同但结果定量小于等于记录79822349098
SELECT * FROM jyjgzbb WHERE jyjgzbb.JCZBMC = (SELECT jyjgzbb.JCZBMC FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '79822349098') AND jyjgzbb.JCZBJGDW = (SELECT jyjgzbb.JCZBJGDW FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '79822349098') AND jyjgzbb.JCZBJGDL <= (SELECT jyjgzbb.JCZBJGDL FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '79822349098')
css
CREATE TABLE table_204_19 ( id number, "university" text, "winner" number, "runner-up" number, "years won" text, "years runner-up" text )
hosei won in 1964 . who won the next year ?
SELECT "university" FROM table_204_19 WHERE "years won" = 1964 + 1
squall
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int )...
What classes at the 300 -level are offered next semester ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number BETWEEN 300 AND 300 + 100 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester...
advising
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit ...
calculate the two year survival probability among the patients who were prescribed dobutamine after they were diagnosed with retropharyngeal abscess.
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd...
mimic_iii
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
how many female patients stayed in hospital for more than 7 days and have undergone the procedure other partial resection of small intestine?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "7" AND procedures.long_title = "Other partial resection of small intestine"
mimicsql_data
CREATE TABLE table_43051 ( "Rank" real, "Name" text, "Team" text, "Games" real, "Assists" real )
With a Rank of less than 4, what is Pablo Prigioni's total number of Games?
SELECT COUNT("Games") FROM table_43051 WHERE "Name" = 'pablo prigioni' AND "Rank" < '4'
wikisql
CREATE TABLE table_name_54 ( year INTEGER, title VARCHAR )
What average year contains the title of machineries of joy vol. 4?
SELECT AVG(year) FROM table_name_54 WHERE title = "machineries of joy vol. 4"
sql_create_context
CREATE TABLE table_name_78 ( competition VARCHAR, date VARCHAR )
Which match was played on April 2, 2006?
SELECT competition FROM table_name_78 WHERE date = "april 2, 2006"
sql_create_context
CREATE TABLE table_name_34 ( hand VARCHAR )
What does a hand of Theoretical return have as a 3 credit?
SELECT 3 AS _credits FROM table_name_34 WHERE hand = "theoretical return"
sql_create_context
CREATE TABLE table_204_617 ( id number, "date" text, "opponent#" text, "rank#" text, "site" text, "tv" text, "result" text, "attendance" number )
what was the ranking in each november game ?
SELECT "rank#" FROM table_204_617 WHERE "date" = 11
squall
CREATE TABLE table_19897294_11 ( no_in_series VARCHAR, family_families VARCHAR )
What episode in the series was the Amaral family featured?
SELECT no_in_series FROM table_19897294_11 WHERE family_families = "The Amaral Family"
sql_create_context
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, va...
did patient 24118 have any procedure?
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24118)
mimic_iii
CREATE TABLE table_name_77 ( rank VARCHAR, country VARCHAR )
What rank was the team from Australia?
SELECT COUNT(rank) FROM table_name_77 WHERE country = "australia"
sql_create_context
CREATE TABLE table_12903 ( "Date" text, "Label" text, "Format" text, "Country" text, "Catalog" text )
What is the format for UK catalog S 63795?
SELECT "Format" FROM table_12903 WHERE "Country" = 'uk' AND "Catalog" = 's 63795'
wikisql
CREATE TABLE table_name_32 ( score_in_final VARCHAR, date VARCHAR )
What was the score on February 14, 1999?
SELECT score_in_final FROM table_name_32 WHERE date = "february 14, 1999"
sql_create_context
CREATE TABLE table_66539 ( "Constituency number" text, "Name" text, "Reserved for ( SC / ST /None)" text, "District" text, "Number of electorates (2009)" real )
What district has an assembly segment named mahidpur?
SELECT "District" FROM table_66539 WHERE "Name" = 'mahidpur'
wikisql
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...
what is the minimum total cost of the hospital, which includes medicines called albuterol until 4 years ago?
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'albuterol')) AND DATETIME(cost.chargetime) <= ...
eicu
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 jybgb ( BBCJBW text, BBDM tex...
看看在零七年八月二十八到一二年三月二十一日医疗机构8485615住院时长超过28天的就诊记录有多少
SELECT COUNT(*) FROM zyjzjlb WHERE zyjzjlb.YLJGDM = '8485615' AND zyjzjlb.RYDJSJ BETWEEN '2007-08-28' AND '2012-03-21' AND DATEDIFF(zyjzjlb.CYSJ, zyjzjlb.RYSJ) > 28
css
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPo...
Top 100 perfis mais visitados.
SELECT Id AS "user_link", Views FROM Users LIMIT 100
sede
CREATE TABLE table_52756 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What Constructor had 66 Laps?
SELECT "Constructor" FROM table_52756 WHERE "Laps" = '66'
wikisql
CREATE TABLE table_837 ( "District" text, "Incumbent" text, "Party" text, "Elected" real, "Status" text, "2007 Result" text )
What was the 2007 result in the 28th district?
SELECT "2007 Result" FROM table_837 WHERE "District" = '28th'
wikisql
CREATE TABLE table_name_17 ( lane INTEGER, name VARCHAR, rank VARCHAR )
What is the lowest numbered lane of Sue Rolph with a rank under 5?
SELECT MIN(lane) FROM table_name_17 WHERE name = "sue rolph" AND rank < 5
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 COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE STUDENT ...
How many hours do the students spend studying in each department. Plot them as bar chart.
SELECT DEPT_CODE, SUM(STU_HRS) FROM STUDENT GROUP BY DEPT_CODE
nvbench
CREATE TABLE table_name_48 ( score VARCHAR, runner_up VARCHAR )
What is the score of the game with Falkirk as the runner-up?
SELECT score FROM table_name_48 WHERE runner_up = "falkirk"
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, a bar chart shows the distribution of hire_date and the sum of employee_id bin hire_date by weekday.
SELECT HIRE_DATE, SUM(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_67301 ( "Driver" text, "Constructor" text, "Laps" text, "Time/Retired" text, "Grid" text )
What is the number of laps for Grid 3?
SELECT "Laps" FROM table_67301 WHERE "Grid" = '3'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmenti...
what is the number of patients who died after diagnosis of anemia during the same month last year?
SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'anemia') AS t1 GROUP BY t1.uniquepid HAVING MIN(t1.diagnosistime...
eicu
CREATE TABLE table_28956 ( "Rd." text, "Circuit" text, "City / State" text, "Date" text, "Championship" text, "Challenge" text, "Production" text )
Which city and state hosted the adelaide street circuit?
SELECT "City / State" FROM table_28956 WHERE "Circuit" = 'Adelaide Street Circuit'
wikisql
CREATE TABLE table_67116 ( "Rank" real, "Airport" text, "City" text, "Code (IATA/ICAO)" text, "2008" real, "2009" real, "2010" real )
What is the average in 2010 of the team with a code of (IATA/ICAO) or cra/lrcv?
SELECT "2010" FROM table_67116 WHERE "Code (IATA/ICAO)" = 'cra/lrcv'
wikisql
CREATE TABLE table_75176 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
Name the home with toronto visiting
SELECT "Home" FROM table_75176 WHERE "Visitor" = 'toronto'
wikisql
CREATE TABLE table_22303 ( "Frequency (in Kuala Lumpur , Selangor , Putrajaya and environs)" text, "Station" text, "Operator" text, "Language" text, "Genre" text, "Coverage Area" text )
Which operators offer a genre of music?
SELECT "Operator" FROM table_22303 WHERE "Genre" = 'music'
wikisql
CREATE TABLE table_63757 ( "Title" text, "Series" text, "Director" text, "Production Num." text, "Release date" text )
What is the release date of I Wanna Play House?
SELECT "Release date" FROM table_63757 WHERE "Title" = 'i wanna play house'
wikisql
CREATE TABLE reservations ( code number, room text, checkin text, checkout text, rate number, lastname text, firstname text, adults number, kids number ) CREATE TABLE rooms ( roomid text, roomname text, beds number, bedtype text, maxoccupancy number, basepric...
How many kids stay in the rooms reserved by ROY SWEAZY?
SELECT kids FROM reservations WHERE firstname = "ROY" AND lastname = "SWEAZY"
spider
CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_...
show me FIRST class flights from PITTSBURGH to SAN FRANCISCO on friday
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, flight, flight_fare WHERE ((DATE...
atis
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE chart...
tell me the birth date of patient 366?
SELECT patients.dob FROM patients WHERE patients.subject_id = 366
mimic_iii
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Total and average number of votes per question and answer.
SELECT CASE p.PostTypeId WHEN 1 THEN 'Questions' ELSE 'Answers' END, CASE v.VoteTypeId WHEN 2 THEN 'Up' ELSE 'Down' END, COUNT(*) FROM Votes AS v INNER JOIN Posts AS p ON v.PostId = p.Id WHERE v.VoteTypeId IN (2, 3) GROUP BY p.PostTypeId, v.VoteTypeId
sede
CREATE TABLE table_name_95 ( round INTEGER, pick VARCHAR, position VARCHAR, name VARCHAR )
What is the total round when DB was the position, and the pick less than 21, and Jeff Welch as the name?
SELECT SUM(round) FROM table_name_95 WHERE position = "db" AND name = "jeff welch" AND pick < 21
sql_create_context
CREATE TABLE table_name_40 ( Id VARCHAR )
Tell me the 2011 with 2012 of 2r
SELECT 2011 FROM table_name_40 WHERE 2012 = "2r" AND 2010 = "2r" AND 2009 = "2r"
sql_create_context
CREATE TABLE table_68522 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
What date was the record 34-41?
SELECT "Date" FROM table_68522 WHERE "Record" = '34-41'
wikisql
CREATE TABLE table_name_72 ( res VARCHAR, method VARCHAR )
What was the result when the method was submission (kimura)?
SELECT res FROM table_name_72 WHERE method = "submission (kimura)"
sql_create_context
CREATE TABLE table_12611 ( "Constituency number" text, "Name" text, "Reserved for ( SC / ST /None)" text, "District" text, "Number of electorates (2009)" real )
What is the constituency number with a reserved for ( SC / ST /None) of none, for Katol?
SELECT "Constituency number" FROM table_12611 WHERE "Reserved for ( SC / ST /None)" = 'none' AND "Name" = 'katol'
wikisql
CREATE TABLE table_201_25 ( id number, "party" text, "leader" text, "from" text, "to" text )
which party has had the most leaders ?
SELECT "party" FROM table_201_25 GROUP BY "party" ORDER BY COUNT("leader") DESC LIMIT 1
squall
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student ( student_id int, lastname varchar, ...
What 's the name of the teacher for Winter Core course ?
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 table_76400 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
what is the average top-10 when the cuts made is less than 9 and the events is more than 14?
SELECT AVG("Top-10") FROM table_76400 WHERE "Cuts made" < '9' AND "Events" > '14'
wikisql
CREATE TABLE table_204_248 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
did vietnam or south korea had the more silver medals ?
SELECT "nation" FROM table_204_248 WHERE "nation" IN ('vietnam', 'south korea') ORDER BY "silver" DESC LIMIT 1
squall
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id nu...
questions + views for tags on serverfault. Enter Query Description
SELECT Tags.TagName, COUNT(Posts.Id) AS questions, SUM(ViewCount) AS views FROM Posts LEFT JOIN PostTags ON Posts.Id = PostTags.PostId LEFT JOIN Tags ON PostTags.TagId = Tags.Id WHERE Tags.TagName IN ('asterisk', 'pbx', 'sms', 'voip') GROUP BY Tags.TagName
sede
CREATE TABLE storm ( Storm_ID int, Name text, Dates_active text, Max_speed int, Damage_millions_USD real, Number_Deaths int ) CREATE TABLE affected_region ( Region_id int, Storm_ID int, Number_city_affected real ) CREATE TABLE region ( Region_id int, Region_code text, R...
For all storms with at least 1 death, compare the number of deaths by name with a bar graph, order from low to high by the Y-axis.
SELECT Name, Number_Deaths FROM storm WHERE Number_Deaths >= 1 ORDER BY Number_Deaths
nvbench
CREATE TABLE table_name_21 ( venue VARCHAR, tickets_sold___available VARCHAR )
Which Venue has an amount of Tickets Sold/ Available of 4,700 / 4,700 (100%)?
SELECT venue FROM table_name_21 WHERE tickets_sold___available = "4,700 / 4,700 (100%)"
sql_create_context
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...
As far as upper-level COMP classes are concerned , what classes are offered in the Summer ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'COMP' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Summer...
advising
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
how many patients whose discharge location is short term hospital and age is less than 70?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND demographic.age < "70"
mimicsql_data
CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int,...
FIRST class round trip airfare from INDIANAPOLIS to MEMPHIS
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'INDIANAPOLIS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_co...
atis
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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,...
患者40108491在2011年9月11日之后的门诊就诊记录里有哪些能对应的检验报告单?这些在就诊时的诊流水号是什么?
SELECT zzmzjzjlb.JZLSH FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE hz_info.RYBH = '40108491' AND NOT zzmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2011-09-11') UNION SELECT fzzmzjzjlb.JZLSH FROM hz_info JOI...
css
CREATE TABLE album ( albumid number, title text, artistid number ) CREATE TABLE artist ( artistid number, name text ) CREATE TABLE employee ( employeeid number, lastname text, firstname text, title text, reportsto number, birthdate time, hiredate time, address text,...
How many albums are there?
SELECT COUNT(*) FROM album
spider
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE treatment ( ...
how many 50 ml flex cont : magnesium sulfate 4% ij soln prescriptions have been written during the previous year?
SELECT COUNT(*) FROM medication WHERE medication.drugname = '50 ml flex cont : magnesium sulfate 4% ij soln' AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
eicu
CREATE TABLE table_23054 ( "Rank" text, "Rating" text, "Completion Percentage" text, "Touchdown Percentage" text, "Yards Per Attempt" text, "Total Yards" text )
What is the completion percentage when yards per attempt was done by Steve McNair : 2003?
SELECT "Completion Percentage" FROM table_23054 WHERE "Yards Per Attempt" = 'Steve McNair : 2003'
wikisql
CREATE TABLE diagnoses_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, d...
how much was patient 27656's difference of arterial bp [diastolic] last measured on the first icu visit compared to the value second to last measured on the first icu visit?
SELECT (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 = 27656) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.item...
mimic_iii
CREATE TABLE table_name_1 ( result VARCHAR, year__ceremony_ VARCHAR )
What is the result of the ceremony in 2006 (79th)?
SELECT result FROM table_name_1 WHERE year__ceremony_ = "2006 (79th)"
sql_create_context
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Find ACC_Road and School_ID , and group by attribute All_Home, and visualize them by a bar chart, order by the Y from high to low.
SELECT ACC_Road, School_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY School_ID DESC
nvbench
CREATE TABLE table_544 ( "Rank (CSA)" text, "Combined Statistical Area (or Metropolitan Statistical Area if noted)" text, "State(s)" text, "2007 Estimate" text, "2000 Population" text, "Percent Change (1990\u20132000)" text )
What is the 2007 estimate when the rank (csa) is 4
SELECT "2007 Estimate" FROM table_544 WHERE "Rank (CSA)" = '4'
wikisql
CREATE TABLE table_22011 ( "Name" text, "Volume" text, "Engine" text, "Fuel" text, "Output" text, "Torque" text, "Engine ID code(s)" text, "0\u2013100km/h,s" text, "Top speed" text, "CO 2" text, "Years" text )
Name the total number for co 2 for atd/axr
SELECT COUNT("CO 2") FROM table_22011 WHERE "Engine ID code(s)" = 'ATD/AXR'
wikisql
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...
检验检验报告单的编码为40675785383的科室编码和名称分别是什么?
SELECT jybgb.JYKSBM, jybgb.JYKSMC FROM jybgb WHERE jybgb.BGDH = '40675785383'
css
CREATE TABLE table_name_53 ( constructor VARCHAR, driver VARCHAR )
Who was Albino Buticchi's constructor?
SELECT constructor FROM table_name_53 WHERE driver = "albino buticchi"
sql_create_context