Compare generic and new drug applications by year
Created on May 6, 2025

Prompt

Compare generic and new drug applications by year

Chart

Query Results

Query Results

SQL Query:

SELECT
    EXTRACT(YEAR FROM p.approval_date) AS approval_year,
    COUNT(CASE WHEN p.appl_type = 'A' THEN 1 END) AS generic_applications_count,
    COUNT(CASE WHEN p.appl_type = 'N' THEN 1 END) AS new_drug_applications_count
FROM
    orange_book_products p
WHERE
    p.approval_date IS NOT NULL
    AND p.appl_type IN ('A', 'N')
GROUP BY
    approval_year
ORDER BY
    approval_year
LIMIT 20;

Results:

approval_yeargeneric_applications_countnew_drug_applications_count
198236072898
1983389149
1984384266
1985503193
1986680172
1987710131
1988667260
1989269159
199092113
1991192115
1992212179
1993243137
1994214122
1995294166
1996359243
1997427233
1998355198
1999281148
2000459192
2001361120
Chart Configuration
{
  "grid": {
    "left": "3%",
    "right": "4%",
    "bottom": "3%",
    "containLabel": true
  },
  "title": {
    "text": "Drug Application Counts by Year"
  },
  "xAxis": {
    "data": [
      "1982",
      "1983",
      "1984",
      "1985",
      "1986",
      "1987",
      "1988",
      "1989",
      "1990",
      "1991",
      "1992",
      "1993",
      "1994",
      "1995",
      "1996",
      "1997",
      "1998",
      "1999",
      "2000",
      "2001"
    ],
    "type": "category",
    "axisLabel": {
      "interval": 0
    }
  },
  "yAxis": {
    "type": "value"
  },
  "legend": {
    "data": [
      "Generic Applications",
      "New Drug Applications"
    ]
  },
  "series": [
    {
      "data": [
        3607,
        389,
        384,
        503,
        680,
        710,
        667,
        269,
        92,
        192,
        212,
        243,
        214,
        294,
        359,
        427,
        355,
        281,
        459,
        361
      ],
      "name": "Generic Applications",
      "type": "line",
      "smooth": true
    },
    {
      "data": [
        2898,
        149,
        266,
        193,
        172,
        131,
        260,
        159,
        113,
        115,
        179,
        137,
        122,
        166,
        243,
        233,
        198,
        148,
        192,
        120
      ],
      "name": "New Drug Applications",
      "type": "line",
      "smooth": true
    }
  ],
  "tooltip": {
    "trigger": "axis"
  }
}