instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_204_111 ( id number, "name" text, "animal type" text, "introduced" number, "reintroduced" text, "retired" number, "beanie baby resembled" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which is the only pillow pal without a listed animal type ?
SELECT "name" FROM table_204_111 WHERE "animal type" IS NULL
squall
CREATE TABLE table_72921 ( "School" text, "Est. Denotes original date of establishment of the school, changes in name and/or location noted in corresponding ootnote" real, "Location Denotes location of school by Seattle neighborhood, does not necessary correspond with attendance area" text, "Nickname" text, "11-12 Enrollment" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the location for school eckstein
SELECT "Location Denotes location of school by Seattle neighborhood, does not necessary correspond with attendance area" FROM table_72921 WHERE "School" = 'Eckstein'
wikisql
CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List all directors along with the number of films directed by each director Plot them as bar chart, list X-axis from high to low order please.
SELECT Directed_by, COUNT(*) FROM film GROUP BY Directed_by ORDER BY Directed_by DESC
nvbench
CREATE TABLE table_name_85 ( date VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date did the home team of footscray play?
SELECT date FROM table_name_85 WHERE home_team = "footscray"
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, hospitaladmitsource text, unitadmittime time, unitdischargetime time, hospitaldischargetime time, hospitaldischargestatus text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) 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 intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the minimum total cost to the hospital that includes mch since 2102?
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 lab.patientunitstayid FROM lab WHERE lab.labname = 'mch')) AND STRFTIME('%y', cost.chargetime) >= '2102' GROUP BY cost.patienthealthsystemstayid) AS t1
eicu
CREATE TABLE table_35494 ( "Date" text, "Tournament" text, "Surface" text, "Opponen" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which tournament happened on september 25, 2006?
SELECT "Tournament" FROM table_35494 WHERE "Date" = 'september 25, 2006'
wikisql
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) 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, intime time, outtime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) 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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many times have patient 15119's been visited in icu when they visited the hospital first time?
SELECT COUNT(DISTINCT icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15119 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)
mimic_iii
CREATE TABLE table_64771 ( "Band" real, "Frequency (MHz)" text, "Wavelength" text, "Type" text, "Power (W)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Band number has a Power (W) of 400 or less?
SELECT SUM("Band") FROM table_64771 WHERE "Power (W)" < '400'
wikisql
CREATE TABLE table_name_61 ( prime_mover VARCHAR, model VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which prime mover had a Model of rs-18?
SELECT prime_mover FROM table_name_61 WHERE model = "rs-18"
sql_create_context
CREATE TABLE table_6643 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What did the loss come from a Club of mumbles rfc?
SELECT "Lost" FROM table_6643 WHERE "Club" = 'mumbles rfc'
wikisql
CREATE TABLE Minor_in ( StuID INTEGER, DNO INTEGER ) CREATE TABLE Member_of ( FacID INTEGER, DNO INTEGER, Appt_Type VARCHAR(15) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Department ( DNO INTEGER, Division VARCHAR(2), DName VARCHAR(25), Room VARCHAR(5), Building VARCHAR(13), DPhone 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 Gradeconversion ( lettergrade VARCHAR(2), gradepoint FLOAT ) CREATE TABLE Enrolled_in ( StuID INTEGER, CID VARCHAR(7), Grade VARCHAR(2) ) CREATE TABLE Course ( CID VARCHAR(7), CName VARCHAR(40), Credits INTEGER, Instructor INTEGER, Days VARCHAR(5), Hours VARCHAR(11), DNO INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Give me the comparison about the amount of Days over the Days , and group by attribute Days by a bar chart.
SELECT Days, COUNT(Days) FROM Course GROUP BY Days ORDER BY Credits
nvbench
CREATE TABLE table_name_94 ( years_for_grizzlies VARCHAR, player VARCHAR ) -- 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_name_94 WHERE player = "obinna ekezie"
sql_create_context
CREATE TABLE table_dev_32 ( "id" int, "post_challenge_capillary_glucose" int, "gender" string, "blood_donation" bool, "untreated_hyperlipidemia" bool, "hemoglobin_a1c_hba1c" float, "hematocrit_hct" float, "fasting_triglycerides" int, "fasting_blood_glucose_fbg" float, "fasting_plasma_glucose" int, "fasting_ldl_cholesterol" int, "dietary_modification" bool, "baseline_hemoglobin_hgb" float, "body_mass_index_bmi" float, "metformin" bool, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- baseline hemoglobin < 10.5 g / dl in female , or < 12.5 g / dl in male . blood donation within 30 days of the study
SELECT * FROM table_dev_32 WHERE (baseline_hemoglobin_hgb < 10.5 AND gender = 'female') OR (baseline_hemoglobin_hgb < 12.5 AND gender = 'male') AND blood_donation = 1
criteria2sql
CREATE TABLE table_28137918_5 ( new_adherents_per_year INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least amount of new adherents per year
SELECT MIN(new_adherents_per_year) FROM table_28137918_5
sql_create_context
CREATE TABLE table_22733 ( "State and District of Columbia" text, "Obese adults" text, "Overweight (incl. obese) adults" text, "Obese children and adolescents" text, "Obesity rank" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many states or District of Columbia have 65.4% overweight or obese adults?
SELECT COUNT("State and District of Columbia") FROM table_22733 WHERE "Overweight (incl. obese) adults" = '65.4%'
wikisql
CREATE TABLE table_18052353_4 ( state_assembly VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the composition of the state assembly in 2008?
SELECT state_assembly FROM table_18052353_4 WHERE year = "2008"
sql_create_context
CREATE TABLE table_54884 ( "Candidate" text, "Total Receipts" real, "Loans Received" real, "Receipts w/o Loans" real, "Money Spent" real, "Cash On Hand" real, "Total Debt" text, "Cash on Hand Minus Debt" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the low money with 374,164$ of debt and receipts larger than 3,898,226 without loans?
SELECT MIN("Money Spent") FROM table_54884 WHERE "Total Debt" = '374,164' AND "Receipts w/o Loans" > '3,898,226'
wikisql
CREATE TABLE table_name_44 ( week INTEGER, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Week of the game with a Result of L 24-0?
SELECT MAX(week) FROM table_name_44 WHERE result = "l 24-0"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, hospitaladmitsource text, unitadmittime time, unitdischargetime time, hospitaldischargetime time, hospitaldischargestatus text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the first prescription drug that was prescribed to patient 022-34558 since 114 months ago?
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 = '022-34558')) AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-114 month') ORDER BY medication.drugstarttime LIMIT 1
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id 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 text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of patients whose ethnicity is hispanic/latino - puerto rican and drug code is warf5?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND prescriptions.formulary_drug_cd = "WARF5"
mimicsql_data
CREATE TABLE table_name_81 ( record VARCHAR, score VARCHAR, points VARCHAR, february VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Record has a Points smaller than 62 and a February larger than 16, and a Score of 8 7?
SELECT record FROM table_name_81 WHERE points < 62 AND february > 16 AND score = "8–7"
sql_create_context
CREATE TABLE table_204_801 ( id number, "year" number, "derby\nwinner" text, "galaxy" number, "draw" number, "chivas" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in what year did chivas have the same number of wins as in 2012 ?
SELECT "year" FROM table_204_801 WHERE "year" <> 2012 AND "chivas" = (SELECT "chivas" FROM table_204_801 WHERE "year" = 2012)
squall
CREATE TABLE table_1601792_4 ( transmitted VARCHAR, frequency VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many stations are transmitted on frequency 7 uhf?
SELECT COUNT(transmitted) FROM table_1601792_4 WHERE frequency = "7 UHF"
sql_create_context
CREATE TABLE table_name_51 ( margin_of_victory VARCHAR, runner_s__up VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the margin of victory over Brad Faxon?
SELECT margin_of_victory FROM table_name_51 WHERE runner_s__up = "brad faxon"
sql_create_context
CREATE TABLE table_name_84 ( recorded VARCHAR, translation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the record for Brussels translations?
SELECT recorded FROM table_name_84 WHERE translation = "brussels"
sql_create_context
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) 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 ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) 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 ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Members by Age oldest first. StackOverflow members from oldest to youngest, by reputation over 1000.
SELECT TOP(1500) AS Id, DisplayName, Age, Reputation, CreationDate, LastAccessDate, 'http://stackoverflow.com/users/' + CAST(Id AS VARCHAR) AS Url FROM Users WHERE NOT Age IS NULL AND Reputation > 1 ORDER BY Age DESC, Reputation DESC
sede
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) 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(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For those employees who did not have any job in the past, return a bar chart about the distribution of job_id and the average of department_id , and group by attribute job_id, and I want to list from high to low by the y axis.
SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY AVG(DEPARTMENT_ID) DESC
nvbench
CREATE TABLE table_18519 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result in the election where the incumbent was first elected in 1942?
SELECT "Result" FROM table_18519 WHERE "First elected" = '1942'
wikisql
CREATE TABLE table_77999 ( "Round" text, "Date" text, "Opponent" text, "Venue" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Venue with a Date with 14 april 2002?
SELECT "Venue" FROM table_77999 WHERE "Date" = '14 april 2002'
wikisql
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE month ( month_number int, month_name text ) 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_miles int, pressurized varchar ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) 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, time_elapsed int, to_airport varchar ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) -- Using valid SQLite, answer the following questions for the tables provided above. -- flights from NASHVILLE to SEATTLE
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 = 'NASHVILLE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SEATTLE' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code
atis
CREATE TABLE table_28243691_2 ( institution VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What school is located in Huntsville, Texas?
SELECT institution FROM table_28243691_2 WHERE location = "Huntsville, Texas"
sql_create_context
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varchar ) 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_id varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments int, respected int, participation int, heavy_reading int, tough_grader int, hilarious int, would_take_again int, good_lecture int, no_skip int ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) 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 ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_projects varchar, has_exams varchar, num_reviews int, clarity_score int, easiness_score int, helpfulness_score int ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_project varchar, has_final_exam varchar, textbook varchar, class_address varchar, allow_audit varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List all Meth Res Physiology courses that give 9 credits .
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Meth Res Physiology%' OR name LIKE '%Meth Res Physiology%') AND credits = 9
advising
CREATE TABLE table_12232526_2 ( hull_numbers INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the maximum number of hull numbers?
SELECT MAX(hull_numbers) FROM table_12232526_2
sql_create_context
CREATE TABLE table_11690135_1 ( interview VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many interviews were there for Miss Virginia?
SELECT COUNT(interview) FROM table_11690135_1 WHERE country = "Virginia"
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, 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, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many of the Spanish speaking patients were born before the year 2052?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "SPAN" AND demographic.dob_year < "2052"
mimicsql_data
CREATE TABLE table_name_29 ( length VARCHAR, junctions VARCHAR, route_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the length of route FM 2895 with junctions sh 359 us 59?
SELECT length FROM table_name_29 WHERE junctions = "sh 359 us 59" AND route_name = "fm 2895"
sql_create_context
CREATE TABLE table_43214 ( "Rank" real, "Name" text, "Span metres" real, "Span feet" real, "Material" text, "Year opened" text, "Country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which country's material was concrete when the span metres were less than 270, span feet is more than 837, and the year opened was 1943?
SELECT "Country" FROM table_43214 WHERE "Material" = 'concrete' AND "Span metres" < '270' AND "Span feet" > '837' AND "Year opened" = '1943'
wikisql
CREATE TABLE table_name_56 ( tries_against VARCHAR, tries_for VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Tries Against, when Tries For is 21?
SELECT tries_against FROM table_name_56 WHERE tries_for = "21"
sql_create_context
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC text, NLS number, NLY number, QTJZYSGH text, SG number, SSY number, SZY number, TW number, TXBZ number, TZ number, WDBZ number, XL number, YLJGDM text, ZSEBZ number, ZZBZ number, ZZYSGH text ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, 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, JYKSBM text, JYKSMC text, JYLX number, JYRQ time, JYSQJGMC text, JYXMDM text, JYXMMC text, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SHRGH text, SHRXM text, SHSJ time, SQKS text, SQKSMC text, SQRGH text, SQRQ time, SQRXM text, YLJGDM text, YLJGDM_MZJZJLB 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, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM text, RYCWH text, RYDJSJ time, RYSJ time, RYTJDM number, RYTJMC text, RZBQDM text, RZBQMC text, WDBZ number, YLJGDM text, ZYBMLX number, ZYZDBM text, ZYZDMC text, ZYZYZDZZBM text, ZYZYZDZZMC text ) 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 hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM 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 text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, SBBM text, SHRGH text, SHRXM text, YLJGDM text, YQBH text, YQMC text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 07088619663的检验报告单是什么标本代码和名称,状态怎样
SELECT jybgb.BBDM, jybgb.BBMC, jybgb.BBZT FROM jybgb WHERE jybgb.BGDH = '07088619663'
css
CREATE TABLE endowment ( endowment_id int, School_id int, donator_name text, amount real ) CREATE TABLE budget ( School_id int, Year int, Budgeted int, total_budget_percent_budgeted real, Invested int, total_budget_percent_invested real, Budget_invested_percent text ) CREATE TABLE School ( School_id text, School_name text, Location text, Mascot text, Enrollment int, IHSAA_Class text, IHSAA_Football_Class text, County text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Compare the total enrollment in each county with a bar chart, sort y-axis from low to high order.
SELECT County, SUM(Enrollment) FROM School GROUP BY County ORDER BY SUM(Enrollment)
nvbench
CREATE TABLE table_25926120_3 ( awardee_s_ VARCHAR, name_of_award VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won best actress?
SELECT awardee_s_ FROM table_25926120_3 WHERE name_of_award = "Best Actress"
sql_create_context
CREATE TABLE table_57765 ( "Heat." real, "Race Title" text, "Circuit" text, "Location / State" text, "Date" text, "Winner" text, "Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the location/state of the race on 16 Jun?
SELECT "Location / State" FROM table_57765 WHERE "Date" = '16 jun'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD text, MED_DIRE_NM text, MED_EXP_BILL_ID text, MED_EXP_DET_ID text, MED_INV_ITEM_TYPE text, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, OVE_SELF_AMO number, PRESCRIPTION_CODE text, PRESCRIPTION_ID text, QTY number, RECIPE_BILL_ID text, REF_STA_FLG number, REIMBURS_TYPE number, REMOTE_SETTLE_FLG text, RER_SOL number, SELF_PAY_AMO number, SELF_PAY_PRO number, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, SPEC text, STA_DATE time, STA_FLG number, SYNC_TIME time, TRADE_TYPE number, UNIVALENT number, UP_LIMIT_AMO number, USE_FRE text, VAL_UNIT text ) CREATE TABLE mzb ( 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_DIAG_DIS_CD text, IN_DIAG_DIS_NM text, IN_HOSP_DATE time, IN_HOSP_DAYS number, MAIN_COND_DES text, MED_AMOUT number, MED_CLINIC_ID number, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, MED_SER_ORG_NO text, MED_TYPE number, OUT_DIAG_DIS_CD text, OUT_DIAG_DIS_NM text, OUT_DIAG_DOC_CD text, OUT_DIAG_DOC_NM text, OUT_HOSP_DATE time, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, PERSON_AGE number, PERSON_ID text, PERSON_NM text, PERSON_SEX number, REIMBURSEMENT_FLG number, REMOTE_SETTLE_FLG text, SERVANT_FLG text, SOC_SRT_CARD text, SYNC_TIME time, TRADE_TYPE number ) CREATE TABLE gyb ( 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_DIAG_DIS_CD text, IN_DIAG_DIS_NM text, IN_HOSP_DATE time, IN_HOSP_DAYS number, MAIN_COND_DES text, MED_AMOUT number, MED_CLINIC_ID number, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, MED_SER_ORG_NO text, MED_TYPE number, OUT_DIAG_DIS_CD text, OUT_DIAG_DIS_NM text, OUT_DIAG_DOC_CD text, OUT_DIAG_DOC_NM text, OUT_HOSP_DATE time, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, PERSON_AGE number, PERSON_ID text, PERSON_NM text, PERSON_SEX number, REIMBURSEMENT_FLG number, REMOTE_SETTLE_FLG text, SERVANT_FLG text, SOC_SRT_CARD text, SYNC_TIME time, TRADE_TYPE 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, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, FLX_MED_ORG_ID text, ILL_PAY number, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, LAS_OVE_PAY number, MED_AMOUT number, MED_CLINIC_ID text, MED_SAFE_PAY_ID text, MED_TYPE number, OLDC_FUND_PAY number, OUT_HOSP_DATE time, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, OVE_ADD_PAY number, OVE_PAY number, PERSON_ID text, PER_ACC_PAY number, PER_EXP number, PER_SOL number, RECEIVER_DEAL_ID text, RECEIVER_OFFSET_ID text, RECEIVER_REVOKE_ID text, RECIPE_BILL_ID text, REF_SLT_FLG number, REIMBURS_FLG number, SENDER_DEAL_ID text, SENDER_OFFSET_ID text, SENDER_REVOKE_ID text, SPE_FUND_PAY number, SUP_ADD_PAY number, SYNC_TIME time, TRADE_TYPE number ) CREATE TABLE qtb ( 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_DIAG_DIS_CD text, IN_DIAG_DIS_NM text, IN_HOSP_DATE time, IN_HOSP_DAYS number, MAIN_COND_DES text, MED_AMOUT number, MED_CLINIC_ID number, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, MED_SER_ORG_NO text, MED_TYPE number, OUT_DIAG_DIS_CD text, OUT_DIAG_DIS_NM text, OUT_DIAG_DOC_CD text, OUT_DIAG_DOC_NM text, OUT_HOSP_DATE time, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, PERSON_AGE number, PERSON_ID text, PERSON_NM text, PERSON_SEX number, REIMBURSEMENT_FLG number, REMOTE_SETTLE_FLG text, SERVANT_FLG text, SOC_SRT_CARD text, SYNC_TIME time, TRADE_TYPE number ) 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_DIAG_DIS_CD text, IN_DIAG_DIS_NM text, IN_HOSP_DATE time, IN_HOSP_DAYS number, MAIN_COND_DES text, MED_AMOUT number, MED_CLINIC_ID number, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, MED_SER_ORG_NO text, MED_TYPE number, OUT_DIAG_DIS_CD text, OUT_DIAG_DIS_NM text, OUT_DIAG_DOC_CD text, OUT_DIAG_DOC_NM text, OUT_HOSP_DATE time, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, PERSON_AGE number, PERSON_ID text, PERSON_NM text, PERSON_SEX number, REIMBURSEMENT_FLG number, REMOTE_SETTLE_FLG text, SERVANT_FLG text, SOC_SRT_CARD text, SYNC_TIME time, TRADE_TYPE number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 都是什么编号的医疗记录上显示了王霞英这个病人吃的药的价格都高于689.98元的?
SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '王霞英' AND NOT qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 689.98) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '王霞英' AND NOT gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 689.98) UNION SELECT zyb.MED_CLINIC_ID FROM zyb WHERE zyb.PERSON_NM = '王霞英' AND NOT zyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 689.98) UNION SELECT mzb.MED_CLINIC_ID FROM mzb WHERE mzb.PERSON_NM = '王霞英' AND NOT mzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 689.98)
css
CREATE TABLE table_name_3 ( mall_name VARCHAR, stores VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Mall has 140 stores?
SELECT mall_name FROM table_name_3 WHERE stores = "140"
sql_create_context
CREATE TABLE table_name_39 ( poles INTEGER, points VARCHAR, class VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Poles have a Class of 125cc, and a Team of matteoni racing team, and Points larger than 3?
SELECT SUM(poles) FROM table_name_39 WHERE class = "125cc" AND team = "matteoni racing team" AND points > 3
sql_create_context
CREATE TABLE table_name_28 ( money___ VARCHAR, to_par VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the amount of money that a +5 to par with a score of 76-69-70-70=285?
SELECT COUNT(money___) AS $__ FROM table_name_28 WHERE to_par = "+5" AND score = 76 - 69 - 70 - 70 = 285
sql_create_context
CREATE TABLE table_39885 ( "Name" text, "Novelty" text, "Status" text, "Authors" text, "Unit" text, "Location" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has the status of jr synonym of protosialis casca?
SELECT "Novelty" FROM table_39885 WHERE "Status" = 'jr synonym of protosialis casca'
wikisql
CREATE TABLE table_2560677_1 ( artist_s_ VARCHAR, start_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many artist(s) have a start date is 1966-12-12?
SELECT COUNT(artist_s_) FROM table_2560677_1 WHERE start_date = "1966-12-12"
sql_create_context
CREATE TABLE table_11867 ( "Name" text, "Premiere" text, "Finale" text, "Original teams" text, "The Biggest Loser" text, "At-Home Winner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the original teams for the season that was won by Danni Allen?
SELECT "Original teams" FROM table_11867 WHERE "The Biggest Loser" = 'danni allen'
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 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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is date of birth of subject id 65652?
SELECT demographic.dob FROM demographic WHERE demographic.subject_id = "65652"
mimicsql_data
CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM text, CYBQMC text, CYCWH text, ZYBMLX number, ZYZDBM text, ZYZDMC text, ZYZYZDZZBM text, ZYZYZDZZMC text, MZBMLX number, MZZDBM text, MZZDMC text, MZZYZDZZBM text, RYSJ time, CYSJ time, CYZTDM number ) 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, YQMC text, CKZFWDX text, CKZFWXX number, CKZFWSX number, JLDW text ) 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, YLJGDM text, RYBH text ) CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH text, SHRXM text, SHSJ time, SQKS text, SQKSMC text, JYKSBM text, JYKSMC text, BGJGDM text, BGJGMC text, SQRQ time, CJRQ time, JYRQ time, BGSJ time, BBDM text, BBMC text, JYBBH text, BBZT number, BBCJBW text, JSBBSJ time, JYXMMC text, JYXMDM text, JYSQJGMC text, JYJGMC text, JSBBRQSJ time, JYJSQM text, JYJSGH text ) CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ZZYSGH text, QTJZYSGH text, JZZDBM text, JZZDSM text, MZZYZDZZBM text, MZZYZDZZMC text, SG number, TZ number, TW number, SSY number, SZY number, XL number, HXPLC number, ML number, JLSJ time ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 检验报告单38029039376的申请人姓名和工号分别是什么?
SELECT SQRGH, SQRXM FROM jybgb WHERE BGDH = '38029039376'
css
CREATE TABLE table_38991 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who ha the gold and 1 bronze, and more than 0 silver?
SELECT "Gold" FROM table_38991 WHERE "Bronze" = '1' AND "Silver" > '0'
wikisql
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto 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 ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route 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, intime time, outtime time ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the medication patient 17462 was prescribed for the first time on this hospital visit via the iv route?
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17462 AND admissions.dischtime IS NULL) AND prescriptions.route = 'iv' ORDER BY prescriptions.startdate LIMIT 1
mimic_iii
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, time_elapsed int, to_airport varchar ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) 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_miles int, pressurized varchar ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what economy flights are available from DALLAS to BALTIMORE on 7 25 1991
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_DAY_0.day_number = 25 AND DATE_DAY_0.month_number = 7 AND DATE_DAY_0.year = 1991 AND DATE_DAY_1.day_number = 25 AND DATE_DAY_1.month_number = 7 AND DATE_DAY_1.year = 1991 AND DAYS_0.day_name = DATE_DAY_0.day_name AND DAYS_1.day_name = DATE_DAY_1.day_name AND FARE_BASIS_0.economy = 'YES' AND FARE_BASIS_1.basis_days = DAYS_1.days_code AND fare.fare_basis_code = FARE_BASIS_0.fare_basis_code AND fare.fare_basis_code = FARE_BASIS_1.fare_basis_code AND flight_fare.fare_id = fare.fare_id AND flight.flight_days = DAYS_0.days_code AND flight.flight_id = flight_fare.flight_id) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code
atis
CREATE TABLE table_68325 ( "Year" text, "Human Resources & Operations" text, "Local Affairs" text, "Academic & University Affairs" text, "External Affairs" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was in external affairs when Jakki Doyle was in Human Resources & Operations?
SELECT "External Affairs" FROM table_68325 WHERE "Human Resources & Operations" = 'jakki doyle'
wikisql
CREATE TABLE table_12856 ( "Designation" text, "Launch date/time ( GMT )" text, "Mass" text, "Apogee" text, "Inclination" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Mass, when Designation is Prognoz 2?
SELECT "Mass" FROM table_12856 WHERE "Designation" = 'prognoz 2'
wikisql
CREATE TABLE table_57184 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest year a chassis of ferrari 312t and results of 31 points occurred?
SELECT MIN("Year") FROM table_57184 WHERE "Chassis" = 'ferrari 312t' AND "Points" = '31'
wikisql
CREATE TABLE railway_manage ( railway_id number, manager_id number, from_year text ) CREATE TABLE train ( train_id number, train_num text, name text, from text, arrival text, railway_id number ) CREATE TABLE railway ( railway_id number, railway text, builder text, built text, wheels text, location text, objectnumber text ) CREATE TABLE manager ( manager_id number, name text, country text, working_year_starts text, age number, level number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the working years of managers in descending order of their level.
SELECT working_year_starts FROM manager ORDER BY level DESC
spider
CREATE TABLE table_name_74 ( top_5 INTEGER, top_10 VARCHAR, top_25 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Top-5 finishes with 2 as the Top-10 and a greater than 4 Top-25?
SELECT AVG(top_5) FROM table_name_74 WHERE top_10 = 2 AND top_25 > 4
sql_create_context
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) 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 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(4,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For all employees who have the letters D or S in their first name, give me the comparison about the sum of manager_id over the hire_date bin hire_date by weekday by a bar chart, and rank in desc by the total number please.
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(MANAGER_ID) DESC
nvbench
CREATE TABLE table_name_74 ( icao VARCHAR, airport VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the ICAO for lilongwe international airport
SELECT icao FROM table_name_74 WHERE airport = "lilongwe international airport"
sql_create_context
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 ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, hospitaladmitsource text, unitadmittime time, unitdischargetime time, hospitaldischargetime time, hospitaldischargestatus text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) 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 ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) -- Using valid SQLite, answer the following questions for the tables provided above. -- had patient 021-100763 undergone any procedure of ct scan in 2105?
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-100763')) AND treatment.treatmentname = 'ct scan' AND STRFTIME('%y', treatment.treatmenttime) = '2105'
eicu
CREATE TABLE loan ( loan_id text, loan_type text, cust_id text, branch_id text, amount number ) CREATE TABLE bank ( branch_id number, bname text, no_of_customers number, city text, state text ) CREATE TABLE customer ( cust_id text, cust_name text, acc_type text, acc_bal number, no_of_loans number, credit_score number, branch_id number, state text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Count the number of bank branches.
SELECT COUNT(*) FROM bank
spider
CREATE TABLE table_26315 ( "Rank" real, "Operators Name" text, "Technology" text, "Subscribers (in millions)" text, "Ownership" text, "Market Share" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the market share of the operator whose technology is CDMA EVDO GSM EDGE HSPA+?
SELECT "Market Share" FROM table_26315 WHERE "Technology" = 'CDMA EVDO GSM EDGE HSPA+'
wikisql
CREATE TABLE table_name_57 ( role VARCHAR, genre VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What drama role does she play in 1973?
SELECT role FROM table_name_57 WHERE genre = "drama" AND year = 1973
sql_create_context
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 medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) 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 time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, hospitaladmitsource text, unitadmittime time, unitdischargetime time, hospitaldischargetime time, hospitaldischargestatus text ) 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 ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the name of a procedure that patient 015-94351 has been given for two times in 07/last year?
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, COUNT(treatment.treatmenttime) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-94351')) AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', treatment.treatmenttime) = '07' GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 = 2
eicu
CREATE TABLE table_30108930_6 ( position VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Tyrell Francisco's player position?
SELECT position FROM table_30108930_6 WHERE player = "Tyrell Francisco"
sql_create_context
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, 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, JYKSBM text, JYKSMC text, JYLX number, JYRQ time, JYSQJGMC text, JYXMDM text, JYXMMC text, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SHRGH text, SHRXM text, SHSJ time, SQKS text, SQKSMC text, SQRGH text, SQRQ time, SQRXM text, YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC text, NLS number, NLY number, QTJZYSGH text, SG number, SSY number, SZY number, TW number, TXBZ number, TZ number, WDBZ number, XL number, YLJGDM text, ZSEBZ number, ZZBZ number, ZZYSGH text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, SBBM text, SHRGH text, SHRXM text, YLJGDM text, YQBH text, YQMC text ) CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text, person_info_CSD text, person_info_CSRQ time, person_info_GJDM text, person_info_GJMC text, person_info_JGDM text, person_info_JGMC text, person_info_MZDM text, person_info_MZMC text, person_info_XBDM number, person_info_XBMC text, person_info_XLDM text, person_info_XLMC text, person_info_XM text, person_info_ZYLBDM text, person_info_ZYMC 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, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM text, RYCWH text, RYDJSJ time, RYSJ time, RYTJDM number, RYTJMC text, RZBQDM text, RZBQMC text, WDBZ number, YLJGDM text, ZYBMLX number, ZYZDBM text, ZYZDMC text, ZYZYZDZZBM text, ZYZYZDZZMC text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 患者潘德运在09年8月4日到21年6月15日内都做了什么检查把检验报告单号列出来
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.person_info_XM = '潘德运' AND jybgb.BGRQ BETWEEN '2000-04-06' AND '2007-09-10' UNION SELECT jybgb.BGDH FROM hz_info JOIN zyjzjlb JOIN jybgb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND zyjzjlb.YLJGDM = jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZJLB WHERE hz_info.person_info_XM = '潘德运' AND jybgb.BGRQ BETWEEN '2000-04-06' AND '2007-09-10'
css
CREATE TABLE table_17738 ( "Year" real, "Song title" text, "Artist" text, "Master recording ?" text, "Release date" text, "Single / Pack" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many master recordings are there for 'Famous for Nothing'?
SELECT COUNT("Master recording ?") FROM table_17738 WHERE "Song title" = 'Famous For Nothing'
wikisql
CREATE TABLE table_name_90 ( rank VARCHAR, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What rank did Best Friends receive?
SELECT rank FROM table_name_90 WHERE title = "best friends"
sql_create_context
CREATE TABLE table_21729 ( "Series #" real, "Episode #" real, "Title" text, "Directed by" text, "Written by" text, "U.S. viewers (million)" text, "Original airdate" text, "Production Code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the production code of the episode 'The Night Moves', which was directed by Patrick Norris?
SELECT "Production Code" FROM table_21729 WHERE "Directed by" = 'Patrick Norris' AND "Title" = 'The Night Moves'
wikisql
CREATE TABLE table_name_74 ( nation VARCHAR, second VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Glenys Bakker was second for which nation?
SELECT nation FROM table_name_74 WHERE second = "glenys bakker"
sql_create_context
CREATE TABLE table_53062 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the driver for grid less than 19 and Laps more than 59 with time/retired of +0.294
SELECT "Driver" FROM table_53062 WHERE "Grid" < '19' AND "Laps" > '59' AND "Time/Retired" = '+0.294'
wikisql
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ZZYSGH text, QTJZYSGH text, JZZDBM text, JZZDSM text, MZZYZDZZBM text, MZZYZDZZMC text, SG number, TZ number, TW number, SSY number, SZY number, XL number, HXPLC number, ML number, JLSJ time ) 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 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, YQMC text, CKZFWDX text, CKZFWXX number, CKZFWSX number, JLDW text ) CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM text, CYBQMC text, CYCWH text, ZYBMLX number, ZYZDBM text, ZYZDMC text, ZYZYZDZZBM text, ZYZYZDZZMC text, MZBMLX number, MZZDBM text, MZZDMC text, MZZYZDZZBM text, RYSJ time, CYSJ time, CYZTDM number ) CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH text, SHRXM text, SHSJ time, SQKS text, SQKSMC text, JYKSBM text, JYKSMC text, BGJGDM text, BGJGMC text, SQRQ time, CJRQ time, JYRQ time, BGSJ time, BBDM text, BBMC text, JYBBH text, BBZT number, BBCJBW text, JSBBSJ time, JYXMMC text, JYXMDM text, JYSQJGMC text, JYJGMC text, JSBBRQSJ time, JYJSQM text, JYJSGH text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 在14年1月24日到20年12月29日的这段时间里,有多少门诊病人找医生62380761看过病
SELECT COUNT(*) FROM mzjzjlb WHERE ZZYSGH = '62380761' AND JZKSRQ BETWEEN '2014-01-24' AND '2020-12-29'
css
CREATE TABLE table_24074130_5 ( against VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every entry for against with opponent Andreas Vinciguerra?
SELECT against FROM table_24074130_5 WHERE opponent = "Andreas Vinciguerra"
sql_create_context
CREATE TABLE film_market_estimation ( Estimation_ID int, Low_Estimate real, High_Estimate real, Film_ID int, Type text, Market_ID int, Year int ) CREATE TABLE film ( Film_ID int, Title text, Studio text, Director text, Gross_in_dollar int ) CREATE TABLE market ( Market_ID int, Country text, Number_cities int ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Please show the number of films for each type in a bar chart, could you order in descending by the Y-axis?
SELECT Type, COUNT(Type) FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Type ORDER BY COUNT(Type) DESC
nvbench
CREATE TABLE route ( train_id int, station_id int ) CREATE TABLE station ( id int, network_name text, services text, local_authority text ) CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, interval text ) CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperature int, precipitation real, wind_speed_mph int ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Give me a bar chart for the number of services of each services, and could you display x-axis in desc order?
SELECT services, COUNT(services) FROM station GROUP BY services ORDER BY services DESC
nvbench
CREATE TABLE table_11924 ( "Tallangatta DFL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of byes that has 11 wins and a Tallangatta DFL of Barnawartha?
SELECT COUNT("Byes") FROM table_11924 WHERE "Wins" = '11' AND "Tallangatta DFL" = 'barnawartha'
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 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 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 text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is days of hospital stay and lab test category of subject id 18372?
SELECT demographic.days_stay, lab."CATEGORY" FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "18372"
mimicsql_data
CREATE TABLE volume ( Volume_ID int, Volume_Issue text, Issue_Date text, Weeks_on_Top real, Song text, Artist_ID int ) CREATE TABLE artist ( Artist_ID int, Artist text, Age int, Famous_Title text, Famous_Release_date text ) CREATE TABLE music_festival ( ID int, Music_Festival text, Date_of_ceremony text, Category text, Volume int, Result text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Return the results of all music festivals using a bar chart, list in descending by the X.
SELECT Result, COUNT(Result) FROM music_festival GROUP BY Result ORDER BY Result DESC
nvbench
CREATE TABLE table_34910 ( "Version" text, "Length" text, "Album" text, "Remixed by" text, "Year" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How long was the instrumental version in 1986?
SELECT "Length" FROM table_34910 WHERE "Year" = '1986' AND "Version" = 'instrumental'
wikisql
CREATE TABLE table_66418 ( "School" text, "Location" text, "Mascot" text, "Enrollment" real, "IHSAA Class" text, "# / County" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which IHSAA Class has a Location of columbia city?
SELECT "IHSAA Class" FROM table_66418 WHERE "Location" = 'columbia city'
wikisql
CREATE TABLE cinema ( name VARCHAR, openning_year VARCHAR, capacity VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show name, opening year, and capacity for each cinema.
SELECT name, openning_year, capacity FROM cinema
sql_create_context
CREATE TABLE table_7853 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE PLACE THAT HAS SCORE OF 65 OR BETTER, FOR ROCCO MEDIATE?
SELECT "Place" FROM table_7853 WHERE "Score" > '65' AND "Player" = 'rocco mediate'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) 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, intime time, outtime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_labitems ( row_id number, itemid number, label 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 ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many days has it been since the last time patient 65582 stayed on the current hospital visit in careunit micu?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65582 AND admissions.dischtime IS NULL) AND transfers.careunit = 'micu' ORDER BY transfers.intime DESC LIMIT 1
mimic_iii
CREATE TABLE table_79723 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the rank of Turkey (TUR) with a total more than 2?
SELECT COUNT("Rank") FROM table_79723 WHERE "Nation" = 'turkey (tur)' AND "Total" > '2'
wikisql
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_projects varchar, has_exams varchar, num_reviews int, clarity_score int, easiness_score int, helpfulness_score int ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_project varchar, has_final_exam varchar, textbook varchar, class_address varchar, allow_audit varchar ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments int, respected int, participation int, heavy_reading int, tough_grader int, hilarious int, would_take_again int, good_lecture int, no_skip int ) 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 program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE area ( course_id int, area varchar ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has not taught TURKISH 202 ?
SELECT DISTINCT name FROM instructor WHERE NOT name IN (SELECT INSTRUCTORalias1.name FROM course AS COURSEalias0 INNER JOIN course_offering AS COURSE_OFFERINGalias0 ON COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id INNER JOIN offering_instructor AS OFFERING_INSTRUCTOR ON OFFERING_OFFERING_ID = COURSE_OFFERINGalias0.offering_id INNER JOIN instructor AS INSTRUCTORalias1 ON offering_instructor_id = INSTRUCTORalias1.instructor_id WHERE COURSEalias0.department = 'TURKISH' AND COURSEalias0.number = 202)
advising
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD text, MED_DIRE_NM text, MED_EXP_BILL_ID text, MED_EXP_DET_ID text, MED_INV_ITEM_TYPE text, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, OVE_SELF_AMO number, PRESCRIPTION_CODE text, PRESCRIPTION_ID text, QTY number, RECIPE_BILL_ID text, REF_STA_FLG number, REIMBURS_TYPE number, REMOTE_SETTLE_FLG text, RER_SOL number, SELF_PAY_AMO number, SELF_PAY_PRO number, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, SPEC text, STA_DATE time, STA_FLG number, SYNC_TIME time, TRADE_TYPE number, UNIVALENT number, UP_LIMIT_AMO number, USE_FRE text, VAL_UNIT text ) 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, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, FLX_MED_ORG_ID text, ILL_PAY number, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, LAS_OVE_PAY number, MED_AMOUT number, MED_SAFE_PAY_ID text, MED_TYPE number, OLDC_FUND_PAY number, OUT_HOSP_DATE time, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, OVE_ADD_PAY number, OVE_PAY number, PERSON_ID text, PER_ACC_PAY number, PER_EXP number, PER_SOL number, RECEIVER_DEAL_ID text, RECEIVER_OFFSET_ID text, RECEIVER_REVOKE_ID text, RECIPE_BILL_ID text, REF_SLT_FLG number, REIMBURS_FLG number, SENDER_DEAL_ID text, SENDER_OFFSET_ID text, SENDER_REVOKE_ID text, SPE_FUND_PAY number, SUP_ADD_PAY number, SYNC_TIME time, TRADE_TYPE number ) CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN_DIAG_DIS_CD text, IN_DIAG_DIS_NM text, IN_HOSP_DATE time, IN_HOSP_DAYS number, MAIN_COND_DES text, MED_AMOUT number, MED_CLINIC_ID text, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, MED_SER_ORG_NO text, MED_TYPE number, OUT_DIAG_DIS_CD text, OUT_DIAG_DIS_NM text, OUT_DIAG_DOC_CD text, OUT_DIAG_DOC_NM text, OUT_HOSP_DATE time, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, PERSON_AGE number, PERSON_ID text, PERSON_NM text, PERSON_SEX number, REIMBURSEMENT_FLG number, REMOTE_SETTLE_FLG text, SERVANT_FLG text, SOC_SRT_CARD text, SYNC_TIME time, TRADE_TYPE number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 就诊结算日期在13年11月17日到14年4月24日内的患者29469375所有医疗就诊记录编号分别是有哪些?
SELECT t_kc21.MED_CLINIC_ID FROM t_kc24 JOIN t_kc21_t_kc24 JOIN t_kc21 ON t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID AND t_kc21_t_kc24.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc24.PERSON_ID = '29469375' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2013-11-17' AND '2014-04-24'
css
CREATE TABLE table_49307 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Week, when Opponent is Minnesota Vikings?
SELECT AVG("Week") FROM table_49307 WHERE "Opponent" = 'minnesota vikings'
wikisql
CREATE TABLE table_61327 ( "Outcome" text, "Date" real, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Partner which is in 1979, and Opponents in the final of heinz g nthardt bob hewitt?
SELECT "Partner" FROM table_61327 WHERE "Date" = '1979' AND "Opponents in the final" = 'heinz günthardt bob hewitt'
wikisql
CREATE TABLE table_2484 ( "Issuer" text, "Issue Date" text, "ISIN" text, "Amount Issued [\u20ac]" text, "Coupon" text, "Maturity" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the ISIN that has a coupon of 1.02 and a value issued of 447,000,000?
SELECT "ISIN" FROM table_2484 WHERE "Coupon" = '1.02' AND "Amount Issued [\u20ac]" = '447,000,000'
wikisql
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, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, FLX_MED_ORG_ID text, ILL_PAY number, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, LAS_OVE_PAY number, MED_AMOUT number, MED_SAFE_PAY_ID text, MED_TYPE number, OLDC_FUND_PAY number, OUT_HOSP_DATE time, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, OVE_ADD_PAY number, OVE_PAY number, PERSON_ID text, PER_ACC_PAY number, PER_EXP number, PER_SOL number, RECEIVER_DEAL_ID text, RECEIVER_OFFSET_ID text, RECEIVER_REVOKE_ID text, RECIPE_BILL_ID text, REF_SLT_FLG number, REIMBURS_FLG number, SENDER_DEAL_ID text, SENDER_OFFSET_ID text, SENDER_REVOKE_ID text, SPE_FUND_PAY number, SUP_ADD_PAY number, SYNC_TIME time, TRADE_TYPE number ) CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD text, MED_DIRE_NM text, MED_EXP_BILL_ID text, MED_EXP_DET_ID text, MED_INV_ITEM_TYPE text, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, OVE_SELF_AMO number, PRESCRIPTION_CODE text, PRESCRIPTION_ID text, QTY number, RECIPE_BILL_ID text, REF_STA_FLG number, REIMBURS_TYPE number, REMOTE_SETTLE_FLG text, RER_SOL number, SELF_PAY_AMO number, SELF_PAY_PRO number, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, SPEC text, STA_DATE time, STA_FLG number, SYNC_TIME time, TRADE_TYPE number, UNIVALENT number, UP_LIMIT_AMO number, USE_FRE text, VAL_UNIT text ) CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN_DIAG_DIS_CD text, IN_DIAG_DIS_NM text, IN_HOSP_DATE time, IN_HOSP_DAYS number, MAIN_COND_DES text, MED_AMOUT number, MED_CLINIC_ID text, MED_ORG_DEPT_CD text, MED_ORG_DEPT_NM text, MED_SER_ORG_NO text, MED_TYPE number, OUT_DIAG_DIS_CD text, OUT_DIAG_DIS_NM text, OUT_DIAG_DOC_CD text, OUT_DIAG_DOC_NM text, OUT_HOSP_DATE time, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, PERSON_AGE number, PERSON_ID text, PERSON_NM text, PERSON_SEX number, REIMBURSEMENT_FLG number, REMOTE_SETTLE_FLG text, SERVANT_FLG text, SOC_SRT_CARD text, SYNC_TIME time, TRADE_TYPE number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 07375083的参保人住院整数金额有多少次
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.PERSON_ID = '07375083' AND t_kc21.CLINIC_TYPE = '住院' AND MOD(t_kc21.MED_AMOUT, 1) = 0
css
CREATE TABLE table_name_34 ( party VARCHAR, electorate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What party is the member that has an electorate of Lindsay?
SELECT party FROM table_name_34 WHERE electorate = "lindsay"
sql_create_context
CREATE TABLE table_21716 ( "Class" text, "Part 1" text, "Part 2" text, "Part 3" text, "Part 4" text, "Verb meaning" text, "Usual PIE origin" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the verb meaning for *bundun?
SELECT "Verb meaning" FROM table_21716 WHERE "Part 3" = '*bundun'
wikisql
CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) ) CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password VARCHAR(40), personal_name VARCHAR(80), middle_name VARCHAR(80), family_name VARCHAR(80), gender_mf VARCHAR(1), address_line_1 VARCHAR(80) ) CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password VARCHAR(10), personal_name VARCHAR(40), middle_name VARCHAR(40), family_name VARCHAR(40) ) CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGER, date_of_enrolment DATETIME, date_of_completion DATETIME ) CREATE TABLE Student_Tests_Taken ( registration_id INTEGER, date_test_taken DATETIME, test_result VARCHAR(255) ) CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_description VARCHAR(255) ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the enrollment date for all the tests that have 'Pass' result, and count them by a bar chart
SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass"
nvbench
CREATE TABLE table_64429 ( "Player" text, "Original Season" text, "Gender" text, "Eliminated" text, "Placing" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who's the player eliminated on episode 8 of Fresh Meat?
SELECT "Player" FROM table_64429 WHERE "Original Season" = 'fresh meat' AND "Eliminated" = 'episode 8'
wikisql
CREATE TABLE editor ( editor_id number, name text, age number ) CREATE TABLE journal_committee ( editor_id number, journal_id number, work_type text ) CREATE TABLE journal ( journal_id number, date text, theme text, sales number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the names of editors who are older than 25.
SELECT name FROM editor WHERE age > 25
spider
CREATE TABLE table_name_3 ( date VARCHAR, week VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date of the game with a result of bye before week 12?
SELECT date FROM table_name_3 WHERE week < 12 AND result = "bye"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, hospitaladmitsource text, unitadmittime time, unitdischargetime time, hospitaldischargetime time, hospitaldischargestatus text ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- when was the last time patient 028-39354 heartrate was measured less than 108.0 until 125 days ago.
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-39354')) AND vitalperiodic.heartrate < 108.0 AND NOT vitalperiodic.heartrate IS NULL AND DATETIME(vitalperiodic.observationtime) <= DATETIME(CURRENT_TIME(), '-125 day') ORDER BY vitalperiodic.observationtime DESC LIMIT 1
eicu
CREATE TABLE table_66238 ( "State (class)" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date of successor's formal installation" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which State (class) has a Successor of harry f. byrd, jr. (d)? Question
SELECT "State (class)" FROM table_66238 WHERE "Successor" = 'harry f. byrd, jr. (d)'
wikisql