instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_49 ( points INTEGER, goals_against VARCHAR, games VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the most points when the goals against are 354 and games less than 82?
SELECT MAX(points) FROM table_name_49 WHERE goals_against = 354 AND games < 82
sql_create_context
CREATE TABLE table_name_9 ( time VARCHAR, city VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the time in Baltimore?
SELECT time FROM table_name_9 WHERE city = "baltimore"
sql_create_context
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CR...
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 ((flight.departure_time <= 1530 AND flight.departure_time >= 1430) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND ...
atis
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime...
SELECT SUM(cost.cost) FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-100453') AND DATETIME(cost.chargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
eicu
CREATE TABLE table_name_60 ( round INTEGER, nfl_club VARCHAR, pick VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of the round of the new york jets NFL club, which has a pick less than 166?
SELECT SUM(round) FROM table_name_60 WHERE nfl_club = "new york jets" AND pick < 166
sql_create_context
CREATE TABLE table_2701625_1 ( male_life_expectancy INTEGER, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most male life expectancy for pakistan
SELECT MAX(male_life_expectancy) FROM table_2701625_1 WHERE country = "Pakistan"
sql_create_context
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_proje...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Trevor Legassick%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_i...
advising
CREATE TABLE table_name_86 ( artist VARCHAR, record_label VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Artist has a Record label of vertigo?
SELECT artist FROM table_name_86 WHERE record_label = "vertigo"
sql_create_context
CREATE TABLE table_16494599_1 ( nationality VARCHAR, school_club_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What nationality is the player who went to school at South Florida?
SELECT nationality FROM table_16494599_1 WHERE school_club_team = "South Florida"
sql_create_context
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAd...
SELECT COUNT(DISTINCT Users.Id), Tags.TagName AS Tag_Name FROM Users, Posts, PostTags, Tags WHERE Posts.OwnerUserId = Users.Id AND PostTags.PostId = Posts.Id AND Tags.Id = PostTags.TagId AND Posts.Score > 15 AND Posts.CreationDate BETWEEN '1/1/2012' AND '1/1/2015' AND Tags.TagName IN ('python', 'r', 'java', 'perl', 'sq...
sede
CREATE TABLE student ( city_code VARCHAR, age INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the number and average age of students living in each city.
SELECT COUNT(*), AVG(age), city_code FROM student GROUP BY city_code
sql_create_context
CREATE TABLE table_22332 ( "District" text, "s Barangay" real, "Population (2010 census)" real, "Area ( has .)" text, "Pop. density (per km2)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the population (2010 census) if s barangay is 51?
SELECT COUNT("Population (2010 census)") FROM table_22332 WHERE "s Barangay" = '51'
wikisql
CREATE TABLE diagnoses ( 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, ...
SELECT demographic.marital_status, demographic.gender FROM demographic WHERE demographic.name = "Miguel Hodges"
mimicsql_data
CREATE TABLE table_name_39 ( runner_up VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the runner-up in 1887 competition for 'Articles with HCards'?
SELECT runner_up FROM table_name_39 WHERE year = 1887
sql_create_context
CREATE TABLE table_70703 ( "Model" text, "Floating point" text, "Decimal" text, "Byte string" text, "Memory map" text, "Max memory (kwords)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What model has both a standard byte string and floating-p...
SELECT "Model" FROM table_70703 WHERE "Byte string" = 'standard' AND "Floating point" = 'standard'
wikisql
CREATE TABLE table_62793 ( "Name" text, "Population (2011)" real, "Population (2006)" real, "Change (%)" real, "Land area (km\u00b2)" real, "Population density (per km\u00b2)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much Population (2...
SELECT SUM("Population (2011)") FROM table_62793 WHERE "Land area (km\u00b2)" > '15.69' AND "Population density (per km\u00b2)" > '57.3'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescription...
SELECT MAX(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.discharge_location = "LONG TERM CARE HOSPITAL"
mimicsql_data
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, ...
(SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND 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 person_info.XM = '沈雅懿' AND NOT...
css
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTas...
WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id =...
sede
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolea...
SELECT Users.Id AS "user_link", COUNT(Posts.Id) AS Questions, CAST(AVG(CAST(Score AS FLOAT)) AS FLOAT(6, 2)) AS "average_question_score" FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId WHERE PostTypeId = 1 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL GROUP BY Users.Id, DisplayName HAVING COUNT(Posts.Id) ...
sede
CREATE TABLE train_station ( Train_ID int, Station_ID int ) CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, Location text, Main_Services text, Number_of_Platforms int ) CREATE TABLE train ( Train_ID ...
SELECT Location, AVG(Number_of_Platforms) FROM station GROUP BY Location ORDER BY AVG(Number_of_Platforms)
nvbench
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number,...
SELECT MAX(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-10724')) AND lab.labname = 'anion gap' AND DATETIME(lab.labresulttime, 'start ...
eicu
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time...
SELECT Score, CreationDate FROM Posts WHERE OwnerUserId = '##UserId##' ORDER BY CreationDate
sede
CREATE TABLE table_41396 ( "Week" real, "Date" text, "Result" text, "Record" text, "Opponent" text, "Points For" real, "Points Against" real, "First Downs" real, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Week ...
SELECT MAX("Week") FROM table_41396 WHERE "Points For" > '19' AND "Opponent" = 'philadelphia eagles' AND "Points Against" > '7'
wikisql
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE compartment_class ( compartment varchar, ...
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 = 'OAKLAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVE...
atis
CREATE TABLE table_13619105_4 ( high_points VARCHAR, high_assists VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the high point total when dee brown (5) had the high assist total?
SELECT high_points FROM table_13619105_4 WHERE high_assists = "Dee Brown (5)"
sql_create_context
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 locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(...
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21'
nvbench
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" AND procedures.icd9_code = "2219"
mimicsql_data
CREATE TABLE table_6286 ( "Round" text, "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the game with a result of won 5-0?
SELECT "Venue" FROM table_6286 WHERE "Result" = 'won 5-0'
wikisql
CREATE TABLE table_204_229 ( id number, "property" text, "test method" text, "units" text, "4275" text, "4301" text, "4435" text, "4630" text, "4645" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what are the number of times astm d ...
SELECT COUNT(*) FROM table_204_229 WHERE "test method" = 'astm d 638'
squall
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT * FROM t_kc21 WHERE PERSON_NM = '沈清妍' AND MED_SER_ORG_NO = '6343102' AND MED_ORG_DEPT_NM LIKE '%产前诊断%'
css
CREATE TABLE table_51423 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the venue of the match that had a win result and a score of 0-4 in the 2002 Tiger Cup Group Stage...
SELECT "Venue" FROM table_51423 WHERE "Result" = 'win' AND "Competition" = '2002 tiger cup group stage' AND "Score" = '0-4'
wikisql
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 wdmzjzjlb ( HXPLC number, HZX...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZ...
css
CREATE TABLE table_67104 ( "Ship" text, "Length" text, "Passengers" real, "Speed" text, "Built" real, "Company" text, "Registry" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What company built the ship named excellent in 1998?
SELECT "Company" FROM table_67104 WHERE "Built" = '1998' AND "Ship" = 'excellent'
wikisql
CREATE TABLE table_74882 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which District has a Result of Re-elected and a First Elected of 1898?
SELECT "District" FROM table_74882 WHERE "Result" = 're-elected' AND "First elected" = '1898'
wikisql
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_dista...
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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN F...
atis
CREATE TABLE table_name_64 ( score VARCHAR, home VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Home of kings had what score?
SELECT score FROM table_name_64 WHERE home = "kings"
sql_create_context
CREATE TABLE table_61003 ( "Date" text, "Opponent" text, "Home/Away" text, "Field" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What field resulted with w 18-12?
SELECT "Field" FROM table_61003 WHERE "Result" = 'w 18-12'
wikisql
CREATE TABLE table_11066 ( "Name" text, "Club" text, "Date of departure" text, "Replacement" text, "Date of appointment" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the club with date of appointment of 1 november 2007
SELECT "Club" FROM table_11066 WHERE "Date of appointment" = '1 november 2007'
wikisql
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text )...
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, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_number = 21 AND date_day.month_number = 2...
atis
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 i...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'thoracentes...
mimic_iii
CREATE TABLE table_15918 ( "Country ( exonym )" text, "Capital ( exonym )" text, "Country ( endonym )" text, "Capital ( endonym )" text, "Official or native language(s) (alphabet/script)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the ca...
SELECT "Capital ( endonym )" FROM table_15918 WHERE "Capital ( exonym )" = 'Douglas'
wikisql
CREATE TABLE table_name_92 ( director_s_ VARCHAR, film_title_used_in_nomination VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the director of Cannibal vegetarian, which is the film title used in nomination?
SELECT director_s_ FROM table_name_92 WHERE film_title_used_in_nomination = "cannibal vegetarian"
sql_create_context
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, ...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Meta-Ethics%' OR course.description LIKE '%Meta-Ethics%' OR course.name LIKE '%Meta-Ethics%') AN...
advising
CREATE TABLE table_20402 ( "Player" text, "Matches" real, "Overs" text, "Maidens" real, "Runs" real, "Wickets" real, "Average" text, "Economy" text, "5w" real, "10w" real, "Best Bowling" text ) -- Using valid SQLite, answer the following questions for the tables provided ab...
SELECT MAX("5w") FROM table_20402 WHERE "Average" = '21.33'
wikisql
CREATE TABLE table_69859 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which years have a Decile smaller than 6, an Area of te kuiti, and an Au...
SELECT "Years" FROM table_69859 WHERE "Decile" < '6' AND "Area" = 'te kuiti' AND "Authority" = 'state integrated'
wikisql
CREATE TABLE table_2679061_1 ( college_junior_club_team VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the college/junior/club team for the player alfie turcotte?
SELECT college_junior_club_team FROM table_2679061_1 WHERE player = "Alfie Turcotte"
sql_create_context
CREATE TABLE table_40065 ( "Year" real, "Venue" text, "City" text, "State" text, "Host" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the venue in 2011, when the state is California?
SELECT "Venue" FROM table_40065 WHERE "State" = 'california' AND "Year" = '2011'
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 tex...
SELECT * FROM qtb WHERE qtb.PERSON_NM = '张永望' AND qtb.MED_SER_ORG_NO = '6947100' AND NOT qtb.MED_ORG_DEPT_NM LIKE '%科学%' UNION SELECT * FROM gyb WHERE gyb.PERSON_NM = '张永望' AND gyb.MED_SER_ORG_NO = '6947100' AND NOT gyb.MED_ORG_DEPT_NM LIKE '%科学%' UNION SELECT * FROM zyb WHERE zyb.PERSON_NM = '张永望' AND zyb.MED_SER_ORG_...
css
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTask...
SELECT OwnerUserId AS "user_link", TopBadge, SUM(Score) AS TotalScore, COUNT(*) AS NofAnswers FROM Posts AS P INNER JOIN PostTags AS PT ON PT.PostId = P.ParentId INNER JOIN Tags AS T ON T.Id = PT.TagId INNER JOIN (SELECT UserId, MIN(Class) AS TopBadge FROM Badges AS B WHERE Name = '##TagName##' AND TagBased > 0 GROUP B...
sede
CREATE TABLE table_15417439_1 ( length VARCHAR, genus_species VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the genus/species arabidopsis thaliana, what are the lengths?
SELECT length FROM table_15417439_1 WHERE genus_species = "Arabidopsis thaliana"
sql_create_context
CREATE TABLE table_53697 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Grid has a Driver of johnny dumfries?
SELECT "Grid" FROM table_53697 WHERE "Driver" = 'johnny dumfries'
wikisql
CREATE TABLE table_name_84 ( college_junior_club_team__league_ VARCHAR, nationality VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which College/Junior/Club Team has a Nationality of Canada and Jeff brown?
SELECT college_junior_club_team__league_ FROM table_name_84 WHERE nationality = "canada" AND player = "jeff brown"
sql_create_context
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 t...
SELECT (SELECT vitalperiodic.sao2 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-63986')) AND NOT vitalperiodic.sao2 IS NULL AND vi...
eicu
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),...
SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment
nvbench
CREATE TABLE station ( id number, name text, lat number, long number, dock_count number, city text, installation_date text ) CREATE TABLE weather ( date text, max_temperature_f number, mean_temperature_f number, min_temperature_f number, max_dew_point_f number, mean_...
SELECT COUNT(DISTINCT bike_id) FROM trip
spider
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 (...
SELECT demographic.admittime, demographic.dischtime FROM demographic WHERE demographic.subject_id = "64208"
mimicsql_data
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewT...
SELECT HasAnswer, COUNT(*) AS NumPosts, ROUND((100.0 * COUNT(*)) / SUM(COUNT(*)) OVER (), 2) AS PercentPosts FROM (SELECT CASE WHEN AnswerCount = 0 THEN 'No' ELSE 'Yes' END AS HasAnswer FROM Posts WHERE Posts.PostTypeId = 1) AS x GROUP BY HasAnswer
sede
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT REF_SLT_FLG FROM t_kc24 WHERE MED_CLINIC_ID = '25552806645'
css
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, ...
SELECT t_kc21.FLX_MED_ORG_ID FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '26289441351'
css
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT COUNT(*) FROM (SELECT zyjybgb.KSBM FROM mzjzjlb JOIN zyjybgb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '5309668' AND zyjybgb.BGRQ BETWEEN '2007-09-27' AND '2008-01-04' GROUP BY zyjybgb.KSBM HAVING COUNT(*) >= 20 UNION SELECT mzjybgb.KSBM FROM mzjz...
css
CREATE TABLE table_name_15 ( transmitting_from VARCHAR, coverage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is the station with a coverage of yucat n quintana roo campeche transmitting from?
SELECT transmitting_from FROM table_name_15 WHERE coverage = "yucatán quintana roo campeche"
sql_create_context
CREATE TABLE table_15346 ( "Sydney" text, "Melbourne" text, "Perth" text, "Adelaide" text, "Gold Coast" text, "Auckland" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Sydney has a Gold Coast of yes, an Adelaide of no, and an Auckland of y...
SELECT "Sydney" FROM table_15346 WHERE "Gold Coast" = 'yes' AND "Adelaide" = 'no' AND "Auckland" = 'yes'
wikisql
CREATE TABLE table_22966 ( "Year" real, "Division" real, "League" text, "Regular Season" text, "Playoffs" text, "U.S. Open Cup" text, "Avg. Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year at the US Open Cup quarterfinals...
SELECT "Year" FROM table_22966 WHERE "League" = 'USL Second Division' AND "Playoffs" = 'Semifinals' AND "U.S. Open Cup" = 'Quarterfinals'
wikisql
CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text ) CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT Class, AVG(age) FROM captain GROUP BY Class
nvbench
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 ...
SELECT JZJSSJ FROM mzjzjlb WHERE JZLSH = '81008457398'
css
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 intakeoutput ( intakeou...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'encephalopathy - metabolic' AND DATETIME(diagnosis...
eicu
CREATE TABLE table_name_56 ( tyres VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which tyres received 8 points?
SELECT tyres FROM table_name_56 WHERE points = 8
sql_create_context
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_DIRE_CD text, MED_DIRE_NM text,...
SELECT COUNT(t_kc21.PERSON_ID) FROM t_kc21 WHERE t_kc21.IN_DIAG_DIS_CD = 'J69.249'
css
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT DISTINCT Users.Id AS "user_link", Users.Reputation FROM Users JOIN Posts ON Users.Id = Posts.OwnerUserId AND Posts.Tags LIKE '%python%' WHERE LOWER(Location) LIKE '%cluj%' ORDER BY Users.Reputation DESC
sede
CREATE TABLE table_22662 ( "Doctor" text, "Season" text, "Story no." text, "Serial" text, "Number of episodes" text, "Total footage remaining from missing episodes (mm:ss)" text, "Missing episodes with recovered footage" text, "Country/Territory" text, "Source" text, "Format" tex...
SELECT "Total footage remaining from missing episodes (mm:ss)" FROM table_22662 WHERE "Story no." = '018' AND "Source" = 'Private individual'
wikisql
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, O...
SELECT ph.PostId AS "post_link", revisions = 'site://posts/' + CAST(ph.PostId AS TEXT) + '/revisions' FROM PostHistory AS ph INNER JOIN Posts AS p ON p.Id = ph.PostId WHERE (ph.PostHistoryTypeId = 16) AND (ph.UserId = p.OwnerUserId) AND ph.Id IN (SELECT MAX(Id) AS last FROM PostHistory GROUP BY PostId) ORDER BY ph.Post...
sede
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, ...
SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '郎颖初' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2003-12-09' AND '2012-01-10' AND t_kc22.MED_INV_ITEM_TYPE = '西药费'
css
CREATE TABLE table_74206 ( "Series #" real, "Season #" text, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wrote episode 23 in the ...
SELECT "Written by" FROM table_74206 WHERE "Season #" = '23'
wikisql
CREATE TABLE table_35092 ( "Year" text, "Best Film" text, "Best Director" text, "Best Actor" text, "Best Actress" text, "Best Supporting Actress" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Best Film has a Best Supporting Actress of sha...
SELECT "Best Film" FROM table_35092 WHERE "Best Supporting Actress" = 'shamaine buencamino for niño'
wikisql
CREATE TABLE table_68105 ( "Player" text, "Wkts" real, "Runs" real, "Econ" real, "Ovrs" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the Ovrs is less than 2, what's the average in Wkts?
SELECT AVG("Wkts") FROM table_68105 WHERE "Ovrs" < '2'
wikisql
CREATE TABLE table_name_35 ( bronze INTEGER, silver VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest bronze number when silver shows 2, and the total is 8?
SELECT MIN(bronze) FROM table_name_35 WHERE silver = 2 AND total = 8
sql_create_context
CREATE TABLE field ( fieldid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid ...
SELECT DISTINCT paper.venueid FROM author, paper, writes WHERE author.authorname = 'Luke Clark' AND paper.year = 2013 AND writes.authorid = author.authorid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
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, ...
SELECT allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-49082')) AND STRFTIME('%y-%m', allergy.allergytime) >= '2100-11'
eicu
CREATE TABLE table_name_50 ( remixed_by VARCHAR, album VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who remixed an album of dance remixes?
SELECT remixed_by FROM table_name_50 WHERE album = "dance remixes"
sql_create_context
CREATE TABLE table_name_86 ( order_year VARCHAR, length__ft_ VARCHAR, model VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What order year has a 30 Length (ft.) and 05.505 model?
SELECT order_year FROM table_name_86 WHERE length__ft_ = "30" AND model = "05.505"
sql_create_context
CREATE TABLE table_71200 ( "Sport" text, "Event" text, "Nation" text, "Gold" text, "Silver" text, "Bronze" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the winner of gold that also has 1 in the sport of cycling?
SELECT "Gold" FROM table_71200 WHERE "Bronze" = '↓ 1' AND "Sport" = 'cycling'
wikisql
CREATE TABLE table_25391981_3 ( number_of_dances VARCHAR, average VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of dances for the team that averages 20.6?
SELECT number_of_dances FROM table_25391981_3 WHERE average = "20.6"
sql_create_context
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate t...
SELECT p.Id AS "post_link", p.AnswerCount, p.Tags, p.Score FROM Tags AS t INNER JOIN PostTags AS pt ON t.Id = pt.TagId INNER JOIN Posts AS p ON p.Id = pt.PostId WHERE p.CreationDate >= '2016-01-01' AND TagName IN ('amazon-web-services') AND p.PostTypeId = 1 AND p.Score >= 0 LIMIT 2000
sede
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, ...
SELECT COUNT(DISTINCT icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25696) AND STRFTIME('%y', icustays.intime) >= '2105'
mimic_iii
CREATE TABLE drivers ( driverid VARCHAR, forename VARCHAR ) CREATE TABLE results ( raceid VARCHAR, driverid VARCHAR ) CREATE TABLE races ( name VARCHAR, year VARCHAR, raceid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Give me a list ...
SELECT T2.name, T2.year FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T1.driverid = T3.driverid WHERE T3.forename = "Lewis"
sql_create_context
CREATE TABLE table_20466963_13 ( presenter VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the presenter 11 may
SELECT presenter FROM table_20466963_13 WHERE date = "11 May"
sql_create_context
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAd...
WITH Raw AS (SELECT LAG(CreationDate) OVER (ORDER BY CreationDate) AS PrevCrDate, Id, CreationDate FROM Posts WHERE PostTypeId = 6) SELECT SUM(CASE WHEN PrevCrDate IS NULL OR DATEDIFF(day, PrevCrDate, CreationDate) > 30 THEN 1 ELSE 0 END) OVER (ORDER BY CreationDate ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS ...
sede
CREATE TABLE table_9900 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Attendance" real, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Game, when Location is Phili...
SELECT MIN("Game") FROM table_9900 WHERE "Location" = 'philips arena' AND "Attendance" < '15,619'
wikisql
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT Posts.Id, Posts.Id AS "post_link", Posts.CreationDate FROM Posts WHERE OwnerUserId = '##userid##' AND PostTypeId = 1 AND Posts.CreationDate >= '##Date1##' AND Posts.CreationDate <= '##Date2##' ORDER BY Posts.CreationDate
sede
CREATE TABLE station_company ( Station_ID int, Company_ID int, Rank_of_the_Year int ) CREATE TABLE gas_station ( Station_ID int, Open_Year int, Location text, Manager_Name text, Vice_Manager_Name text, Representative_Name text ) CREATE TABLE company ( Company_ID int, Rank i...
SELECT Headquarters, COUNT(Headquarters) FROM company GROUP BY Headquarters ORDER BY COUNT(Headquarters) DESC
nvbench
CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text ) CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor text ) -- Using valid SQLite, answer the following questions for the tabl...
SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor
nvbench
CREATE TABLE table_name_55 ( winning_driver VARCHAR, winning_team VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the Winning Driver that has a Winning team of Engstler Motorsport Engstler Motorsport and also the Date 22 July?
SELECT winning_driver FROM table_name_55 WHERE winning_team = "engstler motorsport engstler motorsport" AND date = "22 july"
sql_create_context
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 70950 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'pressu...
mimic_iii
CREATE TABLE table_name_38 ( tournament VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the tournament when the country is united states?
SELECT tournament FROM table_name_38 WHERE country = "united states"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, ...
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-77687')) AND medication.drugname = 'duoneb' AND DATETIME(m...
eicu
CREATE TABLE table_name_27 ( team_1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the 2nd leg score between Patronage Sainte-Anne and Asante Kotoko?
SELECT 2 AS nd_leg FROM table_name_27 WHERE team_1 = "asante kotoko"
sql_create_context
CREATE TABLE table_48106 ( "Rank" real, "Title" text, "Studio" text, "Director" text, "Worldwide Gross" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the worldwide gross for the film directed by joe pytka?
SELECT "Worldwide Gross" FROM table_48106 WHERE "Director" = 'joe pytka'
wikisql
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 (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Twin birth, mate liveborn, born in hospital, delivered by cesarean section" AND prescriptio...
mimicsql_data
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...
SELECT AVG(zyb.MED_CLINIC_ID) FROM zyb WHERE zyb.MED_ORG_DEPT_NM = '662' AND zyb.IN_HOSP_DAYS BETWEEN '2000-12-01' AND '2002-09-23' AND zyb.IN_HOSP_DATE = '煤尘肺(炭末肺)'
css