text2SQL stringlengths 192 7.27k |
|---|
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE fgwyjzb (
CLINIC_ID,
CLINIC_TYPE,
COMP_ID,
DATA_ID,
DIFF_PLACE_FLG,
FERTILITY_STS,
FLX_MED_ORG_ID,
HOSP_LEV,
HOSP_STS,
IDENTITY_CARD,
INPT_AREA_BED,
INSURED_IDENTITY,
INSURED_STS,
I... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE t_kc22 (
MED_EXP_DET_ID,
OVERALL_CD_ORG,
OVERALL_CD_PERSON,
MED_CLINIC_ID,
MED_EXP_BILL_ID,
SOC_SRT_DIRE_CD,
SOC_SRT_DIRE_NM,
DIRE_TYPE,
CHA_ITEM_LEV,
MED_INV_ITEM_TYPE,
MED_DIRE_CD... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE,
ACCOUNT_DASH_FLG,
CASH_PAY,
CIVIL_SUBSIDY,
CKC102,
CLINIC_ID,
CLINIC_SLT_DATE,
COMP_ID,
COM_ACC_PAY,
COM_PAY,
DATA_ID,
ENT_ACC_PAY,
ENT_PAY,
FLX_MED_ORG_... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE zyjzjlb (
CYBQDM,
CYBQMC,
CYCWH,
CYKSDM,
CYKSMC,
CYSJ,
CYZTDM,
HZXM,
JZKSDM,
JZKSMC,
JZLSH,
KH,
KLX,
MZBMLX,
MZJZLSH,
MZZDBM,
MZZDMC,
MZZYZDZZBM,
RYCWH,
RYDJSJ,
RYSJ,
RYTJDM,
RYTJMC... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE,
ACCOUNT_DASH_FLG,
CASH_PAY,
CIVIL_SUBSIDY,
CKC102,
CLINIC_ID,
CLINIC_SLT_DATE,
COMP_ID,
COM_ACC_PAY,
COM_PAY,
DATA_ID,
ENT_ACC_PAY,
ENT_PAY,
FLX_MED_ORG_... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE,
ACCOUNT_DASH_FLG,
CASH_PAY,
CIVIL_SUBSIDY,
CKC102,
CLINIC_ID,
CLINIC_SLT_DATE,
COMP_ID,
COM_ACC_PAY,
COM_PAY,
DATA_ID,
ENT_ACC_PAY,
ENT_PAY,
FLX_MED_ORG_... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE jybgb (
BBCJBW,
BBDM,
BBMC,
BBZT,
BGDH,
BGJGDM,
BGJGMC,
BGRGH,
BGRQ,
BGRXM,
BGSJ,
CJRQ,
JSBBRQSJ,
JSBBSJ,
JYBBH,
JYJGMC,
JYJSGH,
JYJSQM,
JYKSBM,
JYKSMC,
JYLX,
JYRQ,
JYSQJGMC,
JYXMDM... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID,
MED_EXP_DET_ID
)
CREATE TABLE t_kc21 (
CLINIC_ID,
CLINIC_TYPE,
COMP_ID,
DATA_ID,
DIFF_PLACE_FLG,
FERTILITY_STS,
FLX_MED_ORG_ID,
HOSP_LEV,
HOSP_STS,
I... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE mzjzjlb (
YLJGDM,
JZLSH,
KH,
KLX,
MJZH,
HZXM,
NLS,
NLY,
ZSEBZ,
JZZTDM,
JZZTMC,
JZJSSJ,
TXBZ,
ZZBZ,
WDBZ,
JZKSBM,
JZKSMC,
JZKSRQ,
ZZYSGH,
QTJZYSGH,
JZZDBM,
JZZDSM,
MZZYZDZZBM,
MZZYZD... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE,
ACCOUNT_DASH_FLG,
CASH_PAY,
CIVIL_SUBSIDY,
CKC102,
CLINIC_ID,
CLINIC_SLT_DATE,
COMP_ID,
COM_ACC_PAY,
COM_PAY,
DATA_ID,
ENT_ACC_PAY,
ENT_PAY,
FLX_MED_ORG_... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE person_info (
CSD,
CSRQ,
GJDM,
GJMC,
JGDM,
JGMC,
MZDM,
MZMC,
RYBH,
XBDM,
XBMC,
XLDM,
XLMC,
XM,
ZYLBDM,
ZYMC
)
CREATE TABLE jybgb (
BBCJBW,
BBDM,
BBMC,
BBZT,
BGDH,
BGJGDM,
BGJGMC,
B... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE jybgb (
YLJGDM,
YLJGDM_MZJZJLB,
YLJGDM_ZYJZJLB,
BGDH,
BGRQ,
JYLX,
JZLSH,
JZLSH_MZJZJLB,
JZLSH_ZYJZJLB,
JZLX,
KSBM,
KSMC,
SQRGH,
SQRXM,
BGRGH,
BGRXM,
SHRGH,
SHRXM,
SHSJ,
SQKS,
SQKSMC... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE fgwyjzb (
CLINIC_ID,
CLINIC_TYPE,
COMP_ID,
DATA_ID,
DIFF_PLACE_FLG,
FERTILITY_STS,
FLX_MED_ORG_ID,
HOSP_LEV,
HOSP_STS,
IDENTITY_CARD,
INPT_AREA_BED,
INSURED_IDENTITY,
INSURED_STS,
I... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE t_kc22 (
MED_EXP_DET_ID,
OVERALL_CD_ORG,
OVERALL_CD_PERSON,
MED_CLINIC_ID,
MED_EXP_BILL_ID,
SOC_SRT_DIRE_CD,
SOC_SRT_DIRE_NM,
DIRE_TYPE,
CHA_ITEM_LEV,
MED_INV_ITEM_TYPE,
MED_DIRE_CD... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID,
MED_EXP_DET_ID
)
CREATE TABLE t_kc21 (
CLINIC_ID,
CLINIC_TYPE,
COMP_ID,
DATA_ID,
DIFF_PLACE_FLG,
FERTILITY_STS,
FLX_MED_ORG_ID,
HOSP_LEV,
HOSP_STS,
I... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE t_kc21 (
MED_CLINIC_ID,
OVERALL_CD_ORG,
OVERALL_CD_PERSON,
COMP_ID,
PERSON_ID,
PERSON_NM,
IDENTITY_CARD,
SOC_SRT_CARD,
PERSON_SEX,
PERSON_AGE,
IN_HOSP_DATE,
OUT_HOSP_DATE,
DIFF_PLAC... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE,
ACCOUNT_DASH_FLG,
CASH_PAY,
CIVIL_SUBSIDY,
CKC102,
CLINIC_ID,
CLINIC_SLT_DATE,
COMP_ID,
COM_ACC_PAY,
COM_PAY,
DATA_ID,
ENT_ACC_PAY,
ENT_PAY,
FLX_MED_ORG_... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID,
OVERALL_CD_ORG,
OVERALL_CD_PERSON,
MED_CLINIC_ID,
REF_SLT_FLG,
CLINIC_SLT_DATE,
COMP_ID,
PERSON_ID,
FLX_MED_ORG_ID,
INSU_TYPE,
MED_AMOUT,
PER_ACC_PAY,
OVE_... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE t_kc22 (
AMOUNT,
CHA_ITEM_LEV,
DATA_ID,
DIRE_TYPE,
DOSE_FORM,
DOSE_UNIT,
EACH_DOSAGE,
EXP_OCC_DATE,
FLX_MED_ORG_ID,
FXBZ,
HOSP_DOC_CD,
HOSP_DOC_NM,
MED_CLINIC_ID,
MED_DIRE_CD,
MED_D... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE t_kc21 (
CLINIC_ID,
CLINIC_TYPE,
COMP_ID,
DATA_ID,
DIFF_PLACE_FLG,
FERTILITY_STS,
FLX_MED_ORG_ID,
HOSP_LEV,
HOSP_STS,
IDENTITY_CARD,
INPT_AREA_BED,
INSURED_IDENTITY,
INSURED_STS,
IN... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID,
MED_EXP_DET_ID
)
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE,
ACCOUNT_DASH_FLG,
CASH_PAY,
CIVIL_SUBSIDY,
CKC102,
CLINIC_ID,
CLINIC_SLT_DATE,
COMP_ID,
COM... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE mzjzjlb (
HXPLC,
HZXM,
JLSJ,
JZJSSJ,
JZKSBM,
JZKSMC,
JZKSRQ,
JZLSH,
JZZDBM,
JZZDSM,
JZZTDM,
JZZTMC,
KH,
KLX,
MJZH,
ML,
MZZYZDZZBM,
MZZYZDZZMC,
NLS,
NLY,
QTJZYSGH,
SG,
SSY,
SZY,
TW,
... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE hz_info (
KH,
KLX,
RYBH,
YLJGDM
)
CREATE TABLE jybgb (
BBCJBW,
BBDM,
BBMC,
BBZT,
BGDH,
BGJGDM,
BGJGMC,
BGRGH,
BGRQ,
BGRXM,
BGSJ,
CJRQ,
JSBBRQSJ,
JSBBSJ,
JYBBH,
JYJGMC,
JYJSGH,
JYJS... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE zyjzjlb (
CYBQDM,
CYBQMC,
CYCWH,
CYKSDM,
CYKSMC,
CYSJ,
CYZTDM,
HZXM,
JZKSDM,
JZKSMC,
JZLSH,
KH,
KLX,
MZBMLX,
MZJZLSH,
MZZDBM,
MZZDMC,
MZZYZDZZBM,
RYCWH,
RYDJSJ,
RYSJ,
RYTJDM,
RYTJMC... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE jyjgzbb (
BGDH,
BGRQ,
CKZFWDX,
CKZFWSX,
CKZFWXX,
JCFF,
JCRGH,
JCRXM,
JCXMMC,
JCZBDM,
JCZBJGDL,
JCZBJGDW,
JCZBJGDX,
JCZBMC,
JLDW,
JYRQ,
JYZBLSH,
SBBM,
SHRGH,
SHRXM,
YLJGDM,
YQBH,
YQM... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE t_kc22 (
AMOUNT,
CHA_ITEM_LEV,
DATA_ID,
DIRE_TYPE,
DOSE_FORM,
DOSE_UNIT,
EACH_DOSAGE,
EXP_OCC_DATE,
FLX_MED_ORG_ID,
FXBZ,
HOSP_DOC_CD,
HOSP_DOC_NM,
MED_CLINIC_ID,
MED_DIRE_CD,
MED_D... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE gwyjzb (
CLINIC_ID,
CLINIC_TYPE,
COMP_ID,
DATA_ID,
DIFF_PLACE_FLG,
FERTILITY_STS,
FLX_MED_ORG_ID,
HOSP_LEV,
HOSP_STS,
IDENTITY_CARD,
INPT_AREA_BED,
INSURED_IDENTITY,
INSURED_STS,
IN... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE jybgb_jyjgzbb (
JYZBLSH,
YLJGDM,
jyjgzbb_id
)
CREATE TABLE mzjzjlb (
HXPLC,
HZXM,
JLSJ,
JZJSSJ,
JZKSBM,
JZKSMC,
JZKSRQ,
JZLSH,
JZZDBM,
JZZDSM,
JZZTDM,
JZZTMC,
KH,
KLX,
MJZH,
ML,
MZ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE t_kc22 (
AMOUNT,
CHA_ITEM_LEV,
DATA_ID,
DIRE_TYPE,
DOSE_FORM,
DOSE_UNIT,
EACH_DOSAGE,
EXP_OCC_DATE,
FLX_MED_ORG_ID,
FXBZ,
HOSP_DOC_CD,
HOSP_DOC_NM,
MED_DIRE_CD,
MED_DIRE_NM,
MED_EXP... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE mzjybgb (
BBCJBW,
BBDM,
BBMC,
BBZT,
BGDH,
BGJGDM,
BGJGMC,
BGRGH,
BGRQ,
BGRXM,
BGSJ,
CJRQ,
JSBBRQSJ,
JSBBSJ,
JYBBH,
JYJGMC,
JYJSGH,
JYJSQM,
JYKSBM,
JYKSMC,
JYLX,
JYRQ,
JYSQJGMC,
JYXM... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE,
ACCOUNT_DASH_FLG,
CASH_PAY,
CIVIL_SUBSIDY,
CKC102,
CLINIC_ID,
CLINIC_SLT_DATE,
COMP_ID,
COM_ACC_PAY,
COM_PAY,
DATA_ID,
ENT_ACC_PAY,
ENT_PAY,
FLX_MED_ORG_... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE t_kc21 (
MED_CLINIC_ID,
OVERALL_CD_ORG,
OVERALL_CD_PERSON,
COMP_ID,
PERSON_ID,
PERSON_NM,
IDENTITY_CARD,
SOC_SRT_CARD,
PERSON_SEX,
PERSON_AGE,
IN_HOSP_DATE,
OUT_HOSP_DATE,
DIFF_PLAC... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE,
ACCOUNT_DASH_FLG,
CASH_PAY,
CIVIL_SUBSIDY,
CKC102,
CLINIC_ID,
CLINIC_SLT_DATE,
COMP_ID,
COM_ACC_PAY,
COM_PAY,
DATA_ID,
ENT_ACC_PAY,
ENT_PAY,
FLX_MED_ORG_... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID,
MED_EXP_DET_ID
)
CREATE TABLE t_kc22 (
AMOUNT,
CHA_ITEM_LEV,
DATA_ID,
DIRE_TYPE,
DOSE_FORM,
DOSE_UNIT,
EACH_DOSAGE,
EXP_OCC_DATE,
FLX_MED_ORG_ID,
FXB... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE,
ACCOUNT_DASH_FLG,
CASH_PAY,
CIVIL_SUBSIDY,
CKC102,
CLINIC_ID,
CLINIC_SLT_DATE,
COMP_ID,
COM_ACC_PAY,
COM_PAY,
DATA_ID,
ENT_ACC_PAY,
ENT_PAY,
FLX_MED_ORG_... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE ftxmzjzjlb (
HXPLC,
HZXM,
JLSJ,
JZJSSJ,
JZKSBM,
JZKSMC,
JZKSRQ,
JZLSH,
JZZDBM,
JZZDSM,
JZZTDM,
JZZTMC,
KH,
KLX,
MJZH,
ML,
MZZYZDZZBM,
MZZYZDZZMC,
NLS,
NLY,
QTJZYSGH,
SG,
SSY,
SZY,
T... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: CREATE TABLE zyjzjlb (
CYBQDM,
CYBQMC,
CYCWH,
CYKSDM,
CYKSMC,
CYSJ,
CYZTDM,
HZXM,
JZKSDM,
JZKSMC,
JZLSH,
KH,
KLX,
MZBMLX,
MZJZLSH,
MZZDBM,
MZZDMC,
MZZYZDZZBM,
RYCWH,
RYDJSJ,
RYSJ,
RYTJDM,
RYTJMC... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of the department which has the highest average salary of professors.### Response: SELECT dept_name FROM instructor GROUP BY dept_name ORDER BY avg(salary) DESC LIMIT 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: show the train name and station name for each train.### Response: SELECT T2.name , T3.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the dates of performances with attending members whose roles are "Violin".### Response: SELECT T3.Date FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN p... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show director with the largest number of show times in total.### Response: SELECT T2.directed_by FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T2.directed_by ORDER BY... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the captain rank that has no captain in Third-rate ship of the line class.### Response: SELECT rank FROM captain EXCEPT SELECT rank FROM captain WHERE CLASS = 'Third-rate ship of the line... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the starting years shared by technicians from team "CLE" and "CWS".### Response: SELECT Starting_Year FROM technician WHERE Team = "CLE" INTERSECT SELECT Starting_Year FROM technician WHE... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many students does LORIA ONDERSMA teaches?### Response: SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "LORIA" AND T2.lastname =... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the durations of the longest and the shortest tracks in milliseconds?### Response: SELECT max(Milliseconds) , min(Milliseconds) FROM TRACK. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the maximum and minimum resolution of songs whose duration is 3 minutes?### Response: SELECT max(T2.resolution) , min(T2.resolution) FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the maximum and average capacity among rooms in each building.### Response: SELECT max(capacity) , avg(capacity) , building FROM classroom GROUP BY building. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show each gender code and the corresponding count of guests sorted by the count in descending order.### Response: SELECT gender_code , COUNT(*) FROM Guests GROUP BY gender_code ORDER BY COUNT(*... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the total grant amount of the organisations described as research?### Response: SELECT sum(grant_amount) FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisat... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show names and seatings, ordered by seating for all tracks opened after 2000.### Response: SELECT name , seating FROM track WHERE year_opened > 2000 ORDER BY seating. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the name of film studio that have the most number of films.### Response: SELECT Studio FROM film GROUP BY Studio ORDER BY COUNT(*) DESC LIMIT 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the id of the product that was ordered the most often?### Response: SELECT product_id FROM order_items GROUP BY product_id ORDER BY count(*) DESC LIMIT 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Who is the "CTO" of club "Hopkins Student Enterprises"? Show the first name and last name.### Response: SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the studios that have produced films with director "Nicholas Meyer" and "Walter Hill".### Response: SELECT Studio FROM film WHERE Director = "Nicholas Meyer" INTERSECT SELECT Studio FROM ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which destination has least number of flights?### Response: SELECT destination FROM Flight GROUP BY destination ORDER BY count(*) LIMIT 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name of dorms which have both TV Lounge and Study Room as amenities.### Response: SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Can you return all detailed info of jobs which was done by any of the employees who is presently earning a salary on and above 12000?### Response: SELECT * FROM job_history AS T1 JOIN employees... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the names of customers who have once canceled the purchase of the product "food" (the item status is "Cancel").### Response: SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 J... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are id and name of the products whose price is lower than 600 or higher than 900?### Response: SELECT product_id , product_name FROM products WHERE product_price < 600 OR product_price ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the average prices of all products from each manufacture, and list each company's name.### Response: SELECT avg(T1.price) , T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manuf... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Hom many albums does the artist "Metallica" have?### Response: SELECT COUNT(*) FROM ALBUM AS T1 JOIN ARTIST AS T2 ON T1.ArtistId = T2.ArtistId WHERE T2.Name = "Metallica". |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: For each injury accident, find the date of the game and the name of the injured player in the game, and sort the results in descending order of game season.### Response: SELECT T1.date , T2.pla... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find names of the document without any images.### Response: SELECT document_name FROM documents EXCEPT SELECT t1.document_name FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_co... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the first name of students who are living in the Smith Hall.### Response: SELECT T1.fname FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the lowest and highest rating star?### Response: SELECT max(stars) , min(stars) FROM Rating. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show times of elimination of wrestlers with days held more than 50.### Response: SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID WHERE T2.Days_held... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the name and address of the customers who have both New and Pending orders.### Response: SELECT T1.customer_name , T1.customer_address FROM customers AS T1 JOIN customer_orders AS T2 ON T1... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the state and enrollment of the colleges where have any students who got accepted in the tryout decision.### Response: SELECT DISTINCT T1.state , T1.enr FROM college AS T1 JOIN tryout A... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many distinct characteristic names does the product "cumin" have?### Response: SELECT count(DISTINCT t3.characteristic_name) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.prod... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find all the male members of club "Hopkins Student Enterprises". Show the first name and last name.### Response: SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubi... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Who is the friend of Zach with longest year relationship?### Response: SELECT friend FROM PersonFriend WHERE name = 'Zach' AND YEAR = (SELECT max(YEAR) FROM PersonFriend WHERE name = 'Zach')... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which head's name has the substring 'Ha'? List the id and name.### Response: SELECT head_id , name FROM head WHERE name LIKE '%Ha%'. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the role code with the largest number of employees?### Response: SELECT role_code FROM Employees GROUP BY role_code ORDER BY count(*) DESC LIMIT 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the total saving balance for each account name.### Response: SELECT sum(T2.balance) , T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid GROUP BY T1.name. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the nations that have both hosts older than 45 and hosts younger than 35.### Response: SELECT Nationality FROM HOST WHERE Age > 45 INTERSECT SELECT Nationality FROM HOST WHERE Age < 35. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: display the average salary of employees for each department who gets a commission percentage.### Response: SELECT department_id , AVG(salary) FROM employees WHERE commission_pct != "null" GROUP... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the birthday of the staff member with first name as Janessa and last name as Sawayn?### Response: SELECT date_of_birth FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the authors who have submissions to more than one workshop.### Response: SELECT T2.Author FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID GROUP BY T2.Au... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: How many characteristics does the product named "sesame" have?### Response: SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id WHERE t1.pro... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the maximum price of wins from the appelations in Central Coast area and produced before the year of 2005.### Response: SELECT max(T2.Price) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Ap... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the speeds of the longest roller coaster?### Response: SELECT Speed FROM roller_coaster ORDER BY LENGTH DESC LIMIT 1. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show headquarters with at least two companies in the banking industry.### Response: SELECT headquarters FROM company WHERE main_industry = 'Banking' GROUP BY headquarters HAVING count(*) >= ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the name of the customer who has the largest number of orders?### Response: SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the name of the customer who has made the minimum amount of payment in one claim?### Response: SELECT t3.customer_details FROM claim_headers AS t1 JOIN policies AS t2 ON t1.policy_id = ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the distinct names of all wines that have prices higher than some wines from John Anthony winery.### Response: SELECT DISTINCT Name FROM WINE WHERE Price > (SELECT min(Price) FROM wine WH... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the cinema name and location for cinemas with capacity above average.### Response: SELECT name , LOCATION FROM cinema WHERE capacity > (SELECT avg(capacity) FROM cinema). |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the renting arrears tax ids related to the customer master index whose detail is not 'Schmidt, Kertzmann and Lubowitz'?### Response: SELECT T1.council_tax_id FROM Rent_Arrears AS T1 JOI... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find products with max page size as "A4" and pages per minute color smaller than 5.### Response: SELECT product FROM product WHERE max_page_size = "A4" AND pages_per_minute_color < 5. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the details of the lots which are not used in any transactions?### Response: SELECT lot_details FROM Lots EXCEPT SELECT T1.lot_details FROM Lots AS T1 JOIN transactions_lots AS T2 ON T1... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What are the names of the county that the delegates on "Appropriations" committee belong to?### Response: SELECT T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.Distr... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Which city does has most number of customers?### Response: SELECT T2.city FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id GROUP BY T2.city ORDER BY count(*) D... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the name and distance of the aircrafts with more than 5000 distance and which at least 5 people have its certificate.### Response: SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the states of the colleges that have students in the tryout who played in striker position.### Response: SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE ... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: List the names of phones that are not on any market.### Response: SELECT Name FROM phone WHERE Phone_id NOT IN (SELECT Phone_ID FROM phone_market). |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the founder of the company whose name begins with the letter 'S'.### Response: SELECT founder FROM manufacturers WHERE name LIKE 'S%'. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Show the names of all the donors except those whose donation amount less than 9.### Response: SELECT donator_name FROM endowment EXCEPT SELECT donator_name FROM endowment WHERE amount < 9. |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the total checking and saving balance of all accounts sorted by the total balance in ascending order.### Response: SELECT T1.balance + T2.balance FROM checking AS T1 JOIN savings AS T2 ON T... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: What is the venue of the competition "1994 FIFA World Cup qualification" hosted by "Nanjing ( Jiangsu )"?### Response: SELECT T3.venue FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: For each building, show the name of the building and the number of institutions in it.### Response: SELECT T1.name , count(*) FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2... |
Below is an instruction that describes a task. Write a MySQL query that appropriately completes the request. ### Instruction: Find the first names of all instructors who have taught some course and the course description.### Response: SELECT T2.emp_fname , T3.crs_description FROM CLASS AS T1 JOIN employee AS T2 ON T1.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.