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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
input,instruct,output
|
| 2 |
+
"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.
|
| 3 |
+
Name of the table is """"test_performance_v3"""".
|
| 4 |
+
Schema
|
| 5 |
+
Field Name | Field Type | Data Definition
|
| 6 |
+
NPI | varchar | 10 digit HCP identifier (Exclude blank and invalid NPIs from any queries)
|
| 7 |
+
Claim_ID | varchar | Unique claim identifier
|
| 8 |
+
Patient_ID | varchar | Unique patient identifier
|
| 9 |
+
Patient_Gender | varchar(8) | Patient Gender (Exclude """"Unknown"""" and blank values from any queries)
|
| 10 |
+
Patient_State | varchar | State in which prescription was filled (Exclude """"None"""" and blank values from any queries)
|
| 11 |
+
Region | varchar(9) | Region info of state
|
| 12 |
+
plan_type_description | varchar | Payor type (COMMERCIAL, MEDICARE, MEDICAID, etc.) in capital letters. (Exclude """"NONE"""" and blank values from any queries)
|
| 13 |
+
Plan_Name | varchar | Specific payor name
|
| 14 |
+
Drug_name | varchar | Brand or Drug name
|
| 15 |
+
Prescribed_Drug_Indication | varchar(2922) | Drug indication (based on prescribed drug)
|
| 16 |
+
Prescription_Fill_Year_Month | date | Date when prescription was filled
|
| 17 |
+
quantity | double | total quantity of drugs prescribed in each prescription
|
| 18 |
+
Total_Patient_Responsibility | double | Out of Pocket expense borne by patient
|
| 19 |
+
Total_Payer_Responsibility | double | Expense borne by payor
|
| 20 |
+
patient_age | integer | numeric age of patient in years
|
| 21 |
+
indication | string | Indications for given patient
|
| 22 |
+
Unknown_Flag | varchar(3) | If no disease detected, this would be Yes",How many claims did Kyprolis file in the last three months?,"
|
| 23 |
+
|
| 24 |
+
SELECT COUNT(distinct(claim_ID)) AS num_claims
|
| 25 |
+
FROM ""symphony-data"".""test_performance_v3""
|
| 26 |
+
WHERE Drug_Name like '%KYPROLIS%'
|
| 27 |
+
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
|
| 28 |
+
from ""symphony-data"".""test_performance_v3"") - interval '90' day);"
|
| 29 |
+
"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.
|
| 30 |
+
Name of the table is """"test_performance_v3"""".
|
| 31 |
+
Schema
|
| 32 |
+
Field Name | Field Type | Data Definition
|
| 33 |
+
NPI | varchar | 10 digit HCP identifier (Exclude blank and invalid NPIs from any queries)
|
| 34 |
+
Claim_ID | varchar | Unique claim identifier
|
| 35 |
+
Patient_ID | varchar | Unique patient identifier
|
| 36 |
+
Patient_Gender | varchar(8) | Patient Gender (Exclude """"Unknown"""" and blank values from any queries)
|
| 37 |
+
Patient_State | varchar | State in which prescription was filled (Exclude """"None"""" and blank values from any queries)
|
| 38 |
+
Region | varchar(9) | Region info of state
|
| 39 |
+
plan_type_description | varchar | Payor type (COMMERCIAL, MEDICARE, MEDICAID, etc.) in capital letters. (Exclude """"NONE"""" and blank values from any queries)
|
| 40 |
+
Plan_Name | varchar | Specific payor name
|
| 41 |
+
Drug_name | varchar | Brand or Drug name
|
| 42 |
+
Prescribed_Drug_Indication | varchar(2922) | Drug indication (based on prescribed drug)
|
| 43 |
+
Prescription_Fill_Year_Month | date | Date when prescription was filled
|
| 44 |
+
quantity | double | total quantity of drugs prescribed in each prescription
|
| 45 |
+
Total_Patient_Responsibility | double | Out of Pocket expense borne by patient
|
| 46 |
+
Total_Payer_Responsibility | double | Expense borne by payor
|
| 47 |
+
patient_age | integer | numeric age of patient in years
|
| 48 |
+
indication | string | Indications for given patient
|
| 49 |
+
Unknown_Flag | varchar(3) | If no disease detected, this would be Yes",Which brand had the least claims in MM indication in last 3 months?,"
|
| 50 |
+
|
| 51 |
+
SELECT Drug_Name, COUNT(distinct(claim_ID)) as num_prescriptions
|
| 52 |
+
FROM ""symphony-data"".""test_performance_v3""
|
| 53 |
+
WHERE indication like '%MM%'
|
| 54 |
+
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
|
| 55 |
+
from ""symphony-data"".""test_performance_v3"") - interval '90' day)
|
| 56 |
+
GROUP BY Drug_Name
|
| 57 |
+
ORDER BY num_prescriptions ASC
|
| 58 |
+
LIMIT 1;"
|
| 59 |
+
"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.
|
| 60 |
+
Name of the table is """"test_performance_v3"""".
|
| 61 |
+
Schema
|
| 62 |
+
Field Name | Field Type | Data Definition
|
| 63 |
+
NPI | varchar | 10 digit HCP identifier (Exclude blank and invalid NPIs from any queries)
|
| 64 |
+
Claim_ID | varchar | Unique claim identifier
|
| 65 |
+
Patient_ID | varchar | Unique patient identifier
|
| 66 |
+
Patient_Gender | varchar(8) | Patient Gender (Exclude """"Unknown"""" and blank values from any queries)
|
| 67 |
+
Patient_State | varchar | State in which prescription was filled (Exclude """"None"""" and blank values from any queries)
|
| 68 |
+
Region | varchar(9) | Region info of state
|
| 69 |
+
plan_type_description | varchar | Payor type (COMMERCIAL, MEDICARE, MEDICAID, etc.) in capital letters. (Exclude """"NONE"""" and blank values from any queries)
|
| 70 |
+
Plan_Name | varchar | Specific payor name
|
| 71 |
+
Drug_name | varchar | Brand or Drug name
|
| 72 |
+
Prescribed_Drug_Indication | varchar(2922) | Drug indication (based on prescribed drug)
|
| 73 |
+
Prescription_Fill_Year_Month | date | Date when prescription was filled
|
| 74 |
+
quantity | double | total quantity of drugs prescribed in each prescription
|
| 75 |
+
Total_Patient_Responsibility | double | Out of Pocket expense borne by patient
|
| 76 |
+
Total_Payer_Responsibility | double | Expense borne by payor
|
| 77 |
+
patient_age | integer | numeric age of patient in years
|
| 78 |
+
indication | string | Indications for given patient
|
| 79 |
+
Unknown_Flag | varchar(3) | If no disease detected, this would be Yes",Give me the market share by drug for the bottom 5 drugs for MM indication over the last 9 months,"
|
| 80 |
+
|
| 81 |
+
WITH
|
| 82 |
+
top_5_drugs AS (
|
| 83 |
+
SELECT Drug_Name, count (distinct(claim_id)) as prescription_count
|
| 84 |
+
FROM ""symphony-data"".""test_performance_v3""
|
| 85 |
+
WHERE indication like '%MM%'
|
| 86 |
+
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
|
| 87 |
+
from ""symphony-data"".""test_performance_v3"") - interval '9' month)
|
| 88 |
+
GROUP BY Drug_Name
|
| 89 |
+
order by prescription_count asc
|
| 90 |
+
limit 5
|
| 91 |
+
),
|
| 92 |
+
total_prescriptions AS (
|
| 93 |
+
SELECT COUNT(distinct(claim_ID)) AS total_prescriptions
|
| 94 |
+
FROM ""symphony-data"".""test_performance_v3""
|
| 95 |
+
WHERE indication like '%MM%'
|
| 96 |
+
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
|
| 97 |
+
from ""symphony-data"".""test_performance_v3"") - interval '9' month)
|
| 98 |
+
)
|
| 99 |
+
SELECT
|
| 100 |
+
top_5_drugs.Drug_Name,
|
| 101 |
+
ROUND(100.0 * top_5_drugs.prescription_count / total_prescriptions.total_prescriptions, 2) as market_share
|
| 102 |
+
FROM top_5_drugs, total_prescriptions;"
|
| 103 |
+
"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.
|
| 104 |
+
Name of the table is """"test_performance_v3"""".
|
| 105 |
+
Schema
|
| 106 |
+
Field Name | Field Type | Data Definition
|
| 107 |
+
NPI | varchar | 10 digit HCP identifier (Exclude blank and invalid NPIs from any queries)
|
| 108 |
+
Claim_ID | varchar | Unique claim identifier
|
| 109 |
+
Patient_ID | varchar | Unique patient identifier
|
| 110 |
+
Patient_Gender | varchar(8) | Patient Gender (Exclude """"Unknown"""" and blank values from any queries)
|
| 111 |
+
Patient_State | varchar | State in which prescription was filled (Exclude """"None"""" and blank values from any queries)
|
| 112 |
+
Region | varchar(9) | Region info of state
|
| 113 |
+
plan_type_description | varchar | Payor type (COMMERCIAL, MEDICARE, MEDICAID, etc.) in capital letters. (Exclude """"NONE"""" and blank values from any queries)
|
| 114 |
+
Plan_Name | varchar | Specific payor name
|
| 115 |
+
Drug_name | varchar | Brand or Drug name
|
| 116 |
+
Prescribed_Drug_Indication | varchar(2922) | Drug indication (based on prescribed drug)
|
| 117 |
+
Prescription_Fill_Year_Month | date | Date when prescription was filled
|
| 118 |
+
quantity | double | total quantity of drugs prescribed in each prescription
|
| 119 |
+
Total_Patient_Responsibility | double | Out of Pocket expense borne by patient
|
| 120 |
+
Total_Payer_Responsibility | double | Expense borne by payor
|
| 121 |
+
patient_age | integer | numeric age of patient in years
|
| 122 |
+
indication | string | Indications for given patient
|
| 123 |
+
Unknown_Flag | varchar(3) | If no disease detected, this would be Yes",Which brand had the highest claims in MM indication in last 9 months?,"
|
| 124 |
+
|
| 125 |
+
SELECT Drug_Name, COUNT(distinct(claim_ID)) as num_prescriptions
|
| 126 |
+
FROM ""symphony-data"".""test_performance_v3""
|
| 127 |
+
WHERE indication like '%MM%'
|
| 128 |
+
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
|
| 129 |
+
from ""symphony-data"".""test_performance_v3"") - interval '9' month)
|
| 130 |
+
GROUP BY Drug_Name
|
| 131 |
+
ORDER BY num_prescriptions DESC
|
| 132 |
+
LIMIT 1;"
|
| 133 |
+
"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.
|
| 134 |
+
Name of the table is """"test_performance_v3"""".
|
| 135 |
+
Schema
|
| 136 |
+
Field Name | Field Type | Data Definition
|
| 137 |
+
NPI | varchar | 10 digit HCP identifier (Exclude blank and invalid NPIs from any queries)
|
| 138 |
+
Claim_ID | varchar | Unique claim identifier
|
| 139 |
+
Patient_ID | varchar | Unique patient identifier
|
| 140 |
+
Patient_Gender | varchar(8) | Patient Gender (Exclude """"Unknown"""" and blank values from any queries)
|
| 141 |
+
Patient_State | varchar | State in which prescription was filled (Exclude """"None"""" and blank values from any queries)
|
| 142 |
+
Region | varchar(9) | Region info of state
|
| 143 |
+
plan_type_description | varchar | Payor type (COMMERCIAL, MEDICARE, MEDICAID, etc.) in capital letters. (Exclude """"NONE"""" and blank values from any queries)
|
| 144 |
+
Plan_Name | varchar | Specific payor name
|
| 145 |
+
Drug_name | varchar | Brand or Drug name
|
| 146 |
+
Prescribed_Drug_Indication | varchar(2922) | Drug indication (based on prescribed drug)
|
| 147 |
+
Prescription_Fill_Year_Month | date | Date when prescription was filled
|
| 148 |
+
quantity | double | total quantity of drugs prescribed in each prescription
|
| 149 |
+
Total_Patient_Responsibility | double | Out of Pocket expense borne by patient
|
| 150 |
+
Total_Payer_Responsibility | double | Expense borne by payor
|
| 151 |
+
patient_age | integer | numeric age of patient in years
|
| 152 |
+
indication | string | Indications for given patient
|
| 153 |
+
Unknown_Flag | varchar(3) | If no disease detected, this would be Yes",What was the market share for Kyprolis for years 2021 and 2018 for MM indication?,"
|
| 154 |
+
|
| 155 |
+
WITH
|
| 156 |
+
kyprolis_2021 AS (
|
| 157 |
+
SELECT COUNT(distinct(claim_ID)) AS num_prescriptions
|
| 158 |
+
FROM ""symphony-data"".""test_performance_v3""
|
| 159 |
+
WHERE Drug_Name like '%KYPROLIS%'
|
| 160 |
+
AND indication like '%MM%'
|
| 161 |
+
AND Prescription_Fill_Year_Month >= date('2021-01-01')
|
| 162 |
+
AND Prescription_Fill_Year_Month <= date('2021-12-31')
|
| 163 |
+
),
|
| 164 |
+
kyprolis_2018 AS (
|
| 165 |
+
SELECT COUNT(distinct(claim_ID)) AS num_prescriptions
|
| 166 |
+
FROM ""symphony-data"".""test_performance_v3""
|
| 167 |
+
WHERE Drug_Name like '%KYPROLIS%'
|
| 168 |
+
AND indication like '%MM%'
|
| 169 |
+
AND Prescription_Fill_Year_Month >= date('2018-01-01')
|
| 170 |
+
AND Prescription_Fill_Year_Month <= date('2018-12-31')
|
| 171 |
+
),
|
| 172 |
+
total_2021 AS (
|
| 173 |
+
SELECT COUNT(distinct(claim_ID)) AS num_prescriptions
|
| 174 |
+
FROM ""symphony-data"".""test_performance_v3""
|
| 175 |
+
WHERE indication like '%MM%'
|
| 176 |
+
AND Prescription_Fill_Year_Month >= date('2021-01-01')
|
| 177 |
+
AND Prescription_Fill_Year_Month <= date('2021-12-31')
|
| 178 |
+
),
|
| 179 |
+
total_2018 AS (
|
| 180 |
+
SELECT COUNT(distinct(claim_ID)) AS num_prescriptions
|
| 181 |
+
FROM ""symphony-data"".""test_performance_v3""
|
| 182 |
+
WHERE indication like '%MM%'
|
| 183 |
+
AND Prescription_Fill_Year_Month >= date('2018-01-01')
|
| 184 |
+
AND Prescription_Fill_Year_Month <= date('2018-12-31')
|
| 185 |
+
)
|
| 186 |
+
SELECT
|
| 187 |
+
ROUND(100.0 * kyprolis_2021.num_prescriptions / total_2021.num_prescriptions, 2) AS kyprolis_2021_market_share,
|
| 188 |
+
ROUND(100.0 * kyprolis_2018.num_prescriptions / total_2018.num_prescriptions, 2) AS kyprolis_2018_market_share
|
| 189 |
+
FROM kyprolis_2021, kyprolis_2018, total_2021, total_2018;"
|
| 190 |
+
"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.
|
| 191 |
+
Name of the table is """"test_performance_v3"""".
|
| 192 |
+
Schema
|
| 193 |
+
Field Name | Field Type | Data Definition
|
| 194 |
+
NPI | varchar | 10 digit HCP identifier (Exclude blank and invalid NPIs from any queries)
|
| 195 |
+
Claim_ID | varchar | Unique claim identifier
|
| 196 |
+
Patient_ID | varchar | Unique patient identifier
|
| 197 |
+
Patient_Gender | varchar(8) | Patient Gender (Exclude """"Unknown"""" and blank values from any queries)
|
| 198 |
+
Patient_State | varchar | State in which prescription was filled (Exclude """"None"""" and blank values from any queries)
|
| 199 |
+
Region | varchar(9) | Region info of state
|
| 200 |
+
plan_type_description | varchar | Payor type (COMMERCIAL, MEDICARE, MEDICAID, etc.) in capital letters. (Exclude """"NONE"""" and blank values from any queries)
|
| 201 |
+
Plan_Name | varchar | Specific payor name
|
| 202 |
+
Drug_name | varchar | Brand or Drug name
|
| 203 |
+
Prescribed_Drug_Indication | varchar(2922) | Drug indication (based on prescribed drug)
|
| 204 |
+
Prescription_Fill_Year_Month | date | Date when prescription was filled
|
| 205 |
+
quantity | double | total quantity of drugs prescribed in each prescription
|
| 206 |
+
Total_Patient_Responsibility | double | Out of Pocket expense borne by patient
|
| 207 |
+
Total_Payer_Responsibility | double | Expense borne by payor
|
| 208 |
+
patient_age | integer | numeric age of patient in years
|
| 209 |
+
indication | string | Indications for given patient
|
| 210 |
+
Unknown_Flag | varchar(3) | If no disease detected, this would be Yes","Over the past 9 months, which state in the US has seen a higher number of claims for Kyprolis in the MM indication compared to its competitors?","
|
| 211 |
+
|
| 212 |
+
WITH kyprolis_claims AS (
|
| 213 |
+
SELECT Patient_State, COUNT(distinct(claim_ID)) AS num_claims
|
| 214 |
+
FROM ""symphony-data"".""test_performance_v3""
|
| 215 |
+
WHERE Drug_Name like '%KYPROLIS%'
|
| 216 |
+
AND indication like '%MM%'
|
| 217 |
+
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
|
| 218 |
+
from ""symphony-data"".""test_performance_v3"") - interval '9' month)
|
| 219 |
+
GROUP BY Patient_State
|
| 220 |
+
),
|
| 221 |
+
competitor_claims AS (
|
| 222 |
+
SELECT Patient_State, COUNT(distinct(claim_ID)) AS num_claims
|
| 223 |
+
FROM ""symphony-data"".""test_performance_v3""
|
| 224 |
+
WHERE Drug_Name not like '%KYPROLIS%'
|
| 225 |
+
AND indication like '%MM%'
|
| 226 |
+
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
|
| 227 |
+
from ""symphony-data"".""test_performance_v3"") - interval '9' month)
|
| 228 |
+
GROUP BY Patient_State
|
| 229 |
+
)
|
| 230 |
+
SELECT kyprolis_claims.Patient_State
|
| 231 |
+
FROM kyprolis_claims, competitor_claims
|
| 232 |
+
WHERE kyprolis_claims.num_claims > competitor_claims.num_claims;"
|
| 233 |
+
"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.
|
| 234 |
+
Name of the table is """"test_performance_v3"""".
|
| 235 |
+
Schema
|
| 236 |
+
Field Name | Field Type | Data Definition
|
| 237 |
+
NPI | varchar | 10 digit HCP identifier (Exclude blank and invalid NPIs from any queries)
|
| 238 |
+
Claim_ID | varchar | Unique claim identifier
|
| 239 |
+
Patient_ID | varchar | Unique patient identifier
|
| 240 |
+
Patient_Gender | varchar(8) | Patient Gender (Exclude """"Unknown"""" and blank values from any queries)
|
| 241 |
+
Patient_State | varchar | State in which prescription was filled (Exclude """"None"""" and blank values from any queries)
|
| 242 |
+
Region | varchar(9) | Region info of state
|
| 243 |
+
plan_type_description | varchar | Payor type (COMMERCIAL, MEDICARE, MEDICAID, etc.) in capital letters. (Exclude """"NONE"""" and blank values from any queries)
|
| 244 |
+
Plan_Name | varchar | Specific payor name
|
| 245 |
+
Drug_name | varchar | Brand or Drug name
|
| 246 |
+
Prescribed_Drug_Indication | varchar(2922) | Drug indication (based on prescribed drug)
|
| 247 |
+
Prescription_Fill_Year_Month | date | Date when prescription was filled
|
| 248 |
+
quantity | double | total quantity of drugs prescribed in each prescription
|
| 249 |
+
Total_Patient_Responsibility | double | Out of Pocket expense borne by patient
|
| 250 |
+
Total_Payer_Responsibility | double | Expense borne by payor
|
| 251 |
+
patient_age | integer | numeric age of patient in years
|
| 252 |
+
indication | string | Indications for given patient
|
| 253 |
+
Unknown_Flag | varchar(3) | If no disease detected, this would be Yes",What is the relative growth of Kyprolis in last 5 months compared to previous year?,"
|
| 254 |
+
|
| 255 |
+
WITH
|
| 256 |
+
numerator AS (
|
| 257 |
+
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)
|
| 258 |
+
from ""symphony-data"".""test_performance_v3"") - interval '5' month) and Drug_Name like '%KYPROLIS%'
|
| 259 |
+
),
|
| 260 |
+
denominator AS(
|
| 261 |
+
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)
|
| 262 |
+
from ""symphony-data"".""test_performance_v3"") - interval '1' year - interval '5' month) and Prescription_Fill_Year_Month <= date((select max(Prescription_Fill_Year_Month)
|
| 263 |
+
from ""symphony-data"".""test_performance_v3"") - interval '1' year) and Drug_Name like '%KYPROLIS%'
|
| 264 |
+
)
|
| 265 |
+
SELECT (cast(numerator.total_claims as double) / (denominator.total_claims)-1)*100 as relative_growth from numerator, denominator;"
|
| 266 |
+
"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.
|
| 267 |
+
Name of the table is """"test_performance_v3"""".
|
| 268 |
+
Schema
|
| 269 |
+
Field Name | Field Type | Data Definition
|
| 270 |
+
NPI | varchar | 10 digit HCP identifier (Exclude blank and invalid NPIs from any queries)
|
| 271 |
+
Claim_ID | varchar | Unique claim identifier
|
| 272 |
+
Patient_ID | varchar | Unique patient identifier
|
| 273 |
+
Patient_Gender | varchar(8) | Patient Gender (Exclude """"Unknown"""" and blank values from any queries)
|
| 274 |
+
Patient_State | varchar | State in which prescription was filled (Exclude """"None"""" and blank values from any queries)
|
| 275 |
+
Region | varchar(9) | Region info of state
|
| 276 |
+
plan_type_description | varchar | Payor type (COMMERCIAL, MEDICARE, MEDICAID, etc.) in capital letters. (Exclude """"NONE"""" and blank values from any queries)
|
| 277 |
+
Plan_Name | varchar | Specific payor name
|
| 278 |
+
Drug_name | varchar | Brand or Drug name
|
| 279 |
+
Prescribed_Drug_Indication | varchar(2922) | Drug indication (based on prescribed drug)
|
| 280 |
+
Prescription_Fill_Year_Month | date | Date when prescription was filled
|
| 281 |
+
quantity | double | total quantity of drugs prescribed in each prescription
|
| 282 |
+
Total_Patient_Responsibility | double | Out of Pocket expense borne by patient
|
| 283 |
+
Total_Payer_Responsibility | double | Expense borne by payor
|
| 284 |
+
patient_age | integer | numeric age of patient in years
|
| 285 |
+
indication | string | Indications for given patient
|
| 286 |
+
Unknown_Flag | varchar(3) | If no disease detected, this would be Yes",What is the market share of Kyprolis in MM indication for patients above 40 years?,"
|
| 287 |
+
|
| 288 |
+
WITH num AS (
|
| 289 |
+
SELECT COUNT(DISTINCT(Claim_ID)) AS num_data
|
| 290 |
+
FROM ""symphony-data"".""test_performance_v3""
|
| 291 |
+
WHERE Drug_Name LIKE '%KYPROLIS%'
|
| 292 |
+
AND indication LIKE '%MM%'
|
| 293 |
+
AND patient_age > 40
|
| 294 |
+
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
|
| 295 |
+
from ""symphony-data"".""test_performance_v3"") - interval '90' day)
|
| 296 |
+
),
|
| 297 |
+
den AS (
|
| 298 |
+
SELECT COUNT(DISTINCT(Claim_ID)) AS den_data
|
| 299 |
+
FROM ""symphony-data"".""test_performance_v3""
|
| 300 |
+
WHERE indication LIKE '%MM%'
|
| 301 |
+
AND patient_age > 40
|
| 302 |
+
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
|
| 303 |
+
from ""symphony-data"".""test_performance_v3"") - interval '90' day)
|
| 304 |
+
)
|
| 305 |
+
SELECT ROUND(100.0 * num_data / den_data, 2) AS market_share
|
| 306 |
+
FROM num, den;"
|
| 307 |
+
"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.
|
| 308 |
+
Name of the table is """"test_performance_v3"""".
|
| 309 |
+
Schema
|
| 310 |
+
Field Name | Field Type | Data Definition
|
| 311 |
+
NPI | varchar | 10 digit HCP identifier (Exclude blank and invalid NPIs from any queries)
|
| 312 |
+
Claim_ID | varchar | Unique claim identifier
|
| 313 |
+
Patient_ID | varchar | Unique patient identifier
|
| 314 |
+
Patient_Gender | varchar(8) | Patient Gender (Exclude """"Unknown"""" and blank values from any queries)
|
| 315 |
+
Patient_State | varchar | State in which prescription was filled (Exclude """"None"""" and blank values from any queries)
|
| 316 |
+
Region | varchar(9) | Region info of state
|
| 317 |
+
plan_type_description | varchar | Payor type (COMMERCIAL, MEDICARE, MEDICAID, etc.) in capital letters. (Exclude """"NONE"""" and blank values from any queries)
|
| 318 |
+
Plan_Name | varchar | Specific payor name
|
| 319 |
+
Drug_name | varchar | Brand or Drug name
|
| 320 |
+
Prescribed_Drug_Indication | varchar(2922) | Drug indication (based on prescribed drug)
|
| 321 |
+
Prescription_Fill_Year_Month | date | Date when prescription was filled
|
| 322 |
+
quantity | double | total quantity of drugs prescribed in each prescription
|
| 323 |
+
Total_Patient_Responsibility | double | Out of Pocket expense borne by patient
|
| 324 |
+
Total_Payer_Responsibility | double | Expense borne by payor
|
| 325 |
+
patient_age | integer | numeric age of patient in years
|
| 326 |
+
indication | string | Indications for given patient
|
| 327 |
+
Unknown_Flag | varchar(3) | If no disease detected, this would be Yes",Which drug had lowest claims for patients above 60 in MM indication over the last 1 year?,"
|
| 328 |
+
|
| 329 |
+
SELECT Drug_Name, COUNT(distinct(claim_ID)) as num_claims
|
| 330 |
+
FROM ""symphony-data"".""test_performance_v3""
|
| 331 |
+
WHERE indication like '%MM%'
|
| 332 |
+
AND patient_age > 60
|
| 333 |
+
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
|
| 334 |
+
from ""symphony-data"".""test_performance_v3"") - interval '1' year)
|
| 335 |
+
GROUP BY Drug_Name
|
| 336 |
+
ORDER BY num_claims ASC
|
| 337 |
+
LIMIT 1;"
|
| 338 |
+
"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.
|
| 339 |
+
Name of the table is """"test_performance_v3"""".
|
| 340 |
+
Schema
|
| 341 |
+
Field Name | Field Type | Data Definition
|
| 342 |
+
NPI | varchar | 10 digit HCP identifier (Exclude blank and invalid NPIs from any queries)
|
| 343 |
+
Claim_ID | varchar | Unique claim identifier
|
| 344 |
+
Patient_ID | varchar | Unique patient identifier
|
| 345 |
+
Patient_Gender | varchar(8) | Patient Gender (Exclude """"Unknown"""" and blank values from any queries)
|
| 346 |
+
Patient_State | varchar | State in which prescription was filled (Exclude """"None"""" and blank values from any queries)
|
| 347 |
+
Region | varchar(9) | Region info of state
|
| 348 |
+
plan_type_description | varchar | Payor type (COMMERCIAL, MEDICARE, MEDICAID, etc.) in capital letters. (Exclude """"NONE"""" and blank values from any queries)
|
| 349 |
+
Plan_Name | varchar | Specific payor name
|
| 350 |
+
Drug_name | varchar | Brand or Drug name
|
| 351 |
+
Prescribed_Drug_Indication | varchar(2922) | Drug indication (based on prescribed drug)
|
| 352 |
+
Prescription_Fill_Year_Month | date | Date when prescription was filled
|
| 353 |
+
quantity | double | total quantity of drugs prescribed in each prescription
|
| 354 |
+
Total_Patient_Responsibility | double | Out of Pocket expense borne by patient
|
| 355 |
+
Total_Payer_Responsibility | double | Expense borne by payor
|
| 356 |
+
patient_age | integer | numeric age of patient in years
|
| 357 |
+
indication | string | Indications for given patient
|
| 358 |
+
Unknown_Flag | varchar(3) | If no disease detected, this would be Yes",In which state did Kyprolis have the highest number of prescriptions for the itp indication?,"
|
| 359 |
+
|
| 360 |
+
SELECT Patient_State, COUNT(distinct(Claim_ID)) as num_prescriptions
|
| 361 |
+
FROM ""symphony-data"".""test_performance_v3""
|
| 362 |
+
WHERE Drug_Name like '%KYPROLIS%'
|
| 363 |
+
AND indication like '%ITP%'
|
| 364 |
+
GROUP BY Patient_State
|
| 365 |
+
ORDER BY num_prescriptions DESC
|
| 366 |
+
LIMIT 1;"
|
| 367 |
+
"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.
|
| 368 |
+
Name of the table is """"test_performance_v3"""".
|
| 369 |
+
Schema
|
| 370 |
+
Field Name | Field Type | Data Definition
|
| 371 |
+
NPI | varchar | 10 digit HCP identifier (Exclude blank and invalid NPIs from any queries)
|
| 372 |
+
Claim_ID | varchar | Unique claim identifier
|
| 373 |
+
Patient_ID | varchar | Unique patient identifier
|
| 374 |
+
Patient_Gender | varchar(8) | Patient Gender (Exclude """"Unknown"""" and blank values from any queries)
|
| 375 |
+
Patient_State | varchar | State in which prescription was filled (Exclude """"None"""" and blank values from any queries)
|
| 376 |
+
Region | varchar(9) | Region info of state
|
| 377 |
+
plan_type_description | varchar | Payor type (COMMERCIAL, MEDICARE, MEDICAID, etc.) in capital letters. (Exclude """"NONE"""" and blank values from any queries)
|
| 378 |
+
Plan_Name | varchar | Specific payor name
|
| 379 |
+
Drug_name | varchar | Brand or Drug name
|
| 380 |
+
Prescribed_Drug_Indication | varchar(2922) | Drug indication (based on prescribed drug)
|
| 381 |
+
Prescription_Fill_Year_Month | date | Date when prescription was filled
|
| 382 |
+
quantity | double | total quantity of drugs prescribed in each prescription
|
| 383 |
+
Total_Patient_Responsibility | double | Out of Pocket expense borne by patient
|
| 384 |
+
Total_Payer_Responsibility | double | Expense borne by payor
|
| 385 |
+
patient_age | integer | numeric age of patient in years
|
| 386 |
+
indication | string | Indications for given patient
|
| 387 |
+
Unknown_Flag | varchar(3) | If no disease detected, this would be Yes","Over the past 9 months, which state in the US had a lowest number of claims for Kyprolis in the cml indication compared to its competitors?","
|
| 388 |
+
|
| 389 |
+
WITH kyprolis_prescriptions AS (
|
| 390 |
+
SELECT COUNT(distinct(claim_ID)) AS num_prescriptions, Patient_State
|
| 391 |
+
FROM ""symphony-data"".""test_performance_v3""
|
| 392 |
+
WHERE Drug_Name like '%KYPROLIS%'
|
| 393 |
+
AND indication like '%CML%'
|
| 394 |
+
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
|
| 395 |
+
from ""symphony-data"".""test_performance_v3"") - interval '9' month)
|
| 396 |
+
GROUP BY Patient_State
|
| 397 |
+
),
|
| 398 |
+
competitor_prescriptions AS (
|
| 399 |
+
SELECT COUNT(distinct(claim_ID)) AS num_prescriptions, Patient_State
|
| 400 |
+
FROM ""symphony-data"".""test_performance_v3""
|
| 401 |
+
WHERE Drug_Name not like '%KYPROLIS%'
|
| 402 |
+
AND indication like '%CML%'
|
| 403 |
+
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
|
| 404 |
+
from ""symphony-data"".""test_performance_v3"") - interval '9' month)
|
| 405 |
+
GROUP BY Patient_State
|
| 406 |
+
)
|
| 407 |
+
SELECT kyprolis_prescriptions.Patient_State, kyprolis_prescriptions.num_prescriptions/competitor_prescriptions.num_prescriptions as ratio
|
| 408 |
+
FROM kyprolis_prescriptions, competitor_prescriptions
|
| 409 |
+
WHERE kyprolis_prescriptions.Patient_State = competitor_prescriptions.Patient_State
|
| 410 |
+
ORDER BY ratio ASC
|
| 411 |
+
LIMIT 1;"
|
| 412 |
+
"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.
|
| 413 |
+
Name of the table is """"test_performance_v3"""".
|
| 414 |
+
Schema
|
| 415 |
+
Field Name | Field Type | Data Definition
|
| 416 |
+
NPI | varchar | 10 digit HCP identifier (Exclude blank and invalid NPIs from any queries)
|
| 417 |
+
Claim_ID | varchar | Unique claim identifier
|
| 418 |
+
Patient_ID | varchar | Unique patient identifier
|
| 419 |
+
Patient_Gender | varchar(8) | Patient Gender (Exclude """"Unknown"""" and blank values from any queries)
|
| 420 |
+
Patient_State | varchar | State in which prescription was filled (Exclude """"None"""" and blank values from any queries)
|
| 421 |
+
Region | varchar(9) | Region info of state
|
| 422 |
+
plan_type_description | varchar | Payor type (COMMERCIAL, MEDICARE, MEDICAID, etc.) in capital letters. (Exclude """"NONE"""" and blank values from any queries)
|
| 423 |
+
Plan_Name | varchar | Specific payor name
|
| 424 |
+
Drug_name | varchar | Brand or Drug name
|
| 425 |
+
Prescribed_Drug_Indication | varchar(2922) | Drug indication (based on prescribed drug)
|
| 426 |
+
Prescription_Fill_Year_Month | date | Date when prescription was filled
|
| 427 |
+
quantity | double | total quantity of drugs prescribed in each prescription
|
| 428 |
+
Total_Patient_Responsibility | double | Out of Pocket expense borne by patient
|
| 429 |
+
Total_Payer_Responsibility | double | Expense borne by payor
|
| 430 |
+
patient_age | integer | numeric age of patient in years
|
| 431 |
+
indication | string | Indications for given patient
|
| 432 |
+
Unknown_Flag | varchar(3) | If no disease detected, this would be Yes",What is the most common payer type for Kyprolis in the past 9 months?,"
|
| 433 |
+
|
| 434 |
+
SELECT plan_type_description, COUNT(distinct(claim_ID)) as num_prescriptions
|
| 435 |
+
FROM ""symphony-data"".""test_performance_v3""
|
| 436 |
+
WHERE Drug_Name like '%KYPROLIS%'
|
| 437 |
+
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
|
| 438 |
+
from ""symphony-data"".""test_performance_v3"") - interval '9' month)
|
| 439 |
+
AND plan_type_description NOT IN ('NONE', '')
|
| 440 |
+
GROUP BY plan_type_description
|
| 441 |
+
ORDER BY num_prescriptions DESC
|
| 442 |
+
LIMIT 1;"
|
| 443 |
+
"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.
|
| 444 |
+
Name of the table is """"test_performance_v3"""".
|
| 445 |
+
Schema
|
| 446 |
+
Field Name | Field Type | Data Definition
|
| 447 |
+
NPI | varchar | 10 digit HCP identifier (Exclude blank and invalid NPIs from any queries)
|
| 448 |
+
Claim_ID | varchar | Unique claim identifier
|
| 449 |
+
Patient_ID | varchar | Unique patient identifier
|
| 450 |
+
Patient_Gender | varchar(8) | Patient Gender (Exclude """"Unknown"""" and blank values from any queries)
|
| 451 |
+
Patient_State | varchar | State in which prescription was filled (Exclude """"None"""" and blank values from any queries)
|
| 452 |
+
Region | varchar(9) | Region info of state
|
| 453 |
+
plan_type_description | varchar | Payor type (COMMERCIAL, MEDICARE, MEDICAID, etc.) in capital letters. (Exclude """"NONE"""" and blank values from any queries)
|
| 454 |
+
Plan_Name | varchar | Specific payor name
|
| 455 |
+
Drug_name | varchar | Brand or Drug name
|
| 456 |
+
Prescribed_Drug_Indication | varchar(2922) | Drug indication (based on prescribed drug)
|
| 457 |
+
Prescription_Fill_Year_Month | date | Date when prescription was filled
|
| 458 |
+
quantity | double | total quantity of drugs prescribed in each prescription
|
| 459 |
+
Total_Patient_Responsibility | double | Out of Pocket expense borne by patient
|
| 460 |
+
Total_Payer_Responsibility | double | Expense borne by payor
|
| 461 |
+
patient_age | integer | numeric age of patient in years
|
| 462 |
+
indication | string | Indications for given patient
|
| 463 |
+
Unknown_Flag | varchar(3) | If no disease detected, this would be Yes",What is the average out-of-pocket payment for Kyprolis in the state of New York (NY) in the past month?,"
|
| 464 |
+
|
| 465 |
+
SELECT AVG(Total_Patient_Responsibility) as avg_patient_pay
|
| 466 |
+
FROM ""symphony-data"".""test_performance_v3""
|
| 467 |
+
WHERE Drug_Name like '%KYPROLIS%'
|
| 468 |
+
AND Patient_State = 'NY'
|
| 469 |
+
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
|
| 470 |
+
from ""symphony-data"".""test_performance_v3"") - interval '1' month);"
|
| 471 |
+
"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.
|
| 472 |
+
Name of the table is """"test_performance_v3"""".
|
| 473 |
+
Schema
|
| 474 |
+
Field Name | Field Type | Data Definition
|
| 475 |
+
NPI | varchar | 10 digit HCP identifier (Exclude blank and invalid NPIs from any queries)
|
| 476 |
+
Claim_ID | varchar | Unique claim identifier
|
| 477 |
+
Patient_ID | varchar | Unique patient identifier
|
| 478 |
+
Patient_Gender | varchar(8) | Patient Gender (Exclude """"Unknown"""" and blank values from any queries)
|
| 479 |
+
Patient_State | varchar | State in which prescription was filled (Exclude """"None"""" and blank values from any queries)
|
| 480 |
+
Region | varchar(9) | Region info of state
|
| 481 |
+
plan_type_description | varchar | Payor type (COMMERCIAL, MEDICARE, MEDICAID, etc.) in capital letters. (Exclude """"NONE"""" and blank values from any queries)
|
| 482 |
+
Plan_Name | varchar | Specific payor name
|
| 483 |
+
Drug_name | varchar | Brand or Drug name
|
| 484 |
+
Prescribed_Drug_Indication | varchar(2922) | Drug indication (based on prescribed drug)
|
| 485 |
+
Prescription_Fill_Year_Month | date | Date when prescription was filled
|
| 486 |
+
quantity | double | total quantity of drugs prescribed in each prescription
|
| 487 |
+
Total_Patient_Responsibility | double | Out of Pocket expense borne by patient
|
| 488 |
+
Total_Payer_Responsibility | double | Expense borne by payor
|
| 489 |
+
patient_age | integer | numeric age of patient in years
|
| 490 |
+
indication | string | Indications for given patient
|
| 491 |
+
Unknown_Flag | varchar(3) | If no disease detected, this would be Yes",What was the market share of the last 5 drugs prescribed for the cml indication over the past 6 months?,"
|
| 492 |
+
|
| 493 |
+
WITH
|
| 494 |
+
top_5_drugs AS (
|
| 495 |
+
SELECT Drug_Name, count (distinct(claim_id)) as prescription_count
|
| 496 |
+
FROM ""symphony-data"".""test_performance_v3""
|
| 497 |
+
WHERE indication like '%CML%'
|
| 498 |
+
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
|
| 499 |
+
from ""symphony-data"".""test_performance_v3"") - interval '6' month)
|
| 500 |
+
GROUP BY Drug_Name
|
| 501 |
+
order by prescription_count desc
|
| 502 |
+
limit 5
|
| 503 |
+
),
|
| 504 |
+
total_prescriptions AS (
|
| 505 |
+
SELECT COUNT(distinct(claim_ID)) AS total_prescriptions
|
| 506 |
+
FROM ""symphony-data"".""test_performance_v3""
|
| 507 |
+
WHERE indication like '%CML%'
|
| 508 |
+
AND Prescription_Fill_Year_Month >= date((select max(Prescription_Fill_Year_Month)
|
| 509 |
+
from ""symphony-data"".""test_performance_v3"") - interval '6' month)
|
| 510 |
+
)
|
| 511 |
+
SELECT
|
| 512 |
+
top_5_drugs.Drug_Name,
|
| 513 |
+
ROUND(100.0 * top_5_drugs.prescription_count / total_prescriptions.total_prescriptions, 2) as market_share
|
| 514 |
+
FROM top_5_drugs, total_prescriptions;"
|