instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, ...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate, admissions.hadm_id FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'ns syringe (intrapleural)') AS t1 JOIN (SELEC...
mimic_iii
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 text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
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 = "Hypertension NOS" AND prescriptions.route = "IV"
mimicsql_data
CREATE TABLE table_38280 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the College of Rice's highest overall for the guard position?
SELECT MAX("Overall") FROM table_38280 WHERE "Position" = 'guard' AND "College" = 'rice'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT 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 = "Diarrhea" AND prescriptions.route = "IVPCA"
mimicsql_data
CREATE TABLE table_6162 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What college was the defensive end pick that was picked in round 2?
SELECT "College" FROM table_6162 WHERE "Position" = 'defensive end' AND "Round" = '2'
wikisql
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE hz_info ( KH text, KLX number...
SELECT BGRGH, BGRXM FROM jybgb WHERE BGDH = '45876237401'
css
CREATE TABLE mzjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, ...
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDSM = '躁狂型精神病' AND jyjgzbb.JCZBDM = ...
css
CREATE TABLE table_204_229 ( id number, "property" text, "test method" text, "units" text, "4275" text, "4301" text, "4435" text, "4630" text, "4645" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- was the test method for tensile stre...
SELECT (SELECT "test method" FROM table_204_229 WHERE "property" = 'tensile strength') = (SELECT "test method" FROM table_204_229 WHERE "property" = 'tensile elongation')
squall
CREATE TABLE table_47501 ( "Rank" real, "Player" text, "Club(s)" text, "Year(s)" text, "U-17 Goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Rank, when U-17 Goals is '7', and when Player is 'Cesc F bregas'?
SELECT MAX("Rank") FROM table_47501 WHERE "U-17 Goals" = '7' AND "Player" = 'cesc fàbregas'
wikisql
CREATE TABLE table_27704 ( "Date of Issue" text, "Theme" text, "Denomination" text, "Design" text, "Illustration" text, "Quantity" text, "Printing Process" text, "Paper Type" text, "First Day Cover Cancellation" text ) -- Using valid SQLite, answer the following questions for the t...
SELECT "Theme" FROM table_27704 WHERE "Printing Process" = 'Litho in 3 cols and intaglio'
wikisql
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
SELECT RZBQDM, RZBQMC, RYCWH FROM zyjzjlb WHERE JZLSH = '47619208708'
css
CREATE TABLE Customer_Event_Notes ( Customer_Event_Note_ID INTEGER, Customer_Event_ID INTEGER, service_type_code CHAR(15), resident_id INTEGER, property_id INTEGER, date_moved_in DATETIME ) CREATE TABLE Things ( thing_id INTEGER, organization_id INTEGER, Type_of_Thing_Code CHAR(15),...
SELECT T1.property_id, COUNT(*) FROM Properties AS T1 JOIN Residents AS T2 ON T1.property_id = T2.property_id GROUP BY T1.property_id
nvbench
CREATE TABLE table_name_45 ( city VARCHAR, rank VARCHAR, floors VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What city has a building ranked greater than 15 with floors greater than 43?
SELECT city FROM table_name_45 WHERE rank > 15 AND floors > 43
sql_create_context
CREATE TABLE table_name_74 ( played VARCHAR, position VARCHAR, drawn VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games were played by the team with 2 draws, less than 16 points and a position higher than 5?
SELECT COUNT(played) FROM table_name_74 WHERE drawn = 2 AND points < 16 AND position > 5
sql_create_context
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, war...
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 3 * 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 table_name_83 ( fall_07 INTEGER, fall_05 VARCHAR, fall_09 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average value for Fall 07 when Fall 05 is 271 and Fall 09 is less than 347?
SELECT AVG(fall_07) FROM table_name_83 WHERE fall_05 = 271 AND fall_09 < 347
sql_create_context
CREATE TABLE table_70371 ( "Category" text, "Film" text, "Director(s)" text, "Country" text, "Nominating Festival" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the category of the film made in Switzerland?
SELECT "Category" FROM table_70371 WHERE "Country" = 'switzerland'
wikisql
CREATE TABLE Customers ( customer_id INTEGER, payment_method_code VARCHAR(15), customer_number VARCHAR(20), customer_name VARCHAR(80), customer_address VARCHAR(255), customer_phone VARCHAR(80), customer_email VARCHAR(80) ) CREATE TABLE Customer_Address_History ( customer_id INTEGER, ...
SELECT date_to, COUNT(date_to) FROM Customer_Address_History AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id JOIN Addresses AS T3 ON T1.address_id = T3.address_id GROUP BY date_to ORDER BY date_to DESC
nvbench
CREATE TABLE table_15334 ( "Representative" text, "Title" text, "Presentation of Credentials" text, "Termination of Mission" text, "Appointed by" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Appointed has a Presentation of Credentials on Nov...
SELECT "Appointed by" FROM table_15334 WHERE "Presentation of Credentials" = 'november 22, 1990'
wikisql
CREATE TABLE table_name_7 ( score VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The tournament in Belgrade had what as a score?
SELECT score FROM table_name_7 WHERE tournament = "belgrade"
sql_create_context
CREATE TABLE table_name_57 ( ngc_number INTEGER, right_ascension___j2000__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the highest NGC number for right ascension of 09h40m28.5s
SELECT MAX(ngc_number) FROM table_name_57 WHERE right_ascension___j2000__ = "09h40m28.5s"
sql_create_context
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN student_record ON student_record.course_id = course.course_id INNER JOIN program_course ON student_record.course_id = program_course.course_id WHERE program_course.category LIKE '%MDE%' AND student_record.student_id = 1
advising
CREATE TABLE table_dev_50 ( "id" int, "gender" string, "hemoglobin_a1c_hba1c" float, "diabetic" string, "estimated_glomerular_filtration_rate_egfr" int, "hba1c" float, "age" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- ...
SELECT * FROM table_dev_50 WHERE hba1c >= 7 AND hemoglobin_a1c_hba1c <= 9.5
criteria2sql
CREATE TABLE table_17189 ( "Country" text, "Population" real, "Area (km\u00b2)" real, "GDP (nominal)" text, "GDP per capita (nominal)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the GDP (nominal) for Uzbekistan?
SELECT "GDP (nominal)" FROM table_17189 WHERE "Country" = 'Uzbekistan'
wikisql
CREATE TABLE table_12959 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score for the Chicago Black Hawks game with a record of 2-1?
SELECT "Score" FROM table_12959 WHERE "Home" = 'chicago black hawks' AND "Record" = '2-1'
wikisql
CREATE TABLE table_38819 ( "Game" text, "Date" text, "Result" text, "Site" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the site with game of game 6
SELECT "Site" FROM table_38819 WHERE "Game" = 'game 6'
wikisql
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT COUNT(*) FROM Posts AS p INNER JOIN Users AS u ON p.OwnerDisplayName = u.DisplayName WHERE DisplayName LIKE '%User%'
sede
CREATE TABLE table_name_67 ( nominee VARCHAR, category VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the nominee of best musical
SELECT nominee FROM table_name_67 WHERE category = "best musical"
sql_create_context
CREATE TABLE table_name_90 ( top_division_titles INTEGER, founded VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the total number of Top Division Titles where the year founded was prior to 1975 and the location was in Chaguaram...
SELECT SUM(top_division_titles) FROM table_name_90 WHERE founded < 1975 AND location = "chaguaramas"
sql_create_context
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID
nvbench
CREATE TABLE products ( price INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Compute the average price of all the products.
SELECT AVG(price) FROM products
sql_create_context
CREATE TABLE table_46301 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which tie number had an away team of the Tranmere Rovers?
SELECT "Tie no" FROM table_46301 WHERE "Away team" = 'tranmere rovers'
wikisql
CREATE TABLE table_204_781 ( id number, "name(s)" text, "yard no." number, "type (as built)" text, "owner" text, "imo number" number, "laid down" text, "launched" text, "delivered/\ncommissioned" text, "fate/\ndecommissioned" text, "notes" text ) -- Using valid SQLite, answ...
SELECT "name(s)" FROM table_204_781 WHERE id = (SELECT id FROM table_204_781 WHERE "name(s)" = 'caprice') - 1
squall
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) 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 re...
SELECT Sex, SUM(Height) FROM people GROUP BY Sex ORDER BY Sex DESC
nvbench
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL v...
SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE DESC
nvbench
CREATE TABLE table_27529608_21 ( hometown VARCHAR, name_name_of_act VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the hometown of Plutonic?
SELECT hometown FROM table_27529608_21 WHERE name_name_of_act = "PLUtonic"
sql_create_context
CREATE TABLE table_12438767_1 ( network VARCHAR, dates_aired VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many networks aired the franchise in 1981 only?
SELECT COUNT(network) FROM table_12438767_1 WHERE dates_aired = "1981"
sql_create_context
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0),...
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(SALARY)
nvbench
CREATE TABLE table_52709 ( "Rank" real, "Mountain Peak" text, "State" text, "Mountain Range" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the mountain range at 37.3934 n 104.9201 w?
SELECT "Mountain Range" FROM table_52709 WHERE "Location" = '37.3934°n 104.9201°w'
wikisql
CREATE TABLE table_65069 ( "Project" text, "License" text, "Date" text, "Protocol" text, "Technology" text, "Server" text, "Client" text, "Web Client" text, "Multiple Sessions" text, "Encryption" text, "Authentication" text, "Data Compression" text, "Image Quality" te...
SELECT "Color Quality" FROM table_65069 WHERE "Relay" = '✓'
wikisql
CREATE TABLE table_203_104 ( id number, "athlete" text, "nation" text, "olympics" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many silver medals did evgeni plushenko...
SELECT "silver" FROM table_203_104 WHERE "athlete" = 'evgeni plushenko'
squall
CREATE TABLE table_name_71 ( places INTEGER, nation VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Places amount of the United States Ranking 8?
SELECT AVG(places) FROM table_name_71 WHERE nation = "united states" AND rank = 8
sql_create_context
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswer...
SELECT Id AS "post_link", CreationDate, Title, Body FROM Posts WHERE OwnerUserId = '##id##'
sede
CREATE TABLE table_name_53 ( condition VARCHAR, prothrombin_time VARCHAR, bleeding_time VARCHAR, partial_thromboplastin_time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Condition has a Bleeding time of unaffected, and a Partial thromboplasti...
SELECT condition FROM table_name_53 WHERE bleeding_time = "unaffected" AND partial_thromboplastin_time = "prolonged" AND prothrombin_time = "unaffected"
sql_create_context
CREATE TABLE table_8518 ( "Player" text, "Nationality" text, "Position" text, "Years for Grizzlies" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are years that Obinna Ekezie played for the Grizzlies?
SELECT "Years for Grizzlies" FROM table_8518 WHERE "Player" = 'obinna ekezie'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND procedures.short_title = "Chordae tendineae ops"
mimicsql_data
CREATE TABLE table_42252 ( "Pos." text, "Nationality" text, "Player" text, "Apps" real, "Goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Apps did Player Gilberto with more than 1 Goals have?
SELECT AVG("Apps") FROM table_42252 WHERE "Player" = 'gilberto' AND "Goals" > '1'
wikisql
CREATE TABLE table_name_59 ( series_ep VARCHAR, segment_c VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which series episode has a segment c that is Electric pole s transformer?
SELECT series_ep FROM table_name_59 WHERE segment_c = "electric pole s transformer"
sql_create_context
CREATE TABLE table_49864 ( "Date" text, "Home team" text, "Score" text, "Away team" text, "Venue" text, "Box Score" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was the score 121-113?
SELECT "Date" FROM table_49864 WHERE "Score" = '121-113'
wikisql
CREATE TABLE table_name_65 ( school VARCHAR, year VARCHAR, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is School, when Year is less than 2013, and when Event is '100 Breaststroke'?
SELECT school FROM table_name_65 WHERE year < 2013 AND event = "100 breaststroke"
sql_create_context
CREATE TABLE table_name_75 ( laps INTEGER, rider VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Laps have Rider of olivier jacque, and a Grid larger than 7?
SELECT SUM(laps) FROM table_name_75 WHERE rider = "olivier jacque" AND grid > 7
sql_create_context
CREATE TABLE table_61269 ( "Episode" text, "Air date" text, "Official ITV1 rating" real, "Weekly rank" text, "Share" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest official ITV1 rating with 45.4% share?
SELECT MIN("Official ITV1 rating") FROM table_61269 WHERE "Share" = '45.4%'
wikisql
CREATE TABLE table_2668352_5 ( district VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every district for incumbent Joseph Desha?
SELECT district FROM table_2668352_5 WHERE incumbent = "Joseph Desha"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '018-95228')) AND medication.routeadmin = 'transdermal' AND STRFTIME...
eicu
CREATE TABLE table_name_91 ( match VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the match that happened in Bishop's Stortford?
SELECT match FROM table_name_91 WHERE opponent = "bishop's stortford"
sql_create_context
CREATE TABLE table_203_325 ( id number, "year" number, "title" text, "(english)" text, "ifpi israel certification" text, "label" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the certification of the last title on this chart ?
SELECT "ifpi israel certification" FROM table_203_325 ORDER BY id DESC LIMIT 1
squall
CREATE TABLE table_7569 ( "Volume:Issue" text, "Issue Date(s)" text, "Weeks on Top" real, "Song" text, "Artist" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Song, when Weeks on Top is 1, and when Volume:Issue is 15:6?
SELECT "Song" FROM table_7569 WHERE "Weeks on Top" = '1' AND "Volume:Issue" = '15:6'
wikisql
CREATE TABLE table_name_46 ( year_built VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the cormorant built in?
SELECT year_built FROM table_name_46 WHERE name = "cormorant"
sql_create_context
CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE writes ( paperid int, authorid int ...
SELECT DISTINCT COUNT(paper.paperid), writes.authorid FROM keyphrase, paper, paperkeyphrase, writes WHERE keyphrase.keyphrasename = 'Theoretical' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.paperid = paper.paperid GROUP BY writes.authorid ORDER BY COUNT(p...
scholar
CREATE TABLE table_73539 ( "Horizontal order" real, "Height order" real, "Soundfield type" text, "Number of channels" real, "Channels" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the channels is wxyzrstuvpq, what is the horizontal order?
SELECT "Horizontal order" FROM table_73539 WHERE "Channels" = 'WXYZRSTUVPQ'
wikisql
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE cour...
SELECT DISTINCT course.department, course.name, course.number, instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.name LIKE '%Seminar Series%' AND NOT instructor.name LIKE '%Joiner%' AND offering_instructor.instructor_id = instruct...
advising
CREATE TABLE fzzmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZD...
SELECT (SELECT COUNT(*) FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '范华池' AND zzmzjzjlb.JZKSRQ BETWEEN '2007-10-12' AND '2017-03-18' UNION SELECT COUNT(*) FROM p...
css
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 ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2112.0" AND prescriptions.formulary_drug_cd = "KCL40/1000D5NS"
mimicsql_data
CREATE TABLE table_name_92 ( match_report VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Match Report, when Venue is 'Westfalenstadion , Dortmund'?
SELECT match_report FROM table_name_92 WHERE venue = "westfalenstadion , dortmund"
sql_create_context
CREATE TABLE table_23255941_1 ( title VARCHAR, written_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the title of the episode written by Mark Goffman?
SELECT title FROM table_23255941_1 WHERE written_by = "Mark Goffman"
sql_create_context
CREATE TABLE camera_lens ( id int, brand text, name text, focal_length_mm real, max_aperture real ) CREATE TABLE mountain ( id int, name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE photos ( id int, camera_lens_id int, mountain_id ...
SELECT T1.name, COUNT(T1.name) FROM camera_lens AS T1 JOIN photos AS T2 ON T2.camera_lens_id = T1.id WHERE T1.brand = 'Sigma' OR T1.brand = 'Olympus' GROUP BY T1.name ORDER BY T1.name DESC
nvbench
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 Team_Name, Team_ID FROM basketball_match
nvbench
CREATE TABLE table_204_747 ( id number, "season" text, "skip" text, "third" text, "second" text, "lead" text, "events" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- tell me the number of times marcel rocque was lead ?
SELECT COUNT(*) FROM table_204_747 WHERE "lead" = 'marcel rocque'
squall
CREATE TABLE zyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_AGE < 8 UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_AGE < 8 UNION SELECT zyb.MED_CLINIC_ID FROM zyb WHERE zyb.PERSON_AGE < 8 UNION SELECT mzb.MED_CLINIC_ID FROM mzb WHERE mzb.PERSON_AG...
css
CREATE TABLE zyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT AVG(zyb.MED_CLINIC_ID) FROM zyb WHERE zyb.MED_SER_ORG_NO = '小儿传染病科' AND zyb.IN_HOSP_DAYS BETWEEN '2000-12-13' AND '2020-08-16' AND zyb.IN_DIAG_DIS_NM = 'V99.890'
css
CREATE TABLE table_21046 ( "Poll Source" text, "Dates administered" text, "Democrat: Mark Begich" text, "Republican: Ted Stevens" text, "Lead Maragin" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On July 17, 2008, what was the total number of lead...
SELECT COUNT("Lead Maragin") FROM table_21046 WHERE "Dates administered" = 'July 17, 2008'
wikisql
CREATE TABLE table_name_16 ( gold INTEGER, silver VARCHAR, total VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the largest gold number when the total is less than 3, the rank is 5, and the silver is more than 1?
SELECT MAX(gold) FROM table_name_16 WHERE total < 3 AND rank = "5" AND silver > 1
sql_create_context
CREATE TABLE table_49681 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Event" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Position, when Event is 60 m, and when Venue is Budapest , Hungary?
SELECT "Position" FROM table_49681 WHERE "Event" = '60 m' AND "Venue" = 'budapest , hungary'
wikisql
CREATE TABLE table_name_49 ( constructor VARCHAR, grid VARCHAR, time_retired VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who constructed the car with a grid over 19 that retired due to suspension?
SELECT constructor FROM table_name_49 WHERE grid > 19 AND time_retired = "suspension"
sql_create_context
CREATE TABLE table_41248 ( "Event" text, "2006\u201307" text, "2007\u201308" text, "2008\u201309" text, "2009\u201310" text, "2010\u201311" text, "2011\u201312" text, "2012\u201313" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What res...
SELECT "2006\u201307" FROM table_41248 WHERE "2010\u201311" = 'n/a' AND "Event" = 'colonial square'
wikisql
CREATE TABLE table_61099 ( "Rider" text, "Bike" text, "Laps" real, "Time" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the total number of Laps for the rider whose time was +7.951?
SELECT COUNT("Laps") FROM table_61099 WHERE "Time" = '+7.951'
wikisql
CREATE TABLE table_16724844_1 ( mens_open VARCHAR, mens_u20 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the mens open when the mens u20 was Qld Country Rustlers def Southern Suns?
SELECT mens_open FROM table_16724844_1 WHERE mens_u20 = "Qld Country Rustlers def Southern Suns"
sql_create_context
CREATE TABLE table_73064 ( "Parliament" text, "Name" text, "Period in office" text, "Birth and death years" text, "General election contested" real, "Constituency contested" text, "Political party" text ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT "Parliament" FROM table_73064 WHERE "General election contested" = '1997'
wikisql
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_...
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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name =...
atis
CREATE TABLE table_name_75 ( surface VARCHAR, score VARCHAR, date VARCHAR, championship VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the surface later than 1979, for the Melbourne Indoor, Australia, and the score was 2 6, 6 2, 6 2?
SELECT surface FROM table_name_75 WHERE date > 1979 AND championship = "melbourne indoor, australia" AND score = "2–6, 6–2, 6–2"
sql_create_context
CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE Customer_Policies ( Policy_ID INTEGER, Customer_ID INTEGER, Policy_Type_Code CHAR(15), Start_Date DATE, End_Date DATE ) CREATE TABLE Claims ( Claim_ID INTEGER, Policy_ID INTEGER, Date_Cla...
SELECT Payment_Method_Code, SUM(Amount_Payment) FROM Payments GROUP BY Payment_Method_Code ORDER BY SUM(Amount_Payment)
nvbench
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 ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '77448008' AND jybgb.BGRQ BETWEEN '2009-08-04' AND '2021-06-15' UNION...
css
CREATE TABLE table_58140 ( "Player" text, "Position" text, "Date of Birth (Age)" text, "Caps" real, "Club/province" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the mean number of caps for Ryota Asano?
SELECT AVG("Caps") FROM table_58140 WHERE "Player" = 'ryota asano'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2076" AND lab.label = "Phosphate, Urine"
mimicsql_data
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_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, ...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.IN_DIAG_DIS_NM = '维生素B缺乏病'
css
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 SUM(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE MED_SER_ORG_NO = '7500106' AND MED_ORG_DEPT_NM = '高压氧科') AND CLINIC_SLT_DATE BETWEEN '2003-11-16' AND '2012-11-19'
css
CREATE TABLE table_name_6 ( Track VARCHAR, year INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which track title has a year lesser thsn 2005?
SELECT Track AS title FROM table_name_6 WHERE year < 2005
sql_create_context
CREATE TABLE table_name_73 ( to_par VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the TO par for the player who scored 68-71=139?
SELECT to_par FROM table_name_73 WHERE score = 68 - 71 = 139
sql_create_context
CREATE TABLE Participates_in ( stuid INTEGER, actid INTEGER ) CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) ) CREATE TABLE Faculty_Participates_in ( FacID IN...
SELECT Rank, COUNT(Rank) FROM Faculty GROUP BY Rank
nvbench
CREATE TABLE table_name_93 ( date INTEGER, medal VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest date for the bronze medal?
SELECT MIN(date) FROM table_name_93 WHERE medal = "bronze"
sql_create_context
CREATE TABLE table_10691 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the high assists in game...
SELECT "High assists" FROM table_10691 WHERE "Game" = '77'
wikisql
CREATE TABLE table_27573 ( "Player" text, "Games Played" real, "Rebounds" real, "Assists" real, "Steals" real, "Blocks" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many rebounds did Tammy Sutton-Brown have?
SELECT "Rebounds" FROM table_27573 WHERE "Player" = 'Tammy Sutton-Brown'
wikisql
CREATE TABLE table_59696 ( "Election" text, "First member" text, "First party" text, "Second member" text, "Second party" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the first member in the 1868 election?
SELECT "First member" FROM table_59696 WHERE "Election" = '1868'
wikisql
CREATE TABLE table_75377 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest attendance that has a week less than 4, and w 13-7 as the result?
SELECT MIN("Attendance") FROM table_75377 WHERE "Week" < '4' AND "Result" = 'w 13-7'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND procedures.short_title = "Conduit left ventr-aorta"
mimicsql_data
CREATE TABLE user ( uid int, user_id varchar, name varchar ) CREATE TABLE checkin ( cid int, business_id varchar, count int, day varchar ) CREATE TABLE neighborhood ( id int, business_id varchar, neighborhood_name varchar ) CREATE TABLE tip ( tip_id int, business_id va...
SELECT review.text FROM review, user WHERE review.rating > 4 AND user.name = 'Patrick' AND user.user_id = review.user_id
yelp
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, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name
nvbench
CREATE TABLE table_name_6 ( bronze VARCHAR, location VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is listed for the Bronze, with the Location of Bangkok, and the Year of 1978?
SELECT bronze FROM table_name_6 WHERE location = "bangkok" AND year = 1978
sql_create_context
CREATE TABLE table_5959 ( "City" text, "State/Territory" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which city holds Newcastle Airport?
SELECT "City" FROM table_5959 WHERE "Airport" = 'newcastle airport'
wikisql
CREATE TABLE table_name_16 ( neck VARCHAR, shoulder VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the neck measurement of the gun with a shoulder measurement of 10.688 (.420)?
SELECT neck FROM table_name_16 WHERE shoulder = "10.688 (.420)"
sql_create_context