Compare generic and new drug applications by year
Created on Apr 7, 2025

Prompt

Compare generic and new drug applications by year

Chart

Query Results

Query Results

SQL Query:

SELECT
    EXTRACT(YEAR FROM approval_date) AS approval_year,
    SUM(CASE WHEN appl_type = 'A' THEN 1 ELSE 0 END) AS generic_applications,
    SUM(CASE WHEN appl_type = 'N' THEN 1 ELSE 0 END) AS new_applications,
    COUNT(*) AS total_applications
FROM
    orange_book_products
WHERE approval_date IS NOT NULL
GROUP BY
    approval_year
ORDER BY
    approval_year;

Results:

approval_yeargeneric_applicationsnew_applicationstotal_applications
1982360728986505
1983389149538
1984384266650
1985503193696
1986680172852
1987710131841
1988667260927
1989269159428
199092113205
1991192115307
1992212179391
1993243137380
1994214122336
1995294166460
1996359243602
1997427233660
1998355198553
1999281148429
2000459192651
2001361120481
2002603206809
2003479174653
2004689190879
2005640136776
2006703189892
20079931621155
200810121581170
20099681761144
20108581521010
20119361861122
201210741831257
20138441841028
2014803185988
201510872001287
201612621741436
201716022381840
201814612211682
201916411901831
202013881871575
202112892051494
202214241901614
202316552491904
202413822101592
202530423327
Chart Configuration
{
  "grid": {
    "left": "3%",
    "right": "4%",
    "bottom": "10%",
    "containLabel": true
  },
  "title": {
    "left": "center",
    "text": "Generic vs. New Drug Applications by Year"
  },
  "xAxis": {
    "data": [
      "1982",
      "1983",
      "1984",
      "1985",
      "1986",
      "1987",
      "1988",
      "1989",
      "1990",
      "1991",
      "1992",
      "1993",
      "1994",
      "1995",
      "1996",
      "1997",
      "1998",
      "1999",
      "2000",
      "2001",
      "2002",
      "2003",
      "2004",
      "2005",
      "2006",
      "2007",
      "2008",
      "2009",
      "2010",
      "2011",
      "2012",
      "2013",
      "2014",
      "2015",
      "2016",
      "2017",
      "2018",
      "2019",
      "2020",
      "2021",
      "2022",
      "2023",
      "2024",
      "2025"
    ],
    "name": "Year",
    "type": "category",
    "axisLabel": {
      "rotate": 45,
      "interval": 0
    }
  },
  "yAxis": {
    "name": "Number of Applications",
    "type": "value"
  },
  "legend": {
    "top": "bottom",
    "data": [
      "Generic Applications",
      "New Applications",
      "Total Applications"
    ]
  },
  "series": [
    {
      "id": "generic_applications",
      "data": [
        "3607",
        "389",
        "384",
        "503",
        "680",
        "710",
        "667",
        "269",
        "92",
        "192",
        "212",
        "243",
        "214",
        "294",
        "359",
        "427",
        "355",
        "281",
        "459",
        "361",
        "603",
        "479",
        "689",
        "640",
        "703",
        "993",
        "1012",
        "968",
        "858",
        "936",
        "1074",
        "844",
        "803",
        "1087",
        "1262",
        "1602",
        "1461",
        "1641",
        "1388",
        "1289",
        "1424",
        "1655",
        "1382",
        "304"
      ],
      "name": "Generic Applications",
      "type": "bar",
      "color": "#5470c6",
      "label": {
        "show": true,
        "position": "inside"
      },
      "stack": "applications",
      "emphasis": {
        "focus": "series"
      }
    },
    {
      "id": "new_applications",
      "data": [
        "2898",
        "149",
        "266",
        "193",
        "172",
        "131",
        "260",
        "159",
        "113",
        "115",
        "179",
        "137",
        "122",
        "166",
        "243",
        "233",
        "198",
        "148",
        "192",
        "120",
        "206",
        "174",
        "190",
        "136",
        "189",
        "162",
        "158",
        "176",
        "152",
        "186",
        "183",
        "184",
        "185",
        "200",
        "174",
        "238",
        "221",
        "190",
        "187",
        "205",
        "190",
        "249",
        "210",
        "23"
      ],
      "name": "New Applications",
      "type": "bar",
      "color": "#91cc75",
      "label": {
        "show": true,
        "position": "inside"
      },
      "stack": "applications",
      "emphasis": {
        "focus": "series"
      }
    },
    {
      "id": "total_applications",
      "data": [
        "6505",
        "538",
        "650",
        "696",
        "852",
        "841",
        "927",
        "428",
        "205",
        "307",
        "391",
        "380",
        "336",
        "460",
        "602",
        "660",
        "553",
        "429",
        "651",
        "481",
        "809",
        "653",
        "879",
        "776",
        "892",
        "1155",
        "1170",
        "1144",
        "1010",
        "1122",
        "1257",
        "1028",
        "988",
        "1287",
        "1436",
        "1840",
        "1682",
        "1831",
        "1575",
        "1494",
        "1614",
        "1904",
        "1592",
        "327"
      ],
      "name": "Total Applications",
      "type": "line",
      "color": "#fac858",
      "smooth": true,
      "yAxisIndex": 0
    }
  ],
  "tooltip": {
    "trigger": "axis",
    "formatter": "Year: {b}<br />{a0}: {c0}<br />{a1}: {c1}<br />Total: {c2}",
    "axisPointer": {
      "type": "shadow"
    }
  }
}