Data Analysis Programming from SQL to SPL: Medical Visit Records Analysis
Data structure Medical visit records table (Appointments): appid is the medical visit ID, patientid is the patient ID, depid is the department ID, and appdate is the medical visit date. 1. Query for the times when the number of visits reached a multiple of 50,000 in 2020 and 2021, respectively The expected target results are shown in the figure below: SQL statement: While the window function is used, the SQL statement still needs to nest multiple layers of code, which is a bit cumbersome. This is mainly because SQL’s result sets are unordered, requiring the addition of implicit markers to
...