input stringclasses 1
value | instruction stringlengths 54 195 | output stringlengths 281 2.05k |
|---|---|---|
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | What is Kyprolis's claims volume in the last 3 months? |
SELECT COUNT(distinct(claim_ID)) AS num_prescriptions
FROM "symphony-data"."test_performance_v3"
WHERE Drug_Name like '%KYPROLIS%'
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_v3") - interval '90' day); |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | What is Kyprolis's claims volume in the last 3 months for MM indication? |
SELECT COUNT(distinct(claim_ID)) AS num_prescriptions
FROM "symphony-data"."test_performance_v3"
WHERE Drug_Name like '%KYPROLIS%'
AND indication like '%MM%'
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_v3") - interval '90' day); |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | Which brand had the highest claims in MM indication in last 3 months? |
SELECT Drug_Name, COUNT(distinct(claim_ID)) as num_prescriptions
FROM "symphony-data"."test_performance_v3"
WHERE indication like '%MM%'
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_v3") - interval '90' day)
GROUP BY Drug_Name
ORDER BY num_p... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | Which brand had the highest claims in NY state in MM indication in last 3 months? |
SELECT Drug_Name, COUNT(distinct(claim_ID)) as num_prescriptions
FROM "symphony-data"."test_performance_v3"
WHERE indication like '%MM%'
AND Patient_State = 'NY'
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_v3") - interval '90' day)
GROUP BY... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | Identify the state where Kyprolis had the most prescriptions for MM indications? Ignore blanks for state |
SELECT Patient_State, COUNT(distinct(Claim_ID)) as num_prescriptions
FROM "symphony-data"."test_performance_v3"
WHERE Drug_Name like '%KYPROLIS%'
AND indication like '%MM%'
AND Patient_State NOT LIKE 'None'
AND Patient_State NOT LIKE ''
GROUP BY Patient_State
ORDER BY num_prescriptions DESC
LIMIT 1; |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | What was the market share of the top 5 drugs prescribed for MM indication over the last 3 months? |
WITH top_5_drugs AS (
SELECT Drug_Name, count (distinct(claim_id)) as prescription_count
FROM "symphony-data"."test_performance_v3"
WHERE indication like '%MM%'
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_v3") - interval '90' day)
GROUP BY ... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | Give me the market share by drug for the top 5 drugs for MM indication over the last 3 months |
WITH
top_5_drugs AS (
SELECT Drug_Name, count (distinct(claim_id)) as prescription_count
FROM "symphony-data"."test_performance_v3"
WHERE indication like '%MM%'
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_v3") - interval '90' day)
GROUP BY ... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | What was the market share for Kyprolis for years 2021 and 2022 for MM indication? |
WITH
kyprolis_2021 AS (
SELECT COUNT(distinct(claim_ID)) AS num_prescriptions
FROM "symphony-data"."test_performance_v3"
WHERE Drug_Name like '%KYPROLIS%'
AND Prescription_Fill_Year_Month >= date('2021-01-01')
AND Prescription_Fill_Year_Month <= date('2021-12-31')
AND indication like '%MM%'
),
kyprolis_2022 AS (
SELE... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | What's the most prescribed brand for MM indication? What is it's market share? |
WITH num AS (
SELECT COUNT(DISTINCT(Claim_ID)) AS num_data
FROM "symphony-data"."test_performance_v3"
WHERE indication LIKE '%MM%'
AND Drug_Name IN (SELECT Drug_Name
FROM "symphony-data"."test_performance_v3"
WHERE indication LIKE '%MM%'
GROUP BY Drug_Name
... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | Over the past 3 months, which state in the US has seen a higher number of claims for Kyprolis in the MM indication compared to its competitors? |
WITH kyprolis_claims AS (
SELECT Patient_State, COUNT(distinct(claim_ID)) AS num_claims
FROM "symphony-data"."test_performance_v3"
WHERE Drug_Name like '%KYPROLIS%'
AND indication like '%MM%'
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_v3")... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | What is the relative growth of Kyprolis in last 3 months compared to previous year? |
WITH
numerator AS (
select count(Distinct(claim_ID)) as total_claims from "symphony-data"."test_performance_v3" where Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_v3") - interval '3' month) and Drug_Name like '%KYPROLIS%'
),
denominator AS(
sele... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | How did Kyprolis prescriptions for MM indication grow for 2021 vs 2020? |
WITH
kyprolis_prescriptions_2021 AS (
SELECT COUNT(distinct(claim_ID)) AS num_prescriptions
FROM "symphony-data"."test_performance_v3"
WHERE Drug_Name like '%KYPROLIS%'
AND indication like '%MM%'
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | Calculate evolution index for Kyprolis for MM indication for the last 3 months versus same time period last year |
WITH
kyprolis_prescriptions_current AS (
SELECT COUNT(distinct(claim_ID)) AS num_prescriptions
FROM "symphony-data"."test_performance_v3"
WHERE Drug_Name like '%KYPROLIS%'
AND indication like '%MM%'
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performan... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | In which state has Kyprolis presciption count grown the most over the last 3 months compared to the same time period last year? |
WITH
numerator AS (
SELECT Patient_State, COUNT(distinct(claim_ID)) as total_claims
FROM "symphony-data"."test_performance_v3"
WHERE Drug_Name like '%KYPROLIS%'
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_v3") - interval '3' month)
GROUP BY... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | For patients over 60 prescribed drugs for MM indication, what percentage of those prescriptions were for Kyprolis? |
WITH
total_prescriptions AS (
SELECT COUNT(distinct(claim_ID)) AS total_prescriptions
FROM "symphony-data"."test_performance_v3"
WHERE indication like '%MM%'
AND patient_age >= 60
),
kyprolis_prescriptions AS (
SELECT COUNT(distinct(claim_ID)) AS kyprolis_prescriptions
FROM "symphony-data"."test_performance_v3"
WHERE... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | What is the market share of Kyprolis in MM indication for patients above 60 years? |
WITH num AS (
SELECT COUNT(DISTINCT(Claim_ID)) AS num_data
FROM "symphony-data"."test_performance_v3"
WHERE Drug_Name LIKE '%KYPROLIS%'
AND indication LIKE '%MM%'
AND patient_age >= 60
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_v3") ... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | What is the market share of Kyprolis in MM indication for female/male patients over the last 6 months? |
WITH num AS
(
SELECT COUNT(DISTINCT(Claim_ID)) AS num_data
FROM "symphony-data"."test_performance_v3"
WHERE Drug_Name LIKE '%KYPROLIS%'
AND indication LIKE '%MM%'
AND Patient_Gender IN ('Male', 'Female')
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_perf... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | Which drug had highest claims for patients above 60 in MM indication over the last 1 year? |
SELECT Drug_Name, COUNT(distinct(claim_ID)) as num_prescriptions
FROM "symphony-data"."test_performance_v3"
WHERE indication like '%MM%'
AND patient_age > 60
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_v3") - interval '1' year)
GROUP BY Dru... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | Which state in the US had the highest number of claims in the MM indication for patients over the age of 60 over the last 3 months? Exclude None and blank values in state column |
SELECT Patient_State, COUNT(distinct(Claim_ID)) as num_claims
FROM "symphony-data"."test_performance_v3"
WHERE indication like '%MM%'
AND Patient_State NOT IN ('None', '')
AND patient_age > 60
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_v3"... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | What is the most common payer type for Kyprolis in last 3 months? |
SELECT plan_type_description, COUNT(distinct(claim_ID)) as num_prescriptions
FROM "symphony-data"."test_performance_v3"
WHERE Drug_Name like '%KYPROLIS%'
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_v3") - interval '90' day)
AND plan_type_de... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | What is the avg. out of pocket pay for Kyprolis in NY state in last 3 months? |
SELECT AVG(Total_Patient_Responsibility) as avg_patient_pay
FROM "symphony-data"."test_performance_v3"
WHERE Drug_Name like '%KYPROLIS%'
AND Patient_State = 'NY'
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_v3") - interval '90' day); |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | Could you provide a ranking of all the brands in the MM indication based on their share of commercial payers over the last 3 months? |
WITH
commercial_payers AS (
SELECT Drug_Name, COUNT(distinct(claim_ID)) as num_prescriptions
FROM "symphony-data"."test_performance_v3"
WHERE plan_type_description = 'COMMERCIAL'
AND indication like '%MM%'
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_pe... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | Based on the average out-of-pocket expenses for patients over 60 years old in the MM indication over the last 6 months, could you please give me the 5 drugs with lowest out-of-pocket expenses? |
WITH avg_patient_pay AS (
SELECT Drug_Name, AVG(Total_Patient_Responsibility) as avg_patient_pay
FROM "symphony-data"."test_performance_v3"
WHERE indication like '%MM%'
AND patient_age >= 60
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_v3") ... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | What is Kyprolis's claims volume in the last 3 months for patient above 60 and male? | SELECT COUNT(distinct(claim_ID)) as num_claims
FROM "symphony-data"."test_performance_v3"
WHERE Drug_Name like '%KYPROLIS%'
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_v3") - interval '90' day)
AND patient_age > 60
AND Patient_Gender = ... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | What is the most common payer type for Kyprolis in last 3 months for the indication mm? | SELECT plan_type_description, COUNT(distinct(claim_ID)) as num_prescriptions
FROM "symphony-data"."test_performance_v3"
WHERE Drug_Name like '%KYPROLIS%'
AND indication like '%MM%'
AND plan_type_description not like 'NONE'
AND plan_type_description not like ''
AND Prescription_Fill_Year_Month >= date((select max(Prescr... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | What is the market share of Kyprolis in MM indication for female/male patients over the last 6 months for the plan type Commercial? |
WITH num AS (
SELECT COUNT(DISTINCT(Claim_ID)) AS num_data
FROM "symphony-data"."test_performance_v3"
WHERE Drug_Name like '%KYPROLIS%'
AND Patient_Gender IN ('Female', 'Male')
AND plan_type_description = 'COMMERCIAL'
AND indication like '%MM%'
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Ye... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | What is the most common payer type for Kyprolis in last 3 months in ny state? |
WITH kyprolis_prescriptions AS (
SELECT plan_type_description, COUNT(distinct(claim_ID)) AS num_prescriptions
FROM "symphony-data"."test_performance_v3"
WHERE Drug_Name like '%KYPROLIS%'
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_v3") - in... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | How did Kyprolis prescriptions for MM indication for the patient less than 45 years grow for 2021 vs 2020? |
WITH
kyprolis_prescriptions_2021 AS (
SELECT COUNT(distinct(claim_ID)) AS num_prescriptions
FROM "symphony-data"."test_performance_v3"
WHERE Drug_Name like '%KYPROLIS%'
AND indication like '%MM%'
AND patient_age < 45
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-dat... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | What is the market share of Kyprolis in MM indication for female patients above 45 years? |
WITH num AS (
SELECT COUNT(DISTINCT(Claim_ID)) AS num_data
FROM "symphony-data"."test_performance_v3"
WHERE Drug_Name like '%KYPROLIS%'
AND indication like '%MM%'
AND Patient_Gender = 'Female'
AND patient_age > 45
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | What is the claims volume of Kyprolis in the MM indication in the past 6 months? |
SELECT COUNT(distinct(claim_ID)) AS num_prescriptions
FROM "symphony-data"."test_performance_v3"
WHERE Drug_Name like '%KYPROLIS%'
AND indication like '%MM%'
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_v3") - interval '6' month); |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | What is the claims volume of Kyprolis in the cml indication in the past 6 months specifically for (cml)? |
SELECT COUNT(distinct(claim_ID)) AS num_prescriptions
FROM "symphony-data"."test_performance_v3"
WHERE Drug_Name like '%KYPROLIS%'
AND indication like '%CML%'
AND indication like '%Multiple Myeloma%'
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performa... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | Which brand had the highest claims volume in the cml indication in the past 6 months? |
SELECT Drug_Name, COUNT(distinct(claim_ID)) as num_prescriptions
FROM "symphony-data"."test_performance_v3"
WHERE indication like '%CML%'
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_v3") - interval '6' month)
GROUP BY Drug_Name
ORDER BY num... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | Which brand had the highest claims volume in the cml indication in the state of New York (NY) in the past 6 months? | "
SELECT Drug_Name, COUNT(distinct(claim_ID)) as num_claims
FROM ""symphony-data"".""test_performance_v3""
WHERE indication like '%ITP%'
AND Patient_State = 'NY'
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from ""symphony-data"".""test_performance_v3"") - interval '6' month)
GROU... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | In which state did Kyprolis have the highest number of prescriptions for the cml indication? | "
SELECT Patient_State, COUNT(distinct(Claim_ID)) as num_prescriptions
FROM ""symphony-data"".""test_performance_v3""
WHERE Drug_Name like '%KYPROLIS%'
AND indication like '%ITP%'
AND Patient_State NOT LIKE 'None'
AND Patient_State NOT LIKE ''
GROUP BY Patient_State
ORDER BY num_prescriptions DESC
LIMIT 1;" |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | What was the market share of the top 5 drugs prescribed for the cml indication over the past 6 months? | "
WITH
top_5_drugs AS (
SELECT Drug_Name, COUNT(distinct(claim_ID)) as num_prescriptions
FROM ""symphony-data"".""test_performance_v3""
WHERE indication like '%ITP%'
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from ""symphony-data"".""test_performance_v3"") - interval '6' month)
... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | Can you provide the market share by drug for the top 5 drugs prescribed for the cml indication over the past 6 months? |
WITH top_5_drugs AS (
SELECT Drug_Name, count (distinct(claim_id)) as prescription_count
FROM "symphony-data"."test_performance_v3"
WHERE indication like '%CML%'
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_v3") - interval '6' month)
GROUP B... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | What was the market share of Kyprolis for the cml indication in the years 2020 and 2022? |
WITH
kyprolis_2020 AS (
SELECT COUNT(distinct(claim_ID)) AS num_prescriptions
FROM "symphony-data"."test_performance_v3"
WHERE Drug_Name like '%KYPROLIS%'
AND indication like '%CML%'
AND Prescription_Fill_Year_Month >= date '2020-01-01'
AND Prescription_Fill_Year_Month <= date '2020-12-31'
),
kyprolis_2022 AS (
SELEC... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | Which brand was the most prescribed for the cml indication, and what was its market share? |
WITH den AS (
SELECT COUNT(DISTINCT(Claim_ID)) AS den_data
FROM "symphony-data"."test_performance_v3"
WHERE indication LIKE '%CML%'
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_v3") - interval '90' day)
),
brand_data AS (
SELECT Drug_Name... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | Over the past 6 months, which state in the US had a higher number of claims for Kyprolis in the cml indication compared to its competitors? |
WITH kyprolis_claims AS (
SELECT COUNT(distinct(claim_ID)) AS num_claims, Patient_State
FROM "symphony-data"."test_performance_v3"
WHERE Drug_Name like '%KYPROLIS%'
AND indication like '%CML%'
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_v3"... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | What is the relative growth of Kyprolis in the past 6 months compared to the previous year? |
WITH
numerator AS (
select count(Distinct(claim_ID)) as total_claims from "symphony-data"."test_performance_v3" where Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_v3") - interval '6' month) and Drug_Name like '%KYPROLIS%'
),
denominator AS(
sele... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | How did Kyprolis prescriptions for the cml indication grow from 2020 to 2022? |
WITH
kyprolis_prescriptions_2020 AS (
SELECT COUNT(distinct(claim_ID)) AS num_prescriptions
FROM "symphony-data"."test_performance_v3"
WHERE Drug_Name like '%KYPROLIS%'
AND indication like '%CML%'
AND Prescription_Fill_Year_Month >= date('2020-01-01')
AND Prescription_Fill_Year_Month <= date('2020-12-31')
),
kyprolis... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | Calculate the evolution index for Kyprolis for the cml indication in the last 6 months compared to the same time period last year. |
WITH
kyprolis_prescriptions_current AS (
SELECT COUNT(distinct(claim_ID)) AS num_prescriptions
FROM "symphony-data"."test_performance_v3"
WHERE Drug_Name like '%KYPROLIS%'
AND indication like '%CML%'
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performa... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | In which state did Kyprolis prescription count grow the most in the past 6 months compared to the same time period last year? |
WITH
kyprolis_prescriptions_current_year AS (
SELECT Patient_State, COUNT(distinct(claim_ID)) AS num_prescriptions
FROM "symphony-data"."test_performance_v3"
WHERE Drug_Name like '%KYPROLIS%'
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_v3")... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | For patients over 60 who were prescribed drugs for the cml indication, what percentage of those prescriptions were for Kyprolis? |
WITH cml_prescriptions AS (
SELECT COUNT(distinct(claim_ID)) AS num_prescriptions
FROM "symphony-data"."test_performance_v3"
WHERE indication like '%CML%'
AND patient_age >= 60
),
kyprolis_prescriptions AS (
SELECT COUNT(distinct(claim_ID)) AS num_prescriptions
FROM "symphony-data"."test_performance_v3"
WHERE Drug_Na... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | What is the market share of Kyprolis in the cml indication for patients above 60 years old? |
WITH num AS (
SELECT COUNT(DISTINCT(Claim_ID)) AS num_data
FROM "symphony-data"."test_performance_v3"
WHERE Drug_Name LIKE '%KYPROLIS%'
AND indication LIKE '%CML%'
AND patient_age >= 60
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_v3")... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | Which drug had the highest claims for patients above 60 in the cml indication over the past year? |
WITH cml_claims AS (
SELECT Drug_Name, COUNT(distinct(claim_ID)) AS num_claims
FROM "symphony-data"."test_performance_v3"
WHERE indication like '%CML%'
AND patient_age > 60
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_v3") - interval '1' yea... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | Which state in the US had the highest number of claims in the cml indication for patients over the age of 60 in the past 6 months? (Exclude "None" and blank values in the state column) |
SELECT Patient_State, COUNT(distinct(Claim_ID)) as num_claims
FROM "symphony-data"."test_performance_v3"
WHERE indication like '%CML%'
AND patient_age > 60
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_v3") - interval '6' month)
AND Patient_S... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | What is the most common payer type for Kyprolis in the past 6 months? |
WITH kyprolis_prescriptions AS (
SELECT plan_type_description, COUNT(distinct(claim_ID)) AS num_prescriptions
FROM "symphony-data"."test_performance_v3"
WHERE Drug_Name like '%KYPROLIS%'
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_v3") - in... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | What is the average out-of-pocket payment for Kyprolis in the state of New York (NY) in the past 6 months? |
SELECT AVG(Total_Patient_Responsibility) as avg_patient_pay
FROM "symphony-data"."test_performance_v3"
WHERE Drug_Name like '%KYPROLIS%'
AND Patient_State = 'NY'
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_v3") - interval '6' month); |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | Based on the average out-of-pocket expenses for patients over 60 years old in the cml indication over the past 6 months, can you please provide the 5 drugs with the lowest out-of-pocket expenses? |
WITH cml_prescriptions AS (
SELECT Drug_Name, AVG(Total_Patient_Responsibility) as avg_patient_pay
FROM "symphony-data"."test_performance_v3"
WHERE indication like '%CML%'
AND patient_age >= 60
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_v3... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | What is the claims volume of Kyprolis in the past 6 months for patients above 60 and male? |
SELECT COUNT(distinct(claim_ID)) AS num_prescriptions
FROM "symphony-data"."test_performance_v3"
WHERE Drug_Name like '%KYPROLIS%'
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_v3") - interval '6' month)
AND patient_age > 60
AND Patient_Gende... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | What is the most common payer type for Kyprolis in the past 6 months for the cml indication? |
WITH kyprolis_prescriptions AS (
SELECT plan_type_description, COUNT(distinct(claim_ID)) AS num_prescriptions
FROM "symphony-data"."test_performance_v3"
WHERE Drug_Name like '%KYPROLIS%'
AND indication like '%CML%'
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | What is the market share of Kyprolis in the cml indication for female and male patients over the past 6 months for the plan type Commercial? |
WITH num AS (
SELECT COUNT(DISTINCT(Claim_ID)) AS num_data
FROM "symphony-data"."test_performance_v3"
WHERE Drug_Name like '%KYPROLIS%'
AND indication like '%CML%'
AND Patient_Gender IN ('Male', 'Female')
AND plan_type_description = 'COMMERCIAL'
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Y... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | What is the most common payer type for Kyprolis in the past 6 months in the state of New York (NY)? |
SELECT plan_type_description, COUNT(distinct(claim_ID)) as num_prescriptions
FROM "symphony-data"."test_performance_v3"
WHERE Drug_Name like '%KYPROLIS%'
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_v3") - interval '6' month)
AND Patient_Sta... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | How did Kyprolis prescriptions for the cml indication for patients less than 45 years old grow from 2020 to 2022? |
WITH kyprolis_prescriptions_2020 AS (
SELECT COUNT(distinct(claim_ID)) AS num_prescriptions
FROM "symphony-data"."test_performance_v3"
WHERE Drug_Name like '%KYPROLIS%'
AND indication like '%CML%'
AND patient_age < 45
AND Prescription_Fill_Year_Month >= date('2020-01-01')
AND Prescription_Fill_Year_Month < date('2021... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | What is the market share of Kyprolis in the cml indication for female patients above 45 years old? |
WITH num AS (
SELECT COUNT(DISTINCT(Claim_ID)) AS num_data
FROM "symphony-data"."test_performance_v3"
WHERE Drug_Name LIKE '%KYPROLIS%'
AND indication LIKE '%CML%'
AND Patient_Gender = 'Female'
AND patient_age > 45
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | Which brand had the lowest claims volume in the cml indication in the past 6 months? |
SELECT Drug_Name, COUNT(distinct(claim_ID)) as num_prescriptions
FROM "symphony-data"."test_performance_v3"
WHERE indication like '%CML%'
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_v3") - interval '6' month)
GROUP BY Drug_Name
ORDER BY num... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | Which brand had the least claims volume in the cml indication in the state of New York (NY) in the past 6 months? |
SELECT Drug_Name, COUNT(distinct(claim_ID)) as num_prescriptions
FROM "symphony-data"."test_performance_v3"
WHERE indication like '%CML%'
AND Patient_State = 'NY'
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_v3") - interval '6' month)
GROUP ... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | What was the market share of the bottom 5 drugs prescribed for the cml indication over the past 6 months? | with
bottom_5_drugs AS (
SELECT Drug_Name, count (distinct(claim_id)) as prescription_count
FROM "symphony-data"."test_performance_v3"
WHERE indication like '%CML%'
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_v3") - interval '6' month)
GROUP ... |
Hi! I need your help in generating an MySQL/ansi sql query.You are sql query generator all you should return is only query I am going to give you the schema associated with a database.
Name of the table is ""test_performance_v3"".
Schema
Field Name | Field Type | Data Definition
NPI | varchar | 10 digit HCP identifier ... | What was the market share of the first 5 drugs prescribed for the cml indication over the past 6 months? |
WITH
top_5_drugs AS (
SELECT Drug_Name, count (distinct(claim_id)) as prescription_count
FROM "symphony-data"."test_performance_v3"
WHERE indication like '%CML%'
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
from "symphony-data"."test_performance_v3") - interval '6' month)
GROUP B... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.