context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_20745444_1 ( tar_heels_points VARCHAR, result VARCHAR )
How many results finished in a loss?
SELECT COUNT(tar_heels_points) FROM table_20745444_1 WHERE result = "Loss"
sql_create_context
CREATE TABLE table_name_36 ( date VARCHAR, visitor VARCHAR, home VARCHAR )
What was the date of the game when Colorado was the visiting team and Chicago was the home team?
SELECT date FROM table_name_36 WHERE visitor = "colorado" AND home = "chicago"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
how many patients under the age of 55 had drug route as td?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "55" AND prescriptions.route = "TD"
mimicsql_data
CREATE TABLE table_name_11 ( points INTEGER, podiums VARCHAR, wins VARCHAR, season VARCHAR )
What is the average number of points in the 2012 season, which has less than 1 wins and less than 0 podiums?
SELECT AVG(points) FROM table_name_11 WHERE wins < 1 AND season = "2012" AND podiums < 0
sql_create_context
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, ...
列出病患45256601门诊诊断名称中不包含后遗症在医院7264377中的门诊诊察记录分别是哪几条?
SELECT * FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '45256601' AND hz_info.YLJGDM = '7264377' AND NOT wdmzjzjlb.JZZDSM LIKE '%后遗症%' UNION SELECT * FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjlb.YLJGDM AND...
css
CREATE TABLE roller_coaster ( Status VARCHAR, LENGTH VARCHAR, Height VARCHAR )
Show the statuses of roller coasters longer than 3300 or higher than 100.
SELECT Status FROM roller_coaster WHERE LENGTH > 3300 OR Height > 100
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
find the icu stay id for the patient with patient id 3343.
SELECT prescriptions.icustay_id FROM prescriptions WHERE prescriptions.subject_id = "3343"
mimicsql_data
CREATE TABLE table_62201 ( "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real )
When was the result 0 3?
SELECT "Date" FROM table_62201 WHERE "Result" = '0–3'
wikisql
CREATE TABLE table_13197 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What is the score if Millwall is the Home Team?
SELECT "Score" FROM table_13197 WHERE "Home team" = 'millwall'
wikisql
CREATE TABLE table_80426 ( "Season" text, "Team Name" text, "Games" real, "Losses" real, "Points" real )
What's the lowest number of points with fewer than 8 losses and fewer than 24 games for the vancouver burrards?
SELECT MIN("Points") FROM table_80426 WHERE "Losses" < '8' AND "Team Name" = 'vancouver burrards' AND "Games" < '24'
wikisql
CREATE TABLE table_204_360 ( id number, "year" number, "host" text, "gold" text, "silver" text, "bronze" text )
which years did chile place silver or bronze ?
SELECT "year" FROM table_204_360 WHERE "silver" = 'chile' OR "bronze" = 'chile'
squall
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 ) ...
what is the number of patients whose marital status is single and procedure long title is insertion of one vascular stent?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "SINGLE" AND procedures.long_title = "Insertion of one vascular stent"
mimicsql_data
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...
For those employees who was hired before 2002-06-21, return a bar chart about the distribution of hire_date and the sum of employee_id bin hire_date by time.
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21'
nvbench
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code tex...
calculate the difference between patient 010-1155's total output and the total input on the last icu visit.
SELECT (SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-1155') AND NOT patient.unitdischarge...
eicu
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
what is minimum age of patients whose admission type is emergency and primary disease is st elevated myocardial infarction\cardiac cath?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH"
mimicsql_data
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) 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, JSB...
在2019-07-16之前,患者任斯伯有哪些住院就诊的检验报告单?看一下住院就诊的流水号
SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND pers...
css
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, ...
what are the five most frequently performed procedures for a patient who was previously diagnosed with osteomyelitis - extremity within 2 months?
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, 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 = 'osteomyelitis - extremity') AS t1 JOIN (...
eicu
CREATE TABLE table_74958 ( "Ranking" real, "Nationality" text, "Name" text, "Years" text, "ICFC" real, "FCWC" real, "Total" real )
What is the lowest ranking associated with a total of 23?
SELECT MIN("Ranking") FROM table_74958 WHERE "Total" = '23'
wikisql
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_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...
For those employees who was hired before 2002-06-21, return a scatter chart about the correlation between employee_id and department_id .
SELECT EMPLOYEE_ID, DEPARTMENT_ID FROM employees WHERE HIRE_DATE < '2002-06-21'
nvbench
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 demographic ...
provide the number of patients whose ethnicity is hispanic/latino - puerto rican and procedure short title is oth periton adhesiolysis?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND procedures.short_title = "Oth periton adhesiolysis"
mimicsql_data
CREATE TABLE table_name_22 ( city VARCHAR, name VARCHAR )
Name the city for athous lavrensis
SELECT city FROM table_name_22 WHERE name = "athous lavrensis"
sql_create_context
CREATE TABLE table_name_88 ( competition VARCHAR, venue VARCHAR, opponent VARCHAR )
When the venue is away and the opponents are the bracknell bees, what is the competition?
SELECT competition FROM table_name_88 WHERE venue = "away" AND opponent = "bracknell bees"
sql_create_context
CREATE TABLE table_20896 ( "Player" text, "Team" text, "Matches" real, "Wickets" real, "Average" text, "Best Bowling" text )
What was the best bowling score when the average was 23.33?
SELECT "Best Bowling" FROM table_20896 WHERE "Average" = '23.33'
wikisql
CREATE TABLE table_name_88 ( race VARCHAR, time VARCHAR )
Who holds the time of 17:11.572?
SELECT race FROM table_name_88 WHERE time = "17:11.572"
sql_create_context
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, F...
名为何德本的患者在2931380医院的就诊记录中,有哪些科室名是不包含美容的
SELECT * FROM t_kc21 WHERE t_kc21.PERSON_NM = '何德本' AND t_kc21.MED_SER_ORG_NO = '2931380' AND NOT t_kc21.MED_ORG_DEPT_NM LIKE '%美容%'
css
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE T...
all flights from BOSTON to WASHINGTON on 11 10
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 = 'WASHINGTON' AND date_day.day_number = 10 AND date_day.month_number = 11 A...
atis
CREATE TABLE table_47673 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text )
What is 1st Leg, when 2nd Leg is 0-1?
SELECT "1st leg" FROM table_47673 WHERE "2nd leg" = '0-1'
wikisql
CREATE TABLE table_21977704_1 ( chassis VARCHAR, constructor VARCHAR )
Name the chassis for alta
SELECT chassis FROM table_21977704_1 WHERE constructor = "Alta"
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, JY...
查一下花志专这个患者之前的门诊诊断证明
SELECT wdmzjzjlb.JZZDBM, wdmzjzjlb.JZZDSM FROM person_info JOIN hz_info JOIN wdmzjzjlb 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 WHERE person_info.XM = '花志专' UNION SELECT bdmzjzjlb.JZZDBM, bdmzjzjlb.JZZDSM FROM person_info JOIN...
css
CREATE TABLE table_46491 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
what is the round when the college is north carolina and the overall is more than 124?
SELECT SUM("Round") FROM table_46491 WHERE "College" = 'north carolina' AND "Overall" > '124'
wikisql
CREATE TABLE table_name_4 ( original_name VARCHAR, country VARCHAR )
Name the original name for the one from bulgaria
SELECT original_name FROM table_name_4 WHERE country = "bulgaria"
sql_create_context
CREATE TABLE table_name_30 ( result VARCHAR, distance VARCHAR, winner_or_2nd VARCHAR )
What is the result for the distance of 10f, and a winner or 2nd of Lampra?
SELECT result FROM table_name_30 WHERE distance = "10f" AND winner_or_2nd = "lampra"
sql_create_context
CREATE TABLE actor ( actor_id SMALLINT UNSIGNED, first_name VARCHAR(45), last_name VARCHAR(45), last_update TIMESTAMP ) CREATE TABLE store ( store_id TINYINT UNSIGNED, manager_staff_id TINYINT UNSIGNED, address_id SMALLINT UNSIGNED, last_update TIMESTAMP ) CREATE TABLE payment ( pa...
What are the names and ids of the different categories? Show me the bar chart, sort from low to high by the X-axis.
SELECT T2.name, T1.category_id FROM film_category AS T1 JOIN category AS T2 ON T1.category_id = T2.category_id ORDER BY T2.name
nvbench
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, ...
在哪几次医疗记录中,患者39665457被开出过金额超过7246.13元的药品?列出医疗就诊编号是什么?
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '39665457' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 7246.13)
css
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, ...
was the respiration value of patient 027-120551 last measured on the last icu visit greater than the value second to last measured on the last icu visit?
SELECT (SELECT vitalperiodic.respiration FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-120551') AND NOT patient.unitdischargetime ...
eicu
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 ) ...
count the number of patients who were admitted in urgent care and stayed in the hospital for 6 days.
SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.days_stay = "6"
mimicsql_data
CREATE TABLE table_name_43 ( horse VARCHAR, jockey VARCHAR )
What horse for jara?
SELECT horse FROM table_name_43 WHERE jockey = "jara"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
what is the number of patients whose ethnicity is white - russian and procedure long title is dorsal and dorsolumbar fusion of the posterior column, posterior technique?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND procedures.long_title = "Dorsal and dorsolumbar fusion of the posterior column, posterior technique"
mimicsql_data
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE diagnoses_i...
patient 70267 was diagnosed with a cl skul base fx/brf coma?
SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'cl skul base fx/brf coma') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 70267)
mimic_iii
CREATE TABLE table_name_82 ( report VARCHAR, date VARCHAR )
Name the report for 6 may
SELECT report FROM table_name_82 WHERE date = "6 may"
sql_create_context
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, ...
SELECT Id, DisplayName, WebsiteUrl, Location, AccountId FROM Users;.
SELECT Id, DisplayName, WebsiteUrl, Location, AccountId FROM Users
sede
CREATE TABLE table_79233 ( "School" text, "Mascot" text, "Location" text, "Enrollment" real, "IHSAA Class" text, "IHSAA Football Class" text, "County" text )
What IHSAA Football Class has 20 elkhart as the county?
SELECT "IHSAA Football Class" FROM table_79233 WHERE "County" = '20 elkhart'
wikisql
CREATE TABLE table_13480122_5 ( high_points VARCHAR, score VARCHAR )
who is the the high points with score being w 117 93
SELECT high_points FROM table_13480122_5 WHERE score = "W 117–93"
sql_create_context
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...
Unique users with post that contain {mhchem}.
SELECT DISTINCT OwnerUserId FROM Posts WHERE 'body' LIKE '%{mhchem}%'
sede
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id ...
what was the dose of insulin that during their first hospital encounter patient 66015 was last prescribed?
SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 66015 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND prescriptions.drug = 'insulin' ORDER BY prescriptions.startdate DESC LIMIT 1
mimic_iii
CREATE TABLE table_name_69 ( away_team VARCHAR, venue VARCHAR )
What is the away team at victoria park?
SELECT away_team FROM table_name_69 WHERE venue = "victoria park"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
find out the number of alive patients who have been diagnosed with abscess of intestine.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.long_title = "Abscess of intestine"
mimicsql_data
CREATE TABLE Timed_Locations_of_Things ( thing_id INTEGER, Date_and_Time DATETIME, Location_Code CHAR(15) ) CREATE TABLE Customer_Events ( Customer_Event_ID INTEGER, customer_id INTEGER, date_moved_in DATETIME, property_id INTEGER, resident_id INTEGER, thing_id INTEGER ) CREATE TAB...
What are the number of the distinct move in dates of the residents?, could you show in ascending by the total number?
SELECT date_moved_in, COUNT(date_moved_in) FROM Residents ORDER BY COUNT(date_moved_in)
nvbench
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, ...
叫做柏向明的病人在17年5月5日到2018年1月22日期间医保的医疗费总额一共是多少钱?
SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '柏向明' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2017-05-05' AND '2018-01-22'
css
CREATE TABLE table_name_7 ( american VARCHAR, initial_syllable_open_semi_open_unstressed_vowels VARCHAR )
What is American, when Initial-Syllable Open/Semi-Open Unstressed Vowels is 'y /a , /'?
SELECT american FROM table_name_7 WHERE initial_syllable_open_semi_open_unstressed_vowels = "y /aɪ, ɨ/"
sql_create_context
CREATE TABLE table_10840 ( "Year" real, "Title" text, "Role" text, "Leading Lady" text, "Director" text )
Who is the leading lady in a yank in the r.a.f.?
SELECT "Leading Lady" FROM table_10840 WHERE "Title" = 'a yank in the r.a.f.'
wikisql
CREATE TABLE table_45770 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
What is the home team with the ny rangers as the visitor team?
SELECT "Home" FROM table_45770 WHERE "Visitor" = 'ny rangers'
wikisql
CREATE TABLE table_73659 ( "Episode no." real, "Airdate" text, "Viewers" real, "BBC Three weekly ranking" text, "Cable rank" text )
What is the cable rank for episode no. 4?
SELECT "Cable rank" FROM table_73659 WHERE "Episode no." = '4'
wikisql
CREATE TABLE table_name_8 ( commissioned VARCHAR, pennant_number VARCHAR )
On what date was the ship with a Pennant number of Q144 commissioned?
SELECT commissioned FROM table_name_8 WHERE pennant_number = "q144"
sql_create_context
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, cellvaluenumeri...
what is the average hospital cost that involves a procedure, called stress ulcer treatment - antacids until 2104?
SELECT AVG(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 treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'stress ulcer treatment - antacids')) AND STR...
eicu
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid ...
has patient 48706 undergone any procedures the previous year?
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 48706) AND DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
mimic_iii
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
what number of divorced patients have been daignosed with parapelgia?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "DIVORCED" AND diagnoses.long_title = "Paraplegia"
mimicsql_data
CREATE TABLE table_203_563 ( id number, "#" number, "judge" text, "state" text, "born/died" text, "active" text, "chief" text, "senior" text, "appointed by" text, "reason for\ntermination" text )
how many judges were appointed by president carter ?
SELECT COUNT("judge") FROM table_203_563 WHERE "appointed by" = 'carter'
squall
CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT ) CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TE...
Display a line chart for what is the average prices of wines for each each?
SELECT Year, AVG(Price) FROM wine GROUP BY Year
nvbench
CREATE TABLE table_name_11 ( round INTEGER, position VARCHAR, college_junior_club_team__league_ VARCHAR )
Which Round has a Position of lw, and a College/Junior/Club Team (League) of swift current broncos (wchl)?
SELECT AVG(round) FROM table_name_11 WHERE position = "lw" AND college_junior_club_team__league_ = "swift current broncos (wchl)"
sql_create_context
CREATE TABLE table_204_376 ( id number, "date" text, "venue" text, "opponents" text, "score" text, "competition" text )
who was the last opponent on the list , chronologically ?
SELECT "opponents" FROM table_204_376 ORDER BY "date" DESC LIMIT 1
squall
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId n...
Find [A] ([B] or [C]). Search questions by tags intersection and union.
SELECT q.Id AS "post_link", q.Tags, q.LastActivityDate, q.Score, q.ViewCount, q.AnswerCount, q.OwnerUserId AS "user_link" FROM Posts AS q JOIN PostTags AS pt ON pt.PostId = q.Id JOIN PostTags AS pt2 ON pt2.PostId = q.Id JOIN Tags AS t ON t.Id = pt.TagId JOIN Tags AS t2 ON t2.Id = pt2.TagId JOIN TagSynonyms AS ts ON ts....
sede
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, Revision...
Activity on Stack by Time.
SELECT COUNT(p.Id) AS count_of_feature, DATE(p.CreationDate) AS datetime, t.Name AS name FROM Posts AS p INNER JOIN PostTypes AS t ON p.PostTypeId = t.Id LEFT JOIN Posts AS pp ON p.ParentId = pp.Id WHERE (p.Tags LIKE '%##tagname##%') OR (pp.Tags LIKE '%##tagname##%') GROUP BY DATE(p.CreationDate), t.Name ORDER BY DATE(...
sede
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 int, Name text, Time text, Service text ) CREATE TABLE t...
A bar chart shows how many locations, and sort from high to low by the X.
SELECT Location, COUNT(Location) FROM station GROUP BY Location ORDER BY Location DESC
nvbench
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text,...
what are the five most common specimen tests performed since 6 years ago?
SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents WHERE DATETIME(microbiologyevents.charttime) >= DATETIME(CURRENT_TIME(), '-6 year') GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 5
mimic_iii
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...
6107007医疗机构在二零零二年十月九日到二零零六年十二月二十日期间一共有多少新生儿门诊的就诊记录
SELECT COUNT(*) FROM zzmzjzjlb WHERE zzmzjzjlb.YLJGDM = '6107007' AND zzmzjzjlb.JZKSRQ BETWEEN '2002-10-09' AND '2006-12-20' AND zzmzjzjlb.ZSEBZ > 0 UNION SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.YLJGDM = '6107007' AND fzzmzjzjlb.JZKSRQ BETWEEN '2002-10-09' AND '2006-12-20' AND fzzmzjzjlb.ZSEBZ > 0
css
CREATE TABLE table_1976898_1 ( post_code INTEGER, chinese_name__simplified___traditional_ VARCHAR )
What's the post code of the county with the Chinese name / ?
SELECT MIN(post_code) FROM table_1976898_1 WHERE chinese_name__simplified___traditional_ = "潜山县 / 潛山縣"
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_CLINIC_ID text, MED_DIRE_CD tex...
医院2507652在11年1月26日到10月9日这段时间里的所有的医疗就诊记录中有哪些科室02592没有负责?
SELECT * FROM qtb WHERE qtb.MED_SER_ORG_NO = '2507652' AND qtb.IN_HOSP_DATE BETWEEN '2011-06-26' AND '2011-10-09' UNION SELECT * FROM gyb WHERE gyb.MED_SER_ORG_NO = '2507652' AND gyb.IN_HOSP_DATE BETWEEN '2011-06-26' AND '2011-10-09' UNION SELECT * FROM zyb WHERE zyb.MED_SER_ORG_NO = '2507652' AND zyb.IN_HOSP_DATE BETW...
css
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
what is the number of patients whose days of hospital stay is greater than 10 and drug name is phenytoin sodium?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "10" AND prescriptions.drug = "Phenytoin Sodium"
mimicsql_data
CREATE TABLE table_18461045_1 ( michigan VARCHAR, indiana VARCHAR )
What was the little league team from Michigan when the little league team from Indiana was Terre Haute North LL Terre Haute?
SELECT michigan FROM table_18461045_1 WHERE indiana = "Terre Haute North LL Terre Haute"
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...
Next semester , what ULCS courses are available ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'FA' AND semester.semester_id = course...
advising
CREATE TABLE table_2562572_8 ( population__2002_ INTEGER, population__2011_ VARCHAR )
What was the lowes population of 2002 when the 2011 population was 30076?
SELECT MIN(population__2002_) FROM table_2562572_8 WHERE population__2011_ = 30076
sql_create_context
CREATE TABLE table_41451 ( "Rank" real, "Location" text, "Total Passengers" real, "Annual change" text, "Capacity" real, "Capacity in use" text )
What is the total capacity of the airport ranked less than 7, has a capacity in use of 114.2%, and has less than 13,699,657 total passengers?
SELECT COUNT("Capacity") FROM table_41451 WHERE "Rank" < '7' AND "Capacity in use" = '114.2%' AND "Total Passengers" < '13,699,657'
wikisql
CREATE TABLE activity ( actid number, activity_name text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE faculty ( facid number, lname text, fname text, rank text, ...
What are the first names of the professors who do not play Canoeing or Kayaking as activities?
SELECT lname FROM faculty WHERE rank = 'Professor' EXCEPT SELECT DISTINCT T1.lname FROM faculty AS T1 JOIN faculty_participates_in AS T2 ON T1.facid = T2.facid JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' OR T3.activity_name = 'Kayaking'
spider
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_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, H...
统计医疗记录中入院诊断为精神分裂症的在医院4152205的最低和最高医疗费有什么总额?
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '4152205' AND t_kc21.IN_DIAG_DIS_NM = '精神分裂症')
css
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE cours...
What are the classes that are available this Winter ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND semester.semester = 'Winter' AND semester.semester_id = course_offering.semester AND semester.year = 2016
advising
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...
检验报告单10754397443的报告机构单位代码以及名称都叫什么?
SELECT jybgb.BGJGDM, jybgb.BGJGMC FROM jybgb WHERE jybgb.BGDH = '10754397443'
css
CREATE TABLE table_9935 ( "Tournament" text, "Surface" text, "Week" text, "Winner" text, "Finalist" text, "Semifinalists" text )
Who is the Finalist, when the Surface is Clay, and when the Semifinalist is Yevgeny Kafelnikov Juan Carlos Ferrero (2)?
SELECT "Finalist" FROM table_9935 WHERE "Surface" = 'clay' AND "Semifinalists" = 'yevgeny kafelnikov juan carlos ferrero (2)'
wikisql
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...
在以前这个患者戚智纯有得过哪些疾病呢?
SELECT qtb.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_NM = '戚智纯' UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_NM = '戚智纯' UNION SELECT zyb.IN_DIAG_DIS_CD, zyb.IN_DIAG_DIS_NM FROM zyb WHERE zyb.PERSON_NM = '戚智纯' UNION SELECT mzb.IN_DIAG_DIS_CD, mzb.IN_DIAG_DIS_NM FROM mz...
css
CREATE TABLE table_204_55 ( id number, "date" text, "time" text, "opponent#" text, "rank#" text, "site" text, "tv" text, "result" text, "attendance" number )
which dates had below 80,000 in attendance ?
SELECT "date" FROM table_204_55 WHERE "attendance" < 80000
squall
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( ...
among patients who were prescribed potassium chloride inj 2 meq/ml vial after having been diagnosed with acute respiratory distress calculate the four year survival rate.
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 4 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid...
eicu
CREATE TABLE table_22680 ( "Name" text, "Career" text, "Matches" real, "Overs" text, "Maidens" real, "Runs" real, "Wickets" real, "Average" text, "Best" text, "5w" real, "10w" real )
What was the Best score during the game played from 1971-1984?
SELECT "Best" FROM table_22680 WHERE "Career" = '1971-1984'
wikisql
CREATE TABLE table_name_90 ( score VARCHAR, competition VARCHAR, season VARCHAR )
What was the score of the league cup in the 2007-08 season?
SELECT score FROM table_name_90 WHERE competition = "league cup" AND season = "2007-08"
sql_create_context
CREATE TABLE table_name_57 ( derivatives VARCHAR, launch_date VARCHAR )
Which Derivative has a Launch Date of july 15, 1970; 15:05 gmt?
SELECT derivatives FROM table_name_57 WHERE launch_date = "july 15, 1970; 15:05 gmt"
sql_create_context
CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int ) CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text )
What is the total number of each ship type? Give me a bar chart, and list Type in desc order.
SELECT Type, COUNT(Type) FROM ship GROUP BY Type ORDER BY Type DESC
nvbench
CREATE TABLE table_name_41 ( country VARCHAR, player VARCHAR )
Which country has the player Ted Schulz?
SELECT country FROM table_name_41 WHERE player = "ted schulz"
sql_create_context
CREATE TABLE table_29361 ( "Vertical" real, "Horizontal" real, "Aspect ratio" text, "Pixel aspect ratio" text, "Scanning" text, "Frame rate ( Hz )" text )
What was the minimum vertical measurement if the aspect ratio is 16:9 and scanning is interlaced?
SELECT MIN("Vertical") FROM table_29361 WHERE "Aspect ratio" = '16:9' AND "Scanning" = 'interlaced'
wikisql
CREATE TABLE table_name_39 ( tie_no VARCHAR, away_team VARCHAR )
What was the tie no when Oxford city was the away team?
SELECT tie_no FROM table_name_39 WHERE away_team = "oxford city"
sql_create_context
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDat...
Number of questions tagged with Jetbrains.
SELECT TagName AS Tag, Count FROM Tags WHERE TagName LIKE '%fhir%'
sede
CREATE TABLE table_74419 ( "Name" text, "Country" text, "Years" text, "Games" real, "Minutes" real, "Conceded" real, "Shutouts" real, "Int. caps" real )
When 2010 is the year what is the game?
SELECT "Games" FROM table_74419 WHERE "Years" = '2010'
wikisql
CREATE TABLE table_66659 ( "Wimmera FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
How many Draws have Wins larger than 7, and a Wimmera FL of nhill, and Losses larger than 8?
SELECT SUM("Draws") FROM table_66659 WHERE "Wins" > '7' AND "Wimmera FL" = 'nhill' AND "Losses" > '8'
wikisql
CREATE TABLE table_204_206 ( id number, "saros" number, "member" number, "date" text, "time\n(greatest)\nutc" text, "type" text, "location\nlat,long" text, "gamma" number, "mag." number, "width\n(km)" number, "duration\n(min:sec)" text, "ref" number )
when did the first solar saros with a magnitude of greater than 1.00 occur ?
SELECT "date" FROM table_204_206 WHERE "mag." > 1.00 ORDER BY "date" LIMIT 1
squall
CREATE TABLE table_27948565_1 ( moto2_winner VARCHAR, circuit VARCHAR )
Name the total number of moto2 winners for laguna seca
SELECT COUNT(moto2_winner) FROM table_27948565_1 WHERE circuit = "Laguna Seca"
sql_create_context
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, ...
病人在医疗机构6778599就诊,异地来的有多少
SELECT COUNT(t_kc21.PERSON_ID) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '6778599' AND t_kc21.REMOTE_SETTLE_FLG = '异地1' OR t_kc21.REMOTE_SETTLE_FLG = '异地2'
css
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE transfers ( row_id number...
so what's the maximum neutrophils value of patient 64519 in 07/2104?
SELECT MAX(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 64519) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'neutrophils') AND STRFTIME('%y-%m', labevents.charttime) = '2104-07'
mimic_iii
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
provide the number of patients whose admission year is less than 2120 and drug route is oral?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2120" AND prescriptions.route = "ORAL"
mimicsql_data
CREATE TABLE table_15937 ( "UN Operation name" text, "UN Operation title" text, "Location" text, "Dates of Australian involvement" text, "Number of Australians involved" text, "Australian role" text )
What is the UN operation title with the UN operation name, Uncok?
SELECT "UN Operation title" FROM table_15937 WHERE "UN Operation name" = 'UNCOK'
wikisql
CREATE TABLE table_2767 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real, "U.S. viewers (millions)" text )
What is the production code for Episode 153 in the series?
SELECT MIN("Production code") FROM table_2767 WHERE "Series #" = '153'
wikisql
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, visualize the relationship between code and manufacturer , and group by attribute headquarter.
SELECT T1.Code, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter
nvbench
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...
二零零三年七月一日到二零二一年三月二十九日,医疗机构3916890处理异地就诊的次数有多少
SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '3916890' AND IN_HOSP_DATE BETWEEN '2003-07-01' AND '2021-03-29' AND (REMOTE_SETTLE_FLG = '异地1' OR REMOTE_SETTLE_FLG = '异地2')
css